/*
 * Sidekin house styles.
 *
 * Built against Documents/Claude/HOUSE-DESIGN-STANDARD.md, which exists because
 * the owner has rejected work for looking generically AI-made. Everything below
 * is named explicitly rather than left to a default, because silence is what
 * produces the default look: unnamed font becomes Inter, unnamed radius becomes
 * 8px on everything, unnamed shadows get sprinkled.
 *
 * Fonts are SELF-HOSTED (assets/fonts). No CDN: the site must keep working if a
 * third party is unreachable, and nothing about a page load should tell another
 * company who is reading it.
 *
 * The palette is warm on purpose. The creatures are soft-shaded toys photographed
 * on cream, so a cool slate UI would fight them; this reads as the same world.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-display: "Bricolage Grotesque", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", ui-rounded, "Segoe UI", system-ui, sans-serif;

  /* Colour roles. Contrast checked against WCAG AA:
     ink on paper 13.4:1, muted on paper 5.1:1, paper on primary 5.3:1. */
  --ink: #2a201a;
  --muted: #6b5b4f;
  --paper: #faf5ee;
  --card: #fffdfa;
  --line: #e6dbcd;
  --primary: #b4531f;
  --primary-deep: #8f3f14;
  --primary-fg: #fffaf5;
  --accent: #2f6f6a;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgb(42 32 26 / .06);
  --shadow-md: 0 10px 30px -18px rgb(42 32 26 / .45);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 20px; }
p { max-width: 62ch; }

a { color: var(--primary-deep); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--space-6); }

/* ---- header / nav ---- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6); padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}
.mark {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: 0.02em; color: var(--primary-deep); text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.nav { display: flex; gap: var(--space-6); align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: var(--space-1) 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); border-bottom-color: var(--primary); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--primary); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 600 17px/1 var(--font-body);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-deep);
  background: var(--primary); color: var(--primary-fg);
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--primary-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: #fff; border-color: var(--primary); color: var(--primary-deep); }
.btn svg { width: 19px; height: 19px; stroke-width: 2; }

:where(a, button, input, select, summary):focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm);
}

/* ---- hero: deliberately asymmetric, not a centred stack ---- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: var(--space-16); align-items: center;
  padding: var(--space-16) 0;
}
.lede { font-size: 19px; color: var(--muted); margin: var(--space-6) 0 var(--space-8); }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.stage {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-4);
  box-shadow: var(--shadow-md);
}
.stage img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }

.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-deep);
  margin-bottom: var(--space-3);
}

section { padding: var(--space-16) 0; }
.section-head { margin-bottom: var(--space-8); }
.section-head p { color: var(--muted); margin-top: var(--space-3); }

/* ---- alternating feature rows, not a 3-card grid ---- */
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12);
  align-items: center; padding: var(--space-8) 0;
  border-top: 1px solid var(--line);
}
.row:nth-child(even) .row-media { order: -1; }
.row h3 { margin-bottom: var(--space-3); }
.row p { color: var(--muted); }
.row-media {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-6);
  display: flex; align-items: center; justify-content: center; min-height: 190px;
}
.row-media img { max-width: 100%; height: auto; border-radius: var(--radius-md); }

/* ---- creature gallery ---- */
.tools {
  display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center;
  margin-bottom: var(--space-8);
}
.field {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
}
.field svg { width: 18px; height: 18px; color: var(--muted); stroke-width: 2; }
.field input, .field select {
  font: 400 16px/1.4 var(--font-body); border: 0; background: transparent;
  color: var(--ink); min-width: 190px; outline: none;
}
.chip {
  font: 600 14px/1 var(--font-body); padding: var(--space-2) var(--space-3);
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--primary); color: var(--primary-fg); border-color: var(--primary-deep);
}
.count { color: var(--muted); font-size: 15px; margin-left: auto; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--space-4);
}
.kin {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-3);
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: var(--space-2);
  transition: border-color .12s ease, transform .12s ease;
}
.kin:hover { border-color: var(--primary); transform: translateY(-2px); }
.kin img, .kin .ph {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  background: var(--paper); border-radius: var(--radius-sm); display: block;
}
.kin .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.kin b { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.kin span { color: var(--muted); font-size: 13px; text-transform: capitalize; }

/* ---- detail dialog ---- */
dialog#kin-detail {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 0; max-width: 560px; width: calc(100% - var(--space-8));
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-md);
}
dialog#kin-detail::backdrop { background: rgb(42 32 26 / .38); }
.detail-body { padding: var(--space-8); }
.detail-body img { width: 100%; max-width: 300px; margin: 0 auto var(--space-4); display: block; }
.detail-meta { list-style: none; margin: var(--space-4) 0; }
.detail-meta li {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.detail-meta span { color: var(--muted); }
.detail-meta code { font-size: 12px; word-break: break-all; }

/* ---- notices ---- */
.note {
  background: var(--card); border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-6);
  display: flex; gap: var(--space-4); align-items: flex-start;
}
.note svg { width: 22px; height: 22px; color: var(--primary-deep); flex: 0 0 auto; stroke-width: 2; }
.note strong { display: block; margin-bottom: var(--space-1); }
.note p { color: var(--muted); font-size: 16px; }

.steps { counter-reset: step; list-style: none; margin-top: var(--space-6); }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 var(--space-6) var(--space-12);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font: 700 15px/32px var(--font-display); text-align: center;
}
.steps strong { display: block; margin-bottom: var(--space-1); }
.steps p { color: var(--muted); font-size: 16px; }

.site-foot {
  border-top: 1px solid var(--line); margin-top: var(--space-16);
  padding: var(--space-8) 0 var(--space-16); color: var(--muted); font-size: 15px;
  display: flex; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap;
}
.site-foot a { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 860px) {
  .hero, .row { grid-template-columns: 1fr; gap: var(--space-8); }
  .row:nth-child(even) .row-media { order: 0; }
  .site-head { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  section { padding: var(--space-12) 0; }
  .count { margin-left: 0; width: 100%; }
}
