/* SS Maison — design tokens and shared components.
   EVERY colour and font lives in :root below, so a visual direction is one small file:
   theme-a.css "Linen & Olive" (these defaults), theme-b.css "Plaster & Ink", theme-c.css "Clay & Sage".
   Fonts are served from our own site (public/fonts, SIL Open Font Licence) — no Google request. */
@font-face { font-family: "Lora"; src: url("/fonts/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/fonts/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Marcellus"; src: url("/fonts/marcellus.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk.woff") format("woff"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-italic.woff") format("woff"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  /* Theme A — Linen & Olive (default) */
  --bg: #ECE6DB;          /* warm stone: page */
  --surface: #F6F2EA;     /* raised linen: cards, fields */
  --surface-2: #E3DBCD;   /* sunken: photo wells, placeholders */
  --ink: #343C29;         /* deep olive: headings, buttons */
  --text: #3F4535;        /* body text */
  --muted: #5F5C4E;       /* secondary text (≥4.5:1 on bg) */
  --line: #D3C9B7;        /* hairlines */
  --accent: #9A7246;      /* oak: small details, numbers, handle */
  --on-ink: #F6F2EA;      /* text on ink buttons */
  --badge-bg: #343C29;    /* "Virtually staged" badge */
  --badge-text: #F6F2EA;
  --ok: #4D6B3C;
  --warn: #8A5A1E;
  --focus: #6E5A2E;
  --scrim: rgba(36, 40, 28, .5);

  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --display-weight: 400;
  --display-style: normal;
  --display-tracking: -0.015em;
  --label-tracking: 0.16em;
  --radius: 2px;
  --radius-l: 4px;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.9rem, 3.4vw, 2.6rem);
  --step-4: clamp(2.5rem, 6vw, 4.75rem);
  color-scheme: only light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3, h4, strong, legend { color: var(--ink); }
h1, h2, h3 { font-weight: 400; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }

.display {
  font-family: var(--font-display); font-weight: var(--display-weight); font-style: var(--display-style);
  letter-spacing: var(--display-tracking); line-height: 1.04; color: var(--ink); font-size: var(--step-4);
}
.eyebrow {
  font: 500 0.75rem/1.2 var(--font-body); letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--muted);
  margin: 0;
}

/* Logo: wordmark, letterspaced */
.logo { font: 500 0.95rem/1 var(--font-body); letter-spacing: 0.28em; text-transform: uppercase; text-decoration: none; color: var(--ink); white-space: nowrap; }

/* Buttons: quiet, squared */
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink);
  font: 500 0.9375rem/1 var(--font-body); letter-spacing: 0.02em; padding: 15px 24px; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { min-height: 38px; padding: 9px 14px; font-size: var(--step--1); }
.linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Fields */
label.field { display: grid; gap: 6px; font-weight: 500; color: var(--ink); font-size: var(--step--1); letter-spacing: .02em; }
input[type="text"], input[type="email"] {
  font: 400 var(--step-0)/1.3 var(--font-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; width: 100%; min-height: 48px;
}
input[type="text"]:focus, input[type="email"]:focus { border-color: var(--ink); outline: none; }

/* Before / after slider (public/assets/compare.js) */
.compare { position: relative; margin: 0; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); --pos: 50%; aspect-ratio: var(--ratio, 4 / 3); user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 1px; background: var(--on-ink); box-shadow: 0 0 0 .5px rgba(0,0,0,.15); pointer-events: none; }
.compare .handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink));
  background-size: 1px 12px, 1px 12px; background-position: calc(50% - 4px) 50%, calc(50% + 4px) 50%; background-repeat: no-repeat;
}
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input[type="range"]:focus-visible + .handle::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.compare .tag { position: absolute; bottom: 12px; font: 500 0.6875rem/1 var(--font-body); letter-spacing: var(--label-tracking); text-transform: uppercase; padding: 7px 9px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); border-radius: var(--radius); pointer-events: none; }
.compare .tag.before { left: 12px; }
.compare .tag.after-tag { right: 12px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 500 0.6875rem/1 var(--font-body); letter-spacing: var(--label-tracking); text-transform: uppercase; padding: 7px 9px; border-radius: var(--radius); background: var(--badge-bg); color: var(--badge-text); }
.badge.soft { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.compare .badge { position: absolute; top: 12px; left: 12px; pointer-events: none; }
.compare .badge + .badge { left: auto; right: 12px; }

/* Palette dots */
.dots { display: flex; gap: 0; }
.dots i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); margin-left: -4px; }
.dots i:first-child { margin-left: 0; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
