/* Vane & Bearing house styles. Colours follow the README's house palette. */

:root {
  --bg: #f6f0e2;        /* Parchment */
  --surface: #fffaf0;
  --ink: #17222c;       /* Slate */
  --muted: #5b6570;
  --brass: #a8792c;     /* The vane and the ampersand */
  --brass-text: #8a6420;
  --rule: #e2d6bb;
  --hub: #fffaf0;
  --card-edge: transparent;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17222c;
    --surface: #1e2b37;
    --ink: #f6f0e2;
    --muted: #a9b2bb;
    --brass: #d9b867;   /* Gilt */
    --brass-text: #d9b867;
    --rule: #2e3c49;
    --hub: #17222c;
    --card-edge: rgba(246, 240, 226, 0.12);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #17222c;
  --surface: #1e2b37;
  --ink: #f6f0e2;
  --muted: #a9b2bb;
  --brass: #d9b867;
  --brass-text: #d9b867;
  --rule: #2e3c49;
  --hub: #17222c;
  --card-edge: rgba(246, 240, 226, 0.12);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .wrap {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}

.amp { font-style: italic; color: var(--brass); font-weight: 600; }

.eyebrow {
  margin: 0 0 0.75rem;
  font: 700 0.75rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-text);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }

/* The mark: vane over bearing. Colours come from the tokens so it follows the theme. */
.mark .ring, .mark .ticks { stroke: var(--brass); }
.mark .shaft { stroke: var(--ink); }
.mark .head { fill: var(--ink); }
.mark .tail { fill: var(--brass); }
.mark .hub { fill: var(--hub); stroke: var(--ink); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.2rem/1 var(--serif); white-space: nowrap; }
.brand .mark { width: 2rem; height: 2rem; flex: none; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 479px) { .site-nav { gap: 0.9rem; font-size: 0.9rem; } .brand span.word { display: none; } }

/* Hero */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 6rem); }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: auto 1fr; gap: 4rem; } }
.hero-mark { width: clamp(9rem, 26vw, 15rem); height: auto; }
.hero-mark .ring { stroke-width: 2.6; }
.hero h1 { font-size: clamp(2.75rem, 8vw, 5.25rem); }
.hero .sub { margin: 0.9rem 0 0; font: 700 0.8rem/1 var(--sans); letter-spacing: 0.5em; text-transform: uppercase; color: var(--muted); }
.hero .lead { max-width: 36rem; margin: 1.75rem 0 0; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.3rem; border-radius: 999px;
  font: 600 0.95rem/1 var(--sans); text-decoration: none;
  border: 1.5px solid var(--ink); transition: background-color .15s, color .15s;
}
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }

/* Sections */
section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
section + section { border-top: 1px solid var(--rule); }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head p { margin: 1rem 0 0; color: var(--muted); }

/* Games */
.games { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .games { grid-template-columns: repeat(3, 1fr); } .game-card { aspect-ratio: 5 / 4; } }
.game { display: flex; flex-direction: column; }
.game-card {
  aspect-ratio: 16 / 10; border-radius: 1rem; display: grid; place-items: center; align-content: center; gap: 1.1rem;
  text-decoration: none; border: 1px solid var(--card-edge);
  transition: transform .2s ease, box-shadow .2s ease;
}
a.game-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(23, 34, 44, 0.6); }
.game-card svg { width: 3.5rem; height: 3.5rem; }
.game-card .name { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; line-height: 1; }
.game-meta { padding: 1rem 0.15rem 0; }
.game-meta .eyebrow { margin-bottom: 0.4rem; }
.game-meta p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.game-meta .url { display: inline-block; margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink); text-underline-offset: 3px; }

.pitchvane { background: #1b2420; color: #f4f0e4; }
.pitchvane .name { font-family: "Newsreader", Georgia, serif; }
.pitchvane .name em { font-style: normal; color: #c1904c; }

.bearings { background: #13233b; color: #f4ecd8; }
.bearings .name { font-family: var(--serif); }

.cricket { background: transparent; color: var(--muted); border: 1.5px dashed var(--rule); }
.cricket .name { font-family: var(--serif); font-weight: 600; font-style: italic; }
.cricket .stumps { stroke: currentColor; }
.cricket .bails { stroke: var(--brass); }

/* About */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }
.about-grid .prose p { margin: 0 0 1.1rem; }
.about-grid .prose p:first-child { font: 400 clamp(1.25rem, 2.4vw, 1.5rem)/1.45 var(--serif); }
.terms { margin: 0; padding: 0; list-style: none; display: grid; gap: 1rem; }
.terms li { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.85rem; padding: 1.25rem 1.4rem; }
.terms dt, .terms strong { display: block; font: 700 1.2rem/1.2 var(--serif); margin-bottom: 0.35rem; }
.terms span { color: var(--muted); font-size: 0.97rem; }

/* Contact */
.contact { text-align: center; }
.contact .section-head { margin: 0 auto 2rem; }
.contact .email { font: 700 clamp(1.4rem, 4.5vw, 2.4rem)/1.2 var(--serif); text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 6px; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 2.5rem; font-size: 0.88rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.site-footer p { margin: 0; }
.site-footer a { text-underline-offset: 3px; }

/* 404 */
.lost { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem 1rem; }
.lost .mark { width: 7rem; height: 7rem; margin-bottom: 1.5rem; }
.lost .mark g { transform-origin: 32px 32px; animation: drift 6s ease-in-out infinite; }
.lost h1 { font-size: clamp(2rem, 6vw, 3rem); }
.lost p { color: var(--muted); margin: 1rem 0 2rem; }
@keyframes drift { 0%, 100% { transform: rotate(-28deg); } 50% { transform: rotate(40deg); } }

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