/* ============================================================
   The Panda Cat Lab — design system
   Fonts: Bricolage Grotesque (display), Hanken Grotesk (body),
   Space Mono (technical specs)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Hanken+Grotesk:ital,wght@0,400..800;1,400..600&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ---------- Tokens (shared warm base) ---------- */
:root {
  --paper:        oklch(0.976 0.012 78);
  --paper-2:      oklch(0.955 0.016 76);
  --ink:          oklch(0.235 0.012 64);
  --ink-soft:     oklch(0.42 0.012 64);
  --muted:        oklch(0.58 0.012 64);
  --line:         oklch(0.235 0.012 64 / 0.14);
  --line-strong:  oklch(0.235 0.012 64 / 0.32);
  --card:         oklch(0.992 0.008 82);

  --accent:       oklch(0.64 0.152 42);
  --accent-press: oklch(0.56 0.15 42);
  --accent-soft:  oklch(0.93 0.045 55);
  --accent-ink:   oklch(0.985 0.01 80);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px oklch(0.235 0.012 64 / 0.06), 0 12px 32px -16px oklch(0.235 0.012 64 / 0.22);
}

/* ---------- Direction: Atelier (default) ---------- */
[data-dir="atelier"] {
  --radius: 4px;
  --radius-lg: 10px;
}

/* ---------- Direction: Studio (near B/W, acid accent) ---------- */
[data-dir="studio"] {
  --paper:        oklch(0.975 0.003 250);
  --paper-2:      oklch(0.945 0.004 250);
  --ink:          oklch(0.17 0.006 260);
  --ink-soft:     oklch(0.38 0.006 260);
  --muted:        oklch(0.55 0.006 260);
  --line:         oklch(0.17 0.006 260 / 0.16);
  --line-strong:  oklch(0.17 0.006 260 / 0.42);
  --card:         oklch(1 0 0);
  --accent:       oklch(0.78 0.19 128);
  --accent-press: oklch(0.7 0.19 128);
  --accent-soft:  oklch(0.93 0.07 128);
  --accent-ink:   oklch(0.17 0.04 260);
  --radius: 2px;
  --radius-lg: 3px;
}

/* ---------- Direction: Bambou (cream + green, playful) ---------- */
[data-dir="bambou"] {
  --paper:        oklch(0.972 0.02 108);
  --paper-2:      oklch(0.95 0.026 106);
  --ink:          oklch(0.27 0.022 152);
  --ink-soft:     oklch(0.42 0.02 152);
  --muted:        oklch(0.56 0.018 150);
  --line:         oklch(0.27 0.022 152 / 0.16);
  --line-strong:  oklch(0.27 0.022 152 / 0.34);
  --card:         oklch(0.99 0.014 110);
  --accent:       oklch(0.58 0.115 150);
  --accent-press: oklch(0.5 0.115 150);
  --accent-soft:  oklch(0.9 0.06 140);
  --accent-ink:   oklch(0.985 0.012 110);
  --radius: 14px;
  --radius-lg: 22px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(56px, 9vw, 120px); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--accent);
}
.lead { color: var(--ink-soft); font-size: clamp(17px, 2vw, 20px); max-width: 56ch; }
.mono { font-family: var(--mono); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }
h1 { font-size: clamp(40px, 7vw, 84px); font-weight: 700; }
h2 { font-size: clamp(30px, 4.4vw, 54px); }
h3 { font-size: clamp(21px, 2.4vw, 28px); letter-spacing: -0.01em; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* ---------- Print-layer logo motif ---------- */
.layers { display: flex; flex-direction: column; gap: 3px; width: 26px; }
.layers i {
  display: block; height: 3px; border-radius: 2px; background: var(--ink);
}
.layers i:nth-child(1) { width: 40%; }
.layers i:nth-child(2) { width: 75%; }
.layers i:nth-child(3) { width: 100%; background: var(--accent); }
.layers i:nth-child(4) { width: 85%; }
.layers i:nth-child(5) { width: 55%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  transition: transform .12s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-soft); }
.btn-ghost { border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn-lg { padding: 16px 28px; font-size: 17.5px; }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(from var(--paper) l c h / 0.82);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; gap: 24px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand .layers { transform: rotate(0deg); }
.brand small { display: block; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; margin-top: 1px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius); font-weight: 500; font-size: 15.5px; color: var(--ink-soft);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content:""; }
.nav-cta { margin-left: 6px; }

/* language switcher */
.lang {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
}
.lang button { padding: 6px 9px; color: var(--muted); transition: background .15s, color .15s; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"]:hover { color: var(--paper); }

.nav-burger { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius); align-items: center; justify-content: center; }
.nav-burger span { width: 18px; height: 2px; background: var(--ink); position: relative; }
.nav-burger span::before, .nav-burger span::after { content:""; position: absolute; left:0; width: 18px; height: 2px; background: var(--ink); }
.nav-burger span::before { top: -6px; } .nav-burger span::after { top: 6px; }

