:root {
  --bg: #0a0a0a;
  --fg: #f1f0ec;
  --muted: #8f8e8a;
  --line: rgba(255, 255, 255, 0.2);
  --serif: "Instrument Serif", "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }

/* Fixed layers: signature (back) → pixel space (front) → page content */
.layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh; /* large viewport: stays put while mobile toolbars slide */
  pointer-events: none;
}
.layer--sign { z-index: 0; }
.layer--space { z-index: 1; }

section { position: relative; z-index: 2; }

/* ---------- IN monogram (fixed top-left) ---------- */
.logo {
  position: fixed;
  top: clamp(14px, 2vw, 24px);
  left: clamp(14px, 2.2vw, 32px);
  z-index: 10;
  display: block;
  width: 32px;
  height: 32px;
  color: var(--fg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.logo svg { width: 100%; height: 100%; display: block; overflow: visible; }
.logo:hover { opacity: 0.7; transform: scale(1.05); }
.logo:focus-visible { outline: 1px solid var(--line); outline-offset: 6px; border-radius: 6px; }
/* Not shown on the signature screen. It appears once you're in the bio
   section (body gets .in-about from the script): the I wipes in top→bottom,
   then the N. Scrolling back up to the signature hides it again. */
.logo { pointer-events: none; }
.in-about .logo { pointer-events: auto; }
.logo__i,
.logo__n {
  clip-path: inset(0 0 100% 0);
}
.in-about .logo__i,
.in-about .logo__n {
  animation: logo-reveal 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.05s forwards;
}
.in-about .logo__n { animation-delay: 0.4s; }
@keyframes logo-reveal { to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .logo__i, .logo__n { animation: none; clip-path: inset(0 0 100% 0); }
  .in-about .logo__i, .in-about .logo__n { clip-path: none; }
}

/* ---------- Hero ---------- */
.hero {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(16px, 2.2vw, 32px);
}

/* "Scroll" + bouncing down-arrow, bottom centre of the first screen */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s ease, opacity 1.2s ease;
}
.hero__scroll:hover { color: var(--fg); }
.hero__scroll-arrow {
  width: 22px;
  height: 22px;
  animation: scroll-bounce 1.8s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(7px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero__scroll-arrow { animation: none; } }
/* Desktop shows only the word "Scroll"; phones show only the arrow (below) */
.hero__scroll-arrow { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  transition: background 0.3s ease, color 0.3s ease;
}
.pill:hover { background: var(--fg); color: var(--bg); }
.pill__icon {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 11px;
}

.fade-in {
  opacity: 0;
  transition: opacity 1.2s ease;
}
.is-signed .fade-in { opacity: 1; }
.is-signed .hero__scroll { opacity: 1; }

/* ---------- About (pinned while the portrait forms) ---------- */
/* Just long enough for the portrait to form, so the page ends right after:
   no "dead" scrolling at the bottom */
.about { height: 135vh; }

.about__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 6vw, 96px);
}

.about__text {
  max-width: 440px;
  display: grid;
  gap: 18px;
  margin-bottom: 18vh; /* sit above the big name */
  /* Hidden until the portrait is mostly formed, then one smooth reveal
     (body.about-ready, set by the script) — never scrubbed by the scroll */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.about-ready .about__text { opacity: 1; transform: none; }

/* Socials: a thin vertical line on the right with the icons strung along it */
.socials {
  position: absolute;
  right: clamp(16px, 2.6vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease 0.15s, visibility 0s linear 0.85s;
}
.about-ready .socials { opacity: 1; visibility: visible; transition: opacity 0.7s ease 0.15s, visibility 0s; }
.socials::before,
.socials::after {
  content: "";
  width: 1px;
  height: 12vh;
  background: linear-gradient(to bottom, transparent, var(--line));
}
.socials::after { background: linear-gradient(to top, transparent, var(--line)); }
.socials a,
.socials button {
  position: relative;
  cursor: pointer;
  font: inherit;
  padding: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  background: rgba(10, 10, 10, 0.6);
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.socials a:hover,
.socials a:focus-visible,
.socials button:hover,
.socials button:focus-visible {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
  transform: scale(1.08);
  outline: none;
}
.socials .fa-envelope,
.socials button i { font-size: 14px; }

/* Label that slides out to the left on hover ("Copy email", "Email copied") */
.socials [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--fg);
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.socials [data-tip]:hover::after,
.socials [data-tip]:focus-visible::after,
.socials .is-copied::after {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Full name: huge, centred on the very bottom edge, over the portrait */
.about__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: min(11.5vw, 22vh);
  line-height: 0.86;
  letter-spacing: -0.02em;
  white-space: nowrap;
  /* room below the baseline so the descender of the "y" isn't clipped */
  padding: 0 0.04em 0.24em;
  margin-bottom: -0.04em;
  pointer-events: none;
}
.about__name span {
  display: inline-block;
  padding: 0 0.06em;
  /* slides up in one smooth move once the portrait is mostly formed */
  transform: translateY(100%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}
.about-ready .about__name span { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .about__text, .socials, .about__name span { transition: none; }
}

/* "Project showcase coming soon" — small pill with a softly pulsing dot */
.about__note {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.about__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
  animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .about__dot { animation: none; } }

.about__bio {
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55;
  color: #d6d5d0;
}

/* Narrow screens: portrait sits on top, text below */
/* ---------- Phones / narrow screens (desktop layout above is unchanged) ---------- */
@media (max-width: 800px) {
  /* Bio sits low: just above the big name, overlapping only the bottom
     of the figure (shoulders) */
  .about__pin {
    align-items: flex-end;
    padding: 0 20px calc(min(11.5vw, 22vh) * 1.15 + 22px);
  }
  .about__text {
    max-width: none;
    margin-bottom: 0;
    gap: 12px;
    /* keep clear of the socials column on the right */
    padding-right: 56px;
  }
  .about__bio { font-size: 15px; line-height: 1.5; }
  .about__note { font-size: 10px; padding: 5px 10px; }

  /* Socials: compact column on the right edge, clear of the text */
  .socials { right: 12px; gap: 12px; top: auto; bottom: calc(min(11.5vw, 22vh) * 1.15 + 22px); transform: none; }
  .socials::before { height: 6vh; }
  .socials::after { display: none; }
  .socials a, .socials button { width: 32px; height: 32px; font-size: 13px; }
  .socials [data-tip]::after { display: none; } /* no hover labels on touch screens */

  .hero__scroll { bottom: 18px; }
  .hero__scroll-label { display: none; }
  .hero__scroll-arrow { display: block; width: 26px; height: 26px; }
}
