/* Entune website: base styles and the components every page shares.
   Reads only the variables in tokens.css. Home page sections are in
   home.css and the guides' reading layout in guide.css. */

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text-strong);
  font: 400 var(--body)/var(--lh-body) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
p:not(.more-link) a:not([class]) { text-decoration: underline; text-decoration-color: var(--accent-ring); text-underline-offset: 3px; }
p:not(.more-link) a:not([class]):hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-wash); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: var(--r-8);
  background: var(--ink); color: var(--on-ink); font-size: var(--small);
}
.skip:focus { top: 12px; color: var(--on-ink); text-decoration: none; }

/* Type */

.eyebrow { font-size: var(--eyebrow-size); letter-spacing: var(--eyebrow-track); text-transform: uppercase; color: var(--text-muted); }
.label { font-size: var(--label-size); font-weight: 600; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--text-muted); }
.h1 { font: var(--h1-weight) var(--h1-size)/var(--h1-lh) var(--font-display); letter-spacing: var(--h1-track); text-wrap: balance; }
.h2 { margin-top: 16px; max-width: 760px; font: var(--h2-weight) var(--h2-size)/var(--h2-lh) var(--font-display); letter-spacing: var(--h2-track); text-wrap: balance; }
.h2--wide { max-width: 820px; }
.h2--flush { margin-top: 0; }
.h3 { margin-top: 12px; font: var(--h2-weight) var(--h3-size)/var(--h3-lh) var(--font-display); letter-spacing: var(--h2-track); }
.quiet { color: var(--text-dim); }
.lead { margin-top: 24px; max-width: 680px; font-size: var(--lead); line-height: var(--lh-body); color: var(--text-soft); text-wrap: pretty; }
.lead--wide { max-width: 700px; }
.body-lead { font-size: var(--lead); line-height: var(--lh-body); color: var(--text-soft); text-wrap: pretty; }
.fineprint { margin-top: 24px; max-width: 820px; font-size: 13.5px; line-height: var(--lh-body); color: var(--text-muted); }
.mono-num { font: var(--micro) var(--font-mono); color: var(--accent-text); }
.code { font: 13px var(--font-mono); }
.more-link { display: flex; justify-content: flex-end; margin-top: 12px; font-size: var(--small); }

/* Buttons */

.btn-ink {
  flex: none; height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
  border-radius: var(--r-8); background: var(--ink); color: var(--on-ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.btn-ink:hover { background: var(--ink-hover); color: var(--on-ink); text-decoration: none; }
.btn-ink__arrow { opacity: .7; }
.btn-outline {
  height: 32px; display: inline-flex; align-items: center; padding: 0 14px; border: 0;
  border-radius: var(--r-8); background: none; box-shadow: inset 0 0 0 1px var(--line-control);
  font-size: 13.5px; font-weight: 500; color: inherit; cursor: pointer;
}
.btn-outline:hover { background: var(--hover-wash); }
.btn-outline[aria-expanded="true"] .when-closed,
.btn-outline[aria-expanded="false"] .when-open { display: none; }

/* Command box */

.command {
  max-width: 100%; height: 46px; display: inline-flex; align-items: center; gap: 12px; padding: 0 7px 0 16px;
  border-radius: var(--r-10); background: var(--card); box-shadow: var(--shadow-command);
  font: 14px var(--font-mono); color: var(--text-strong);
}
.command code { min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.command code::-webkit-scrollbar { display: none; }
.command__prompt { flex: none; color: var(--text-faint); }
.command button {
  flex: none; height: 32px; min-width: 64px; padding: 0 12px; border: 0; border-radius: var(--r-7);
  background: var(--ink); color: var(--on-ink); font: 500 12.5px var(--font-sans); cursor: pointer;
}
.command button:hover { background: var(--ink-hover); }
.command button.is-pending { visibility: hidden; }
.command--lg { height: 52px; gap: 14px; padding: 0 8px 0 20px; border-radius: var(--r-12); font-size: 15px; }
.command--lg button { height: 36px; min-width: 70px; padding: 0 14px; border-radius: var(--r-8); font-weight: 600; font-size: 13px; }

/* Segmented control */

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-9); background: var(--well); }
.segmented button {
  height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-7); background: transparent;
  color: var(--text-muted); font-size: 13px; white-space: nowrap; cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--segment-on); color: var(--text-strong); box-shadow: var(--shadow-segment); }
