/* ==========================================================================
   Stacey Smith — Software Developer
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #09090b;
  --bg-2: #0f1013;
  --bg-3: #16171b;
  --ink: #f7f4f3;
  --muted: #9d9ca5;
  --dim: #5f5e67;
  --pink: #f1b8c8;
  --pink-12: rgba(241, 184, 200, 0.12);
  --pink-20: rgba(241, 184, 200, 0.2);
  --line: rgba(247, 244, 243, 0.08);
  --line-2: rgba(247, 244, 243, 0.16);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1520px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --nav-h: 4.5rem;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  /* No background here: html paints it, so the .field canvas can sit between. */
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Film grain — adds depth to the flat charcoal */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--pink); color: var(--bg); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
  border-radius: 6px;
}

.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--pink);
  color: var(--bg);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

em { font-style: normal; }

/* ---------- Optional content (driven by site.config.js) ---------- */
html:not([data-projects="on"]) [data-requires="projects"],
html[data-projects="on"] [data-requires="no-projects"],
html:not([data-email="on"]) [data-requires="email"] { display: none !important; }

/* ---------- Monogram ---------- */
/* Two interlocking script S's; the second sits a touch lower, in pink. */
.monogram {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--script);
  font-size: 1.35em;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  padding-right: 0.08em;
}
.monogram i {
  font-style: normal;
  color: var(--pink);
  margin-left: -0.32em;
  transform: translateY(0.08em);
}

/* ---------- Hairline field (canvas behind the whole page) ---------- */
.field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.js .field { animation: field-in 2.4s ease 0.6s backwards; }
@keyframes field-in { from { opacity: 0; } }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: transform 0.6s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }

.nav__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
  border-radius: 999px;
  transition: background-color 0.4s var(--ease);
}
.nav__mark .monogram {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 1.3rem;
  padding: 0.1em 0.12em 0 0;
  transition: border-color 0.4s var(--ease), transform 0.6s var(--ease);
}
.nav__mark:hover .monogram { border-color: var(--pink); transform: rotate(-8deg); }
.nav__name {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav.is-scrolled .nav__mark {
  background: rgba(15, 16, 19, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 3.35rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  overflow: hidden;
  white-space: nowrap;
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.45s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.btn:hover::before { transform: none; }
.btn__arrow { display: inline-block; transition: transform 0.45s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--solid { background: var(--pink); color: var(--bg); }
.btn--solid::before { background: var(--ink); }

.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn--ghost::before { background: var(--pink-12); }
.btn--ghost:hover { border-color: rgba(241, 184, 200, 0.5); color: var(--pink); }

/* ==========================================================================
   Reveal + line animation helpers
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.2s var(--ease) var(--d, 0ms);
}
.js .reveal.is-in,
.js.is-ready .hero .reveal { opacity: 1; transform: none; }
.js .hero .reveal { --d0: 650ms; transition-delay: calc(var(--d0) + var(--d, 0ms)); }

.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line__clip { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line__inner { display: inline-block; transition: transform 1.3s var(--ease) var(--d, 0ms); }
.js .line__inner { transform: translateY(130%); }
.js.is-ready .hero .line__inner,
.js .is-in .line__inner { transform: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  /* The whole home page is this one screen. min-height (not height) lets it
     grow and scroll only on screens too short to fit it. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: calc(var(--nav-h) + clamp(1.5rem, 4vh, 3rem) + env(safe-area-inset-top)) 0 clamp(1.5rem, 4vh, 2.75rem);
  isolation: isolate;
  overflow: hidden;
}

.hero__ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__rules {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-evenly;
  max-width: var(--max);
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
}
.hero__rules i { width: 1px; background: rgba(247, 244, 243, 0.035); }

.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(2.5rem, 6vh, 4rem);
}

.hero__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__title {
  font-size: clamp(3rem, min(12.4vw, 17.5vh), 13.75rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.058em;
  margin-block: auto;
}
.hero__title .line:nth-child(3) .line__inner { --d: 90ms; }
.hero__title .line:nth-child(4) .line__inner { --d: 180ms; }
.hero__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.035em;
  color: var(--pink);
  padding-right: 0.08em;
}
.line--indent { padding-left: clamp(2.25rem, 13vw, 15rem); }
/* Room below "thoughtfully" so the tails of the italic g and y aren't cut off. */
.hero__title .line--indent { padding-bottom: 0.34em; margin-bottom: -0.34em; }
.js .hero__title .line--indent .line__inner { transform: translateY(170%); }
.js.is-ready .hero__title .line--indent .line__inner { transform: none; }
.line--last {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  overflow: visible;
}

/* Rotating badge */
.badge {
  position: relative;
  flex: none;
  width: clamp(4.6rem, 9.5vw, 10rem);
  aspect-ratio: 1;
  opacity: 0;
  transform: scale(0.6) rotate(-40deg);
  transition: opacity 1s var(--ease) 0.5s, transform 1.4s var(--ease) 0.5s;
}
html:not(.js) .badge,
.is-ready .badge { opacity: 1; transform: none; }
.badge__ring {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin 28s linear infinite;
  rotate: var(--badge-r, 0deg);
}
.badge__ring text {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  fill: var(--muted);
}
.badge__core {
  position: absolute;
  inset: 28%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(241, 184, 200, 0.35);
  background: radial-gradient(circle at 30% 25%, rgba(241, 184, 200, 0.18), rgba(241, 184, 200, 0.02) 70%);
  font-size: clamp(1.15rem, 2.2vw, 2.3rem);
  letter-spacing: 0;
  padding-right: 0.15em;
  line-height: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 2fr);
  align-items: end;
  gap: 2rem;
  padding-top: clamp(1.25rem, 3vh, 2rem);
  position: relative;
}
/* Divider: soft pink under the intro, fading toward the right. */
.hero__foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(241, 184, 200, 0.8), rgba(241, 184, 200, 0.4) 55%, rgba(241, 184, 200, 0.06));
}
.hero__intro {
  max-width: 30rem;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.6;
  color: var(--muted);
}
.hero__intro strong { font-weight: 500; color: var(--ink); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-self: center; }
.hero__note {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { position: relative; padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(3rem, 7vw, 6rem); }

.section__label {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: clamp(2.5rem, 5.5vw, 4.5rem);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section__label h2 { font-size: inherit; font-weight: 400; color: var(--ink); }
.section__rule {
  flex: 1;
  height: 1px;
  background: var(--line-2);
  transform-origin: left;
  transition: transform 1.6s var(--ease) 0.2s;
}
.js .section__label:not(.is-in) .section__rule { transform: scaleX(0); }

/* ==========================================================================
   About
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
}
.about__aside {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.about__aside p span { color: var(--muted); }
.about__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 2.4rem;
}
.about__mark::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  border: 1px dashed rgba(241, 184, 200, 0.3);
  animation: spin 40s linear infinite;
}

.about__body { grid-column: 4 / -1; }
.about__lead {
  font-size: clamp(1.75rem, 3.65vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.032em;
  font-weight: 400;
  text-wrap: pretty;
}
.about__lead .hl { color: var(--pink); }
.about__lead em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1em;
  letter-spacing: -0.015em;
}
.about__lead .w { transition: opacity 1.1s var(--ease) calc(300ms + var(--i, 0) * 70ms); }
.about__lead.is-resetting .w { transition: none; }
.about__lead.is-lighting .w { opacity: 0.2; }
.about__lead.is-lighting .w.is-lit { opacity: 1; }

.about__more {
  position: relative;
  max-width: 36rem;
  margin: clamp(3rem, 6vw, 5.5rem) 0 0 auto;
  padding-top: 1.75rem;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.7;
  color: var(--muted);
}
.about__more::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3rem;
  height: 1px;
  background: var(--pink);
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects { border-top: 1px solid var(--line); }
.projects__intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem 3rem;
}
.projects__heading {
  font-size: clamp(2.8rem, 7.6vw, 7.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.projects__heading em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.03em;
  color: var(--pink);
}
.projects__note { max-width: 20rem; color: var(--muted); }

.projects__list {
  display: grid;
  gap: clamp(5rem, 11vw, 10rem);
  margin-top: clamp(4rem, 9vw, 8rem);
}

.project {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
}
.project__stage { grid-column: 1 / span 7; grid-row: 1; }
.project__meta { grid-column: 9 / span 4; grid-row: 1; }
.project:nth-child(even) .project__stage { grid-column: 6 / -1; }
.project:nth-child(even) .project__meta { grid-column: 1 / span 4; }

.project__stage {
  --mx: 50%;
  --my: 70%;
  position: relative;
  aspect-ratio: 6 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: clamp(1.25rem, 2.2vw, 2rem);
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at var(--mx) var(--my), rgba(241, 184, 200, 0.16), rgba(241, 184, 200, 0) 100%),
    linear-gradient(160deg, var(--bg-3), var(--bg-2) 60%);
  transition: border-color 0.6s var(--ease), clip-path 1.4s var(--ease);
}
.js .project__stage { clip-path: inset(14% 6% 0 6% round 2rem); }
.js .project.is-in .project__stage { clip-path: inset(0 0 0 0 round clamp(1.25rem, 2.2vw, 2rem)); }
.project:hover .project__stage { border-color: rgba(241, 184, 200, 0.22); }

.project__num {
  position: absolute;
  left: 4%;
  bottom: -0.18em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(9rem, 20vw, 19rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(247, 244, 243, 0.07);
  pointer-events: none;
  user-select: none;
}
.project:nth-child(even) .project__num { left: auto; right: 4%; }

.device {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  transform: perspective(1400px) translateY(calc(var(--lift) + var(--py-shift, 0px))) rotateX(var(--rx)) rotateY(var(--ry)) rotate(var(--rot, 0deg));
  transition: transform 0.9s var(--ease);
  will-change: transform;
}
.project:hover .device { --lift: -10px; }

/* Phone */
.device--phone {
  --rot: -3deg;
  height: 84%;
  padding: 0.5rem;
  border-radius: clamp(1.6rem, 2.6vw, 2.6rem);
  background: linear-gradient(150deg, #34353c, #1a1b1f 45%, #2a2b31);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 50px 90px -30px rgba(0, 0, 0, 0.75),
    0 30px 60px -40px rgba(241, 184, 200, 0.35);
}
.project:nth-child(4n + 3) .device--phone { --rot: 3deg; }
.project:hover .device--phone { --rot: 0deg; }
.device--phone img {
  height: 100%;
  width: auto;
  border-radius: clamp(1.25rem, 2.15vw, 2.15rem);
}
.device--phone::after {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border-radius: clamp(1.25rem, 2.15vw, 2.15rem);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}

/* Browser */
.device--browser {
  position: absolute;
  top: 50%;
  left: 9%;
  width: 104%;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #212227;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 50px 90px -30px rgba(0, 0, 0, 0.75),
    0 30px 60px -40px rgba(241, 184, 200, 0.3);
  transform: perspective(1400px) translate(var(--bx, 0), calc(-50% + var(--lift) + var(--py-shift, 0px))) rotateX(var(--rx)) rotateY(var(--ry));
}
.project:hover .device--browser { --bx: -2.5%; }
.device__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.1rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.device__bar i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3a3b42; }
.device__bar i:first-child { background: var(--pink); opacity: 0.8; }
.device__bar span {
  height: 0.95rem;
  width: 34%;
  margin-left: 18%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.device--browser img { width: 100%; }

.project__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
.project__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.project__tag b { font-weight: 400; color: var(--pink); }
.project__tag span {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.project__title {
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.project__desc { max-width: 26rem; color: var(--muted); font-size: 1.02rem; }
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-bottom: 0.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(var(--pink), var(--pink)) left bottom / 100% 1px no-repeat;
  transition: color 0.3s, background-size 0.5s var(--ease);
}
.project__link span { transition: transform 0.45s var(--ease); }
.project__link:hover { color: var(--pink); }
.project__link:hover span { transform: translate(3px, -3px); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  min-height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.contact__ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.contact__glow {
  position: absolute;
  left: 50%;
  bottom: -40%;
  width: 140vw;
  height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(241, 184, 200, 0.16), rgba(241, 184, 200, 0) 100%);
}
.contact__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(241, 184, 200, 0.16);
  animation: spin 90s linear infinite;
}
.contact__ring--1 { width: min(62vw, 900px); aspect-ratio: 1; right: -16vw; top: 50%; margin-top: min(-31vw, -450px); }
.contact__ring--2 {
  width: min(40vw, 580px);
  aspect-ratio: 1;
  right: -5vw;
  top: 50%;
  margin-top: min(-20vw, -290px);
  border-style: solid;
  border-color: var(--line);
  animation-direction: reverse;
}

.contact__title {
  font-size: clamp(3.2rem, 10.2vw, 11rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.058em;
}
.contact__title .line:nth-child(2) .line__inner { --d: 120ms; }
.contact__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.035em;
  color: var(--pink);
}

.contact__body {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem 4rem;
  margin-top: clamp(3rem, 7vw, 5.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.contact__text { max-width: 24rem; color: var(--muted); font-size: 1.05rem; }
.contact__email { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.3rem;
  font-size: clamp(1.4rem, 3.1vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  background:
    linear-gradient(var(--pink), var(--pink)) left bottom / 0 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) left bottom / 100% 1px no-repeat;
  transition: background-size 0.7s var(--ease), color 0.3s;
  overflow-wrap: anywhere;
}
.contact__link:hover { color: var(--pink); background-size: 100% 1px, 100% 1px; }
.contact__arrow { color: var(--pink); transition: transform 0.5s var(--ease); }
.contact__link:hover .contact__arrow { transform: translate(4px, -4px) rotate(45deg); }
.contact__copy {
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.contact__copy:hover { color: var(--pink); border-color: rgba(241, 184, 200, 0.5); }

/* ---------- Contact form ---------- */
.contact__body { align-items: flex-start; }
.contact__intro { flex: 1 1 16rem; max-width: 24rem; }
.form {
  flex: 1 1 30rem;
  max-width: 40rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1.5rem;
}
.form__field { display: flex; flex-direction: column; gap: 0.5rem; }
.form__field--wide,
.form__actions { grid-column: 1 / -1; }
.form__field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.form__field input,
.form__field textarea {
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form__field textarea { min-height: 7.5rem; resize: vertical; line-height: 1.55; }
.form__field input:hover,
.form__field textarea:hover { border-bottom-color: rgba(247, 244, 243, 0.4); }
.form__field input:focus,
.form__field textarea:focus { outline: none; border-bottom-color: var(--pink); box-shadow: 0 1px 0 var(--pink); }
.form__field [aria-invalid="true"] { border-bottom-color: #e8a0a0; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form__actions .btn[disabled] { opacity: 0.6; cursor: progress; }
.form__status { flex: 1 1 14rem; font-size: 0.9rem; line-height: 1.5; color: var(--pink); }
.form__status:empty { display: none; }
/* Wide screens: headline + intro on the left, form on the right, so it all fits. */
@media (min-width: 1000px) {
  .contact .shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: clamp(3rem, 6vw, 6.5rem);
    align-items: end;
  }
  .contact .section__label { grid-column: 1 / -1; }
  .contact__title { grid-column: 1; grid-row: 2; font-size: clamp(3.2rem, 6.6vw, 8rem); }
  .contact__body { display: contents; }
  .contact__intro { grid-column: 1; grid-row: 3; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: none; }
  .contact__email { grid-column: 1; grid-row: 4; margin-top: 1.5rem; }
  .form { grid-column: 2; grid-row: 2 / span 3; max-width: none; align-self: end; }
}
@media (max-width: 520px) {
  .form { grid-template-columns: 1fr; }
  .form__actions .btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Panel — About / Projects / Contact open here, over the home screen
   ========================================================================== */
.panel {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: clamp(0.5rem, 2vw, 1.75rem);
  margin-top: calc(clamp(0.5rem, 2vw, 1.75rem) + env(safe-area-inset-top));
  margin-bottom: calc(clamp(0.5rem, 2vw, 1.75rem) + env(safe-area-inset-bottom));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: clamp(1.25rem, 2.2vw, 2rem);
  background: rgba(9, 9, 11, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  backdrop-filter: blur(22px) saturate(130%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  overflow: hidden;
}
.panel[open] {
  display: flex;
  flex-direction: column;
  animation: panel-in 0.75s var(--ease);
}
.panel::backdrop {
  background: rgba(12, 12, 15, 0.38);
}
.panel[open]::backdrop { animation: backdrop-in 0.6s var(--ease); }
.panel.is-closing { animation: panel-out 0.36s var(--ease) forwards; }
.panel.is-closing::backdrop { animation: backdrop-out 0.36s var(--ease) forwards; }
@keyframes panel-in { from { opacity: 0; transform: translateY(28px) scale(0.985); } }
@keyframes panel-out { to { opacity: 0; transform: translateY(18px) scale(0.99); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
html:has(.panel[open]) { overflow: hidden; }

.panel__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.85rem 0.85rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.panel__tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 16, 19, 0.62);
}
.panel__tabs a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.3s, background-color 0.3s;
}
.panel__tabs a:hover { color: var(--ink); }
.panel__tabs a[aria-current="true"] {
  color: var(--pink);
  background: var(--pink-12);
  box-shadow: inset 0 0 0 1px rgba(241, 184, 200, 0.18);
}
.panel__close {
  position: relative;
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  transition: border-color 0.3s, transform 0.5s var(--ease);
}
.panel__close:hover { border-color: var(--pink); transform: rotate(90deg); }
.panel__close span::before,
.panel__close span::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 50%;
  width: 40%;
  height: 1.5px;
  background: var(--ink);
  transform: rotate(45deg);
}
.panel__close span::after { transform: rotate(-45deg); }
.panel__close:hover span::before,
.panel__close:hover span::after { background: var(--pink); }

.panel__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel__body:focus { outline: none; }
.panel [data-view][hidden] { display: none !important; }

.about__next {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}
.about__next span { transition: transform 0.4s var(--ease); }
.about__next:hover span { transform: translateX(4px); }

/* Without JavaScript the panel can't open, so its sections simply follow the hero. */
html:not(.js) .panel {
  position: static;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
html:not(.js) .panel__bar { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .hero__foot { grid-template-columns: minmax(0, 1fr) auto; }
  .hero__note { display: none; }
  .hero__actions { justify-self: end; }
  .project__stage,
  .project:nth-child(even) .project__stage { grid-column: 1 / span 7; }
  .project__meta,
  .project:nth-child(even) .project__meta { grid-column: 8 / -1; }
  .project:nth-child(even) .project__stage { grid-column: 6 / -1; }
  .project:nth-child(even) .project__meta { grid-column: 1 / span 5; }
}

@media (max-width: 860px) {
  :root { --nav-h: 4.25rem; }

  .hero__foot { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero__actions { justify-self: start; }

  .about__aside { position: static; grid-column: 1 / -1; flex-direction: row; align-items: center; margin-bottom: 2.5rem; }
  .about__mark { width: 3.75rem; font-size: 1.7rem; }
  .about__body { grid-column: 1 / -1; }

  .project { row-gap: 1.75rem; }
  .project .project__stage,
  .project:nth-child(even) .project__stage { grid-column: 1 / -1; grid-row: 1; }
  .project .project__meta,
  .project:nth-child(even) .project__meta { grid-column: 1 / -1; grid-row: 2; }
  .project__stage { aspect-ratio: 1 / 1; }
  .project__stage:has(.device--browser) { aspect-ratio: 5 / 4; }
  .device--browser,
  .project:nth-child(even) .device--browser { left: 7%; right: auto; width: 112%; }
  .device__bar { height: 1.6rem; padding: 0 0.7rem; }
  .device__bar i { width: 0.45rem; height: 0.45rem; }

  .contact__ring--1 { width: 120vw; right: -60vw; margin-top: -60vw; }
  .contact__ring--2 { width: 80vw; right: -40vw; margin-top: -40vw; }
}

@media (max-width: 520px) {
  .hero__meta .hero__role { display: none; }
  .hero__title { font-size: min(16vw, 12vh); }
  .line--indent { padding-left: 1.4rem; }
  .hero__actions { width: 100%; flex-wrap: nowrap; gap: 0.6rem; }
  .hero__actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 0.75rem; font-size: 0.9rem; white-space: nowrap; }
  .hero__actions .btn__arrow { display: none; }

  /* Phones: home is exactly one screen and never scrolls or bounces. */
  html, body { overscroll-behavior: none; }
  .hero { min-height: 0; height: 100vh; height: 100dvh; }
}

/* Shorter phones: tighten the spacing so everything still fits on one screen. */
@media (max-width: 520px) and (max-height: 700px) {
  .hero { padding-top: calc(var(--nav-h) + 0.75rem + env(safe-area-inset-top)); padding-bottom: 1.25rem; }
  .hero__inner { gap: 1.25rem; }
  .hero__title { font-size: min(16vw, 10.5vh); }
  .hero__foot { gap: 1rem; padding-top: 1rem; }
  .hero__intro { font-size: 0.95rem; line-height: 1.5; }
}

/* Short screens (small laptops, landscape tablets): tighten so home still fits. */
@media (max-height: 720px) and (min-width: 521px) {
  .hero__inner { gap: 1.25rem; }
  .hero__title { font-size: clamp(2.75rem, min(12.4vw, 15vh), 13.75rem); }
  .hero__foot { padding-top: 1rem; }
}

@media (min-width: 521px) and (max-width: 1100px) and (orientation: portrait) {
  .hero__title { font-size: min(15vw, 14vh); }
}


/* ==========================================================================
   Reduced motion — everything is visible and still
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal,
  .js .line__inner,
  .badge { opacity: 1; transform: none; }
  .js .project__stage { clip-path: none; }
  .js .section__label .section__rule { transform: none; }
  .panel[open], .panel[open]::backdrop, .panel.is-closing, .panel.is-closing::backdrop { animation: none !important; }
  .about__lead.is-lighting .w { opacity: 1; }
}
