:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #14161a;
  --ink-soft: #3c4046;
  --muted: #6c7178;
  --line: #e4e1d8;
  --line-strong: #d3cfc3;
  --accent: #d9482a;
  --accent-soft: #fbe9e4;
  --ok: #17715a;
  --err: #a8261b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 18px 40px -24px rgba(20, 22, 26, .28);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --sans: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.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;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 26px 32px 0;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 6px 0 0 -3px var(--ink);
}

.brand__name {
  font-weight: 650;
  letter-spacing: -.02em;
  font-size: .95rem;
}

.topbar__note {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .01em;
  color: var(--muted);
}

/* ---------- layout ---------- */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

.hero { padding: 40px 0 28px; }

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6.2vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -.038em;
  font-weight: 600;
  text-wrap: balance;
}

.lede {
  margin: 20px 0 0;
  max-width: 58ch;
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

/* ---------- tool card ---------- */

.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.label {
  display: block;
  font-size: .6875rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* drop */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 38px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfbf8;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}

.drop:hover { border-color: var(--accent); background: #fffaf8; }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(.995); }

.drop__icon { width: 30px; height: 30px; color: var(--accent); }

.drop__title {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.drop__help {
  margin: 0;
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--muted);
}

/* file card */

.filecard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfbf8;
  animation: rise .2s var(--ease);
}

.filecard__main { min-width: 0; }

.filecard__name {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filecard__meta {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ghost {
  flex: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}

.ghost:hover { border-color: var(--ink); color: var(--ink); background: #fff; }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* target */

.target {
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding: 5px;
  background: #f2f0ea;
  border-radius: 14px;
}

.seg__item { position: relative; }

.seg__item input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.seg__item span {
  display: block;
  padding: 11px 4px;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  border-radius: 10px;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}

.seg__item input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 22, 26, .08), 0 0 0 1px rgba(20, 22, 26, .06);
}

.seg__item input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.custom__label {
  font-size: .8125rem;
  color: var(--muted);
}

.custom__input {
  width: 96px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.custom__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.custom__input[aria-invalid="true"] {
  border-color: var(--err);
  background: #fdf1ef;
  color: var(--err);
}

.custom__input[aria-invalid="true"]:focus {
  outline-color: var(--err);
}

.custom__unit {
  font-size: .8125rem;
  color: var(--muted);
}

.hint {
  margin: 12px 0 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* budget bar */

.budget { margin-top: 26px; }

.budget__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.budget__cut {
  font-family: var(--mono);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}

.budget__track {
  position: relative;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eceae2;
  overflow: hidden;
}

.budget__src,
.budget__dst {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width .3s var(--ease);
}

.budget__src { background: #dcd8cc; }
.budget__dst { background: var(--accent); }

.budget__scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.budget__est { color: var(--ink-soft); }

/* go */

.go {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  margin-top: 24px;
  padding: 15px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.01em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: transform .14s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
  box-shadow: 0 10px 24px -14px rgba(217, 72, 42, .9);
}

.go:hover:not(:disabled) { background: #c43f23; }
.go:active:not(:disabled) { transform: translateY(1px); }

.go:disabled {
  background: #e7e4da;
  color: #9b978b;
  box-shadow: none;
  cursor: not-allowed;
}

.go__hint {
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .01em;
  opacity: .8;
}

/* Already-small state: the disabled button carries the whole sentence, so it
   needs to wrap cleanly instead of shouting at 1rem. */
.go--notice {
  padding: 16px 22px;
  font-size: .9rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -.005em;
}

.noop { margin-top: 14px; }

.noop__hint {
  margin: 0 0 4px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
}

.download--original { margin-top: 10px; }

/* status */

.status { margin-top: 22px; }

.status__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .8rem;
  color: var(--ink-soft);
}

.status__pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.status__track {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eceae2;
  overflow: hidden;
}

.status__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  transition: width .25s var(--ease);
}

.status.is-busy .status__bar {
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 50%, var(--ink) 100%);
  background-size: 200% 100%;
  animation: slide 1.4s linear infinite;
}

@keyframes slide {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}

/* result */

.result {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfaf6;
  animation: rise .22s var(--ease);
}

.result__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
}

.result__cell { display: flex; flex-direction: column; gap: 6px; }

.result__cell:first-child { align-items: flex-end; text-align: right; }

.result__num {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  font-weight: 600;
}

.result__num--accent { color: var(--accent); }

.result__arrow {
  color: var(--line-strong);
  font-size: 1.1rem;
  line-height: 1;
  padding-bottom: 6px;
}

.result__note {
  margin: 14px 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.download {
  display: block;
  margin-top: 16px;
  padding: 14px 18px;
  text-align: center;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 12px;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.download:hover { background: var(--ink); color: #fff; }

.error {
  margin: 18px 0 0;
  padding: 12px 14px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--err);
  background: #fdf1ef;
  border: 1px solid #f3d3cd;
  border-radius: 10px;
}

/* ---------- prose ---------- */

.prose { margin-top: 72px; }

.prose h2 {
  margin: 44px 0 12px;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.prose h2:first-child { margin-top: 0; }

.prose p {
  margin: 0 0 14px;
  max-width: 64ch;
  color: var(--ink-soft);
  line-height: 1.68;
}

.prose code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 2px 5px;
  background: #efece3;
  border-radius: 5px;
}

.table-wrap { overflow-x: auto; margin: 4px 0 12px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  border-bottom-color: var(--line-strong);
}

td:first-child {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.footnote {
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- faq ---------- */

.faq { margin-top: 72px; }

.faq h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

details:first-of-type { border-top: 1px solid var(--line); }

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.01em;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--muted);
  transition: transform .16s var(--ease);
}

details[open] summary::after { transform: rotate(45deg); }

details p {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.foot p {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
}

.foot__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 14px;
}

.foot__nav a {
  font-size: .8rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}

.foot__nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- sub pages: privacy / about / contact ---------- */

.wrap--doc { max-width: 680px; }

.doc { padding: 34px 0 0; }

.doc h1 {
  font-size: clamp(1.75rem, 4.4vw, 2.4rem);
  letter-spacing: -.03em;
}

.doc .updated {
  margin: 14px 0 0;
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--muted);
}

.doc h2 {
  margin: 40px 0 10px;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.doc p {
  margin: 0 0 14px;
  max-width: 64ch;
  color: var(--ink-soft);
  line-height: 1.68;
}

.doc ul {
  margin: 0 0 14px;
  padding-left: 20px;
  max-width: 64ch;
  color: var(--ink-soft);
  line-height: 1.68;
}

.doc li { margin-bottom: 8px; }

.doc a.inline {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.doc a.inline:hover { color: var(--accent); border-bottom-color: var(--accent); }

.doc .pending {
  display: inline-block;
  font-family: var(--mono);
  font-size: .85em;
  padding: 3px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
}

.doc .back { margin-top: 44px; }

/* ---------- focus ---------- */

:where(button, a, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- responsive ---------- */

/* Wide screens: the tool holds the left column and stays in view while the
   explanation reads down the right. One column below 1024px. */
@media (min-width: 1024px) {
  .topbar { max-width: 1120px; }
  .wrap {
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
    column-gap: 64px;
    align-items: start;
  }
  .hero {
    grid-column: 1 / -1;
    padding: 52px 0 34px;
    max-width: 780px;
  }
  h1 { font-size: clamp(2.6rem, 3.9vw, 3.9rem); }
  .lede { max-width: 52ch; margin-top: 18px; }
  .tool {
    grid-column: 1;
    grid-row: 2 / span 2;
    position: sticky;
    top: 28px;
  }
  .prose { grid-column: 2; grid-row: 2; margin-top: 6px; }
  .faq { grid-column: 2; grid-row: 3; margin-top: 44px; }
  .foot { grid-column: 1 / -1; margin-top: 80px; }
  .wrap--doc { display: block; max-width: 680px; }
  .topbar--doc { max-width: 680px; }
}

@media (max-width: 560px) {
  .topbar { padding: 20px 20px 0; }
  .topbar__note { display: none; }
  .wrap { padding: 0 20px 72px; }
  .hero { padding: 36px 0 26px; }
  .tool { padding: 18px; border-radius: 16px; }
  .drop { padding: 34px 16px; }
  .drop__title { font-size: .95rem; }
  .seg { grid-template-columns: repeat(3, 1fr); }
  .result__num { font-size: 1.3rem; }
  .prose, .faq { margin-top: 56px; }
  .prose h2, .faq h2 { font-size: 1.06rem; }
  .budget__scale { font-size: .68rem; flex-wrap: wrap; row-gap: 2px; }
  .budget__est { order: 3; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
