/* Unterpost. Paper, two inks, nothing loaded from outside. */
:root {
  --paper: #EFEBE1;
  --paper-2: #E6E0D2;
  --card: #F7F3EA;
  --ink: #1C1A17;
  --ink-2: #4A463F;
  --ink-3: #6E685E;
  --rule: #CFC8B8;
  --lila: #7A4C9E;
  --lila-soft: #E7DDF0;
  --green: #39FF6E;
  --green-deep: #138A3A;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  /* faint paper grain */
  background-image:
    radial-gradient(rgba(28,26,23,.035) 1px, transparent 1px),
    radial-gradient(rgba(28,26,23,.025) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
  color: var(--ink);
  font: 19px/1.55 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--lila); text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 5.4vw, 60px); }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
b { font-weight: 600; }

.kicker, .note, .counter, .share, .tax, figcaption, nav, .btn, .period button, label, th, .pill, .remaining {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
}
.kicker { text-transform: uppercase; color: var(--lila); margin-bottom: 1.2em; }
.lede { font-size: 21px; color: var(--ink-2); max-width: 40em; }

/* layout */
main > section { max-width: 1120px; margin: 0 auto; padding: 72px 24px; border-top: 1px solid var(--rule); }
main > section:first-child { border-top: 0; }
main > section[id] { scroll-margin-top: 56px; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  background: rgba(239,235,225,.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--mono); font-size: 15px; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; font-weight: 600; }
.top nav { display: flex; gap: 20px; }
.top nav a { text-decoration: none; text-transform: uppercase; }
.top nav a:hover { color: var(--lila); }

/* buttons */
.btn {
  display: inline-block; cursor: pointer;
  padding: 13px 20px; border: 1.5px solid var(--ink); border-radius: 2px;
  background: transparent; color: var(--ink); text-decoration: none; text-transform: uppercase;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--lila); border-color: var(--lila); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 9px 14px; font-size: 12px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; padding-top: 88px !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.counter { color: var(--lila); }
