/* =====================================================================
   Kyloe Homepage — v0.1 design pass: "Stone & Static"
   ---------------------------------------------------------------------
   Direction: Highland-Bull-from-the-rift made structural.
   - Asymmetric hero (wordmark left, portrait + Fibonacci cipher right)
   - Chapter markers instead of plain rules
   - Ritual stagger entrance (one moment of spectacle on first load)
   - Tactile inverted CTA (transparent → fills with gold on hover)
   - Carved social rows with per-platform voice
   - Stone-and-static atmosphere (layered gradient + grain)
   ---------------------------------------------------------------------
   Locked decisions preserved per spec-v0.md (palette, IA, no autoplay,
   "Joining the herd" CTA copy).
   ===================================================================== */

:root {
  /* palette (locked) */
  --bg: #0d1117;
  --bg-soft: #11161e;
  --bg-deep: #080b10;
  --gold: #c4a46c;
  --gold-dim: #8b7448;
  --gold-bright: #d6b97e;
  --text: #e6e3dd;
  --text-muted: #8b8678;
  --text-dim: #5a564c;
  --rule: #1f2530;
  --rule-bright: #2a3140;

  --font-display: 'Cabinet Grotesk', 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 1180px;
  --gutter-mobile: 22px;
  --gutter-desktop: 72px;

  --radius-pill: 999px; /* play button only */

  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-soft: cubic-bezier(0.16, 0.68, 0.4, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* layered atmosphere: deep gradient + film grain + slow mist */
body {
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, #131a25 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 90% 100%, #0e151f 0%, transparent 55%),
    var(--bg);
}

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

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms var(--ease-out-soft), color 160ms var(--ease-out-soft);
}
a:hover {
  border-bottom-color: var(--gold);
}

main {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter-mobile);
  position: relative;
  z-index: 2;
}

/* skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--bg);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* visually hidden */
.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;
}

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

/* =====================================================================
   ATMOSPHERE — film grain + slow drifting mist
   ===================================================================== */
.atmos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.atmos-grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.atmos-mist {
  position: absolute;
  inset: -10% -10%;
  opacity: 0.16;
  background:
    radial-gradient(ellipse 50% 30% at 12% 18%, rgba(196, 164, 108, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 88% 78%, rgba(196, 164, 108, 0.04), transparent 70%);
  filter: blur(20px);
  animation: mist-drift 32s ease-in-out infinite alternate;
}
@keyframes mist-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, -1.5%, 0) scale(1.04);
  }
}

/* =====================================================================
   CHAPTER MARKERS — replace plain <hr> with editorial section breaks
   ===================================================================== */
.chapter {
  border: 0;
  position: relative;
  margin: 72px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(196, 164, 108, 0.35) 0%, rgba(196, 164, 108, 0.18) 50%, transparent 100%);
}
.chapter::before {
  content: attr(data-chapter);
  position: absolute;
  top: -9px;
  left: 0;
  background: var(--bg);
  padding-right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

/* =====================================================================
   1. HERO — asymmetric grid (mobile stacks, desktop splits)
   ===================================================================== */
.hero {
  padding: 84px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: start;
}

.hero-copy {
  min-width: 0;
}

/* eyebrow as editorial mark */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 28px;
}
.eyebrow-mark {
  color: var(--gold-dim);
}
.eyebrow-text {
  color: var(--gold);
}

/* monolith wordmark */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(72px, 22vw, 220px);
  line-height: 0.84;
  letter-spacing: -0.01em;
  margin: 0 0 30px;
  color: var(--text);
  /* slight optical overhang left on desktop, like a carved monolith */
  margin-left: -0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.tagline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.18;
  letter-spacing: 0.005em;
  color: var(--gold);
  margin: 0 0 44px;
  max-width: 22ch;
}