.segmented--lg button { height: 30px; padding: 0 16px; font-size: 13.5px; }

/* Tags, chips and dots */

.tag {
  flex: none; height: 22px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px;
  border-radius: var(--r-pill); background: var(--chip); color: var(--text-muted);
  font-size: var(--micro); font-weight: 400; white-space: nowrap;
}
.tag--sm { height: 20px; padding: 0 8px; font-size: 11.5px; }
.tag--accent { background: var(--accent-wash); color: var(--accent-text); }
.tag--ok { background: var(--ok-wash); color: var(--ok-text); }
.chip {
  height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 0;
  border-radius: var(--r-8); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; cursor: pointer;
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}
.chip[aria-checked="true"] { background: var(--accent-wash); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-text); }
.chip:disabled { cursor: default; }
.chip__start { flex: none; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dot { flex: none; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot--accent { background: var(--accent); }
.dot--faint { background: var(--text-faint); }

/* Cards */

.card { border-radius: var(--r-18); background: var(--card); box-shadow: var(--shadow-edge); }
.card--raised { box-shadow: var(--shadow-card-raised); }

/* Switch */

.switch { flex: none; position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--track); transition: background var(--dur-fast); }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--knob); box-shadow: var(--shadow-switch-knob); transition: transform var(--dur-fast) var(--ease-out);
}
[aria-checked="true"] > .switch { background: var(--accent); }
[aria-checked="true"] > .switch::after { transform: translateX(16px); }

/* Words in demos */

.word-struck { text-decoration: line-through; color: var(--text-faint); }
.word-fixed { font-weight: 600; color: var(--accent-text); }
.word-corrected { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.word-highlight { border-radius: 4px; background: var(--accent-wash); color: var(--accent-text); }

/* Layout */

.section { background: var(--surface); }
.section--alt { background: var(--surface-alt); }
.container { max-width: var(--container); margin: 0 auto; padding: var(--section-y) var(--gutter); }

/* Header */

.site-header { background: var(--surface); }
.site-header__inner {
  display: flex; align-items: center; height: var(--nav-h);
  max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-strong); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.brand:hover { color: var(--text-strong); text-decoration: none; }
.brand img { width: 22px; height: 23px; }
.site-nav { display: flex; gap: 28px; margin-left: 56px; font-size: var(--small); }
.site-nav a { color: var(--text-soft); }
.site-nav a:hover { color: var(--text-strong); text-decoration: none; }
.site-header .btn-ink { margin-left: auto; }

/* Footer */

.site-footer { background: var(--surface-alt); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 48px 80px; max-width: var(--container); margin: 0 auto;
  padding: 72px var(--gutter) 40px; border-top: 1px solid var(--line);
}
.site-footer__brand { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__brand p { font-size: var(--small); line-height: 1.55; color: var(--text-muted); }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: var(--small); }
.site-footer__note { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 48px; font-size: var(--caption-sm); line-height: 1.55; color: var(--text-muted); }

/* Smaller screens */

@media (max-width: 860px) {
  .site-nav { display: none; }
}
@media (max-width: 560px) {
  .command, .command--lg { gap: 8px; padding: 0 7px 0 14px; font-size: 12px; }
  .command--lg button { min-width: 64px; }
  .site-footer__inner { gap: 36px 48px; padding-top: 56px; }
}

/* Reduced motion: final states, no travelling dots */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  .stations__dot, .learn__dot { display: none !important; }
}
