@font-face {
  font-family: "Grenze Gotisch";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/grenze-gotisch-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Vollkorn";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/vollkorn-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Vollkorn";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/vollkorn-italic-latin.woff2") format("woff2");
}

:root {
  --plum: #3a1442;
  --plum-deep: #260b2c;
  --gilt: #d9b54a;
  --board: #f8f9fb;
  --ink: #241628;
  --ink-soft: #5a4560;
  --rule: #c7c2d4;
  --red: #b81d36;
  --display: "Grenze Gotisch", "Vollkorn", Georgia, serif;
  --text: "Vollkorn", Georgia, "Times New Roman", serif;
  --satin: url("assets/plates/satin-band.webp");
  --flowers: url("assets/plates/flower-field.webp");
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: var(--plum) #ece5ee; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 30px clamp(12px, 4.4vw, 64px) 30px;
  background: var(--plum-deep) var(--flowers) 0 0 / 35rem auto repeat;
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  font-variant-numeric: lining-nums;
  caret-color: var(--plum);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--plum); color: var(--board); }
h1, h2, h3, p, dl, dd { margin: 0; }
b { font-weight: 700; }
a { color: var(--plum); text-decoration-color: color-mix(in srgb, var(--plum) 45%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--plum); }
a, button, label[for] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 2px; }
.caps { font-family: var(--text); font-weight: 700; font-size: .78em; letter-spacing: .01em; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--plum); color: var(--board); font-weight: 600; text-decoration: none; }
.skip:focus { top: 1rem; outline-color: var(--gilt); }

/* The newspaper sheet pinned on the flower board */
.sheet {
  position: relative;
  max-width: 1312px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.3vw, 56px) 3rem;
  background: var(--board);
  box-shadow: 0 0 0 2px var(--plum-deep), 0 4px 10px rgba(38, 11, 44, .35);
}

/* Masthead: the sash crosses the sheet's head, its left end under the wreath */
.mast { position: relative; height: 178px; }
.band {
  position: absolute;
  left: 32px;
  top: 30px;
  width: min(960px, calc(100% - 320px));
  height: 112px;
  transform: rotate(-3deg);
  transform-origin: 0 50%;
}
.tail { clip-path: polygon(0 0, 100% 0, calc(100% - 46px) 50%, 100% 100%, 0 100%); }
/* The sash's shadow is its own blurred layer, so the lettering never sits inside a filter */
.shade { z-index: 2; translate: 0 11px; filter: blur(7px); opacity: .5; }
.shade i { position: absolute; inset: 0; background: var(--plum-deep); }
.sash {
  z-index: 3;
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.9vw, 28px);
  padding: 0 60px 4px 130px;
  background: var(--satin) center / 100% 100% no-repeat;
}
/* Both lines scale with the viewport so the strapline stays clear of the sash's tail */
.name { font: 700 clamp(3.2rem, 4.6vw, 4.25rem)/1 var(--display); color: var(--gilt); text-shadow: 0 0 1px rgba(38, 11, 44, .4); padding-bottom: 6px; white-space: nowrap; }
.strap { font: italic 400 clamp(1rem, 1.42vw, 1.3rem)/1.2 var(--text); color: var(--gilt); white-space: nowrap; overflow: hidden; text-overflow: clip; min-width: 0; }
.wreath {
  position: absolute;
  left: -54px;
  top: -6px;
  z-index: 4;
  width: 184px;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(38, 11, 44, .4));
}
.nav { position: absolute; top: 40px; right: 0; z-index: 5; display: flex; align-items: center; gap: 30px; }
.nav a { display: inline-block; padding: .6rem 0; font: 600 1.125rem/1 var(--text); }
.stamp {
  padding: .5rem .85rem .42rem;
  border: 3px double var(--plum);
  border-radius: 3px;
  color: var(--plum);
  font: 700 .8rem/1 var(--text);
  letter-spacing: .18em;
  text-transform: uppercase;
  transform: rotate(-6deg);
}