/* play button — tactile, with metadata strip */
.play-block {
  margin-top: 4px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  padding: 14px 22px 14px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: background-color 200ms var(--ease-out-soft),
    color 200ms var(--ease-out-soft), transform 200ms var(--ease-out-soft),
    box-shadow 240ms var(--ease-out-soft);
}
.play-btn:hover,
.play-btn:focus-visible {
  background: var(--gold);
  color: var(--bg);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -10px rgba(196, 164, 108, 0.55);
}
.play-btn.is-playing {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 6px 24px -10px rgba(196, 164, 108, 0.55);
}
.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.play-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  padding-left: 10px;
  margin-left: 6px;
  border-left: 1px solid currentColor;
  opacity: 0.75;
}
.play-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 16px 0 0;
  letter-spacing: 0.04em;
}

/* hero side: portrait + cipher column */
.hero-side {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.portrait-frame {
  position: relative;
  background: linear-gradient(160deg, #11161e 0%, #08090d 100%);
  border-top: 1px solid var(--rule-bright);
  border-bottom: 1px solid var(--rule);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.portrait-frame::before {
  /* gold accent rule running down the left edge — the "iron rule" */
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--gold);
}
.portrait-frame::after {
  /* tiny corner mark on the bottom-right — print-shop registration cue */
  content: '';
  position: absolute;
  right: 14px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--gold-dim);
  border-right: 1px solid var(--gold-dim);
}
.portrait-tag {
  position: absolute;
  left: 16px;
  top: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.portrait-img {
  width: 70%;
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 0 36px rgba(196, 164, 108, 0.16));
}
.portrait-coords {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* cipher column — Fibonacci, the BlockSeed pattern Kyloe debugs.
   Renders horizontally on mobile, vertically on desktop.            */
.cipher {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.cipher li {
  position: relative;
}
.cipher .cipher-mark {
  color: var(--gold);
}
.cipher .cipher-mark::before {
  content: '◆';
  position: absolute;
  left: -12px;
  top: 0;
  color: var(--gold-dim);
  font-size: 8px;
  line-height: 1.6;
}

/* =====================================================================
   2. INTRO — editorial body, oversized lede
   ===================================================================== */
.intro {
  padding: 24px 0 8px;
}
.intro-body {
  max-width: 60ch;
}
.intro-lede {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 28px;
}
.intro-body p {
  font-size: clamp(17px, 2.05vw, 19px);
  line-height: 1.66;
  margin: 0 0 22px;
  color: var(--text);
}
.intro-closer {
  font-family: var(--font-mono);
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--gold);
  margin: 32px 0 0;
  padding: 22px 0 0 22px;
  border-top: 1px solid var(--rule);
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(196, 164, 108, 0.04), transparent 60%);
}

/* =====================================================================
   3. CTA — "Joining the herd" (locked copy)
   tactile inverted button: transparent → fills with gold on hover
   ===================================================================== */
.cta {
  padding: 28px 0;
}
.cta-inner {
  max-width: 56ch;
}
.cta-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 18px;
}
.cta-sub {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 30px;
  max-width: 50ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: color 220ms var(--ease-out-soft), transform 200ms var(--ease-out-soft);
}
.btn-iron {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
}
.btn-iron::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform 320ms var(--ease-out-quint);
  z-index: 0;
}
.btn-iron .btn-label,
.btn-iron .btn-arrow {
  position: relative;
  z-index: 1;
}
.btn-iron .btn-arrow {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0;
  transition: transform 220ms var(--ease-out-soft);
}
.btn-iron:hover,
.btn-iron:focus-visible {
  color: var(--bg);
  outline: none;
  transform: translateY(-1px);
}
.btn-iron:hover::before,
.btn-iron:focus-visible::before {
  transform: translateY(0);
}
.btn-iron:hover .btn-arrow,
.btn-iron:focus-visible .btn-arrow {
  transform: translateX(4px);
}

/* =====================================================================
   4. SOCIAL — carved gallows-mark rows with per-platform voice
   ===================================================================== */
