/* takehouse.net: one stylesheet for every page. Colours, type and radii follow the app's tokens
   (D:\Projects\Takehouse\tokens\takehouse.tokens.json): dark by default, light when the system asks for it.
   Body text keeps a contrast of 7:1 or more in both themes. */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }

:root {
  --bg: #121417; --bg-sunk: #0d0f12; --panel: #181b1f; --raised: #1f2328;
  --line: #2a2f36; --line-2: #3a4049;
  --text: #e6e9ed; --text-2: #b4bac2;
  --accent: #f0b43c; --accent-ink: #141619;
  --link-line: #f0b43c;
  --focus: #9be3f2;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r2: 5px; --r3: 8px;
  --wrap: 1120px; --measure: 68ch;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f6; --bg-sunk: #e8ebef; --panel: #ffffff; --raised: #ffffff;
    --line: #d6dae0; --line-2: #b9c0c9;
    --text: #15181c; --text-2: #3f4650;
    --accent: #a86d00; --accent-ink: #ffffff;
    --link-line: #a86d00;
    --focus: #0b7f99;
    --shadow: 0 12px 32px rgba(20, 24, 28, 0.18);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }

h1, h2, h3 { line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); }
h2 { font-size: clamp(1.4rem, 1.5vw + 1rem, 1.85rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
p, ul, ol { margin: 0 0 1em; }
ul { padding-left: 1.25em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.25em; overflow-wrap: anywhere; }
pre { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r2); padding: 1em; overflow-x: auto; white-space: pre-wrap; }
q { quotes: '\201C' '\201D'; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: calc(var(--measure) + 40px); }
.prose { max-width: calc(var(--measure) + 40px); padding-top: 48px; padding-bottom: 64px; }
.prose h2:first-of-type { margin-top: 1.4em; }
.lede { font-size: 1.2rem; color: var(--text-2); }
.effective { font-family: var(--font-mono); font-size: 0.95rem; color: var(--text-2); }
.more { margin-top: 1em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 12px; top: -48px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r2); z-index: 10; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.2rem; text-decoration: none; }
.brand img { border-radius: 6px; }
.site-header nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; padding: 6px 2px; color: var(--text-2); border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; padding-bottom: 24px; }
.footer-row p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--text-2); }

/* Home */
.hero { padding: 56px 0 24px; }
.hero h1 { margin-bottom: 0.1em; }
.tagline { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.6rem); font-weight: 600; margin-bottom: 0.6em; }
.hero .lede { max-width: var(--measure); }
.hero-store { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 1.4em 0 2em; }
.store { display: inline-block; border-radius: var(--r2); padding: 10px 16px; font-weight: 600; text-decoration: none; }
a.store { background: var(--accent); color: var(--accent-ink); }
.store-soon { border: 1px solid var(--line-2); color: var(--text); }
.hero-note { color: var(--text-2); }
.shot { margin: 0; border: 1px solid var(--line-2); border-radius: var(--r3); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-sunk); }
.position { padding: 32px 0 8px; }
.position p { font-size: 1.15rem; color: var(--text-2); }
.features { padding: 16px 0 24px; }
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding: 40px 0; border-top: 1px solid var(--line); }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature h3 { font-size: 1.45rem; margin-top: 0; }
.feature p { color: var(--text-2); }
.facts, .editions, .req-brief { padding: 24px 0 32px; border-top: 1px solid var(--line); }
.fact-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.fact-grid li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); padding: 16px 18px; margin: 0; color: var(--text-2); }
.fact-grid strong { color: var(--text); }
.req-brief { padding-bottom: 64px; }
.req-brief ul, .editions p { max-width: var(--measure); }

/* Tables */
.table-scroll { margin: 0 0 1em; }
table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); }
th, td { text-align: left; padding: 10px 14px; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 600; background: var(--raised); }
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 32px; }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px 0; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  .fact-grid { grid-template-columns: minmax(0, 1fr); }
  .prose { padding-top: 32px; }
}

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