/* Column heads, ruled like a newspaper's */
.head {
  padding: 16px 0 10px;
  text-align: center;
  border-bottom: 1px solid var(--plum);
  background:
    linear-gradient(var(--plum) 0 0) 0 0 / 100% 3px no-repeat,
    linear-gradient(var(--plum) 0 0) 0 6px / 100% 1px no-repeat;
  font: 700 2.75rem/1 var(--display);
  color: var(--plum);
}
.head-small { margin-top: 3.4rem; font-size: 2rem; }

/* The notices */
.notices {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "lead draw season" "lead burn ask";
  margin-top: 26px;
}
.n { padding: 0 30px 24px; border-left: 1px solid var(--plum); text-align: center; }
.n h2, .n h3 { font: 700 2.125rem/1.05 var(--display); color: var(--plum); margin-bottom: 12px; text-wrap: balance; }
.n p { text-wrap: pretty; }
.n p + p { margin-top: 8px; }
.draw { grid-area: draw; }
.season { grid-area: season; }
.burn { grid-area: burn; }
.ask { grid-area: ask; }
.burn, .ask { border-top: 1px solid var(--plum); padding-top: 22px; }
.day { font: italic 400 1.3rem/1.2 var(--text); }
.big { font: 700 3.75rem/1 var(--display); color: var(--plum); }
.big .caps { font-size: 1.2rem; margin-left: 2px; }
.n .big + p { margin-top: 4px; }

/* Lead notice: the working calculator */
.lead { grid-area: lead; padding: 0 44px 24px 0; text-align: center; }
.lead h2 { font: 700 4rem/1 var(--display); color: var(--plum); text-wrap: balance; }
.intro { font-size: 1.2rem; line-height: 1.5; margin: 16px auto 0; max-width: 30em; text-wrap: balance; }
.calc { margin: 24px 0 0; text-align: left; }
.row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.row label { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 1.125rem; }
.row label::after { content: ""; flex: 1; min-width: 1rem; margin-top: 10px; border-bottom: 2px dotted var(--rule); }
.row input {
  flex: none;
  width: 8.25rem;
  height: 2.75rem;
  padding: 0 14px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: 600 1.3rem/1 var(--text);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  transition: border-color .2s var(--ease);
}
.row input:hover { border-color: var(--plum); }
.row input:focus-visible { outline-offset: 2px; border-color: var(--plum); }
.row input[aria-invalid="true"] { border: 2px dashed var(--plum); }
.result {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--plum);
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 16px;
  font: italic 400 1.875rem/1 var(--text);
}
.result .count { display: inline-flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.result output { font: 700 6.5rem/.9 var(--display); font-style: normal; color: var(--red); font-variant-numeric: lining-nums; }
.working { margin-top: 12px; text-align: center; color: var(--ink-soft); font-variant-numeric: tabular-nums lining-nums; }
.calc-msg { margin-top: 6px; text-align: center; font: italic 400 1rem/1.4 var(--text); color: var(--ink-soft); }
.calc-msg.is-error { color: var(--plum); font-weight: 600; }

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 3.5rem;
  margin-top: 16px;
  padding: 0 28px 3px;
  background: var(--satin) center / 100% 100% no-repeat;
  color: var(--gilt);
  font: 700 1.125rem/1 var(--text);
  text-decoration: none;
  text-shadow: 0 0 1px rgba(38, 11, 44, .4);
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.cta:hover { color: #ecd27f; }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline-offset: 4px; }

/* Further notices: centred like the column above, the fee split given the most room,
   and the risk notice boxed in a double rule the way a paper sets its formal notices */
.more {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  margin-top: 26px;
}
.more .n:first-child { border-left: 0; padding-left: 0; }
.more .n h3 { font-size: 1.75rem; }
.more .n a { display: inline-block; margin-top: 10px; padding: .4rem 0; }
.fee h3 { font-size: 2.125rem; }
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--plum); }
.split div { padding: 12px 4px 0; }
.split div + div { border-left: 1px dotted var(--rule); }
.split dt { font: 700 3rem/1 var(--display); color: var(--plum); }
.split dd { margin-top: 4px; font-size: .95rem; line-height: 1.3; color: var(--ink-soft); }
.more .risk { margin-left: 30px; padding: 20px 22px 22px; border: 3px double var(--plum); }
.pending { font-style: italic; color: var(--ink-soft); }