.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4.6vw, 42px);
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 6px;
}
.section-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin: 0 0 30px;
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.social-row {
  border-bottom: 1px solid var(--rule);
}
.social-link {
  display: grid;
  grid-template-columns: auto 28px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 4px;
  color: var(--text);
  text-decoration: none;
  cursor: not-allowed;
  opacity: 0.92;
  transition:
    background-color 200ms var(--ease-out-soft),
    padding-left 200ms var(--ease-out-soft),
    opacity 200ms var(--ease-out-soft);
  position: relative;
}
.social-link::before {
  /* gold left-edge mark that grows in on hover, like a chisel cut */
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 22px;
  background: var(--gold);
  transition: width 240ms var(--ease-out-quint);
}
.social-link:hover,
.social-link:focus-visible {
  outline: none;
  background-color: rgba(196, 164, 108, 0.04);
  padding-left: 18px;
  opacity: 1;
}
.social-link:hover::before,
.social-link:focus-visible::before {
  width: 3px;
}
.social-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  width: 28px;
}
.social-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.social-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: 0.005em;
  color: var(--text);
}
.social-line {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.social-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =====================================================================
   5. THE FORGE — coordinates anchor the Highland geography
   ===================================================================== */
.forge {
  padding: 24px 0 8px;
}
.forge-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 12px;
}
.forge-body {
  max-width: 52ch;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.6;
  color: var(--text-muted);
  margin: 14px 0 0;
}

/* =====================================================================
   6. FOOTER — closing chant + lineage
   ===================================================================== */
.footer {
  padding: 56px 0 72px;
  border-top: 1px solid var(--rule);
  margin-top: 72px;
}
.footer-chant {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
  margin: 0 0 12px;
}
.footer-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0;
}
.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* =====================================================================
   Desktop layout (>= 760px)
   ===================================================================== */
@media (min-width: 760px) {
  main {
    padding: 0 var(--gutter-desktop);
  }

  .chapter {
    margin: 110px 0;
  }

  .hero {
    padding: 130px 0 64px;
  }
  .intro {
    padding: 36px 0 28px;
  }
  .cta {
    padding: 56px 0;
  }
  .forge {
    padding: 40px 0 24px;
  }
  .footer {
    padding: 72px 0 88px;
    margin-top: 96px;
  }
}

/* 2-column hero only kicks in when the wordmark has room (KYLOE ≈ 3.1× font-size) */
@media (min-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1.45fr 1fr;
    gap: 72px;
    align-items: start;
  }
  /* portrait left, cipher right — side by side within the aside */
  .hero-side {
    grid-template-columns: 1fr auto;
    gap: 0 22px;
    align-items: stretch;
  }
  .cipher {
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 14px 0 14px 16px;
    gap: 6px;
    border-top: none;
    border-left: 1px solid var(--rule);
    font-size: 11px;
    justify-content: space-between;
    align-self: stretch;
    min-width: 32px;
  }
  .cipher li {
    text-align: left;
  }
}

/* =====================================================================
   RITUAL ENTRANCE STAGGER (one moment of spectacle on first load)
   ---------------------------------------------------------------------
   Items start at opacity 0 + 8px below; on .is-ready (set on next RAF)
   they fade up with delays per data-stagger index.
   ===================================================================== */
.stagger-item {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 720ms var(--ease-out-quint),
    transform 720ms var(--ease-out-quint);
}
body.is-ready .stagger-item {
  opacity: 1;
  transform: translateY(0);
}
body.is-ready .stagger-item[data-stagger='0'] { transition-delay: 80ms; }
body.is-ready .stagger-item[data-stagger='1'] { transition-delay: 220ms; }
body.is-ready .stagger-item[data-stagger='2'] { transition-delay: 480ms; }
body.is-ready .stagger-item[data-stagger='3'] { transition-delay: 740ms; }
body.is-ready .stagger-item[data-stagger='4'] { transition-delay: 940ms; }

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .atmos-mist {
    animation: none;
  }
  .stagger-item {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================================
   Focus ring (keyboard accessibility)
   ===================================================================== */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
