/* Page CSS for htmlto.video, on top of the tasteskill kit (public/assets/system.css).
   Colours, type, spacing, radius and buttons come from the kit's tokens; this file only draws
   the converter window and the few things a working tool needs that a brochure page does not. */

@font-face { font-family: "Gabarito"; font-weight: 400 700; font-display: swap; src: url(/fonts/gabarito-latin-ext-wght-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Gabarito"; font-weight: 400 700; font-display: swap; src: url(/fonts/gabarito-latin-wght-normal.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: "Figtree"; font-weight: 400 600; font-display: swap; src: url(/fonts/figtree-latin-ext-wght-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-weight: 400 600; font-display: swap; src: url(/fonts/figtree-latin-wght-normal.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: "DM Mono"; font-weight: 400; font-display: swap; src: url(/fonts/dm-mono-latin-400-normal.woff2) format("woff2"); }

[hidden] { display: none !important; }
/* The site is dark only: native scrollbars (the code box) and form controls draw dark too, not white. */
:root { color-scheme: dark; }

/* The play-button mark, the same one as the favicon, the share image and the ident. */
.brandmark rect { fill: var(--accent); }
.brandmark path { fill: var(--accent-ink); }

/* Every section is as tall as its content: the kit's one-section-per-screen rule left a text-only
   tool page half empty. */
main > section.section { height: auto; min-height: 0; padding-block: var(--s-8); }
main > section.section.section--tight { padding-top: 0; }
/* A page that opens on a plain section (About, Privacy, Terms) clears the fixed header first. */
main > section.section:first-child { padding-top: calc(var(--nav, 72px) + var(--s-7)); }
/* Headline line breaks: Japanese by phrase, Korean only at spaces, never inside a word. */
:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; }
:lang(ko) { word-break: keep-all; }
/* The tool's hero is as tall as the tool, not a full screen: on a wide, short screen the window is narrower than
   the screen is tall, and a full-screen hero left an empty band under it. The next section follows right after. */
main > .hero.hero--tool { height: auto; min-height: 0; --hgap: var(--s-5); }
footer.closing { height: auto; min-height: 0; padding-block: var(--s-8) var(--s-6); }
.foot-lead { display: grid; gap: var(--s-5); justify-items: start; }
.foot-lead h2 { font-size: var(--t-h3); margin: 0; max-width: 18ch; }
.footer .footer__legal { margin-top: var(--s-5); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.section h2 { margin-bottom: var(--s-6); }
.section .section-head h2 { margin-bottom: 0; }
.section .section-head { margin-bottom: var(--s-6); }
main > .hero.hero--tool { padding-bottom: var(--s-5); }
.hero--tool .hero__head { align-items: end; }
/* The window is the hero's picture and has to end above the fold with its Export button, so the headline steps down a size. */
.hero--tool h1 { font-size: clamp(34px, 2.2vw + 24px, 56px); }
.hero--tool .hero__head > :first-child { grid-column: 1 / span 7; }
.hero--tool .hero__head > .hero__lead { grid-column: 8 / -1; max-width: none; margin: 0; }
/* Here the h1 itself is the head's first child, so the kit's stacking rule (.hero__head > :first-child > * + *)
   would push down every word mask but the first while the entrance runs, then the headline snaps back 32px. */
.hero--tool .hero__head > h1 > * { margin-top: 0; }
@media (max-width: 1023px) { .hero--tool .hero__head > :first-child, .hero--tool .hero__head > .hero__lead { grid-column: 1 / -1; } }

/* ---- The converter window ---- */
.tool { margin-top: var(--s-4); }
.tool__win {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.tool__pane { display: flex; flex-direction: column; min-width: 0; position: relative; }
.tool__pane + .tool__pane { border-left: 1px solid var(--line); }
.tool__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); height: 48px; padding: 0 var(--s-4); border-bottom: 1px solid var(--line); font: 500 var(--t-small)/1 var(--font-text); }
.tool__head > div { display: flex; gap: var(--s-2); }
.tool .btn--sm { height: 32px; padding: 0 var(--s-3); font-size: var(--t-small); }
#h2v-code {
  flex: 1; min-height: 104px; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: var(--ink);
  padding: var(--s-4); font: 400 13px/1.6 var(--font-mono); white-space: pre; overflow: auto; tab-size: 2;
}
#h2v-code::placeholder { color: var(--muted); font-family: var(--font-text); font-size: var(--t-body); white-space: normal; }
#h2v-code:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.tool__foot { padding: 10px var(--s-4) var(--s-3); border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tool__foot p { font-size: var(--t-small); color: var(--muted); }
/* Examples: one row of cards, each a frame of the animation (scripts/thumbs.mjs draws them), scrolled sideways. */
.ex { --card: 152px; position: relative; margin-inline: calc(-1 * var(--s-4)); }
.ex-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card); gap: var(--s-2);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--s-4);
  padding: 2px var(--s-4) 4px; scrollbar-width: none;
}
.ex-rail::-webkit-scrollbar { display: none; }
.ex-card {
  display: grid; grid-template-rows: auto auto; padding: 0; text-align: left; scroll-snap-align: start; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ex-card__pic { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; background: var(--bg); }
/* a picture narrower than the card sits on a blurred, dimmed copy of itself instead of empty bars */
.ex-card__pic::before { content: ""; position: absolute; inset: -12px; z-index: -1; background: var(--img) center / cover; filter: blur(14px) saturate(1.1); opacity: 0.45; }
.ex-card[data-alpha] .ex-card__pic::before { filter: none; opacity: 1; background: repeating-conic-gradient(color-mix(in oklab, var(--ink) 9%, var(--bg)) 0 25%, var(--bg) 0 50%) 0 0 / 12px 12px; inset: 0; }
.ex-card__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; transition: scale 400ms var(--ease); }
.ex-card__tag { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: color-mix(in oklab, #000 62%, transparent); color: #fff; font: 400 11px/1.3 var(--font-mono); }
.ex-card__name { padding: var(--s-2) var(--s-3); border-top: 1px solid var(--line); font: 500 var(--t-small)/1.3 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-card:hover { border-color: var(--ink); }
.ex-card:hover .ex-card__pic img { scale: 1.04; }
.ex-card:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.ex-card[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ex-card[aria-pressed='true'] .ex-card__name { background: color-mix(in oklab, var(--accent) 14%, var(--surface)); }
.ex-card:active { transform: translateY(1px); }
/* the arrows: over the pictures at either end, only while there is more that way (and not on touch, which swipes) */
.ex-nav {
  position: absolute; top: calc(2px + var(--card) * 9 / 32); translate: 0 -50%; z-index: 2; width: 36px; height: 36px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink);
  background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: blur(6px); box-shadow: 0 4px 16px rgb(0 0 0 / 0.35);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ex-nav::before { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: -45deg; margin-left: -3px; }
.ex-nav--prev { left: var(--s-2); }
.ex-nav--prev::before { rotate: 135deg; margin: 0 -3px 0 0; }
.ex-nav--next { right: var(--s-2); }
.ex-nav:hover { background: var(--surface); border-color: var(--ink); }
@media (pointer: coarse) { .ex-nav { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ex-card__pic img { transition: none; } .ex-card:hover .ex-card__pic img { scale: none; } }

/* The prompt for AI, opened from the tool so the visitor sees what they copy before copying it. */
.pdlg {
  width: min(640px, calc(100vw - 32px)); max-height: min(720px, calc(100svh - 32px)); padding: 0; margin: auto;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.5);
}
.pdlg[open] { display: flex; flex-direction: column; }
.pdlg::backdrop { background: rgb(4 10 5 / 0.66); backdrop-filter: blur(3px); }
.pdlg__head { display: flex; align-items: start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-5) 0; }
.pdlg__head h2 { font-size: var(--t-h3); line-height: 1.2; margin: 0; }
.pdlg__x { flex: none; width: 36px; height: 36px; margin: -4px -8px 0 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; position: relative; }
.pdlg__x::before, .pdlg__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; background: currentColor; translate: -50% -50%; rotate: 45deg; }
.pdlg__x::after { rotate: -45deg; }
.pdlg__x:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 8%, transparent); }
.pdlg__body { padding: var(--s-2) var(--s-5) 0; color: var(--muted); }
.pdlg__text {
  flex: 1 1 auto; min-height: 120px; overflow: auto; margin: var(--s-4) var(--s-5) 0; padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  font: 400 13px/1.7 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.pdlg__text:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.pdlg__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-4) var(--s-5) var(--s-5); }