/* Footer: the sheet ends, the sash's end lies on the flowers */
.foot {
  max-width: 1312px;
  margin: 30px auto 0;
  padding: 2.4rem 1.5rem 1.6rem;
  text-align: center;
  background: var(--board);
  box-shadow: 0 0 0 2px var(--plum-deep), 0 4px 10px rgba(38, 11, 44, .35);
}
.foot p { margin: 0 0 .6rem; }
.foot-sash { display: flex; align-items: center; justify-content: center; margin: 0 0 1.2rem; }
.foot-wreath { position: relative; z-index: 1; width: 5.6rem; height: auto; margin-right: -1.4rem; filter: drop-shadow(0 5px 7px rgba(38, 11, 44, .35)); }
.foot-name {
  padding: .9rem 2.4rem 1.1rem 2.6rem;
  font: 700 2.6rem/1 var(--display);
  color: var(--gilt);
  text-shadow: 0 0 1px rgba(38, 11, 44, .4);
  background: var(--satin) center / 100% 100% no-repeat;
  box-shadow: 0 8px 12px -4px rgba(38, 11, 44, .35);
}
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 1.6rem; }
.foot a { display: inline-block; padding: .5rem 0; }

@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: press .6s var(--ease) .25s both; }
  @keyframes press {
    from { transform: rotate(-6deg) scale(1.18); opacity: .3; }
    to { transform: rotate(-6deg) scale(1); opacity: 1; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Narrow laptops: the sash keeps the name only */
@media (max-width: 76rem) {
  .strap { display: none; }
}

/* Tablets: the lead notice takes the full width */
@media (max-width: 68rem) {
  /* The nav drops below the sash so the sash's tail never covers it */
  .mast { height: 214px; }
  .band { width: calc(100% - 64px); }
  .nav { top: 152px; }
  .strap { display: none; }
  .notices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "lead lead" "draw season" "burn ask"; }
  .lead { padding: 0 0 28px; border-bottom: 1px solid var(--plum); margin-bottom: 24px; }
  .draw, .burn { border-left: 0; }
  .burn, .ask { padding-top: 22px; }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .more .n:nth-child(3) { border-left: 0; padding-left: 0; }
  .more .n:nth-child(2n) { padding-right: 0; }
  .more .risk { margin-left: 30px; padding: 20px 22px 22px; }
}

/* Phones: one notice after another */
@media (max-width: 44rem) {
  body { font-size: 1rem; padding-top: 14px; }
  .mast { height: 168px; }
  .band { left: 12px; top: 18px; width: calc(100% - 12px); height: 78px; transform: rotate(-3deg); }
  .sash { padding-left: 84px; }
  .name { font-size: 2.6rem; }
  .wreath { left: -22px; top: 2px; width: 108px; }
  .nav { top: 116px; right: 0; gap: 18px; }
  .stamp { font-size: .72rem; }
  .head { font-size: 2.2rem; }
  .head-small { font-size: 1.7rem; }
  .notices { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "draw" "season" "burn" "ask"; }
  .n, .more .n { border-left: 0; border-top: 1px solid var(--plum); padding: 22px 0; }
  .draw { border-top: 0; padding-top: 0; }
  .lead h2 { font-size: 3rem; }
  .row { flex-wrap: wrap; gap: 6px 12px; }
  .row label::after { display: none; }
  .row input { width: 100%; }
  .result { flex-direction: column; align-items: center; gap: 6px; }
  .result output { font-size: 5rem; }
  .more { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .more .n:first-child { border-top: 0; }
  .more .risk { margin: 22px 0 0; padding: 20px 18px; border: 3px double var(--plum); }
}
