/* v4 (2026-09-04) — full rework per Khalid's "Rework alnowaiser.me" brief: not a nicer template,
   an interactive experience. Display type now does real visual work (Space Grotesk, self-hosted
   variable woff2 — the ONE deliberate font choice, not a system-stack default); monospace is
   reserved for genuine metadata (dates, palette hints, footer) instead of decorating everything;
   the dot-grid from v3 is gone from the whole page and kept ONLY behind the hero, where it reads
   as a technical marking under the assembling headline rather than global wallpaper. Card grids
   for Achievements/Projects are gone — see index.html for the chapter/showcase structure instead.
*/

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/space-grotesk-variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0a0b0d;
  --bg-raised: #101216;
  --line: rgba(255, 255, 255, 0.09);
  --line-bright: rgba(255, 255, 255, 0.2);
  --text: #eceff2;
  --text-dim: #8b93a1;
  --text-faint: #565d6b;
  --accent: #5eead4;
  --accent-ink: #08201c;
  --accent-dim: rgba(94, 234, 212, 0.13);
  --panel: #f4f6f5;
  --panel-ink: #12151a;
  --panel-muted: #5c6470;
  --radius: 10px;
  --wrap: 1160px;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-family: var(--body);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; } /* Lenis owns smooth scroll when JS runs */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
body.palette-locked { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 2rem; }
.mono { font-family: var(--mono); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --- Generic reveal (varied variants, not one fade-up for everything) --------------------- */
[data-reveal="rise"] { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-reveal="scale"] { opacity: 0; transform: scale(0.96); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal="mask"] { clip-path: inset(0 0 100% 0); transition: clip-path 0.9s cubic-bezier(.16,1,.3,1); }
[data-reveal].is-visible { opacity: 1; transform: none; clip-path: inset(0 0 0% 0); }

/* --- Custom cursor ---------------------------------------------------------------------------- */
.cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9000;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, background 0.25s ease;
  display: flex; align-items: center; justify-content: center;
}
.cursor-dot.is-active {
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  background: rgba(94, 234, 212, 0.14);
  backdrop-filter: blur(2px);
}
.cursor-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  white-space: nowrap;
}

/* --- Header / nav --------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem; flex-wrap: wrap; gap: 0.75rem;
}
.nav-brand {
  font-family: var(--display); font-weight: 600; color: var(--text); font-size: 1rem;
  background: none; border: none; cursor: pointer; padding: 0;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cmdk {
  font-family: var(--mono); font-size: 0.78rem;
  border: 1px solid var(--line-bright); color: var(--text-dim);
  background: none; cursor: pointer;
  padding: 0.4rem 0.7rem; border-radius: 6px;
  display: flex; align-items: center; gap: 0.4rem;
}
.nav-cmdk:hover { border-color: var(--accent); color: var(--accent); }
.nav-cmdk kbd { font-family: var(--mono); background: var(--line); padding: 0.05rem 0.35rem; border-radius: 3px; }

/* --- Hero --------------------------------------------------------------------------------- */
.hero {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  padding: 7rem 2rem 6rem;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; align-items: center;
  perspective: 1000px;
}
.hero::before {
  content: "";
  position: absolute; inset: -2rem -2rem auto -2rem; height: 34rem;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 60% at 30% 30%, black 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
.hero-text { position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem;
  color: var(--accent); font-weight: 600; margin: 0 0 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hero-heading {
  font-size: clamp(3rem, 6.2vw, 4.75rem);
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-heading .char { display: inline-block; }
.tagline { font-size: 1.25rem; color: var(--text-dim); margin: 1.25rem 0 2rem; max-width: 36ch; }
.hero-photo {
  position: relative; z-index: 1;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5;
  border: 1px solid var(--line-bright);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }

.social-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.social-row a {
  font-family: var(--mono); font-size: 0.82rem;
  border: 1px solid var(--line-bright); color: var(--text-dim);
  padding: 0.45rem 0.95rem; border-radius: 6px; display: inline-block;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* --- Section rhythm: some dense, some spacious, not uniform ------------------------------- */
section.wrap { padding: 6rem 2rem; }
.section-title { font-size: 1.9rem; margin: 0 0 2.5rem; }
.section-num { font-family: var(--mono); color: var(--accent); font-size: 0.95rem; font-weight: 500; margin-right: 0.6rem; }

/* About: dense, compact, generous negative space around it rather than inside it */
.about-inner { max-width: 62ch; }
.about-lead { font-size: 1.35rem; color: var(--text); font-family: var(--display); font-weight: 500; margin: 0 0 1.25rem; }
.about-inner p { color: var(--text-dim); font-size: 1.05rem; }
.hobby-line { font-family: var(--mono); font-size: 0.85rem; color: var(--text-faint); margin-top: 1.75rem; letter-spacing: 0.02em; }
.hobby-line span { color: var(--accent); }

.gallery-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; }
.gallery-item { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.92); transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.04); }

/* --- Experience chapters (signature moment 03) --------------------------------------------- */
/* Explicit scroll-track height: ScrollTrigger's pin covers `top top` -> `bottom bottom` of THIS
   element, so without a real height here the pin only lasts ~1 viewport for all N chapters
   combined (caught live: a 900px scroll blew straight through every chapter into Achievements).
   ~1.15 viewport-heights of scroll per chapter gives each one room to actually read + settle. */
.chapters { position: relative; height: calc(var(--chapter-count, 4) * 115vh); }
.chapters-pin {
  height: 100vh; min-height: 560px;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.chapter {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  max-width: var(--wrap); margin: 0 auto; padding: 0 2rem;
}
.chapters-static { height: auto !important; }
.chapters-static .chapter { position: relative; padding: 3rem 2rem; border-top: 1px solid var(--line); }
.chapters-static .chapters-pin { height: auto; min-height: 0; overflow: visible; }
.chapter-index { font-family: var(--mono); color: var(--accent); font-size: 1rem; margin-bottom: 1rem; display: block; }
.chapter-title { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 0.4rem; }
.chapter-org { color: var(--text-faint); font-family: var(--display); font-weight: 400; }
.chapter-meta { font-family: var(--mono); color: var(--text-faint); font-size: 0.82rem; margin: 0.75rem 0 1.5rem; }
.chapter-story { color: var(--text-dim); font-size: 1.1rem; max-width: 60ch; }
.chapters-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--line);
}
.chapters-static .chapters-progress { display: none; }

