@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD;
}

/* Oat theme variables, set to the design's palette */
@layer theme {
  :root {
    --background: light-dark(#fbfbfa, #121312);
    --foreground: light-dark(#161716, #eceeea);
    --card: light-dark(#fff, #1a1b1a);
    --card-foreground: var(--foreground);
    --primary: light-dark(#161716, #eceeea);
    --primary-foreground: light-dark(#fff, #121312);
    --secondary: light-dark(#f1f2ef, #262825);
    --secondary-foreground: light-dark(#5d605c, #a4a7a2);
    --muted: light-dark(#eceeea, #2a2c29);
    --muted-foreground: light-dark(#5d605c, #a4a7a2);
    --faint: light-dark(#fdfdfc, #1d1f1d);
    --faint-foreground: light-dark(#7a7d78, #8a8d88);
    --accent: light-dark(#f2f3f0, #222421);
    --success: light-dark(oklch(0.48 0.13 150), oklch(0.78 0.14 150));
    --border: light-dark(#e6e7e4, #2a2c29);
    --input: light-dark(#e1e3de, #333632);
    --ring: light-dark(#5d605c, #a4a7a2);
    --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    --radius-medium: 6px;
    --radius-large: 10px;
    --leading-normal: normal;

    --body: light-dark(#3a3c39, #c9cbc6);
    --arrow: light-dark(#a3a6a1, #5f625d);
    --line2: light-dark(#eeefec, #262825);
    --line3: light-dark(#f2f3f0, #222421);
    --dash: light-dark(#cfd1cc, #3a3d39);
    --bar: light-dark(#f7f8f6, #161816);
    --stripe1: light-dark(#eceee9, #2a2c29);
    --stripe2: light-dark(#f6f7f4, #222421);
    --ok-text: light-dark(oklch(0.42 0.12 150), oklch(0.84 0.12 150));
    --ok-bg: light-dark(oklch(0.95 0.04 150), oklch(0.32 0.06 150));
    --ok-track: light-dark(oklch(0.9 0.05 150), oklch(0.36 0.06 150));
  }
}

/* Oat sets these in its components layer, so they must be unlayered to win.
   The design's 880px is a content-box width, so add the 20px side padding. */
:root { --container-max: 920px; --container-pad: 20px; }
h1, h2, h3, h4, h5, h6 { line-height: normal; }

[hidden] { display: none !important; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html[data-theme="dark"] .i-moon, html[data-theme="light"] .i-sun { display: none; }

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding-block-start: 0; }
.mono { font-family: var(--font-mono); }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); }
.site-header nav { padding-block: 14px; justify-content: space-between; flex-wrap: nowrap; }
.site-header .logo { display: flex; align-items: center; gap: 10px; min-height: 36px; color: var(--foreground); text-decoration: none; }
.site-header .logo:hover { color: var(--foreground); }
.site-header .logo .mark { display: block; flex-shrink: 0; }
.site-header .logo .mark path { stroke: var(--background); }
.site-header .logo span { font-size: clamp(14px, 4vw, 16px); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
@media (max-width: 360px) { .site-header .logo span { white-space: normal; max-width: 6.5em; line-height: 1.1; } }
.site-header .controls { gap: 8px; flex-wrap: nowrap; }
.site-header .controls button { width: 52px; height: 32px; padding: 0; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-medium); color: var(--muted-foreground); font-family: var(--font-mono); font-size: 12px; font-weight: 400; }
.site-header [popover] { padding: var(--space-1); min-width: 10rem; }
.site-header [role="menuitem"] { color: var(--foreground); border-radius: var(--radius-medium); font-size: var(--text-7); }
.site-header [role="menuitem"][aria-current] { font-weight: var(--font-semibold); }

.site-footer { border-top: 1px solid var(--border); font-size: 13px; color: var(--faint-foreground); }
.site-footer .container { max-width: 928px; padding-block: 28px; padding-inline: 24px; justify-content: space-between; gap: 16px; }
.site-footer a { color: inherit; }
.site-footer .owner a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer nav { gap: 20px; }

/* Hero and tool */
.hero { padding-block: clamp(36px, 8vw, 64px) 40px; transition: padding var(--transition); }
.hero:has(.tool:not([data-state="empty"])) { padding-block-start: clamp(24px, 4vh, 40px); }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 52px); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.hero .lead { margin-block-start: 16px; font-size: 18px; line-height: 1.5; color: var(--muted-foreground); max-width: 560px; text-wrap: pretty; }

.tool { margin-block-start: 32px; padding: 0; border-radius: 14px; box-shadow: none; overflow: hidden; }

.tool ot-upload {
  width: auto; margin: 12px; gap: 14px; align-items: center; box-shadow: none;
  padding: clamp(36px, 8vw, 56px) 20px; border: 1.5px dashed var(--dash); border-radius: var(--radius-large);
  background: var(--faint); transition: background-color var(--transition-fast), border-color var(--transition-fast);
  animation: fade-in .3s both;
}
.tool ot-upload:hover, .tool ot-upload[data-drag] { border-color: var(--foreground); background: var(--accent); box-shadow: none; }
.tool .plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--secondary); font-size: 22px; font-weight: 500; }
.tool .drop-title { font-size: 17px; font-weight: 500; }
.tool .drop-title u { text-underline-offset: 3px; }
.tool .drop-hint { font-size: 12px; color: var(--faint-foreground); }
.tool[data-drag] { outline: 2px solid var(--ring); outline-offset: -2px; }

.files-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px clamp(14px, 4vw, 20px); border-bottom: 1px solid var(--line2); font-size: 14px; }
.files-head strong { font-weight: 500; }
.files-head button { height: auto; padding: 12px 10px; border: 0; border-radius: 0; font-size: 14px; font-weight: 400; }
.files-head #clear { color: var(--muted-foreground); }

.files { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; max-height: max(184px, calc(100dvh - 570px)); }
.tool:has(.advanced[open]) .files { max-height: max(124px, calc(100dvh - 740px)); }
.files li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0; padding: 10px clamp(14px, 4vw, 20px); border-bottom: 1px solid var(--line3); animation: fade-up .4s cubic-bezier(.2, .7, .2, 1) both; }
.files .thumb { width: 40px; height: 40px; border-radius: var(--radius-medium); object-fit: cover; background: repeating-linear-gradient(45deg, var(--stripe1) 0 4px, var(--stripe2) 4px 8px); }
.files .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .name a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.files .sizes { display: flex; gap: 6px; margin-block-start: 2px; font-size: 12px; color: var(--faint-foreground); }
.files .sizes .arrow { color: var(--arrow); }
.files .sizes .after { color: var(--success); font-weight: 500; animation: fade-in .4s both; }
.tool .badge { font-family: var(--font-mono); font-size: 12px; border-radius: 5px; padding: 3px 8px; }
.tool .badge[data-variant="secondary"] { color: var(--muted-foreground); }
.tool .badge[data-variant="success"] { color: var(--ok-text); background: var(--ok-bg); }

.settings { display: flex; flex-direction: column; gap: 16px; padding: clamp(14px, 4vw, 20px); }
.settings .quality { min-height: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; gap: clamp(10px, 3vw, 16px); align-items: center; font-size: 14px; }
/* The design uses the native slider (ink fill left of the knob, grey track right), so undo Oat's flat track */
.settings .quality input[type="range"] { all: revert; }
.settings .quality input[type="range"]::-webkit-slider-thumb { all: revert; }
.settings .quality input[type="range"]::-moz-range-thumb { all: revert; }
.settings .quality input[type="range"] { width: 100%; accent-color: var(--foreground); }
.settings .quality output { font-size: 13px; text-align: end; font-weight: 400; }

.advanced { border: 0; border-radius: 0; overflow: visible; }
.advanced summary { width: fit-content; justify-content: flex-start; gap: 8px; padding: 10px 0; font-size: 14px; font-weight: 400; color: var(--muted-foreground); }
.advanced summary:hover { background: none; color: var(--foreground); }
.advanced[open] summary { border-bottom: 0; }
.advanced summary::after { content: "›"; order: -1; width: auto; height: auto; mask: none; background: none; transform: none; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.advanced[open] summary::after { transform: rotate(90deg); }
.advanced > .adv-grid { margin: 0; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; padding: 10px 2px 2px; font-size: 13px; color: var(--muted-foreground); }
.adv-grid label, .adv-grid .format-field > span { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 400; }
.adv-grid input { margin: 0; min-width: 0; padding: 10px; font-size: 16px; background: var(--card); }
.adv-grid .format-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.adv-grid .formats { gap: 6px; }
.adv-grid .formats button { padding: 10px 14px; font-size: 13px; font-weight: 400; border-color: var(--input); }
.adv-grid .formats button.outline { background: var(--card); color: var(--body); }

.tool-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(14px, 4vw, 20px); background: var(--bar); border-top: 1px solid var(--line2); }
.tool-foot .total { flex: 999 1 auto; font-size: 13px; color: var(--muted-foreground); }
.tool-foot .go { flex: 1 1 auto; max-width: 100%; height: auto; min-height: 48px; padding: 12px 22px; border: 0; font-size: 15px; border-radius: 8px; animation: fade-in .3s both; }
.tool-foot .go:disabled { opacity: .6; cursor: progress; }
.stats { flex: 999 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 10px; animation: fade-up .4s cubic-bezier(.2, .7, .2, 1) both; }
.stats .ends { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.stats .stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stats .saved { align-items: flex-end; text-align: end; }
.stats small { font-size: 12px; color: var(--faint-foreground); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.stats strong { font-size: clamp(17px, 4.6vw, 20px); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.stats .saved small, .stats .saved strong { color: var(--success); }
.stats .saved .hstack { gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.stats .badge { padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.stats progress { --muted: var(--ok-track); display: block; height: 8px; }
.stats .orig { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; font-size: 13px; color: var(--faint-foreground); }
.stats .orig small { font-size: 11px; }

.note { margin-block-end: 0; display: flex; align-items: center; gap: 8px; margin-block-start: 14px; font-size: 13px; color: var(--faint-foreground); }
.note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--foreground); }

/* Page content */
.content { display: flex; flex-direction: column; gap: clamp(40px, 8vw, 64px); padding-block-end: clamp(48px, 10vw, 80px); }
.content > section { border-top: 1px solid var(--border); padding-block-start: clamp(32px, 6vw, 48px); }
.content > section:not(.what) { display: flex; flex-direction: column; gap: 24px; }
.content > section.how { gap: 28px; }
.content > section.faq { gap: 20px; }
.content h2 { margin: 0; font-size: clamp(22px, 5vw, 26px); letter-spacing: -.02em; }
.content p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--body); text-wrap: pretty; }
.content .what { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 48px; }
.content .what h2 { line-height: 1.2; }
.content .what div { display: flex; flex-direction: column; gap: 14px; }
.content .measure { max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.steps .num { font-size: 13px; color: var(--faint-foreground); }
.steps h3 { margin: 0; font-size: 17px; }
.steps p { font-size: 15px; line-height: 1.6; color: var(--muted-foreground); }
.formats-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin: 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-large); overflow: hidden; }
.formats-dl div { padding: 18px 20px; background: var(--card); }
.formats-dl dt { font-size: 13px; font-weight: 500; }
.formats-dl dd { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted-foreground); }
.content .more { font-size: 15px; line-height: normal; color: var(--muted-foreground); }

.faq details { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; }
.faq summary { padding: 18px 0; gap: 16px; }
.faq summary:hover { background: none; }
.faq details[open] summary { border-bottom: 0; }
.faq summary h3 { margin: 0; font-size: 16px; font-weight: 500; }
.faq summary::after { content: "+"; mask: none; background: none; width: auto; height: auto; font-family: var(--font-mono); color: var(--faint-foreground); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { margin: 0; padding-block-end: 18px; max-width: 660px; font-size: 15px; color: var(--muted-foreground); }

/* Legal pages and articles: same 880px column and type scale as the home page */
.page { padding-block: clamp(36px, 8vw, 64px) clamp(48px, 10vw, 80px); }
.page h1 { margin: 0 0 clamp(24px, 4vw, 32px); font-size: clamp(34px, 6vw, 52px); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.page h2 { margin: clamp(32px, 6vw, 48px) 0 16px; font-size: clamp(22px, 5vw, 26px); letter-spacing: -.02em; }
.page h3 { margin: 28px 0 12px; font-size: 17px; }
.page p, .page li { font-size: 16px; line-height: 1.65; color: var(--body); text-wrap: pretty; }
.page p { margin-block-end: 14px; }
.page :is(ul, ol) { margin-block-end: 14px; }
.page :is(ul, ol) a, .page td a { text-decoration: underline; }
.page table { margin-block: 20px; font-size: 15px; }
.page .table-wrap { overflow-x: auto; }
.page .next { margin-block-start: clamp(40px, 8vw, 64px); padding-block-start: clamp(32px, 6vw, 48px); border-top: 1px solid var(--border); }
.page .next ul { margin-block: 12px 0; }
