/* FantasyLab house style. See /DESIGN.md. Each page sets --accent / --accent-2 on <body>. */
:root {
  --ink-0: #0f0d0b; --ink-1: #171410; --ink-2: #221d17;
  --paper: #efe6d6; --paper-dim: #b9ae9c; --paper-faint: #8f8676; --rule: rgba(239, 230, 214, .14);
  --lamp: #ffb45e; --accent: var(--lamp); --accent-2: #8c6a4a;
  --display: "Gloock", "Iowan Old Style", Georgia, serif;
  --text: "Familjen Grotesk", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1240px; --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; background: var(--ink-0); color: var(--paper); font: 400 18px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
/* paper grain over everything (SVG noise, no image request) */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink-0); padding: 8px 12px; z-index: 200; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.015em; line-height: .98; margin: 0 0 .4em; }
h1 { font-size: clamp(46px, 7.2vw, 112px); }
h2 { font-size: clamp(34px, 4.6vw, 68px); }
h3 { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.08; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
p { margin: 0 0 1em; max-width: 64ch; }
.lede { font-size: clamp(19px, 1.6vw, 23px); color: var(--paper-dim); max-width: 46ch; }
.mono, .eyebrow, .note, .fig { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { color: var(--paper-faint); display: block; margin-bottom: 22px; }
.eyebrow b { color: var(--accent); font-weight: 600; }
.note { color: var(--paper-faint); font-size: 11px; }
.fig { color: var(--paper-faint); font-size: 11px; margin-top: 10px; }
.caption { font: 400 13px/1.45 var(--mono); color: var(--paper-faint); margin-top: 10px; } /* plain-case alternative for long captions */
.band.paper .caption { color: #6d6458; }

/* bands */
.band { padding: clamp(72px, 11vw, 160px) 0; position: relative; }
.band.paper { background: var(--paper); color: var(--ink-0); }
.band.paper .eyebrow, .band.paper .note, .band.paper .fig { color: #6d6458; }
.band.paper .lede { color: #4a4238; }
.band.paper a:hover, .foot a:hover, .skip:hover { color: var(--accent-2); }
.band.paper .eyebrow b { color: var(--accent-2); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.band.paper .rule { border-top-color: rgba(15, 13, 11, .16); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 3px;
  background: var(--paper); color: var(--ink-0); font: 600 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--paper); box-shadow: 0 0 0 var(--accent);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.btn:hover { color: var(--ink-0); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--accent); }
.band.paper .btn { background: var(--ink-0); color: var(--paper); border-color: var(--ink-0); }
.band.paper .btn:hover { color: var(--paper); }
.link { font: 600 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; position: relative; padding-bottom: 6px; }
.link::after, .scribble::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -2px; height: 8px; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><path d='M1 5.2C30 2.8 62 6.4 98 4.1s70-.9 101 1.6' fill='none' stroke='%23ffb45e' stroke-width='2.2' stroke-linecap='round'/></svg>") no-repeat center/100% 100%;
  filter: hue-rotate(var(--scribble-hue, 0deg));
}
.scribble { position: relative; white-space: nowrap; }
.actions .link { display: inline-flex; align-items: center; min-height: 44px; padding-bottom: 0; }

/* sticker */
.tag {
  display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 7px 10px 6px;
  background: var(--accent); color: var(--ink-0); transform: rotate(-1.6deg); border-radius: 2px;
}
.tag + .tag { transform: rotate(1.2deg); margin-left: 6px; }

/* nav (same markup on every page) */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .4s var(--ease); }
.nav.scrolled { background: rgba(15, 13, 11, .86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark { font: 400 24px/1 var(--display); text-decoration: none; display: flex; align-items: center; gap: 10px; color: var(--paper); }
.wordmark svg { width: 20px; height: 20px; }
.nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.nav ul a { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--paper-dim); position: relative; padding: 8px 0; }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: var(--paper); }
.nav ul a[aria-current="page"]::after {
  content: ""; position: absolute; left: -3px; right: -3px; bottom: 0; height: 6px;
  background: var(--accent); -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M1 4C24 2 52 5 99 2.6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M1 4C24 2 52 5 99 2.6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
}
.nav .menu-btn { display: none; background: none; border: 1px solid var(--rule); color: var(--paper); font: 600 12px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase; padding: 12px 14px; border-radius: 3px; min-height: 44px; }
@media (max-width: 900px) {
  .nav .menu-btn { display: block; }
  .nav ul { position: fixed; inset: 68px 0 0; flex-direction: column; gap: 0; background: var(--paper); padding: 24px var(--gut);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  .nav.open ul { opacity: 1; transform: none; pointer-events: auto; }
  .nav ul a { display: block; color: var(--ink-0); font: 400 34px/1.2 var(--display); text-transform: none; letter-spacing: 0; padding: 12px 0;
    border-bottom: 1px solid rgba(15, 13, 11, .14); }
  .nav ul a[aria-current="page"]::after { display: none; }
}

/* hero shell: copy left, object right (stacks under 900) */
.hero { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: center; position: relative; padding-top: 68px; }
.hero .copy { padding: 0 0 0 max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); position: relative; z-index: 2; }
.hero .stage { position: relative; height: min(88svh, 860px); margin-right: -6vw; }
.hero .stage canvas { width: 100% !important; height: 100% !important; touch-action: pan-y; cursor: grab; }
.hero .stage canvas:active { cursor: grabbing; }
.hero .stage .fallback { position: absolute; inset: 10%; display: none; }
.hero .stage.no-webgl .fallback { display: block; }
.hero .stage .note { position: absolute; z-index: 2; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 30px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 108px; }
  .hero .copy { padding: 0 var(--gut); }
  .hero .stage { height: 70svh; margin: 18px 0 0; }
}

/* ruled list instead of card grids */
.ruled { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ruled > li { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.ruled .num { font: 400 46px/1 var(--display); color: var(--accent); }
.band.paper .ruled, .band.paper .ruled > li { border-color: rgba(15, 13, 11, .16); }
@media (max-width: 760px) { .ruled > li { grid-template-columns: 52px 1fr; } .ruled > li > :last-child { grid-column: 2; } }

/* figure */
.figure { margin: 0; }
.figure .frame { background: var(--paper); padding: 10px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); transform: rotate(-.6deg); }
.figure .frame img, .figure .frame video { width: 100%; height: auto; }

/* reveal on scroll (fl-stage.js toggles .in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* footer */
.foot { background: var(--paper); color: var(--ink-0); padding: 90px 0 40px; }
.foot .cols { display: grid; grid-template-columns: 1.1fr 2fr; gap: 48px; }
.foot .products { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.foot .products li { break-inside: avoid; padding: 10px 0; border-top: 1px solid rgba(15, 13, 11, .14); }
.foot .products a { font: 400 26px/1.1 var(--display); text-decoration: none; }
.foot .products span { display: block; font-size: 14px; color: #5a5146; }
.foot .small { font: 500 12px/1.6 var(--mono); letter-spacing: .04em; color: #6d6458; margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
.foot .small a { text-decoration: none; }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr; } .foot .products { columns: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