/* --- Achievements: editorial, not a card grid ---------------------------------------------- */
.achievement {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; align-items: center;
  padding: 3rem 0; border-top: 1px solid var(--line);
}
.achievement:last-child { border-bottom: 1px solid var(--line); }
.achievement-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.achievement-media img { width: 100%; display: block; filter: saturate(0.92); }
.achievement-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.achievement-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.achievement-period { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; }
.achievement h3 { font-size: 1.5rem; margin: 0.5rem 0 0.75rem; }
.achievement p { color: var(--text-dim); font-size: 1rem; max-width: 48ch; }
.achievement:not(:has(.achievement-media)) { grid-template-columns: 1fr; }

/* --- Projects: Geoffrey full-bleed showcase (signature moment 02) -------------------------- */
.project-showcase {
  position: relative;
  padding: 7rem 2rem;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.showcase-inner { max-width: var(--wrap); margin: 0 auto; position: relative; z-index: 2; }
.showcase-eyebrow { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.25rem; }
.showcase-title { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 16ch; margin-bottom: 1.5rem; }
.showcase-body { color: var(--text-dim); font-size: 1.1rem; max-width: 56ch; }
.showcase-nodes {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  opacity: 0.9;
}
.node-path { fill: none; stroke: var(--line-bright); stroke-width: 1.5; }
.node-dot { fill: var(--accent); }
.showcase-next { margin-top: 3rem; font-family: var(--mono); font-size: 0.85rem; color: var(--text-faint); }

/* --- Contact / ending (signature moment 05) ------------------------------------------------- */
.ending {
  padding: 7rem 2rem 5rem;
  text-align: left;
}
.ending-inner { max-width: var(--wrap); margin: 0 auto; }
.ending-heading {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: 2.5rem;
}
.ending-heading .char { display: inline-block; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-intro { color: var(--text-dim); font-size: 1.1rem; max-width: 46ch; }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form label {
  display: flex; flex-direction: column; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint);
}
.contact-form input, .contact-form textarea {
  font-family: var(--body); font-size: 1rem;
  padding: 0.75rem 0.9rem; border: 1px solid var(--line-bright); border-radius: 8px;
  background: var(--bg-raised); color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form button {
  align-self: flex-start; background: var(--accent); color: var(--accent-ink);
  border: none; font-weight: 600; font-family: var(--mono); font-size: 0.9rem;
  padding: 0.75rem 1.85rem; border-radius: 999px; cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.contact-form button:hover { opacity: 0.88; transform: translateY(-1px); }
.contact-form.is-sent button { background: var(--text); }

.site-footer {
  max-width: var(--wrap); margin: 0 auto; padding: 2.5rem 2rem 3.5rem;
  text-align: center; color: var(--text-faint); border-top: 1px solid var(--line);
}
.site-footer .social-row { justify-content: center; margin-bottom: 1.25rem; }
.site-footer p { font-family: var(--mono); font-size: 0.8rem; }

/* --- Command palette -------------------------------------------------------------------------- */
.palette-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(6, 7, 8, 0.6);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
.palette-overlay.is-open { opacity: 1; pointer-events: auto; }
.palette {
  width: min(560px, 90vw);
  background: var(--bg-raised);
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.18s ease;
}
.palette-overlay.is-open .palette { transform: translateY(0); }
.palette-input {
  width: 100%; border: none; background: none; color: var(--text);
  font-family: var(--body); font-size: 1.05rem;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line);
}
.palette-input:focus { outline: none; }
.palette-list { max-height: 320px; overflow-y: auto; padding: 0.5rem; }
.palette-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0.85rem; border-radius: 8px; font-size: 0.95rem; cursor: pointer;
}
.palette-item.is-active { background: var(--accent-dim); color: var(--accent); }
.palette-hint { font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint); }
.palette-item.is-active .palette-hint { color: var(--accent); }
.palette-empty { padding: 1rem; color: var(--text-faint); font-size: 0.9rem; }
.palette-footer {
  display: flex; gap: 1.25rem; padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint);
}

/* --- Toasts (copy-email confirmation + surprise-me easter egg) ---------------------------- */
.toast, .surprise-toast {
  position: fixed; left: 50%; bottom: 2.5rem; transform: translate(-50%, 12px);
  background: var(--text); color: var(--panel-ink);
  font-family: var(--mono); font-size: 0.85rem;
  padding: 0.8rem 1.4rem; border-radius: 999px;
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9500; max-width: min(480px, 86vw); text-align: center;
}
.surprise-toast { background: var(--accent); color: var(--accent-ink); border-radius: 12px; font-family: var(--display); font-size: 0.95rem; }
.toast.is-visible, .surprise-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Responsive ------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cursor-dot { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .hero-photo { order: -1; max-width: 320px; margin: 0 auto; }
  .gallery-strip { grid-template-columns: 1fr; }
  section.wrap { padding: 4rem 1.5rem; }
  .achievement { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr; }
  .chapters { height: auto; }
  .chapters-pin { height: auto; min-height: 0; }
  .chapter { position: relative; padding: 3rem 1.5rem; }
  .chapters-progress { display: none; }
}
