/* tiro.trof.dev (MAC-99). Tiro's DESIGN.md on the web: one ink, red only for recording, the system
   type, one leading edge. No custom fonts, no shadows, no inline styles (the CSP refuses them). */

:root {
  color-scheme: light dark;
  --ground: #ffffff;
  --ink: #2b3a78;          /* ink-text: links, the focus ring, evidence */
  --ink-fill: #2b3a78;     /* ink-fill: under white text only */
  --on-ink: #ffffff;
  --label: rgba(0, 0, 0, 0.85);
  --label-2: rgba(0, 0, 0, 0.6);   /* 5.7:1 on white; DESIGN's 0.50 is 3.95:1, too low for web text */
  --label-3: rgba(0, 0, 0, 0.3);   /* decoration only, never text */
  --quiet: rgba(0, 0, 0, 0.05);
  --hairline: rgba(0, 0, 0, 0.1);
  --ink-tint: rgba(43, 58, 120, 0.1);
  --band: #f7f7f8;
  --me: #1e7b34;
  --orange: #b25000;
  --red: #ff3b30;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 38rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1e1e1e;
    --ink: #9aaae6;
    --ink-fill: #5064be;
    --label: rgba(255, 255, 255, 0.88);
    --label-2: rgba(255, 255, 255, 0.62);
    --label-3: rgba(255, 255, 255, 0.3);
    --quiet: rgba(255, 255, 255, 0.07);
    --hairline: rgba(255, 255, 255, 0.13);
    --ink-tint: rgba(154, 170, 230, 0.14);
    --band: #252526;
    --me: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--label);
  font: 400 1.0625rem/1.55 var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink-tint); color: inherit; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { color: var(--label); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.2rem + 4.6vw, 4.5rem); line-height: 1.04; font-weight: 650; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); line-height: 1.1; font-weight: 650; letter-spacing: -0.025em; }
h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.012em; }
p { margin: 0; text-wrap: pretty; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--quiet); border-radius: 5px; padding: 0.08em 0.36em; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--hairline); border-radius: 5px; padding: 0.02em 0.38em; background: var(--quiet); }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.glyph, .badge-glyph, .node-glyph, .chip-glyph {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.glyph { width: 1.25rem; height: 1.25rem; flex: none; color: var(--label-2); }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink-fill); color: var(--on-ink); padding: 8px 14px; border-radius: 8px; z-index: 2; }
.skip:focus { top: 12px; }

/* header and footer */
.site-header { padding-block: 18px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; color: var(--label); text-decoration: none; font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; }
.site-header nav { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 0.95rem; }
.site-header nav a, .site-footer nav a { color: var(--label-2); text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover, [aria-current="page"] { color: var(--label); }

.site-footer { border-top: 1px solid var(--hairline); margin-top: clamp(64px, 10vw, 120px); padding-block: 28px 40px; color: var(--label-2); font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-guides { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--hairline); align-items: baseline; }
.footer-label { font-size: inherit; font-weight: 600; letter-spacing: 0; color: var(--label); width: 100%; }

/* hero */
.hero { padding-top: clamp(40px, 8vw, 96px); }
.hero h1 { max-width: 14ch; }
.hero h1 span { color: var(--ink); display: block; }
.lede { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem); line-height: 1.5; color: var(--label-2); max-width: var(--measure); margin-top: 22px; }
.fine { color: var(--label-2); font-size: 0.92rem; margin-top: 14px; }