@media (max-width: 520px) { .pdlg__foot .btn { flex: 1 1 auto; } }
.drop-veil { display: none; position: absolute; inset: 0; place-items: center; background: color-mix(in oklab, var(--bg) 86%, var(--action)); outline: 2px dashed var(--action); outline-offset: -8px; font-weight: 500; pointer-events: none; }
.is-drag .drop-veil { display: grid; }

.stage { flex: 1; display: grid; place-items: center; padding: var(--s-3); min-height: 280px; background: var(--bg); }
.stage-box {
  position: relative; overflow: hidden; width: min(100%, calc(43.5svh * var(--ratio, 1.7778))); aspect-ratio: 16 / 9; border-radius: var(--r-sm);
  outline: 1px solid var(--line-strong);
  /* Checkerboard, so a transparent page reads as transparent. */
  background: repeating-conic-gradient(color-mix(in oklab, var(--ink) 10%, var(--bg)) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px;
}
.stage-holder iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--s-5); color: var(--muted); background: var(--surface); font-size: var(--t-body); }
.stage-result { position: absolute; inset: 0; display: none; background: var(--bg); }
.stage-result video, .stage-result img { width: 100%; height: 100%; object-fit: contain; display: block; }

.tool__status { border-top: 1px solid var(--line); padding: var(--s-4); display: none; gap: var(--s-3); }
.progress-track { height: 6px; background: color-mix(in oklab, var(--ink) 12%, transparent); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--action); transition: width 0.15s linear; }
.tool__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; font-size: var(--t-body); font-variant-numeric: tabular-nums; }
.tool__status p { font-size: var(--t-small); color: var(--muted); }
.result strong { font-weight: 500; display: block; }
.result .btn-row { flex-wrap: wrap; }

