/* Shared scaffolding for the concept demo sites.
   Each demo's theme file sets the tokens below and adds its signature details. */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;
  --surface: #f4f4f4;
  --line: #dddddd;
  --accent: #111111;
  --accent-fg: #ffffff;
  --font-head: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --h-weight: 700;
  --h-track: -0.02em;
  --radius: 8px;
  --max: 1200px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section: clamp(4rem, 3rem + 4vw, 7rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; background: var(--accent); color: var(--accent-fg); }
.skip-link:focus { top: 3rem; }

/* Concept bar — always Black Track styling, on every demo */
.concept-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding: .55rem var(--gutter); background: #10110f; color: #f4f0e8; font: 500 .75rem/1.4 ui-monospace, "JetBrains Mono", Consolas, monospace; letter-spacing: .06em; }
.concept-bar strong { color: #c9f755; font-weight: 500; }
.concept-bar__mark { display: inline-block; width: auto; height: 14px; margin-right: .6rem; vertical-align: -3px; }
/* Padding gives a 24px+ tap target; the negative margin keeps the bar's height unchanged */
.concept-bar a { padding-block: .25rem; margin-block: -.25rem; color: #c9f755; text-underline-offset: .2em; }

/* Pause control for rotating headlines (added by demo.js) */
.rotate-toggle {
  display: inline-block; margin-top: 1rem; padding: .45rem .75rem; border: 1px solid currentColor; border-radius: 999px;
  background: rgb(0 0 0 / .35); color: inherit; font: 500 .75rem/1 ui-monospace, "JetBrains Mono", Consolas, monospace;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.rotate-toggle:focus-visible { outline: 3px solid #c9f755; outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Nav */
.nav { display: flex; align-items: center; gap: 2rem; padding-block: 1.25rem; }
.nav__brand { margin-right: auto; padding-block: .3rem; margin-block: -.3rem; font: var(--h-weight) 1.35rem/1 var(--font-head); letter-spacing: var(--h-track); text-decoration: none; }
.nav__links { display: flex; gap: 1.75rem; font-size: .9375rem; }
.nav__links a { text-decoration: none; opacity: .85; }
.nav__links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: .3em; }

/* Type */
.eyebrow { font: 600 .8125rem/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.display { font: var(--h-weight) clamp(2.75rem, 1.5rem + 5vw, 5.5rem)/1 var(--font-head); letter-spacing: var(--h-track); }
.h2 { font: var(--h-weight) clamp(2rem, 1.4rem + 2.4vw, 3.25rem)/1.05 var(--font-head); letter-spacing: var(--h-track); margin-bottom: 1rem; }
.h3 { font: var(--h-weight) 1.375rem/1.2 var(--font-head); letter-spacing: var(--h-track); margin-bottom: .5rem; }
.lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); max-width: 36rem; }
.muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: .8rem 1.4rem; border: 1px solid transparent; border-radius: var(--radius); background: var(--accent); color: var(--accent-fg); font: 600 1rem/1 var(--font-body); text-decoration: none; transition: transform 150ms, filter 150ms; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn--line { background: transparent; color: inherit; border-color: currentColor; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Sections + grids */
.section { padding-block: var(--section); }
.section--alt { background: var(--surface); }
.section__head { max-width: 44rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.card { padding: 1.75rem; background: var(--card, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); }
.card p { color: var(--muted); font-size: .9375rem; }
.media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }

/* Steps / list rows */
.rows > li { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding-block: 1.25rem; border-top: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 1px solid var(--line); }
.rows b { font: var(--h-weight) 1.25rem/1.3 var(--font-head); }

/* Enquiry note — demos never collect data */
.demo-note { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card, var(--bg)); }
.demo-note p + p { margin-top: .75rem; }

/* Footer */
.footer { padding-block: 2.5rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer a { color: inherit; }

/* Photos */
.photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame-img { overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.frame-img img { transition: transform 900ms cubic-bezier(.16, 1, .3, 1); }
.frame-img:hover img { transform: scale(1.04); }
.credit { font-size: .75rem; color: var(--muted); }

/* Rotating word: all words share one grid cell, so the layout never shifts */
[data-rotate] { display: inline-grid; vertical-align: bottom; }
[data-rotate] > * { grid-area: 1 / 1; }
[data-rotate] > :not(.is-active) { visibility: hidden; }
.motion [data-rotate] { overflow: hidden; }
.motion [data-rotate] > * { visibility: visible; opacity: 0; transform: translateY(45%); transition: opacity 450ms ease, transform 600ms cubic-bezier(.16, 1, .3, 1); }
.motion [data-rotate] > .is-active { opacity: 1; transform: none; }

/* Reveal (enabled by demo.js only when motion is allowed) */
.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms cubic-bezier(.16, 1, .3, 1), transform 700ms cubic-bezier(.16, 1, .3, 1); }
.motion .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