.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.badge {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 20px 9px 16px;
  border-radius: 14px; text-decoration: none; line-height: 1.15;
}
.badge-glyph { width: 26px; height: 26px; }
.badge small { display: block; font-size: 0.75rem; letter-spacing: 0.01em; }
.badge strong { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.badge-soon { background: var(--quiet); color: var(--label); box-shadow: inset 0 0 0 1px var(--hairline); }
.badge-soon small { color: var(--label-2); }
.badge-live { background: var(--ink-fill); color: var(--on-ink); }
.badge-live:hover { filter: brightness(1.12); }

.shot { margin: 0; }
.shot picture, .shot img { border-radius: var(--radius); }
.shot img { box-shadow: 0 0 0 1px var(--hairline); background: var(--ground); }
.shot-hero { margin-top: clamp(40px, 7vw, 80px); }
.shot-hero img { width: 100%; }

/* the basics: a script, like Tiro's transcript - a gutter for the name, then the line */
.basics { margin-top: clamp(56px, 9vw, 112px); }
.script { margin: 0; display: grid; gap: 28px; }
.script > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, var(--measure)); gap: 6px 32px; }
.script dt { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.script dt .glyph { margin-top: 0.15rem; color: var(--ink); }
.script dd { margin: 0; color: var(--label-2); }

/* features */
.features { margin-top: clamp(80px, 12vw, 152px); }
.features > h2 { max-width: 20ch; }
.feature {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding-block: clamp(48px, 7vw, 88px); border-bottom: 1px solid var(--hairline);
}
.feature:last-child { border-bottom: 0; }
.feature-text { max-width: 30rem; }
.feature-text p { color: var(--label-2); margin-top: 14px; }
.feature-text h3 + p { margin-top: 16px; }
.feature .shot { justify-self: end; width: 100%; }
.feature .shot img { width: 100%; }

.phone-pair { display: grid; justify-items: center; gap: 22px; justify-self: center; }
.shot-phone { max-width: 300px; }
.shot-phone img { border-radius: 30px; }
.shot-lock { max-width: 300px; }
/* the dictation panel is small on screen; shown near its real size, not stretched to the column */
.feature .shot-hud { max-width: 360px; justify-self: center; }
.guide .shot-hud { max-width: 360px; margin-inline: auto; }
.shot-lock img { border-radius: 18px; box-shadow: none; }

/* a small replica of the edited transcript (MAC-88), drawn in HTML so no real conversation ships */
.mini-transcript {
  margin: 0; padding: 24px clamp(16px, 3vw, 28px); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--hairline);
  display: grid; gap: 14px; font-size: 0.98rem;
}
.mini-transcript .line { display: grid; grid-template-columns: 3.4rem 7.5rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.mini-transcript .ts { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--label-2); text-align: right; }
.mini-transcript .who { font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 7px; }
.mini-transcript em { font-size: 0.78rem; color: var(--label-2); margin-left: 4px; }
.mini-transcript .removed .who { font-weight: 400; color: var(--label-2); font-size: 0.82rem; }
.mini-transcript .removed s { color: var(--label-2); }
.mini-transcript .link { color: var(--ink); margin-left: 6px; }
.mark { width: 10px; height: 10px; flex: none; }
.mark-me { border-radius: 50%; background: var(--me); }
.mark-tri { background: var(--orange); clip-path: polygon(50% 4%, 100% 96%, 0 96%); }

/* privacy */
.privacy { margin-top: clamp(48px, 8vw, 96px); padding-block: clamp(64px, 10vw, 128px); background: var(--band); border-block: 1px solid var(--hairline); }
.privacy .lede { margin-top: 18px; }
.flow { margin: clamp(36px, 6vw, 64px) 0 0; }
.flow svg { width: 100%; height: auto; font-family: var(--sans); }
.flow-tall { display: none; max-width: 420px; }
.flow .box { fill: var(--ground); stroke: var(--hairline); stroke-width: 1.2; }
.flow .box-mac { stroke: var(--ink); stroke-width: 2; }
.flow .box-dashed { fill: none; stroke: var(--label-3); stroke-dasharray: 5 5; }
.flow .chip { fill: var(--ink-tint); }
.flow .chip-glyph { color: var(--ink); stroke-width: 1.8; }
.flow .node-glyph { color: var(--label); }
.flow .node-glyph.quiet { color: var(--label-2); }
.flow text { fill: var(--label); }
.flow .t-title { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.flow .t-head { font-size: 17px; font-weight: 600; }
.flow .t-label { font-size: 16px; font-weight: 600; }
.flow .t-small { font-size: 13.5px; fill: var(--label-2); }
.flow .t-ink { fill: var(--ink); font-weight: 600; }
.flow .link-solid { stroke: var(--ink); stroke-width: 2; fill: none; }
.flow .link-quiet { stroke: var(--label-2); stroke-width: 1.4; stroke-dasharray: 5 5; fill: none; }
.flow .arrowhead { fill: var(--ink); }
.flow .arrowhead-quiet { fill: var(--label-2); }

.facts { margin: clamp(40px, 6vw, 72px) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(32px, 6vw, 80px); }
.facts dt { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.facts dt .glyph { color: var(--ink); }
.facts dd { margin: 8px 0 0; color: var(--label-2); max-width: 32rem; }
.pledge { margin-top: clamp(48px, 7vw, 80px); font-size: clamp(1.6rem, 1rem + 2.2vw, 2.4rem); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }

/* Tiro at a glance (MAC-106): short, quotable statements from site/src/facts.toml */
.glance { margin-top: clamp(72px, 11vw, 136px); }
.glance-list {
  margin: 28px 0 0; padding: 0; list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0 clamp(32px, 5vw, 64px);
}
.glance-list li { padding: 16px 0 16px 18px; border-top: 1px solid var(--hairline); position: relative; }
.glance-list li::before {
  content: ""; position: absolute; left: 0; top: 1.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
}

/* New in Tiro (MAC-136): the privacy facts' two columns, from facts.toml */
.latest { margin-top: clamp(72px, 11vw, 136px); }
.latest .lede { margin-top: 18px; }
.facts-new { margin-top: clamp(32px, 5vw, 56px); }

/* /download (MAC-136): the button, then the release facts in a mono-friendly two-column list */
.download-panel { margin-top: 2em; }
.download .download-panel .badges { margin-top: 0; }
.release { margin: 24px 0 0; display: grid; gap: 10px; font-size: 0.95rem; }
.release > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 4px 16px; align-items: baseline; }
.release dt { color: var(--label-2); }
.release dd { margin: 0; }
.checksum { font-size: 0.8rem; overflow-wrap: anywhere; }
.placeholder { color: var(--label-2); font-style: italic; padding: 0.05em 0.45em; border: 1px dashed var(--label-3); border-radius: 6px; }
.download .facts { grid-template-columns: minmax(0, 1fr); margin-top: 1.4em; gap: 22px; }
.download .facts dd { max-width: none; }
.download .badges { margin-top: 1.4em; }

/* the use-case pages, linked from the home page (MAC-107) */
.guides { margin-top: clamp(72px, 11vw, 136px); }
.guide-list {
  margin: 28px 0 0; padding: 0; list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 16px;
}
.guide-list li { padding: 20px 22px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hairline); }
.guide-list a { font-weight: 600; font-size: 1.08rem; }
.guide-list p { margin-top: 8px; color: var(--label-2); font-size: 0.95rem; }

