/* ============================================================
   Duty & Pay — stylesheet
   Palette: ink / paper / wash / revenue-green / flag-amber
   Type:    Fraunces (display, restrained) + Public Sans (body)
   ============================================================ */

:root {
  --ink: #10202e;
  --ink-soft: #3d5162;
  --muted: #64798a;
  --paper: #ffffff;
  --wash: #eef3f2;
  --wash-deep: #dde7e4;
  --rule: #d7dfe4;
  --revenue: #0b6e5f;
  --revenue-deep: #06544a;
  --flag: #b45309;
  --flag-wash: #fdf4e7;
  --radius: 4px;
  --measure: 68ch;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.narrow { max-width: var(--measure); }

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem); margin-top: 2.4em; }
h3 { font-size: 1.18rem; margin-top: 1.9em; font-family: "Public Sans", sans-serif; font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

a { color: var(--revenue-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--revenue);
  outline-offset: 2px;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--revenue-deep);
  margin: 0 0 0.7em;
}

.lede {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.small { font-size: 0.87rem; color: var(--muted); }

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  flex-wrap: wrap;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand .perf {
  width: 15px; height: 15px;
  background: var(--revenue);
  border-radius: 2px;
  -webkit-mask: radial-gradient(circle 2.6px at 0 50%, transparent 98%, #000) -1px 0,
                radial-gradient(circle 2.6px at 100% 50%, transparent 98%, #000) 1px 0;
  mask: radial-gradient(circle 2.6px at 0 50%, transparent 98%, #000) -1px 0,
        radial-gradient(circle 2.6px at 100% 50%, transparent 98%, #000) 1px 0;
}

.nav {
  display: flex;
  gap: 6px;
  font-size: 0.92rem;
  flex-wrap: wrap;
  margin-right: -10px;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 11px 10px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--revenue-deep); text-decoration: underline; }

/* ---------- Breadcrumbs ---------- */

.crumbs {
  font-size: 0.83rem;
  color: var(--muted);
  padding: 14px 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs span { padding: 0 6px; }

/* ---------- Hero ---------- */

.hero { padding: 28px 0 8px; }

.updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--revenue-deep);
  background: var(--wash);
  border: 1px solid var(--wash-deep);
  border-radius: 100px;
  padding: 4px 13px;
  margin-bottom: 14px;
}
.updated::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--revenue);
}

/* ---------- Calculator ---------- */

.calc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 26px 0 8px;
  align-items: start;
}

/* Mobile: the answer comes first. Otherwise the result sits below the
   option pills and the user cannot see it while typing a price. */
.calc > .panel { order: 2; }
.calc > [data-out] { order: 1; }

@media (min-width: 860px) {
  .calc { grid-template-columns: 1fr 1fr; gap: 34px; }
  .calc > .panel { order: 1; }
  .calc > [data-out] { order: 2; }
}

/* Tighter hero on small screens so the calculator starts higher up */
@media (max-width: 640px) {
  .hero { padding: 16px 0 4px; }
  .lede { font-size: 1.05rem; }
  .calc { margin-top: 18px; gap: 16px; }
  .panel { padding: 18px 16px; }
}

.panel {
  background: var(--wash);
  border: 1px solid var(--wash-deep);
  border-radius: var(--radius);
  padding: 22px;
}

.field { margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}

