/* Base for v3: brand fonts and tokens, reset, buttons, the frame, header and footer every page shares, the demo player. */

@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext.5717f37059.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin.e3a28eade2.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-ext.6bb06407c9.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin.01d2854474.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Brand tokens (brand-three-second-studio.md). Light is Paper, dark is Ink. */
:root {
  --paper: #F4F6FA; --haze: #E3E8F0; --ink: #141821; --steel: #566072; --signal: #FF5B2E; --ember: #C2410C;
  --bg: var(--paper);
  --surface: var(--haze);
  --surface-2: #D3DAE5;
  --fg: var(--ink);
  --muted: var(--steel);
  --accent: var(--signal);
  --on-accent: var(--ink);
  --accent-text: var(--ember);
  --inverse-bg: var(--ink);
  --inverse-fg: var(--paper);
  --inverse-muted: #A9B2C1;
  --track: #D3DAE5;
  /* the demo bar: the part still to play is white edged in Steel, so Signal reads against it at 3:1 and not by hue alone */
  --seg-empty: #FFFFFF; --seg-edge: var(--steel);
  --frame: var(--ink);
  --logo-studio: var(--steel);

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-16: 1rem; --t-21: 1.3125rem; --t-28: 1.75rem; --t-38: 2.375rem; --t-50: 3.125rem; --t-67: 4.1875rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --maxw: 1440px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink); --surface: #1C2130; --surface-2: #2A3141; --fg: var(--paper); --muted: #A9B2C1;
    --accent-text: #FF7A52; --inverse-bg: var(--paper); --inverse-fg: var(--ink); --inverse-muted: var(--steel);
    --track: #2A3141; --seg-empty: #1C2130; --seg-edge: #A9B2C1; --frame: #2A3141; --logo-studio: var(--haze);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--ink); --surface: #1C2130; --surface-2: #2A3141; --fg: var(--paper); --muted: #A9B2C1;
  --accent-text: #FF7A52; --inverse-bg: var(--paper); --inverse-fg: var(--ink); --inverse-muted: var(--steel);
  --track: #2A3141; --seg-empty: #1C2130; --seg-edge: #A9B2C1; --frame: #2A3141; --logo-studio: var(--haze);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--display); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
p { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.display { font-family: var(--display); font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; line-height: 1; text-wrap: balance; }
.mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 50; background: var(--fg); color: var(--bg); padding: 12px 16px; }
.skip:focus { top: 16px; }

.logo { height: 44px; width: auto; }
.logo-wm { fill: var(--fg); }
.logo-st { fill: var(--logo-studio); }

/* Buttons: one fill colour, a solid 2px edge for the second kind. Radius is set per version. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--radius, 0);
  font-family: var(--display); font-size: 1rem; font-weight: 650; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ink { background: var(--fg); color: var(--bg); }
.btn-edge { background: transparent; color: var(--fg); border: 2px solid currentColor; }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: scale(0.97); }
}

/* Shared by every page: the frame, the header and the footer */
:root { --radius: 6px; --pad: clamp(16px, 2.2vw, 32px); --gap-section: clamp(112px, 12vw, 176px); }
html { scrollbar-color: var(--muted) var(--bg); }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: max(var(--pad), env(safe-area-inset-left, 0px)) max(var(--pad), env(safe-area-inset-right, 0px)); }

.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.top .logo { color: var(--fg); --st: var(--logo-studio); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { text-decoration: underline; } }

/* the footer: name and address, the links, the time in Italy, as a row of tiles */
.board { margin-top: var(--gap-section); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.bt { background: var(--surface); border-radius: var(--radius); padding: 24px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; font-size: 1rem; }
.t-say { grid-column: 1 / span 5; }
.t-say p:first-child { font-size: var(--t-21); line-height: 1.35; }
.t-nav { grid-column: 6 / span 3; justify-content: flex-start; gap: 0; }
.t-nav a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.t-nav a[aria-current] { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) { .t-nav a:hover { text-decoration: underline; } }
.t-time { grid-column: 9 / span 4; }
/* the clock keeps a fixed five-character box so a new minute never moves the tile; it is not a live region, so screen readers read it only when they reach it */
.t-time .now { display: inline-block; min-width: 5ch; font-size: var(--t-38); line-height: 1; }

@media (max-width: 767px) {
  .nav a:not(:last-child) { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .bt { min-height: 0; padding: 20px; grid-column: span 2; }
  .t-nav, .t-time { grid-column: span 1; }
}
@media (max-width: 420px) {
  .t-nav, .t-time { grid-column: span 2; }
}

/* The demo player */
.timeline { display: flex; gap: 4px; }
.seg { position: relative; flex: var(--w) 1 0; min-width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.seg .track { position: absolute; left: 0; right: 0; top: 17px; height: 10px; border-radius: 3px; border: 1px solid var(--seg-edge); background: var(--seg-empty); overflow: hidden; }
.seg .fill { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.seg:focus-visible { outline-offset: 0; }
@media (hover: hover) and (pointer: fine) { .seg:hover .track { border-color: var(--fg); } }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls .btn { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }
.readout { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}
