/* Daedal + COGGS shared tokens. Values follow DaedalGames/daedal-games skills/company/brand/identity.md */
:root {
  --marble: #ECE4D2;
  --marble-deep: #E2D8C2;
  --paper: #F5F0E4;
  --stone: #8A8377;
  --stone-light: #BDB4A4;
  --ink: #16140F;
  --ink-soft: #3A362E;
  --patina: #2E6E5E;   /* permanent: logo, structure */
  --emerald: #12A974;  /* live: one place per screen */
  --pink: #FF3D8B;     /* COGGS identity */
  --pink2: #FF6FB0;
  --riso-green: #2E6E5E; /* riso drum 1: landscape, structure */
  --riso-deep: #1F4A41;  /* riso green at full coverage */

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --rule: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--marble);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Aged marble grain: low contrast noise so the base reads as stone, never as a pattern. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.011 .032' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .41 0 0 0 0 .34 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--marble); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nav */
.brand { font-family: var(--serif); font-size: 28px; line-height: 1; text-decoration: none; letter-spacing: -.01em; }
.brand .dot { color: var(--patina); }

/* COGGS wordmark: COGGS #FF3D8B / . ink / ai #FF6FB0 */
.wm { font-family: var(--serif); letter-spacing: -.015em; white-space: nowrap; line-height: 1; }
.wm .c { color: var(--pink); }
.wm .d { color: var(--ink); }
.wm .a { color: var(--pink2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--marble); font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, color .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { color: var(--ink); background: color-mix(in srgb, var(--paper) 38%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.5); backdrop-filter: blur(10px) saturate(1.5); border-color: color-mix(in srgb, var(--ink) 28%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(22,20,15,.06), 0 8px 20px -12px rgba(22,20,15,.4); }
.btn.ghost:hover { background: var(--ink); color: var(--marble); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

.section-label { display: flex; align-items: center; gap: 14px; color: var(--stone); margin: 0 0 28px; }
.section-label::before { content: ""; width: 28px; height: 1px; background: var(--patina); }

/* Footer */

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }


/* Maze fullscreen (Exhibit A) */
/* Selectors use :is() so an unsupported pseudo-class drops only itself. Specificity (0,2,0)+ beats the inline .plinth/.stage rules in index.html. */
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) {
  position: fixed; inset: 0; z-index: 100;
  box-sizing: border-box; width: 100%; height: 100%; max-width: none; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(12px, 2vw, 24px);
  background: var(--paper); color: var(--ink);
  overflow: hidden;
}
.plinth::backdrop { background: var(--paper, #F5F0E4); }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .stage {
  flex: 1 1 auto; min-height: 0; min-width: 0; aspect-ratio: auto; box-shadow: none;
}
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) figcaption { flex: none; }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .hud { margin-top: 0; }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .rules { margin-top: 8px; }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .rules li { padding: 8px 14px 0 0; font-size: 12px; }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .rules li span { display: inline; margin: 0 8px 0 0; }
:is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .dpad { margin-top: 8px; }
@media (max-height: 520px) {
  :is(.plinth:fullscreen, .plinth:-webkit-full-screen, .plinth.maze-full) .rules { display: none; }
}
.hud [data-maze-fs] { margin-left: 0; }
html.maze-lock, html.maze-lock body { overflow: hidden; overscroll-behavior: none; }