@media (max-width: 880px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px var(--pad) 18px;
    transform: translateY(-120%); transition: transform .28s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 6px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .nav-cta { margin: 12px 0 0; }
  .nav-burger { display: inline-flex; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: clamp(48px, 7vw, 80px) 28px; }
.site-footer .layers i { background: var(--paper); }
.site-footer .layers i:nth-child(3) { background: var(--accent); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px 24px; }
.foot-grid h4 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: oklch(from var(--paper) l c h / 0.55); font-weight: 400; margin-bottom: 14px; }
.foot-grid a, .foot-grid p { color: oklch(from var(--paper) l c h / 0.78); font-size: 15px; display: block; padding: 4px 0; }
.foot-grid a:hover { color: var(--paper); }
.foot-brand p { color: oklch(from var(--paper) l c h / 0.7); max-width: 34ch; margin-top: 14px; }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  margin-top: 48px; padding-top: 22px; border-top: 1px solid oklch(from var(--paper) l c h / 0.16);
  font-size: 13px; color: oklch(from var(--paper) l c h / 0.6); font-family: var(--mono); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed; z-index: 80; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(680px, calc(100vw - 28px));
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 18px 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 14px 18px; align-items: center;
}
.cookie.hide { display: none; }
.cookie p { font-size: 14px; color: var(--ink-soft); }
.cookie p strong { color: var(--ink); }
.cookie .actions { display: flex; gap: 8px; }
.cookie .btn { padding: 9px 16px; font-size: 14px; }
@media (max-width: 560px) { .cookie { grid-template-columns: 1fr; } }

/* ---------- Cards / pills ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 500; }
.pill .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 14.5px; }
.field .hint { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.input, .textarea, .select {
  width: 100%; padding: 13px 15px; background: var(--card);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.req { color: var(--accent); }

/* ---------- Utility ---------- */
.grid { display: grid; }
.flex { display: flex; }
.hr { height: 1px; background: var(--line); border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
[hidden] { display: none !important; }

/* ---------- Image placeholder (striped) ---------- */
.ph {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--paper-2) 0 14px, oklch(from var(--paper-2) calc(l - 0.02) c h) 14px 28px);
  border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
}
.ph .ph-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px; }

/* ---------- Direction switcher (home) ---------- */
.dir-switch {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: 18px;
  display: flex; align-items: center; gap: 4px; padding: 7px 8px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow);
}
.dir-switch .dsl { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 8px 0 6px; }
.dir-switch button { padding: 8px 15px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); transition: background .15s, color .15s; }
.dir-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.dir-switch button:hover:not([aria-pressed="true"]) { background: var(--paper-2); color: var(--ink); }
.dir-switch .sw { width: 11px; height: 11px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 560px) { .dir-switch .dsl { display: none; } .dir-switch button { padding: 8px 12px; } }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 76px); padding-bottom: clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin: 18px 0 22px; }
.hero .accent-word { color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px 44px; margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line); }
.hero-stats .stat .n { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; }
.hero-stats .stat .l { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); margin-top: 7px; text-transform: uppercase; }
.hero-visual { aspect-ratio: 4/5; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { aspect-ratio: 16/11; order: -1; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { padding: 28px 26px 30px; counter-increment: step; position: relative; }
.step .num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.step .num::before { content: counter(step, decimal-leading-zero); }
.step h3 { margin: 16px 0 10px; }
.step p { color: var(--ink-soft); }
.step .ph { margin-top: 20px; aspect-ratio: 16/10; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Materials ---------- */
.mats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mat { padding: 22px 20px 24px; transition: transform .18s, border-color .18s; }
.mat:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.mat .swatch { width: 100%; height: 64px; border-radius: var(--radius); margin-bottom: 16px; }
.mat h3 { font-size: 22px; }
.mat .desc { color: var(--ink-soft); font-size: 14.5px; margin: 8px 0 16px; min-height: 3em; }
.mat dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-family: var(--mono); font-size: 12.5px; }
.mat dt { color: var(--muted); } .mat dd { text-align: right; }
@media (max-width: 820px) { .mats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .mats { grid-template-columns: 1fr; } }

/* ---------- Feature split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.rev > :first-child { order: 2; }
.feat-list { display: grid; gap: 2px; margin-top: 26px; }
.feat-list .row { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.feat-list .row:last-child { border-bottom: 1px solid var(--line); }
.feat-list .ic { width: 34px; height: 34px; border-radius: var(--radius); background: var(--accent-soft); display: grid; place-items: center; }
.feat-list .ic span { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.feat-list h4 { font-family: var(--body); font-weight: 700; font-size: 16.5px; letter-spacing: 0; }
.feat-list p { color: var(--ink-soft); font-size: 15px; margin-top: 3px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split.rev > :first-child { order: 0; } }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 72px); text-align: center; }
.cta-band h2 { color: var(--paper); }
.cta-band p { color: oklch(from var(--paper) l c h / 0.78); max-width: 50ch; margin: 16px auto 32px; }
.cta-band .btn-primary { background: var(--accent); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