/* FAQ */
.faq { margin-top: clamp(72px, 11vw, 136px); }
.faq-list { margin-top: 28px; border-top: 1px solid var(--hairline); max-width: 48rem; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font-weight: 600; font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 1.6px solid var(--label-2); border-bottom: 1.6px solid var(--label-2); transform: rotate(45deg);
  transition: transform 0.2s ease-out;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq summary:hover { color: var(--ink); }
.faq details p { padding: 0 0 22px; color: var(--label-2); max-width: var(--measure); }

/* prose pages: privacy, terms, support */
.prose { max-width: calc(42rem + 2 * var(--gutter)); margin-inline: auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 0; }
.prose h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.prose h2 { font-size: 1.35rem; letter-spacing: -0.012em; margin-top: 2.4em; }
.prose p, .prose ul, .prose blockquote { margin-top: 1em; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--label-3); }
.prose blockquote { margin-inline: 0; padding-left: 16px; border-left: 1px solid var(--hairline); color: var(--label-2); }
.prose .lede { margin-top: 16px; }
.guide .shot { margin-top: 2em; }
.guide .shot img { width: 100%; }
/* a settings capture at its own size (its width attribute), never upscaled to the column */
.guide .shot-settings img { width: auto; }
.guide figcaption { margin-top: 10px; color: var(--label-2); font-size: 0.9rem; }
.guide .badges { margin-top: 2.4em; }
.guide-phones { display: grid; justify-items: center; gap: 22px; margin-top: 2em; }
.guide-phones .shot { margin-top: 0; }

/* the comparison pages (MAC-137): a three-column table that stays readable at phone width */
.compare .checked { margin-top: 1.2em; color: var(--label-2); font-size: 0.92rem; }
.compare .as-of { margin-top: 0.8em; color: var(--label-2); font-size: 0.9rem; }.table-wrap { margin-top: 2em; overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hairline); }
.compare-table thead th { font-weight: 600; color: var(--label); border-bottom-color: var(--label-3); }
.compare-table tbody th { font-weight: 600; color: var(--label-2); width: 28%; }
.compare-table td { width: 36%; }
.compare-table tr > :last-child { padding-right: 0; }
/* At phone width the row label goes above its two answers, so each answer gets half the width. */
@media (max-width: 560px) {
  .compare-table thead tr, .compare-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .compare-table thead th:first-child { display: none; }
  .compare-table th, .compare-table td { width: auto; padding-right: 0; }
  .compare-table tbody tr { border-bottom: 1px solid var(--hairline); padding-bottom: 12px; }
  .compare-table tbody th { grid-column: 1 / -1; width: auto; border-bottom: 0; padding-bottom: 2px; }
  .compare-table tbody td { width: auto; border-bottom: 0; padding-top: 4px; padding-bottom: 0; }
}
.draft-note {
  margin-top: 20px !important; padding: 14px 18px; border-radius: 12px; background: var(--ink-tint); color: var(--label);
}

@media (max-width: 860px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .shot, .phone-pair { justify-self: start; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .script > div { grid-template-columns: minmax(0, 1fr); }
  .flow-wide { display: none; }
  .flow-tall { display: block; }
}

@media (max-width: 420px) {
  body { font-size: 1rem; }
  /* with Download in the header (MAC-136) five links no longer fit beside the brand: they wrap */
  .header-row { flex-wrap: wrap; row-gap: 10px; }
  .site-header nav { gap: 6px 14px; font-size: 0.9rem; flex-wrap: wrap; }
  .badge { width: 100%; }
  .mini-transcript .line { grid-template-columns: 2.9rem minmax(0, 1fr); }
  .mini-transcript .line p { grid-column: 2; }
  .shot-phone { max-width: 260px; }
}

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

@media (prefers-contrast: more) {
  :root { --label-2: var(--label); --hairline: currentColor; }
}
