/* Hamster Brand Guidelines — styles
 * Tokens mirror the production design system (website globals.css / DESIGN.md). */

@font-face {
  font-family: 'Agrandir';
  src: url('../fonts/ag.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 50% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand surfaces (dark is the default Hamster shell) */
  --shell: hsl(0 0% 8%);          /* neutral-990 */
  --panel: hsl(0 0% 9%);          /* neutral-980 */
  --panel-2: hsl(0 0% 13%);       /* neutral-970 */
  --hairline: hsl(0 0% 13%);
  --ink: oklch(0.985 0 0);
  --muted: oklch(0.705 0.015 286.067);

  /* Accents */
  --success: oklch(0.72 0.19 145);
  --warning: oklch(0.78 0.16 55);
  --info: oklch(0.65 0.2 255);
  --destructive: oklch(0.704 0.191 22.216);

  /* Type */
  --font-display: 'Agrandir', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  --radius: 0.65rem;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'rlig' 1, 'calt' 1;
}

a { color: inherit; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100vh;
  flex: 0 0 var(--sidebar-w);
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--hairline);
  background: var(--panel);
}
.sidebar .brand { display: flex; align-items: center; margin-bottom: 2rem; }
.sidebar .brand .logo { height: 22px; aspect-ratio: 904 / 172; width: auto; color: var(--ink); }

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.nav a {
  display: block;
  padding: 0.4rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav .section-label { margin: 1.25rem 0 0.375rem; padding: 0 0.625rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); opacity: 0.7; }

.content { flex: 1 1 auto; max-width: 920px; padding: 4rem 3rem 6rem; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .sidebar .brand { margin-bottom: 1rem; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 2.5rem 1.5rem 4rem; }
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; font-stretch: 80%; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { color: var(--muted); max-width: 62ch; }
.lead { font-size: 1.125rem; color: var(--ink); opacity: 0.85; }

section { padding: 3.5rem 0; border-bottom: 1px solid var(--hairline); }
section:first-of-type { padding-top: 0; }
section:last-of-type { border-bottom: 0; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 0; }
.hero .mark { width: 64px; height: 64px; color: var(--ink); margin-bottom: 1.5rem; }
.meta { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 500; }

/* ---------- Logo ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.logo-tile { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 2.5rem; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.logo-tile.on-dark { background: var(--shell); color: var(--ink); }
.logo-tile.on-panel { background: var(--panel-2); color: var(--ink); }
.logo-tile.on-light { background: hsl(60 9.1% 97.8%); color: oklch(0.141 0.005 285.823); }
.logo-tile .logo-lockup { height: 34px; aspect-ratio: 904 / 172; width: auto; }
.logo-tile .mark-only svg { width: 56px; height: 56px; }
.tile-caption { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2.5rem; margin-top: 1.75rem; }
.rules .do, .rules .dont { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1rem 1.25rem; }
.rules h4 { margin: 0 0 0.5rem; font-size: 0.85rem; font-family: var(--font-ui); }
.rules .do h4 { color: var(--success); }
.rules .dont h4 { color: var(--destructive); }
.rules ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 600px) { .rules { grid-template-columns: 1fr; } }

/* ---------- Colour ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.swatch { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.swatch .chip { height: 96px; }
.swatch .info { padding: 0.75rem 0.875rem; }
.swatch .info .name { font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.swatch .info .val { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.group-label { margin-top: 2rem; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Type specimens ---------- */
.type-table { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.type-row { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.type-row .spec { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 0.5rem; }
.sp-display { font-family: var(--font-display); font-weight: 500; font-stretch: 80%; line-height: 1.2; font-size: clamp(2.25rem, 5vw, 3.5rem); }
.sp-headline { font-family: var(--font-display); font-weight: 500; font-stretch: 80%; line-height: 1.2; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.sp-title { font-family: var(--font-ui); font-weight: 500; font-size: 1.125rem; line-height: 1.4; }
.sp-body { font-family: var(--font-ui); font-weight: 400; font-size: 1rem; line-height: 1.75; color: var(--ink); }
.sp-label { font-family: var(--font-ui); font-weight: 500; font-size: 0.875rem; line-height: 1.25; }

.font-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.font-card .fc { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.5rem; }
.font-card .fc .big { font-size: 3rem; line-height: 1; margin-bottom: 0.75rem; }
.font-card .fc.display .big { font-family: var(--font-display); font-weight: 500; font-stretch: 80%; }
.font-card .fc.ui .big { font-family: var(--font-ui); font-weight: 500; }

/* ---------- Topo device ---------- */
.triad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.75rem; }
.triad .t { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.4rem; background: var(--panel); }
.triad .t .k { font-family: var(--font-display); font-weight: 500; font-stretch: 80%; font-size: 1.15rem; margin-bottom: 0.35rem; }
.triad .t .glyph { font-size: 1.25rem; opacity: 0.8; margin-bottom: 0.5rem; }
.triad .t p { font-size: 0.86rem; margin: 0; }
@media (max-width: 720px) { .triad { grid-template-columns: 1fr; } }

.colorways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.cw { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.cw .art { height: 200px; background-size: cover; background-position: center; }
.cw .meta-row { padding: 0.75rem 0.875rem; }
.cw .meta-row .name { font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.cw .meta-row .use { font-size: 0.74rem; color: var(--muted); }
.cw.tonal .art { background-image: url('../topo/topo-tonal.svg'); }
.cw.ink .art   { background-image: url('../topo/topo-ink.svg'); }
.cw.dark .art  { background-image: url('../topo/topo-dark.svg'); }
@media (max-width: 720px) { .colorways { grid-template-columns: 1fr; } }

.treatments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.tr { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.tr .stage { height: 220px; overflow: hidden; position: relative; background: hsl(60 9.1% 97.8%); }
.tr .meta-row { padding: 0.75rem 0.875rem; }
.tr .meta-row .name { font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.tr .meta-row .desc { font-size: 0.74rem; color: var(--muted); }
@media (max-width: 900px) { .treatments { grid-template-columns: 1fr; } }

/* Movement — slow drift of the contour field */
.tr.movement .stage { background-image: url('../topo/topo-ink.svg'); background-size: 170%; background-position: 0 0; animation: topo-drift 40s linear infinite; }
@keyframes topo-drift { from { background-position: 0% 0%; } to { background-position: 100% 60%; } }

/* Relief — embossed 3D hills via SVG convolve filter */
.tr.relief .stage { background: hsl(60 9.1% 97.8%); }
.tr.relief .stage img { width: 170%; height: 170%; object-fit: cover; filter: url(#topo-emboss); }

/* ASCII — tech-roots character rendering */
.tr.ascii .stage { background: #f7f6f0; display: flex; align-items: center; justify-content: center; }
.tr.ascii pre { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 6px; line-height: 6px; letter-spacing: 0.5px; color: #1c1917; white-space: pre; }

@media (prefers-reduced-motion: reduce) { .tr.movement .stage { animation: none; } }

footer { padding: 2.5rem 0 0; color: var(--muted); font-size: 0.82rem; }
