/* ============================================================
   SELF & SYSTEM — globals.css v0.1
   ------------------------------------------------------------
   Drop-in design tokens, base styles, and component primitives.
   Iterate the :root block to retune the whole system at once.
   ============================================================ */


/* ------------------------------------------------------------
   1. FONT IMPORTS
   ------------------------------------------------------------
   Using Google Fonts as the v0 free option.
   Fraunces (serif display) + Inter (grotesque body) + JetBrains
   Mono (sparingly). Swap Fraunces → Editorial New / PP Editorial
   New / Tiempos Headline when paid licenses are in place.
   ------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');


/* ------------------------------------------------------------
   2. DESIGN TOKENS
   ------------------------------------------------------------ */

:root {

  /* --- COLOR — Foundation (deep, cool, almost-black) -------- */
  --ink-900: #0E1216;        /* primary background */
  --ink-800: #141A20;        /* surface raised */
  --ink-700: #1C242C;        /* surface elevated */
  --ink-600: #2A343E;        /* borders, dividers */

  /* --- COLOR — Foreground (warm bone, not white) ------------ */
  --bone-100: #F2EEE6;       /* primary text */
  --bone-200: #E4DFD4;       /* secondary text */
  --bone-300: #B8B2A6;       /* tertiary, captions */
  --bone-400: #6F6A60;       /* muted, hints */

  /* --- COLOR — Accent (single, disciplined) ----------------- */
  --accent:        #6B8E86;
  --accent-soft:   #6B8E8633;  /* 20% — glows, hover halos */
  --accent-deep:   #3F5651;    /* pressed states */

  /* --- COLOR — Functional ---------------------------------- */
  --focus-ring: #6B8E8666;
  --selection:  #6B8E8640;

  /* --- TYPOGRAPHY — Families ------------------------------- */
  --font-display: 'Fraunces', 'Editorial New', 'Tiempos Headline', Georgia, serif;
  --font-body:    'Inter', 'Söhne', 'Neue Haas Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* --- TYPOGRAPHY — Scale (1.25 modular) -------------------- */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2.25rem;    /* 36px */
  --text-3xl:  3.5rem;     /* 56px */
  --text-4xl:  5rem;       /* 80px */

  /* --- TYPOGRAPHY — Rhythm --------------------------------- */
  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.55;
  --leading-relaxed: 1.7;

  --tracking-tight:   0;
  --tracking-normal:   0;
  --tracking-wide:     0.08em;
  --tracking-widest:   0.18em;

  /* --- SPACING --------------------------------------------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-48: 12rem;

  /* --- LAYOUT — Containers --------------------------------- */
  --container-narrow:  38rem;   /* 608px — reading width */
  --container-default: 56rem;   /* 896px — most content */
  --container-wide:    72rem;   /* 1152px — full layouts */

  --grid-gutter: var(--space-6);
  --grid-margin: var(--space-8);

  /* --- MOTION — Durations (long, deliberate) --------------- */
  --dur-fast:    240ms;
  --dur-base:    480ms;
  --dur-slow:    800ms;
  --dur-ambient:  12s;
  --dur-breath:   6s;

  /* --- MOTION — Easings (never linear, never bouncy) ------- */
  --ease-out-quart:    cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);

  /* --- RADIUS — Almost-square, not pill -------------------- */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* --- Z-INDEX scale --------------------------------------- */
  --z-base:    1;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   1000;
}


/* ------------------------------------------------------------
   3. RESET + BASE
   ------------------------------------------------------------ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: 400;
  color: var(--bone-100);
  background: var(--ink-900);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--selection);
  color: var(--bone-100);
}

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

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

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

input, textarea {
  font: inherit;
}


/* ------------------------------------------------------------
   4. TYPOGRAPHY CLASSES
   ------------------------------------------------------------ */

.display-hero {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-variation-settings: "opsz" 144, "SOFT" 50;  /* Fraunces optical */
  color: var(--bone-100);
}

.display-section {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  font-variation-settings: "opsz" 100, "SOFT" 50;
  color: var(--bone-100);
}

