/* Layer8 - stealth marketing site
   Refined dark minimalism. Instrument Serif (display) + Hanken Grotesk (body)
   + JetBrains Mono (technical labels). One brass accent, used sparingly. */

:root {
  --bg:        #07080b;
  --bg-soft:   #0d0f14;
  --ink:       #ecebe4;
  --muted:     #8c8f99;
  --faint:     #4a4d57;
  --line:      rgba(236, 235, 228, 0.08);
  --brass:     #c9a24a;
  --brass-dim: rgba(201, 162, 74, 0.16);

  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 350;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Atmosphere: cool depth + a single warm brass glow, plus a whisper-faint grid. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 82% -10%, rgba(201, 162, 74, 0.10), transparent 55%),
    radial-gradient(90% 80% at 8% 110%, rgba(72, 96, 140, 0.12), transparent 60%),
    linear-gradient(180deg, #07080b 0%, #06070a 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 90%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 90%);
  opacity: 0.5;
}

/* Film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- shell ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---- nav ---- */
nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0 0;
}
.brand {
  font-family: var(--serif);
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.brand b { font-weight: 400; }
.brand .eight { color: var(--brass); font-style: italic; }
.nav-right {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-right a { color: var(--muted); text-decoration: none; transition: color 0.3s ease; }
.nav-right a:hover { color: var(--brass); }

/* ---- hero ---- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
  min-height: min(calc(100vh - 260px), 720px);
  padding: 40px 0 56px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 0 rgba(201,162,74,0.7);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,162,74,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(201,162,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,162,74,0); }
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 5vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 .em { font-style: italic; color: var(--brass); }

.lede {
  margin-top: 30px;
  max-width: 46ch;
  font-size: 1.075rem;
  color: var(--muted);
  line-height: 1.7;
}

.cta-row {
  margin-top: 44px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.link-arrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(201, 162, 74, 0.55);
  border-radius: 9px;
  padding: 14px 26px;
  background: var(--brass-dim);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, gap 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.link-arrow:hover {
  color: var(--brass);
  border-color: var(--brass);
  background: rgba(201, 162, 74, 0.22);
  gap: 16px;
}

/* ---- hero visual: stacked OSI layers, the 8th lit ---- */
.stage {
  position: relative;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stack-wrap { perspective: 1400px; }
.stack {
  position: relative;
  width: 310px;
  height: 310px;
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-42deg);
  animation: drift 16s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: rotateX(58deg) rotateZ(-42deg) translateZ(0); }
  50%      { transform: rotateX(54deg) rotateZ(-38deg) translateZ(10px); }
}
.layer {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(236,235,228,0.14);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(236,235,228,0.05), rgba(236,235,228,0.01));
  backdrop-filter: blur(1px);
  transform: translateZ(calc(var(--i) * 30px));
  opacity: calc(0.28 + var(--i) * 0.07);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.layer.is-eighth {
  border-color: rgba(201,162,74,0.95);
  background: linear-gradient(135deg, rgba(201,162,74,0.3), rgba(201,162,74,0.06));
  box-shadow: 0 0 44px rgba(201,162,74,0.4), 0 0 0 1px rgba(201,162,74,0.45);
  opacity: 1;
}
.layer.is-eighth::after {
  content: "08";
  position: absolute;
  top: 12px; left: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--brass);
}
.stage-caption {
  position: absolute;
  bottom: 44px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- beliefs strip ---- */
.beliefs {
  border-top: 1px solid var(--line);
  padding: 80px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.belief .n {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--brass);
  display: block;
  margin-bottom: 18px;
}
.belief h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.15;
  margin-bottom: 12px;
}
.belief p { color: var(--muted); font-size: 0.95rem; }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-transform: uppercase;
}
.foot-links { display: flex; gap: 26px; }
.foot-links a { color: var(--muted); text-decoration: none; transition: color 0.3s ease; }
.foot-links a:hover { color: var(--brass); }

/* ---- entrance choreography ---- */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 1s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.31s; }
.d4 { animation-delay: 0.44s; }
.d5 { animation-delay: 0.6s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.stage.reveal { animation: fadein 1.4s ease 0.3s forwards; }
@keyframes fadein { to { opacity: 1; transform: none; } }

/* Assembly: layers stack up one by one; the eighth lands last and flares. */
@media (prefers-reduced-motion: no-preference) {
  .layer {
    opacity: 0;
    animation: layer-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    animation-delay: calc(0.7s + var(--i) * 0.16s);
  }
  .layer.is-eighth {
    animation-name: layer-in-eighth;
    animation-duration: 0.9s;
  }
}
@keyframes layer-in {
  from {
    opacity: 0;
    transform: translateZ(calc(var(--i) * 30px + 130px));
  }
  to {
    opacity: calc(0.28 + var(--i) * 0.07);
    transform: translateZ(calc(var(--i) * 30px));
  }
}
@keyframes layer-in-eighth {
  0% {
    opacity: 0;
    transform: translateZ(calc(var(--i) * 30px + 170px));
  }
  60% {
    opacity: 1;
    transform: translateZ(calc(var(--i) * 30px));
    box-shadow: 0 0 80px rgba(201,162,74,0.65), 0 0 0 1px rgba(201,162,74,0.6);
  }
  100% {
    opacity: 1;
    transform: translateZ(calc(var(--i) * 30px));
    box-shadow: 0 0 44px rgba(201,162,74,0.4), 0 0 0 1px rgba(201,162,74,0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .stage.reveal { animation: none; opacity: 1; transform: none; }
  .stack, .pulse { animation: none; }
}

/* ---- legal pages ---- */
.legal { max-width: 760px; margin: 0 auto; padding: 60px 0 100px; }
.legal .kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
}
.legal h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 18px 0 10px;
}
.legal .updated {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 48px;
}
.legal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  margin: 44px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.legal h2 .s {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--brass);
}
.legal p, .legal li { color: var(--muted); font-size: 0.98rem; line-height: 1.75; }
.legal p { margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.legal a:hover { text-decoration-color: var(--brass); color: var(--brass); }
.legal strong { color: var(--ink); font-weight: 500; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 20px; }
  .stage { height: 340px; margin-top: 40px; }
  .stack-wrap { transform: scale(0.8); }
  .beliefs { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 22px; }
  .stage { height: 290px; margin-top: 24px; }
  .stack-wrap { transform: scale(0.6); }
  .stage-caption { bottom: 24px; }
  .footer-flex, footer { flex-direction: column; align-items: flex-start; }
  .stage-caption {
    white-space: normal;
    left: 0;
    transform: none;
    width: 100%;
    text-align: center;
    line-height: 1.8;
  }
}

/* ---- cookie consent ---- */
.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.cookie-banner p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.cookie-banner a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}
.cookie-banner a:hover { color: var(--brass); text-decoration-color: var(--brass); }
.cookie-actions { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-actions button {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 18px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.cookie-decline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.cookie-decline:hover { color: var(--ink); border-color: var(--faint); }
.cookie-accept {
  background: var(--brass-dim);
  border: 1px solid rgba(201, 162, 74, 0.55);
  color: var(--ink);
}
.cookie-accept:hover { color: var(--brass); border-color: var(--brass); background: rgba(201, 162, 74, 0.22); }

@media (prefers-reduced-motion: no-preference) {
  .cookie-banner { animation: cookie-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
}
@keyframes cookie-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 16px; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}
