/* Open LLM Translator landing page: concrete-gray page, white paper surfaces,
   ink rules, tabular mono figures, one ledger-green accent, receipts for
   cost. Nothing here targets
   llmt-translation: the demo's translations inherit the mock site's styles. */

:root {
  --bg: #edefec;
  --surface: #ffffff;
  --ink: #16191a;
  --muted: #50565a;
  --line: #cfd4cf;
  --accent: #1a6342;
  --accent-wash: #dce9e1;
  --f-sans: "IBM Plex Sans", "Noto Sans TC", system-ui, sans-serif;
  --f-cjk: "Noto Sans TC", "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "Noto Sans TC", ui-monospace, monospace;
  --gutter: 24px;
}
/* The English page sets its headings in the Latin face; CJK falls back. */
:root:lang(en) { --f-cjk: var(--f-sans); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.75 var(--f-sans);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 8px 14px; }
.skip:focus { top: 12px; }

/* Headings break only between phrases: each .nw phrase stays whole. */
h1, h2, h3 { text-wrap: balance; }
.nw { white-space: nowrap; }
/* Body text never ends a paragraph with one lone character (例。). */
p, li, dd { text-wrap: pretty; }

/* GitHub mark, sized to the label it sits in. */
.gh-mark { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }

/* ---- Header ---- */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15.5px; letter-spacing: .01em; white-space: nowrap; }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 14.5px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.gh { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font: 500 13.5px var(--f-mono); border: 1px solid var(--line); padding: 4px 10px; border-radius: 4px; background: var(--surface); color: var(--ink); }
.gh:hover { border-color: var(--ink); color: var(--ink); }
.lang-switch { font-size: 14.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.lang-switch:hover { color: var(--ink); text-decoration: underline; }

/* ---- Hero ---- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6.4fr); gap: 56px; padding-top: 36px; padding-bottom: 72px; align-items: start; }
.pitch { padding-top: 10px; }
.eyebrow { font: 500 13px var(--f-mono); color: var(--muted); letter-spacing: .02em; margin: 0 0 18px; }
h1 { font: 700 clamp(34px, 3.3vw, 46px)/1.25 var(--f-cjk); letter-spacing: .01em; margin: 0 0 22px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 30px; max-width: 30em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  font: 600 15.5px var(--f-sans); text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1px solid #aab1ab; border-radius: 6px;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2b3032; color: #fff; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14.5px; }

/* Ledger: dotted leaders between label and value. */
.ledger { margin: 40px 0 0; padding: 14px 0 0; border-top: 1.5px solid var(--ink); font-size: 15px; max-width: 30em; }
.ledger div { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; }
.ledger dt { color: var(--muted); }
.ledger div::after { content: ""; order: 1; flex: 1; min-width: 16px; border-bottom: 1.5px dotted #9aa29c; transform: translateY(-4px); }
.ledger dd { order: 2; margin: 0; font: 600 15px var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Demo ---- */
.demo { min-width: 0; scroll-margin-top: 12px; }
.try { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; }
.try-label { margin: 0; font-size: 15px; line-height: 1.9; }
.try-label kbd { margin: 0 3px; }
kbd {
  display: inline-block; min-width: 34px; padding: 2px 8px; text-align: center;
  font: 600 13.5px var(--f-mono); color: var(--ink); background: var(--surface);
  border: 1px solid #aab1ab; border-bottom-width: 3px; border-radius: 5px;
}
/* A few presses to draw the eye, then it stops (no endless motion). */
html[data-demo="off"]:not([data-ext]) .hero kbd { animation: press 2.4s ease-in-out 2; }
@keyframes press { 0%, 72%, 100% { transform: none; border-bottom-width: 3px; } 80% { transform: translateY(2px); border-bottom-width: 1px; } }
/* CJK in the sans face; only the counts in mono. */
.state { font: 500 13px var(--f-cjk); color: var(--muted); padding: 3px 9px; border: 1px dashed #9aa29c; border-radius: 4px; }
html[data-demo="on"] .hero .state { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-wash); }
.state .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.try .btn { margin-left: auto; }
.ext-note { margin: -4px 0 14px; padding: 10px 14px; font-size: 14.5px; line-height: 1.65; background: var(--accent-wash); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; }
.ext-note:focus { outline: none; }

.frame { background: var(--surface); border: 1px solid #b9c0ba; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 0 #fff inset, 0 24px 40px -28px #1b25204d; }
.chrome { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #e3e6e3; border-bottom: 1px solid #c6ccc6; color: #555b5f; }
.chrome .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px system-ui, sans-serif; background: #fff; border-radius: 999px; padding: 4px 12px; }
.chrome .ext { opacity: .4; transition: opacity .2s; }
html[data-demo="on"] .chrome .ext { opacity: 1; }

/* The mock third-party blog. Its own fonts and colors, unlike the landing page. */
.site { display: block; font: 16px/1.6 "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif; color: #1f2328; background: #fff; }
.site a { color: #5a2d82; }
.site-top { display: flex; align-items: center; gap: 18px; padding: 10px 26px; background: #fbf6ee; border-bottom: 1px solid #eadfcd; font-size: 14.5px; flex-wrap: wrap; }
.site-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .01em; color: #3b2357; }
.site-logo i { width: 14px; height: 14px; background: #e4572e; border-radius: 50%; box-shadow: 5px 0 0 -1px #f3a712; }
.site-nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.site-top a { color: #5a4a3a; text-decoration: none; }
.site-body { padding: 18px 30px 24px; }
.crumbs { margin: 0 0 4px; font-size: 13px; color: #6b5b4b; }
.site h2 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; font-weight: 700; color: #2a1a3d; }
.site-lede { font-size: 17.5px; color: #3a434c; margin: 0 0 14px; }
.site h3 { font-size: 18px; margin: 16px 0 4px; font-weight: 700; color: #2a1a3d; }
.site p { margin: 0 0 10px; }
.site-note { padding: 8px 14px; background: #fff4e5; border-left: 4px solid #e4572e; border-radius: 0 4px 4px 0; font-size: 15px; }

/* ---- Sections as datasheet pages ---- */
.sheet { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; padding-top: 56px; padding-bottom: 72px; position: relative; }
.sheet::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1.5px solid var(--ink); }
.sheet-no { margin: 0; font: 600 44px/1 var(--f-mono); color: var(--ink); letter-spacing: -.02em; }
.sheet-no span { display: block; margin-top: 10px; font: 500 14px/1.4 var(--f-cjk); color: var(--muted); letter-spacing: 0; }
.sheet-body { min-width: 0; max-width: 960px; }
h2 { font: 700 clamp(24px, 2.4vw, 32px)/1.4 var(--f-cjk); margin: 0 0 12px; }
.sub { font-size: 17px; color: var(--muted); margin: 0 0 32px; max-width: 40em; }
h3 { font: 700 17px/1.5 var(--f-cjk); margin: 0 0 6px; }

/* Three or two short points under ink rules. */
.trio, .pair { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 36px; }
.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trio li, .pair li { border-top: 1.5px solid var(--ink); padding-top: 14px; }
.trio p, .pair p { margin: 0; color: var(--muted); }
.pair h3 { font-size: 19px; }
.pair p { font-size: 16.5px; }

/* Translation close-up. Not an llmt-translation node (the demo and its
   probes own those); .closeup-tr copies content.css's block layout. */
.bi-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 40px; align-items: start; margin-top: 32px; }
.pair.stack { grid-template-columns: minmax(0, 1fr); }
.closeup { margin: 0; }
.closeup-paper { padding: 22px 30px 26px; border: 1px solid #c6ccc6; border-radius: 8px; box-shadow: 0 1px 0 #c6ccc6; }
.closeup-url { margin: 0 0 14px !important; font: 600 13px var(--f-cjk); letter-spacing: .08em; color: #555b5f; }
.closeup-paper h3 { font-size: 26px; line-height: 1.3; margin: 0 0 14px; }
.closeup-paper p { font-size: 21px; line-height: 1.55; margin: 0; }
.closeup-tr { display: block; margin-top: 0.25em; font: inherit; color: inherit; }

/* YouTube, inside the bilingual section */
.yt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 36px; align-items: center; margin-top: 48px; padding: 24px; background: var(--surface); border: 1px solid #c6ccc6; border-radius: 8px; }
.yt-copy p { margin: 0 0 16px; color: var(--muted); }
.yt .try { margin: 0; }
.yt .try .btn { margin-left: 0; }
#movie_player { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #1b2a38; --llmt-yt-size: 16px; }
#movie_player svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#movie_player .caption-window { position: absolute; left: 5%; right: 5%; bottom: 60px; text-align: center; font: 16px/1.45 Roboto, system-ui, sans-serif; }
#movie_player .caption-window span { background: rgba(8, 8, 8, .75); color: #fff; padding: .08em .35em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
#movie_player .ctl { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: linear-gradient(transparent, #000b); color: #fff; font: 13px system-ui, sans-serif; }
#movie_player .ctl .prog { position: absolute; left: 12px; right: 12px; top: 2px; height: 3px; background: #fff4; border-radius: 2px; }
#movie_player .ctl .prog i { display: block; height: 100%; width: 2.3%; background: #f03; border-radius: 2px; }
#movie_player .ctl .cc { margin-left: auto; font: 600 11px system-ui, sans-serif; padding: 1px 5px; border: 1.5px solid #fff; border-radius: 3px; }
#movie_player .ctl .ext { opacity: .45; transition: opacity .2s; }
html.llmt-yt-on #movie_player .ctl .ext { opacity: 1; }
#movie_player .ctl .pp { all: unset; cursor: pointer; width: 28px; height: 28px; text-align: center; font-size: 13px; line-height: 28px; }
#movie_player .ctl .pp:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
html.llmt-yt-on .yt .state { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-wash); }

/* Cost: price examples, collapsed by default */
.cost-more { margin-top: 48px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line); }
.cost-more > summary { display: flex; align-items: center; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; font: 700 clamp(17px, 1.6vw, 20px)/1.5 var(--f-cjk); }
.cost-more > summary::-webkit-details-marker { display: none; }
.cost-more > summary:hover { color: var(--accent); }
.cost-more > summary::after { content: ""; flex: none; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.cost-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.cost-more[open] { padding-bottom: 24px; }
@media (prefers-reduced-motion: reduce) { .cost-more > summary::after { transition: none; } }
/* Cost: three receipts */
.receipts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.receipt {
  margin: 0; padding: 20px 20px 32px; background: var(--surface);
  border: 1px solid #c6ccc6; border-bottom: 0;
  font: 14px/1.6 var(--f-mono); font-variant-numeric: tabular-nums;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.receipt figcaption { text-align: center; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px dashed #9aa29c; }
.r-title { display: block; font: 700 17px var(--f-cjk); }
.r-meta { display: block; font: 13px var(--f-cjk); color: var(--muted); }
.receipt dl { margin: 0; }
.receipt dl div { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; }
.receipt dt { font-family: var(--f-cjk); font-size: 14px; white-space: nowrap; }
.receipt dl div::after { content: ""; order: 1; flex: 1; min-width: 10px; border-bottom: 1.5px dotted #9aa29c; transform: translateY(-4px); }
.receipt dd { order: 2; margin: 0; font-weight: 600; white-space: nowrap; }
.receipt dl div:first-child dd { color: var(--accent); }

.notes { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.notes li { padding: 10px 0 10px 26px; border-bottom: 1px solid var(--line); position: relative; }
.notes li::before { content: ""; position: absolute; left: 4px; top: 23px; width: 10px; height: 2px; background: var(--accent); }
.notes a, .more { color: var(--accent); font-weight: 600; }
.foot-note { margin: 16px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); max-width: 52em; }

/* Safety */
.aside { margin: 28px 0 0; font-size: 15.5px; color: var(--muted); max-width: 46em; }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 0; }
.more { display: inline-flex; align-items: center; gap: 7px; }

/* Start */
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); grid-row: span 2; font: 600 20px/1.4 var(--f-mono); color: var(--accent); }
.steps h3 { margin: 0 0 6px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); max-width: 44em; }

/* ---- Footer ---- */
.foot { border-top: 1.5px solid var(--ink); background: #e3e6e2; }
.foot-in { padding-top: 28px; padding-bottom: 40px; text-align: center; }
.foot-name { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; font-weight: 600; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 14.5px; }
.foot nav a { display: inline-flex; align-items: center; gap: 7px; }
.tm { margin: 18px auto 0; font-size: 12.5px; color: var(--muted); max-width: 60em; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .hero { gap: 36px; }
  .receipts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yt { grid-template-columns: minmax(0, 1fr); }
  .bi-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 900px) {
  .top-in { gap: 18px; }
  .top nav { gap: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 56px; row-gap: 0; }
  .pitch { padding-top: 0; display: contents; }
  .demo { order: 2; margin-top: 30px; }
  .ledger { order: 3; margin-top: 36px; }
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 36px; padding-bottom: 56px; }
  .sheet-no { font-size: 30px; display: flex; align-items: baseline; gap: 12px; }
  .sheet-no span { margin: 0; }
  .trio { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .top-in { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 12px; }
  .top-in { column-gap: 16px; }
  .lang-switch { margin-left: auto; font-size: 14px; }
  .top nav { order: 3; width: 100%; margin: 0; padding: 6px 0 10px; gap: 4px 20px; font-size: 14px; }
  h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .lede { font-size: 16.5px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
  .hero .try .btn { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .site-top { padding: 8px 16px; gap: 10px; }
  .site-nav { margin-left: 0; gap: 12px; }
  .site-body { padding: 14px 16px 18px; }
  .site h2 { font-size: 22px; }
  .site-lede { font-size: 16.5px; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .closeup-paper { padding: 16px 18px 20px; }
  .closeup-paper h3 { font-size: 21px; }
  .closeup-paper p { font-size: 17.5px; }
  .receipts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .yt { padding: 16px; margin-top: 36px; }
  .ledger, .ledger dd { font-size: 14px; }
  .ledger dt { flex: 0 1 auto; min-width: 0; }
  .steps li { grid-template-columns: 40px minmax(0, 1fr); }
  #movie_player { --llmt-yt-size: 13px; }
  #movie_player .caption-window { font-size: 13px; }
}
/* Narrow phones: the GitHub button keeps its icon and its accessible name. */
@media (max-width: 400px) {
  .top-in { column-gap: 12px; }
  .gh { padding: 4px 7px; }
  .gh .gh-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 360px) {
  .brand span { font-size: 14px; }
  .gh { padding: 3px 8px; }
  .receipt { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.steps .step-cta { grid-column: 2; margin-top: 12px; }
