/*
 * Scriptomancy home site (scriptomancy.me): the shared base of the home page and the case study.
 * Launch build of design H3.1 (PO decisions 116, 144). Static, self-hosted: no font CDN, no remote image,
 * no script, no inline style (the page works under a strict CSP: default-src 'self').
 *
 * Tokens follow the Realm Weather "Engraved Steel" palette (apps/web/src/v2/theme/engraved-steel.css)
 * so the home and the app read as one house. Contrast ratios (WCAG 2.2) are against --sh-bg / --sh-panel.
 */

/* ---------- Fonts: two families, self-hosted (SIL OFL 1.1; ./fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/cinzel-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --sh-bg: #0B0B0D;
  --sh-panel: #131317;
  --sh-raised: #1B1B21;
  --sh-line: #2C2D34;          /* decorative hairline */
  --sh-line-steel: #4A4E57;    /* decorative bevel */
  --sh-line-ui: #707682;       /* a control's edge: 3.8+ (WCAG 1.4.11) */
  --sh-text: #ECEAE6;          /* 16.4 / 15.4 */
  --sh-text-2: #B4B8BF;        /* 9.9 / 9.3 */
  --sh-muted: #9399A2;         /* 6.9 / 6.5: smallest text colour */
  --sh-steel: #C4C9D0;         /* 11.8 / 11.1 */
  --sh-red: #8E1B24;           /* brand fill; white on it 9.0 */
  --sh-red-bright: #A2232D;
  --sh-red-deep: #5E0F16;
  --sh-red-text: #E2545D;      /* red as text 5.3 / 5.0 */
  --sh-focus: #F2D27A;         /* focus ring 13.4 */

  --sh-font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --sh-font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --sh-ease: cubic-bezier(.2, .7, .2, 1);
  --sh-bevel: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -1px 0 rgba(0, 0, 0, .6);
  --sh-e2: var(--sh-bevel), 0 8px 24px rgba(0, 0, 0, .55);
  --sh-e3: var(--sh-bevel), 0 18px 48px rgba(0, 0, 0, .7);
  --sh-brushed: repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px), linear-gradient(180deg, #16161B, #101013);
  --sh-tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--sh-bg); color: var(--sh-text);
  font-family: var(--sh-font-body); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
::selection { background: rgba(162, 35, 45, .7); color: #FFF; }

/* Focus: gold ring over a dark halo, reads over art. */
:focus-visible { outline: 2px solid var(--sh-focus); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(11, 11, 13, .85); border-radius: 3px; }

/* The inline SVG icon sprite: present, never shown (replaces the prototype's inline style attribute). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Engraved display type: letterpress, cut into the plate. */
.engraved { font-family: var(--sh-font-display); font-weight: 700; letter-spacing: .04em; line-height: 1.1; text-shadow: 0 1px 0 rgba(0, 0, 0, .9), 0 -1px 0 rgba(255, 255, 255, .06); }
.eyebrow { font-family: var(--sh-font-display); font-weight: 500; font-size: .8125rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sh-steel); }

/* The seal's rule: two hairlines and a red lozenge. */
.rule { display: flex; align-items: center; gap: 12px; color: var(--sh-line-steel); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--sh-line-steel), transparent); }
.rule__gem { width: 7px; height: 7px; transform: rotate(45deg); background: var(--sh-red); box-shadow: 0 0 0 1px var(--sh-line-steel); }

/* Buttons and links: 44 px targets. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--sh-tap); padding: 0 20px; border-radius: 3px; border: 1px solid var(--sh-line-ui);
  background: linear-gradient(180deg, #24242B, #18181D); box-shadow: var(--sh-bevel), 0 1px 2px rgba(0, 0, 0, .6);
  color: var(--sh-text); font-weight: 600; font-size: .9375rem; letter-spacing: .02em; text-decoration: none; line-height: 1.2;
  transition: border-color 140ms var(--sh-ease), transform 140ms var(--sh-ease);
}
.btn:hover { border-color: var(--sh-steel); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(180deg, var(--sh-red-bright), var(--sh-red) 55%, var(--sh-red-deep)); border-color: #B8414A; color: #FFF; }
.btn--primary:hover { border-color: #F0A0A6; }
.btn .icon { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid currentColor; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1; }
.badge--alpha { color: var(--sh-red-text); }
.badge--steel { color: var(--sh-steel); border-color: var(--sh-line-ui); }

.fan-line { font-size: .875rem; line-height: 1.45; color: var(--sh-muted); }

/* ---------- Reduce motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