#h2v:not([data-view='empty']) .stage-empty { display: none; }
#h2v[data-view='progress'] .progress { display: grid; }
#h2v[data-view='progress'] .stage-holder { pointer-events: none; }
#h2v[data-view='result'] .result { display: grid; }
#h2v[data-view='result'] .stage-result { display: block; }
#h2v[data-view='result'] .stage-holder { display: none; }
/* One filled button a view: once the file is ready, Download is the action and Export steps back. */
#h2v[data-view='result'] #h2v-export { background: color-mix(in oklab, var(--ink) 8%, var(--bg)); color: var(--ink); }
#h2v.is-rendering .tool__bar, #h2v.is-rendering .ex { opacity: 0.5; pointer-events: none; }

.tool__bar { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: flex-end; }
.field { display: grid; gap: var(--s-2); min-width: 0; }
.field > span:first-child, .field > label { font: 500 var(--t-label)/1 var(--font-text); color: var(--muted); }
.field--go { flex: 1 1 140px; }
.field--go .btn { width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button { height: 42px; padding: 0 10px; border: 0; border-right: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 500 var(--t-small)/1 var(--font-text); white-space: nowrap; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.tool__bar select, .unit { height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--ink); padding: 0 var(--s-3); font: 400 var(--t-body)/1 var(--font-text); }
.tool__bar select option { color: #0f1f10; background: #fff; }
.unit { display: flex; align-items: center; gap: var(--s-2); }
.unit input { width: 56px; border: 0; outline: none; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.unit span { color: var(--muted); font-size: var(--t-small); }
.unit:focus-within { outline: 2px solid var(--action); outline-offset: 2px; }
.tool__under { margin-top: var(--s-3); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2) var(--s-5); flex-wrap: wrap; font-size: var(--t-small); }
.tool__note { color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.lastfile { color: var(--ink); }

/* Over the code box while an example is in it */
.tool__banner { display: flex; align-items: center; gap: var(--s-3); padding: 6px var(--s-4); background: color-mix(in oklab, var(--accent) 14%, var(--surface)); border-bottom: 1px solid var(--line); font-size: var(--t-small); }
.tool__banner::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tool__ask { padding-top: 10px; border-top: 1px dashed var(--line); }
.link-btn { padding: 0; border: 0; background: none; color: var(--action); font: 500 var(--t-small)/1.4 var(--font-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }

.notices { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.notices:empty { display: none; }
.notice { border: 1px solid var(--line-strong); border-left: 3px solid #f2c94c; border-radius: var(--r-md); background: var(--surface); padding: var(--s-4); display: grid; gap: var(--s-1); justify-items: start; }
.notice-error { border-left-color: #ff7a66; }
.notice strong { font-weight: 500; }
.notice p { max-width: 80ch; }
.notice details { font-size: var(--t-small); color: var(--muted); }
.notice summary { cursor: pointer; }
.notice pre { margin: var(--s-2) 0 0; white-space: pre-wrap; word-break: break-all; font: 400 13px/1.5 var(--font-mono); }
#h2v-safari { margin-bottom: var(--s-4); }

/* ---- Sections ---- */
.steprow { list-style: none; padding: 0; margin: 0; }
.steprow li { display: grid; gap: var(--s-2); align-content: start; }
.steprow h3 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; margin-top: var(--s-2); }
.promptrow { margin-top: var(--s-8); padding-top: var(--s-7); border-top: 1px solid var(--line); }
.promptintro { display: grid; gap: var(--s-3); justify-items: start; align-content: start; }
.promptintro h3 { font: 500 var(--t-lead)/1.3 var(--font-text); letter-spacing: -0.01em; }
.prompt-block { margin: 0; padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font: 400 14px/1.75 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.plain-list { display: grid; gap: var(--s-3); }
.plain-list li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); }
.plain-list li::before { content: ""; width: 10px; height: 2px; margin: 11px 5px 0; background: var(--muted); }
.card > h3 { margin-bottom: var(--s-1); }
.facts { font-size: var(--t-lead); line-height: 1.6; }
.faq.faq--cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-8); }
.faq.faq--cols > .faq__item:first-child, .faq.faq--cols > .faq__item { padding: var(--s-5) 0; }
.faq.faq--cols > .faq__item { border-top: 1px solid var(--line); border-bottom: 0; align-content: start; }
@media (max-width: 860px) { .faq.faq--cols { grid-template-columns: minmax(0, 1fr); } }
.prose { max-width: 62ch; display: grid; gap: var(--s-4); }
.prose h2 { font-size: var(--t-h3); margin-top: var(--s-5); }
.lang-select { height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--ink); padding: 0 var(--s-2); font: 400 15px/1 var(--font-text); }
.lang-select option { color: #0f1f10; background: #fff; }
.footer .footer__col--wide ul { display: block; column-count: 2; column-gap: var(--s-5); }
.footer .footer__col--wide li { break-inside: avoid; padding-bottom: var(--s-3); }
.closing__cta.close--type { display: grid; gap: var(--s-6); justify-items: start; }

@media (max-width: 860px) {
  .tool__win { grid-template-columns: minmax(0, 1fr); }
  /* On a phone the animation comes first, then the code (short, it scrolls), then the settings. */
  .tool__pane:nth-child(2) { order: -1; }
  .tool__pane:nth-child(2) { border-bottom: 1px solid var(--line); }
  .tool__pane + .tool__pane { border-top: 0; }
  .tool__pane + .tool__pane { border-left: 0; border-top: 1px solid var(--line); }
  #h2v-code { min-height: 0; height: 132px; flex: none; }
  .tool__pane + .tool__pane { border-top: 0; }
  /* The example cards are a little narrower so a phone shows two and part of a third. */
  .ex { --card: 148px; }
  .stage { min-height: 0; padding: var(--s-4); }
  .stage-box { width: min(100%, calc(60svh * var(--ratio, 1.7778))); }
  .field--go { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }
.lang404 { list-style: none; padding: 0; margin: var(--s-7) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