.envelope { margin: 0; }
.envelope svg { width: 100%; height: auto; filter: drop-shadow(0 12px 18px rgba(28,26,23,.14)); }
.env-body { fill: #F4EDDC; stroke: #D9CFB8; stroke-width: 1.5; }
.env-flap { fill: none; stroke: #D3C8AE; stroke-width: 1.5; }
.env-fold { stroke: #E0D7C2; stroke-width: 1.2; }
.address line { stroke: #B9AE95; stroke-width: 1.5; }
.stamp-lila-bg { fill: var(--card); }
.stamp-green-bg { fill: var(--green); }
.card { fill: #FBF8F1; }
.lila-ink { stroke: var(--lila); stroke-width: 1.6; }
.lila-thin { stroke: var(--lila); stroke-width: .7; opacity: .7; }
.frank { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.stamp-label { font: 600 5.6px var(--mono); letter-spacing: .08em; text-anchor: middle; }
.stamp-label.lila { fill: var(--lila); }
.stamp-label.dark { fill: var(--ink); }
.perf { fill: none; stroke: #F4EDDC; stroke-width: 5; stroke-dasharray: .1 5.2; stroke-linecap: round; }
figcaption { color: var(--ink-3); margin-top: 10px; text-align: center; }

/* how */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.how p { color: var(--ink-2); }

/* plans */
.period { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 2px; margin: 8px 0 28px; }
.period button { border: 0; background: transparent; padding: 10px 16px; cursor: pointer; text-transform: uppercase; color: var(--ink); }
.period button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--rule); padding: 28px 24px 24px;
}
.plan.featured { border: 2px solid var(--ink); }
.plan .pill { position: absolute; top: -11px; left: 22px; background: var(--ink); color: var(--paper); padding: 3px 9px; text-transform: uppercase; }
.plan .price { font-size: 44px; line-height: 1; margin: 6px 0 4px; }
.plan .per { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.plan .format { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--lila); margin-bottom: 8px; }
.plan .contents { color: var(--ink-2); flex: 1; }
.plan .stamps-line { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin: 6px 0 18px; }
.plan .limit { font-family: var(--mono); font-size: 13px; color: var(--lila); margin: -8px 0 16px; }
.note { color: var(--ink-3); margin-top: 18px; }

.delivery { margin-top: 44px; max-width: 520px; }
.delivery label { display: block; text-transform: uppercase; margin-bottom: 8px; }
.delivery-row { display: flex; gap: 10px; }
.delivery-answer { margin-top: 12px; min-height: 1.6em; color: var(--ink-2); }

input, select, textarea {
  font: 17px var(--serif); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--ink-3); border-radius: 2px; padding: 11px 12px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--lila); outline-offset: 2px; }
#postcode { flex: 1; min-width: 0; }

/* funds */
.fund-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 28px 0; }
.fund { background: var(--card); border: 1px solid var(--rule); padding: 26px 24px; border-top: 6px solid var(--lila); }
.fund.green { border-top-color: var(--green); }
.fund p { color: var(--ink-2); }
.share { color: var(--ink-3); margin: 0; }
.mini-stamp { width: 40px; height: 52px; float: right; margin: -4px 0 8px 12px; border: 4px dotted var(--card); outline: 1px solid var(--rule); }
.mini-stamp.lila { background: repeating-linear-gradient(to bottom, var(--card) 0 7px, var(--lila) 7px 8px); }
.mini-stamp.green { background: var(--green); }
h3.sub { margin-top: 40px; }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.goal { background: var(--card); border: 1px solid var(--rule); padding: 16px 18px; border-left: 5px solid var(--lila); }
.goal.green { border-left-color: var(--green); }
.goal h4 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.goal-stamp { float: right; width: 46px; height: 60px; object-fit: cover; margin: 0 0 6px 10px; border: 3px dotted var(--card); outline: 1px solid var(--rule); }
.choice-stamp { width: 40px; height: 52px; object-fit: cover; flex: none; border: 3px dotted var(--card); outline: 1px solid var(--rule); }
.sheet-photo { display: block; width: 100%; aspect-ratio: 148 / 105; object-fit: cover; border: 1px solid var(--rule); margin-bottom: 14px; }
.goal p { font-size: 15px; color: var(--ink-2); margin: 0 0 10px; }
.bar { height: 6px; background: var(--paper-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--lila); }
.goal.green .bar > span { background: var(--green-deep); }
.goal .figs { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.ledger { margin-top: 36px; }
.ledger summary { cursor: pointer; font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.ledger-totals { display: flex; gap: 28px; margin: 18px 0; font-family: var(--mono); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
th { text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* sheets */
.chapter-head { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; margin: 10px 0 26px; }
.chapter-head .ch { font-size: 26px; }
.chapter-head .meta { font-family: var(--mono); font-size: 13px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sheet { background: var(--card); border: 1px solid var(--rule); padding: 18px; display: flex; flex-direction: column; }
.sheet-art {
  aspect-ratio: 148 / 105; background: #FBF8F1; border: 1px solid var(--rule);
  padding: 13% 6% 6%; position: relative; margin-bottom: 14px;
}
.sheet-art .margin { position: absolute; top: 4%; left: 6%; right: 6%; font: 600 8px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-art .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; height: 100%; }
.sheet-art .grid i { display: block; border: 2px dotted #FBF8F1; outline: 1px solid rgba(28,26,23,.08); }
.sheet .price { font-size: 32px; line-height: 1; }
.sheet h4 { margin: 8px 0 4px; font-size: 17px; font-weight: 500; }
.sheet p { font-size: 14px; color: var(--ink-2); flex: 1; }
.remaining { color: var(--lila); margin-bottom: 12px; }
.remaining.out { color: var(--ink-3); }

/* gifts */
.gift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gift { background: var(--card); border: 1px solid var(--rule); padding: 26px 24px; }
.gift p { color: var(--ink-2); }
.gift-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* waitlist */
.waitlist { max-width: 760px !important; }
.form-row { display: flex; gap: 10px; margin: 18px 0 12px; }
.form-row input { flex: 1; min-width: 0; }
.check { display: block; position: relative; padding-left: 30px; font-family: var(--serif); font-size: 15px; letter-spacing: 0; color: var(--ink-2); margin-bottom: 16px; }
.check input { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; margin: 0; }
.form-msg { margin-top: 12px; min-height: 1.5em; }
.form-msg.error, .dlg .error { color: #A3342A; }

/* footer */
footer { border-top: 1px solid var(--rule); padding: 40px 24px 56px; text-align: center; color: var(--ink-3); }
.foot-line { font-size: 16px; }
.legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 14px 0; }
.legal a { text-decoration: none; }
.cancel-link { border: 1.5px solid var(--ink-3); padding: 6px 10px; }
.tax { color: var(--ink-3); }

/* dialog */
dialog { border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(620px, calc(100% - 32px)); max-height: calc(100% - 40px); box-shadow: 0 30px 80px rgba(28,26,23,.35); }
dialog::backdrop { background: rgba(28,26,23,.5); }
.dlg { padding: 34px 32px 30px; position: relative; }
.close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 30px; cursor: pointer; color: var(--ink-3); }
.dlg h3 { font-size: 26px; }
.dlg .step { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--lila); margin-bottom: 6px; }
.dlg fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.dlg legend { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); background: var(--card); margin-bottom: 6px; cursor: pointer; font: 16px/1.4 var(--serif); letter-spacing: 0; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice input { margin-top: 4px; flex: none; accent-color: var(--lila); }
.choice > span { flex: 1; display: block; }
.dlg-delivery { display: flex; gap: 8px; margin: 4px 0 8px; }
.dlg-delivery input { flex: 1; min-width: 0; }
.choice small { display: block; color: var(--ink-3); font-size: 14px; }
.choice .bar { margin-top: 6px; }
.fan { display: grid; gap: 6px; }
.more { font-family: var(--mono); font-size: 12px; text-transform: uppercase; background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--lila); }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button { width: 34px; height: 34px; border: 1.5px solid var(--ink); background: var(--card); cursor: pointer; font-size: 18px; }
.stepper output { min-width: 1.5em; text-align: center; font-family: var(--mono); }
.extra-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.summary { background: var(--card); border: 1px solid var(--rule); padding: 14px 16px; font-size: 15px; margin: 8px 0 18px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.summary .total { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 8px; font-weight: 600; }
.dlg-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.dlg .fine { font-size: 13px; color: var(--ink-3); }

/* legal pages */
.page { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.page h1 { font-size: 40px; }
.page h2 { font-size: 24px; margin-top: 1.6em; }
.page p, .page li { color: var(--ink-2); }
.page .todo { background: #FFF3B0; padding: 0 4px; }

@media (max-width: 900px) {
  .hero, .how, .fund-grid, .gift-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .sheet-grid { grid-template-columns: 1fr 1fr; }
  .hero { gap: 32px; padding-top: 48px !important; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  main > section { padding: 52px 16px; }
  .top { padding: 12px 16px; }
  .top nav { gap: 12px; }
  .top nav a { font-size: 11px; }
  .wordmark { font-size: 12px; letter-spacing: .2em; }
  .sheet-grid { grid-template-columns: 1fr; }
  .form-row, .delivery-row { flex-direction: column; }
  .dlg { padding: 30px 18px 22px; }
}
