/* ============================================================
   Faris Hamacher — personal site
   Aesthetic: near-black, one warm accent, mono labels + clean prose.
   ============================================================ */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #111113;
  --fg:        #ededed;
  --fg-muted:  #8a8a8f;
  --fg-faint:  #57575c;
  --rule:      #1e1e21;
  --accent:    #ff5e1a;   /* Kasdor warm orange */
  --accent-dim:#ff5e1a33;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 760px;
  --pad:  clamp(1.25rem, 5vw, 3rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #0a0a0b; }

a { color: inherit; text-decoration: none; }

.accent { color: var(--accent); }

/* ---------- Generative field canvas ---------- */
#field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* keep all real content above the canvas */
#nav, #home, #reader { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(10,10,11,0.85), rgba(10,10,11,0));
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}
#nav.scrolled { border-bottom: 1px solid var(--rule); }

.nav__brand {
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--fg);
}
.nav__brand:hover { color: var(--accent); }

.nav__links {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  list-style: none;
}
.nav__links a {
  color: var(--fg-muted);
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { width: 100%; }

/* ---------- Layout primitives ---------- */
.hero, .manifesto, .section, .footer, #reader {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 6rem;
}
.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}
.hero__headline {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero__scroll {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
  margin-top: 3.5rem;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- Manifesto ---------- */
.manifesto {
  padding-block: clamp(3rem, 9vw, 7rem);
  position: relative;
}
.manifesto__rule {
  width: 56px; height: 2px;
  background: var(--accent);
  margin-bottom: 2.6rem;
}
.manifesto__body p { margin-bottom: 1.5rem; color: #cfcfd2; }
.manifesto__body strong { color: var(--fg); font-weight: 600; }
.manifesto__lead {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.4;
  color: var(--fg) !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-block: 0.6rem;
}

/* ---------- Generic section ---------- */
.section { padding-block: clamp(3rem, 8vw, 6rem); scroll-margin-top: 5rem; }
.section__head { margin-bottom: 2.8rem; }
.section__num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
}
.section__desc { color: var(--fg-muted); margin-top: 0.6rem; max-width: 46ch; }

/* ---------- Thoughts list ---------- */
.thoughts { list-style: none; }
.thoughts__item { border-top: 1px solid var(--rule); }
.thoughts__item:last-child { border-bottom: 1px solid var(--rule); }
.thoughts__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
  padding: 1.4rem 0.25rem;
  transition: padding-left 0.3s var(--ease), color 0.25s var(--ease);
}
.thoughts__link:hover { padding-left: 1rem; }
.thoughts__link:hover .thoughts__title { color: var(--accent); }
.thoughts__title { font-size: 1.15rem; font-weight: 500; transition: color 0.25s var(--ease); }
.thoughts__date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  white-space: nowrap;
}
.thoughts__excerpt {
  grid-column: 1 / -1;
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 60ch;
}

/* ---------- Songs ---------- */
.songs { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.song {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-soft);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.song:hover { border-color: var(--accent-dim); transform: translateX(4px); }
.song__play {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  color: var(--accent);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.song:hover .song__play { background: var(--accent); color: #0a0a0b; border-color: var(--accent); }
.song__name { font-weight: 500; flex: 1; }
.song__meta { font-family: var(--mono); font-size: 0.74rem; color: var(--fg-faint); }

/* ---------- Loved ---------- */
.loved { display: grid; gap: 2.4rem; }
.loved__group-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.1rem;
}
.loved__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}
.loved__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-soft);
  transition: border-color 0.3s var(--ease), transform 0.2s var(--ease);
}
.loved__item:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.loved__logo {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 7px;
  object-fit: cover;
  background: #1a1a1d;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}
/* image logos: app-icon chips on white, muted until hover */
img.loved__logo {
  object-fit: contain;
  background: #fff;
  padding: 3px;
  filter: grayscale(0.4);
  transition: filter 0.3s var(--ease);
}
.loved__item:hover img.loved__logo { filter: none; }
.loved__name { font-size: 0.92rem; font-weight: 500; line-height: 1.2; }
.loved__ref {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: auto;
}

/* ---------- Books ---------- */
.books {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.6rem 1.1rem;
}
.book { display: flex; flex-direction: column; gap: 0.6rem; }
.book__cover {
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #18181b, #221f1c);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.6rem;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.book:hover .book__cover { transform: translateY(-4px); border-color: var(--accent-dim); }
.book__cover img { width: 100%; height: 100%; object-fit: cover; }
.book__cover-fallback {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.book__title { font-size: 0.88rem; font-weight: 500; line-height: 1.25; }
.book__author { font-size: 0.78rem; color: var(--fg-muted); }

/* ---------- Connect ---------- */
.connect {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.connect__link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-soft);
  transition: border-color 0.3s var(--ease), transform 0.25s var(--ease);
}
.connect__link:hover { border-color: var(--accent); transform: translateX(4px); }
.connect__icon { flex: none; width: 22px; height: 22px; color: var(--fg-muted); transition: color 0.25s var(--ease); }
.connect__link:hover .connect__icon { color: var(--accent); }
.connect__label { display: flex; flex-direction: column; }
.connect__platform { font-weight: 500; }
.connect__handle { font-family: var(--mono); font-size: 0.76rem; color: var(--fg-faint); }
.connect__arrow { margin-left: auto; color: var(--fg-faint); transition: transform 0.25s var(--ease), color 0.25s var(--ease); }
.connect__link:hover .connect__arrow { transform: translate(3px, -3px); color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 3rem;
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--fg-faint);
}

/* ---------- Reader view ---------- */
#reader { padding-block: 8rem 6rem; }
.reader__back {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  transition: color 0.25s var(--ease);
  display: inline-block;
  margin-bottom: 3rem;
}
.reader__back:hover { color: var(--accent); }
.reader__title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.9rem;
}
.reader__date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-faint);
  margin-bottom: 2.8rem;
  display: block;
}
.reader__body p { margin-bottom: 1.5rem; color: #cfcfd2; }
.reader__body h2 { font-size: 1.4rem; font-weight: 600; margin: 2.4rem 0 1rem; letter-spacing: -0.01em; }
.reader__body h3 { font-size: 1.15rem; font-weight: 600; margin: 1.8rem 0 0.8rem; }
.reader__body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.8rem 0;
  color: var(--fg);
  font-style: italic;
}
.reader__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.reader__body ul, .reader__body ol { margin: 0 0 1.5rem 1.3rem; color: #cfcfd2; }
.reader__body li { margin-bottom: 0.5rem; }
.reader__body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav__brand { display: none; }
  .footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scroll { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