@media (min-width: 640px) {
  .display-hero { font-size: var(--text-3xl); }
  .display-section { font-size: var(--text-2xl); }
}

@media (min-width: 1024px) {
  .display-hero { font-size: var(--text-4xl); }
  .display-section { font-size: var(--text-3xl); }
}

.lead {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--bone-200);
  font-weight: 300;
}

.body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--bone-200);
}

.caption {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--bone-300);
}

/* The signature small-caps label — used for section signage */
.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--bone-400);
  display: inline-block;
}


/* ------------------------------------------------------------
   5. LAYOUT PRIMITIVES
   ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
}

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

@media (max-width: 768px) {
  .section { padding-block: var(--space-16); }
}


/* ------------------------------------------------------------
   6. COMPONENT PRIMITIVES
   ------------------------------------------------------------ */

/* --- Buttons — two variants only --------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out-expo);
  position: relative;
  isolation: isolate;
}

.btn-primary {
  color: var(--ink-900);
  background: var(--bone-100);
}
.btn-primary:hover {
  background: var(--bone-200);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.btn-ghost {
  color: var(--bone-200);
  background: transparent;
  border-color: var(--ink-600);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--bone-100);
}

/* --- Resource card — the linktree primitive ---------------- */

.resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-8);
  background: transparent;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-sm);
  transition: all var(--dur-base) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.resource-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}

.resource-card:hover {
  border-color: var(--bone-400);
  background: var(--ink-800);
}

.resource-card:hover::after {
  transform: scaleX(1);
}

.resource-card__content {
  flex: 1;
  min-width: 0;
}

.resource-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  color: var(--bone-100);
  margin-bottom: var(--space-2);
}

.resource-card__description {
  font-size: var(--text-sm);
  color: var(--bone-300);
  line-height: var(--leading-normal);
}

.resource-card__arrow {
  flex-shrink: 0;
  color: var(--bone-400);
  transition: transform var(--dur-base) var(--ease-out-expo),
              color var(--dur-base) var(--ease-out-expo);
}

.resource-card:hover .resource-card__arrow {
  transform: translateX(6px);
  color: var(--accent);
}


/* ------------------------------------------------------------
   7. WORDMARK
   ------------------------------------------------------------ */

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  font-variation-settings: "opsz" 100, "SOFT" 50;
  display: inline-block;
}

.wordmark-stacked {
  font-size: var(--text-xl);
  line-height: 1.05;
}

.wordmark-stacked .ampersand {
  font-size: 1.15em;
  color: var(--bone-300);
  font-style: italic;
}

.wordmark-inline {
  font-size: var(--text-lg);
}


/* ------------------------------------------------------------
   8. SIGNATURE MOTION
   ------------------------------------------------------------ */

/* --- Ambient grain (whole-page texture) ------------------- */
.grain-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.04;
  mix-blend-mode: overlay;
}

/* --- Breathing element (used on hero) --------------------- */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.015); opacity: 1; }
}
.breathe {
  animation: breathe var(--dur-breath) var(--ease-in-out-cubic) infinite;
}

/* --- Hero reveal — word-by-word fade up ------------------- */
@keyframes reveal-word {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
.reveal-word {
  display: inline-block;
  opacity: 0;
  animation: reveal-word var(--dur-slow) var(--ease-out-expo) forwards;
}

/* --- Scroll-revealed hairline ----------------------------- */
.hairline {
  width: 100%;
  height: 1px;
  background: var(--bone-400);
  opacity: 0.2;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.hairline.is-visible {
  transform: scaleX(1);
}

/* --- Cursor-following light (controlled via JS) ----------- */
.cursor-light {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
  z-index: var(--z-base);
  transform: translate(-50%, -50%);
  filter: blur(60px);
  opacity: 0.6;
  transition: transform 400ms var(--ease-out-expo);
  will-change: transform;
}


/* ------------------------------------------------------------
   9. FOCUS + ACCESSIBILITY
   ------------------------------------------------------------ */

*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .breathe { animation: none; }
}


/* ------------------------------------------------------------
   10. UTILITIES (minimal — extend as needed)
   ------------------------------------------------------------ */

.stack-2  > * + * { margin-top: var(--space-2); }
.stack-4  > * + * { margin-top: var(--space-4); }
.stack-6  > * + * { margin-top: var(--space-6); }
.stack-8  > * + * { margin-top: var(--space-8); }
.stack-12 > * + * { margin-top: var(--space-12); }
.stack-16 > * + * { margin-top: var(--space-16); }

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }


/* ------------------------------------------------------------
   11. SITE LAYOUT
   ------------------------------------------------------------ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-overlay);
  padding: var(--space-6) var(--grid-margin);
  transition: background var(--dur-base) var(--ease-out-expo),
              backdrop-filter var(--dur-base) var(--ease-out-expo);
}

.site-header.is-scrolled {
  background: rgba(14, 18, 22, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-header__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-32) var(--grid-margin) var(--space-16);
  overflow: hidden;
}

.hero__breath {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vmin, 800px);
  height: min(80vmin, 800px);
  border-radius: 50%;
  background: radial-gradient(circle,
              rgba(107, 142, 134, 0.08) 0%,
              rgba(107, 142, 134, 0.02) 40%,
              transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: var(--container-default);
}

.hero__label {
  margin-bottom: var(--space-12);
  animation-delay: 100ms;
}

.hero__headline {
  margin-bottom: var(--space-8);
}

.hero__lead {
  max-width: 36rem;
  margin-inline: auto;
  animation-delay: 1600ms;
}

.hero__headline .reveal-word:nth-of-type(1) { animation-delay: 400ms; }
.hero__headline .reveal-word:nth-of-type(2) { animation-delay: 460ms; }
.hero__headline .reveal-word:nth-of-type(3) { animation-delay: 520ms; }
.hero__headline .reveal-word:nth-of-type(4) { animation-delay: 580ms; }
.hero__headline .reveal-word:nth-of-type(5) { animation-delay: 640ms; }
.hero__headline .reveal-word:nth-of-type(6) { animation-delay: 700ms; }
.hero__headline .reveal-word:nth-of-type(7) { animation-delay: 760ms; }
.hero__headline .reveal-word:nth-of-type(8) { animation-delay: 820ms; }
.hero__headline .reveal-word:nth-of-type(9) { animation-delay: 880ms; }
.hero__headline .reveal-word:nth-of-type(10) { animation-delay: 940ms; }
.hero__headline .reveal-word:nth-of-type(11) { animation-delay: 1100ms; }
.hero__headline .reveal-word:nth-of-type(12) { animation-delay: 1160ms; }
.hero__headline .reveal-word:nth-of-type(13) { animation-delay: 1220ms; }
.hero__headline .reveal-word:nth-of-type(14) { animation-delay: 1280ms; }

.hero__scroll-cue {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--bone-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--bone-400), transparent);
  animation: scroll-cue 3s var(--ease-in-out-cubic) infinite;
  transform-origin: top;
}

@keyframes scroll-cue {
  0%, 100% { transform: scaleY(0.3); opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 1; }
}

.resources {
  padding: var(--space-32) var(--grid-margin);
  position: relative;
}

.resources__inner {
  max-width: var(--container-default);
  margin-inline: auto;
}

.resources__header {
  margin-bottom: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.resources__hairline {
  margin-bottom: var(--space-12);
}

.resources__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.site-footer {
  padding: var(--space-16) var(--grid-margin) var(--space-8);
  border-top: 1px solid var(--ink-700);
}

.site-footer__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.site-footer__links {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.site-footer__link {
  font-size: var(--text-sm);
  color: var(--bone-300);
  transition: color var(--dur-base) var(--ease-out-expo);
}

.site-footer__link:hover {
  color: var(--bone-100);
}

.site-footer__meta {
  font-size: var(--text-xs);
  color: var(--bone-400);
  letter-spacing: var(--tracking-wide);
}

.not-found {
  min-height: 100vh;
  display: grid;
  align-content: center;
}

@media (max-width: 640px) {
  :root {
    --grid-margin: var(--space-6);
  }

  .resource-card {
    padding: var(--space-6);
  }

  .resource-card__title {
    font-size: var(--text-lg);
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
