/* =========================================================
   ZELYFF — main.css
   Design tokens, reset, base typography & layout primitives.
   ========================================================= */

:root {
  /* Color */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F7F5;
  --color-text: #14171A;
  --color-text-muted: #5B5F66;
  --color-border: #E7E5DD;
  --color-accent: #19864B;
  --color-accent-soft: #EAF7EF;
  --color-accent-text: #0F6E3D;
  --color-dark: #0B0E14; /* dark technical surface — status card, not reused from --color-text */

  /* Typography */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-handwriting: "Caveat", cursive, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;
  /* Oversized editorial scale — reserved for the hero name (signature
     element / personal wordmark, §16). Brief suggests up to clamp(5rem,
     11vw, 11rem); tuned down slightly here so role/statement/actions
     still have room to breathe within a ~1180px container. */
  --fs-hero: clamp(3rem, 9vw + 1rem, 9.5rem);
  --fs-section: clamp(1.75rem, 1.1vw + 1.5rem, 2.5rem);
  /* Dramatic, numberless section heading (Work) — bigger than a normal
     section-title, used once so it stays a genuine visual statement. */
  --fs-statement: clamp(2.25rem, 2.6vw + 1.6rem, 4rem);

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.04), 0 1px 1px rgba(20, 23, 26, 0.03);
  --shadow-md: 0 8px 24px rgba(20, 23, 26, 0.06), 0 2px 6px rgba(20, 23, 26, 0.04);

  /* Layout */
  --container-w: 1120px;
  --nav-h: 72px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-base: 260ms;
  --dur-slow: 600ms;

  /* Ambient background grid — extremely subtle, subconscious only */
  --grid-line: rgba(20, 23, 26, 0.035);
  --grid-size: 56px;
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p {
  margin: 0;
}

/* ---------- Focus states (accessibility) ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-7); /* mobile-first base; widened at >=768px */
}

.section--tight {
  padding-block: var(--space-7);
}

.section-header {
  max-width: 620px;
  margin-bottom: var(--space-7);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.section-index {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  opacity: 0.6;
}

.section-kicker .eyebrow {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: var(--space-3);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.section-title {
  font-size: var(--fs-section);
  margin-bottom: var(--space-3);
}

.section-lede {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  max-width: 56ch;
}

/* ---------- Transition statements (narrative bridges, §63/64) ----------
   Quiet connective tissue between sections — not a full section with its
   own eyebrow/title, deliberately lighter so it reads as a beat in the
   story rather than another block competing for the same attention. */
.transition-statement {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.transition-statement p {
  font-family: var(--font-display);
  font-size: var(--fs-lg); /* var(--fs-xl) at >=768px */
  color: var(--color-text-muted);
  max-width: 34ch;
  letter-spacing: -0.01em;
}

.text-muted {
  color: var(--color-text-muted);
}

.font-mono {
  font-family: var(--font-mono);
}

/* ---------- Editorial link (§46) ----------
   The restrained alternative to a pill button: underline + arrow,
   nothing rounded, nothing filled. Used wherever a CTA doesn't need
   to compete visually with the page's one real button. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-border);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.link-arrow:hover {
  border-color: var(--color-text);
}

.link-arrow:hover svg[data-arrow] {
  transform: translateX(3px);
}

.link-arrow svg[data-arrow] {
  transition: transform var(--dur-fast) var(--ease-out);
}

/* ---------- Section kicker variants (§47 — vary the numbering, don't
   repeat one component everywhere) ---------- */

/* About: quiet inline number, as-is — "01 · About" */

/* Experience: the number stands alone on its own line, slightly
   larger, before the eyebrow — a heavier beat for the section that
   carries the most credibility. */
.section-kicker--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.section-kicker--stacked .section-index {
  font-size: var(--fs-lg);
  opacity: 1;
  color: var(--color-border);
  line-height: 1;
}

/* Work / Contact: no number at all, no small eyebrow — a big
   numberless statement instead (see .section-statement). This is a
   deliberate omission, not an inconsistency: it's the pause in the
   page's numbered rhythm right where the content itself needs to
   carry the moment. */
.section-statement {
  font-size: var(--fs-statement);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  max-width: 14ch;
}

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

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Ambient background (art direction §29) ----------
   One fixed layer for the whole page: a barely-there technical
   grid plus a soft radial light near the top. Opacity is tuned to
   be noticeable only subconsciously — never a foreground element. */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 900px 560px at 50% -10%, var(--color-accent-soft) 0%, transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size);
  background-position: 0 0, center top, center top;
  opacity: 0.6;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
}
