/* Yenlens site. Colours come from the green customs labels on parcels from Japan, with
   vermilion seal ink as the one accent. Type: Zen Old Mincho for headings and money,
   Zen Kaku Gothic New for everything else. */

:root {
  --paper: #e6ece4;
  --slip: #fbfcf7;
  --ink: #142a24;
  --ink-soft: #4b5f58;
  --rule: #b9c8bd;
  --seal: #c4351f;
  --seal-ink: #a72b17; /* seal red dark enough for small text */
  --shadow: 20 42 36;
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a17;
    --slip: #17241f;
    --ink: #e2eae4;
    --ink-soft: #a3b5ac;
    --rule: #2e413a;
    --seal: #e2533a;
    --seal-ink: #ff8a72;
    --shadow: 0 0 0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a17; --slip: #17241f; --ink: #e2eae4; --ink-soft: #a3b5ac; --rule: #2e413a;
  --seal: #e2533a; --seal-ink: #ff8a72; --shadow: 0 0 0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: "palt" 0;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--seal-ink); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; border-radius: 2px; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--slip); padding: 8px 12px; z-index: 10; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; }
h2 { font-size: 30px; letter-spacing: -0.01em; }
p { margin: 0; }

/* --- page frame ------------------------------------------------------- */
.top, main, .bottom { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 22px/1 var(--serif); text-decoration: none; }
.top nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.top nav a:not(.button) { text-decoration: none; color: var(--ink-soft); }
.top nav a:not(.button):hover { color: var(--ink); text-decoration: underline; }

.button {
  display: inline-block; background: var(--ink); color: var(--slip); text-decoration: none;
  font: 700 16px/1 var(--sans); padding: 14px 22px; border-radius: 4px;
}
.button:hover { color: var(--slip); background: color-mix(in srgb, var(--ink) 86%, var(--seal)); }
.button.small { font-size: 14px; padding: 10px 14px; }

/* --- hero -------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 64px;
  align-items: start; padding-top: 56px; padding-bottom: 88px;
}
h1 { display: grid; gap: 2px; font-weight: 400; }
h1 .says { font: 400 22px/1.3 var(--sans); color: var(--ink-soft); margin-top: 14px; }
h1 .says:first-child { margin-top: 0; }
h1 .amount {
  font: 400 clamp(52px, 7.4vw, 92px)/1 var(--serif); letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums; color: var(--ink-soft);
}
h1 .amount.door { font-weight: 900; color: var(--ink); }
.lede { margin-top: 36px; max-width: 34em; font-size: 18px; }
.actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; font-size: 15px; }

/* The receipt: a slip with a torn top edge, like one fed out of a till. */
.slip-wrap { margin: 0; }
.slip {
  position: relative; background: var(--slip); padding: 30px 28px 26px;
  box-shadow: 0 1px 0 var(--rule), 0 24px 40px -26px rgb(var(--shadow) / .45);
  --tooth: 9px;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--tooth) * 2) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) 0 var(--tooth) / 100% calc(100% - var(--tooth)) no-repeat;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--tooth) * 2) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) 0 var(--tooth) / 100% calc(100% - var(--tooth)) no-repeat;
}
.slip-card { font: 700 20px/1.3 var(--serif); }
.slip-meta { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* Destination picker drawn like the tick boxes on a customs declaration. */
.dest { border: 0; padding: 0; margin: 20px 0 6px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.dest legend { padding: 0; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; float: left; width: 100%; }
.dest label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.dest input {
  appearance: none; margin: 0; width: 16px; height: 16px; border: 1.5px solid var(--ink);
  border-radius: 1px; display: grid; place-content: center; cursor: pointer; background: transparent;
}
.dest input::after {
  content: ""; width: 10px; height: 10px; transform: scale(0);
  background:
    linear-gradient(45deg, transparent 43%, var(--ink) 43% 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--ink) 43% 57%, transparent 57%);
}
.dest input:checked::after { transform: scale(1); }
.dest input:checked + span { font-weight: 700; }

.lines { width: 100%; border-collapse: collapse; margin-top: 14px; font-variant-numeric: tabular-nums; }
.lines th { text-align: left; font-weight: 400; padding: 7px 12px 7px 0; vertical-align: top; }
.lines td { text-align: right; padding: 7px 0; vertical-align: top; white-space: nowrap; font-family: var(--serif); font-size: 16px; }
.lines tbody tr + tr th, .lines tbody tr + tr td { border-top: 1px dotted var(--rule); }
.lines .note { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.lines tfoot th, .lines tfoot td { border-top: 1.5px dashed var(--ink); padding-top: 14px; font: 700 20px/1.2 var(--serif); }
.lines tfoot td { font-size: 26px; }

.stamp {
  position: absolute; right: 42%; bottom: 10px; width: 64px; height: 64px;
  transform: rotate(-9deg); opacity: .92; mix-blend-mode: multiply; pointer-events: none;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp { mix-blend-mode: normal; opacity: .85; } }
.restamp .stamp { animation: stamp .42s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes stamp {
  0% { transform: rotate(-4deg) scale(1.35); opacity: 0; }
  60% { opacity: .95; }
  100% { transform: rotate(-9deg) scale(1); opacity: .92; }
}
.slip-wrap figcaption { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); max-width: 40em; }

/* --- how it reads a listing ------------------------------------------- */
.reads { padding: 72px 0 80px; border-top: 1px solid var(--rule); }
.reads .intro { max-width: 38em; margin-top: 16px; }
.proof {
  margin: 36px 0 28px; padding: 28px 28px 24px; background: var(--slip); border-left: 3px solid var(--seal);
  display: grid; gap: 8px; max-width: 860px;
}
.proof-label { font-size: 13px; color: var(--ink-soft); }
.proof-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; margin-bottom: 14px; font-size: 22px; line-height: 1.4; }
.proof-line .plain { color: var(--ink-soft); }
.mark { display: inline-grid; gap: 4px; }
.mark .jp { border-bottom: 2px solid var(--seal); padding-bottom: 1px; }
.mark .note { font: 400 13px/1.3 var(--sans); color: var(--seal-ink); }
.result { font: 700 22px/1.3 var(--serif); padding-top: 14px; border-top: 1px solid var(--rule); }
.proof figcaption { font-size: 14px; color: var(--ink-soft); max-width: 44em; }

/* --- facts ------------------------------------------------------------ */
.facts { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 64px; padding: 72px 0; border-top: 1px solid var(--rule); }
.plainlist { list-style: none; margin: 20px 0 0; padding: 0; }
.plainlist li { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.plainlist li:first-child { border-top: 1px solid var(--rule); }
.counts { margin: 20px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 0 28px; }
.counts dt, .counts dd { padding: 12px 0; border-top: 1px solid var(--rule); margin: 0; }
.counts dt { font: 700 17px/1.5 var(--serif); }
.counts dd { max-width: 36em; }

.honest { padding: 72px 0 96px; border-top: 1px solid var(--rule); }
.honest .wide { max-width: 44em; margin-bottom: 24px; }

/* --- footer ----------------------------------------------------------- */
.bottom { border-top: 1px solid var(--rule); padding-top: 28px; padding-bottom: 48px; font-size: 14px; color: var(--ink-soft); display: grid; gap: 16px; }
.bottom p { max-width: 48em; }
.bottom nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* --- legal pages ------------------------------------------------------ */
.doc { padding-top: 32px; padding-bottom: 88px; }
.doc > * { max-width: 720px; }
.doc h1 { font-size: 40px; font-weight: 700; display: block; margin-bottom: 8px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; }
.doc p, .doc li { max-width: 38em; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc table { border-collapse: collapse; width: 100%; margin-top: 16px; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-top: 1px solid var(--rule); }
.doc th { font-weight: 700; white-space: nowrap; }
.todo { background: color-mix(in srgb, var(--seal) 16%, transparent); padding: 0 3px; border-radius: 2px; }

/* --- small screens ---------------------------------------------------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 32px; padding-bottom: 64px; }
  .facts { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 560px) {
  .top, main, .bottom { padding-left: 16px; padding-right: 16px; }
  .top nav a:not(.button) { display: none; }
  .slip { padding: 26px 18px 22px; }
  .stamp { width: 54px; height: 54px; right: 44%; bottom: 12px; }
  .counts { grid-template-columns: 1fr; }
  .counts dd { border-top: 0; padding-top: 0; }
  .proof { padding: 22px 18px 18px; }
  .proof-line { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