input[type="text"], select {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 11px 13px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

input[type="text"]:focus, select:focus { border-color: var(--revenue); }

.money-input { position: relative; }
.money-input span {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.05rem;
  pointer-events: none;
}
.money-input input { padding-left: 27px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }

.choices label {
  margin: 0;
  font-weight: 500;
  font-size: 0.92rem;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  border-radius: 100px;
  padding: 11px 17px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices label:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.choices label:has(input:focus-visible) { outline: 3px solid var(--revenue); outline-offset: 2px; }

/* ---------- The stamp (signature element) ---------- */

.stamp {
  background: var(--paper);
  padding: 26px 24px 22px;
  border: 1px solid var(--rule);
  position: relative;
  /* perforated edge, like a real duty stamp */
  -webkit-mask:
    radial-gradient(circle 7px at 50% 0, transparent 98%, #000) 0 0/28px 100%,
    radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0/28px 100%;
  mask:
    radial-gradient(circle 7px at 50% 0, transparent 98%, #000) 0 0/28px 100%,
    radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0/28px 100%;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  box-shadow: inset 0 0 0 1px var(--wash-deep);
}

.stamp-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.stamp-figure {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.4rem, 1.8rem + 3vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--revenue-deep);
  margin: 0;
}

.stamp-figure.zero { color: var(--revenue); }

.stamp-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.saving {
  display: inline-block;
  background: var(--wash);
  border-radius: var(--radius);
  padding: 5px 11px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--revenue-deep);
  margin-top: 12px;
}

/* ---------- Breakdown ---------- */

.breakdown {
  margin-top: 18px;
  border-top: 1px solid var(--rule);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.94rem;
}
.row dt { color: var(--ink-soft); margin: 0; }
.row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.total { border-bottom: none; font-size: 1.02rem; }
.row.total dt { font-weight: 700; color: var(--ink); }

/* ---------- Working / formula ---------- */

.working {
  background: var(--wash);
  border-left: 3px solid var(--revenue);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 0.9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.working code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.87em;
  background: var(--paper);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Tables ---------- */

/* Tables are wider than a phone. Fade the right edge so it is obvious
   the table scrolls sideways, instead of the content just being cut off. */
.table-scroll {
  overflow-x: auto;
  margin: 18px 0 26px;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--paper) 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat,
    linear-gradient(to left, var(--paper) 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat,
    radial-gradient(farthest-side at 0 50%, rgba(16,32,46,0.14), transparent) left / 12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(16,32,46,0.14), transparent) right / 12px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 0.93rem;
}

caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 8px;
}

th, td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--ink);
}

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }

tbody tr:hover { background: var(--wash); }

/* ---------- Callouts ---------- */

.note {
  background: var(--flag-wash);
  border: 1px solid #f0dcc0;
  border-radius: var(--radius);
  padding: 15px 18px;
  margin: 22px 0;
  font-size: 0.94rem;
}
.note strong { color: var(--flag); }
.note p:last-child { margin-bottom: 0; }

.source {
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  margin-top: 26px;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  margin: 22px 0 30px;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 17px;
  background: var(--paper);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--revenue); transform: translateY(-2px); }
.card a { text-decoration: none; font-weight: 700; font-size: 1.02rem; display: block; color: var(--ink); }
.card a:hover { color: var(--revenue-deep); }
.card p { font-size: 0.87rem; color: var(--muted); margin: 5px 0 0; }

/* ---------- Link grid (programmatic pages) ---------- */

.linkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 18px 0 28px;
}
.linkgrid a {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.linkgrid a:hover { border-color: var(--revenue); color: var(--revenue-deep); background: var(--wash); }

/* ---------- FAQ ---------- */

.faq { margin: 10px 0 30px; max-width: var(--measure); }

details {
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 13px 30px 13px 0;
  list-style: none;
  position: relative;
  font-size: 0.99rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 4px; top: 11px;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--revenue);
}
details[open] summary::after { content: "\2212"; }
details p { font-size: 0.96rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 56px;
  padding: 34px 0 46px;
  background: var(--wash);
  font-size: 0.89rem;
  color: var(--muted);
}
.footer h4 { font-size: 0.76rem; letter-spacing: 0.11em; text-transform: uppercase; margin: 0 0 10px; color: var(--ink); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 6px; }
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 26px;
  margin-bottom: 26px;
}
.footer-legal { border-top: 1px solid var(--wash-deep); padding-top: 18px; }
.footer-legal p { max-width: 78ch; margin-bottom: 0.6em; }

/* ---------- Ad slots ---------- */

.ad {
  margin: 30px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Utility ---------- */

.hide { display: none !important; }
.mt0 { margin-top: 0; }
