:root {
  --paper: #f4ecdc;
  --paper-2: #ece2cc;
  --card: #f8f2e6;
  --ink: #1c2424;
  --ink-2: #44504e;
  --muted: #7a776a;
  --rule: #d9caa9;
  --gold: #9a6f1f;
  --gold-2: #c8a14a;
  --gold-line: #c2a468;
  --teal: #1f4a4f;
  --teal-deep: #143236;
  --cream: #f3e9d3;
  --caps: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --top-h: 74px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--gold-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* faint paper fibre over everything */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .47  0 0 0 0 .33  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 48px); }

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--caps); font-size: 13px; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
h2 { font-family: var(--display); font-size: clamp(38px, 4.6vw, 62px); line-height: 1.04; letter-spacing: -.005em; }
h2 em, .statement em { font-style: italic; color: var(--teal); }
h3 { font-family: var(--display); font-size: 29px; line-height: 1.1; font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  border: 1px solid var(--ink); border-radius: 1px;
  font-family: var(--caps); font-size: 13.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); background: transparent; white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn::after { content: ""; position: absolute; inset: 3px; border: 1px solid currentColor; opacity: .28; pointer-events: none; }
.btn:hover { background: var(--ink); color: var(--cream); }
.btn-solid { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-solid:hover { background: var(--teal); border-color: var(--teal); }
.btn-paper { background: var(--card); }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.actions.center { justify-content: center; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244, 236, 220, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top-in { display: flex; align-items: center; gap: 34px; height: var(--top-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 38px; height: 38px; }
.brand span { font-family: var(--caps); font-size: 17px; font-weight: 600; letter-spacing: .08em; }
.nav { display: flex; gap: 32px; }
.nav a { text-decoration: none; font-family: var(--caps); font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 0; height: 1px; background: var(--gold); transition: left .3s, right .3s; }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { left: 0; right: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(calc(100svh - var(--top-h)), 980px);
  display: flex; align-items: center;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.kb { position: absolute; inset: 0; animation: kb 32s ease-in-out infinite alternate; transform-origin: 62% 60%; }
.kb picture, .kb img { width: 100%; height: 100%; }
.kb img { object-fit: cover; object-position: 50% 50%; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.06); } }
/* the plate slips in the press now and then */
.slip { position: absolute; inset: 0; background: url("assets/hero-1600.jpg") 50% 50% / cover no-repeat; opacity: 0; pointer-events: none; }
.s1 { clip-path: inset(41% 0 56.5% 0); animation: slip 9s steps(1, end) infinite 4s; }
.s2 { clip-path: inset(63% 0 35.5% 0); animation: slip2 9s steps(1, end) infinite 4s; }
@keyframes slip { 0%, 90%, 100% { opacity: 0; transform: none; } 91% { opacity: 1; transform: translateX(16px); } 93% { opacity: 1; transform: translateX(-7px); } 95% { opacity: 0; } }
@keyframes slip2 { 0%, 91%, 100% { opacity: 0; transform: none; } 92% { opacity: 1; transform: translateX(-20px); } 94% { opacity: 0; } }

.hero-in { position: relative; padding: 48px 0 96px; }
.cartouche {
  position: relative; container-type: inline-size;
  width: min(660px, 56vw); aspect-ratio: 1100 / 717;
  background: url("assets/cartouche.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 18px 30px rgba(20, 40, 42, .28));
  margin-left: -1.5%;
}
.cartouche-text {
  position: absolute; inset: 22% 14% 30% 14%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.kicker { margin: 0 0 2.2cqi; font-family: var(--caps); font-size: 2.05cqi; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.cartouche h1 { font-family: var(--caps); font-weight: 500; line-height: 1.02; color: #1d3a3d; text-transform: uppercase; }
.cartouche h1 .l1, .cartouche h1 .l2 { display: block; white-space: nowrap; }
.cartouche h1 .l1 { font-size: 7.8cqi; letter-spacing: .14em; margin-right: -.14em; }
.cartouche h1 .l2 { font-size: 5.8cqi; letter-spacing: .05em; margin-top: .6cqi; }
.ticker { margin: 1.6cqi 0 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 4.3cqi; line-height: 1; color: var(--gold); }
.hero-actions { margin: 26px 0 0 calc(min(660px, 56vw) * .14); }
.hero-cap {
  position: absolute; right: 24px; bottom: 16px; margin: 0;
  font-style: italic; font-size: 15px; color: rgba(28, 36, 36, .8);
  background: rgba(244, 236, 220, .84); padding: 3px 12px;
}

/* "Glitch": the middle band of the word printed a second time, slipped sideways */
.misprint { position: relative; display: inline-block; }
.misprint > span { display: inline-block; clip-path: inset(0 0 54% 0); }
.misprint::before, .misprint::after { content: attr(data-t); position: absolute; left: 0; top: 0; pointer-events: none; }
.misprint::before { clip-path: inset(67% 0 0 0); }
.misprint::after { clip-path: inset(46% 0 33% 0); transform: translateX(.07em); }

/* ---------- frieze ---------- */
.frieze {
  overflow: hidden; white-space: nowrap;
  background: var(--teal-deep); color: var(--cream);
  border-top: 1px solid var(--gold-line); border-bottom: 1px solid var(--gold-line);
  box-shadow: inset 0 4px 0 var(--teal-deep), inset 0 5px 0 rgba(194, 164, 104, .5), inset 0 -4px 0 var(--teal-deep), inset 0 -5px 0 rgba(194, 164, 104, .5);
  padding: 20px 0;
}
.frieze-track { display: inline-flex; animation: frieze 70s linear infinite; }
.frieze span { font-family: var(--caps); font-size: 15px; letter-spacing: .32em; text-transform: uppercase; }
.frieze i { font-style: normal; color: var(--gold-2); margin: 0 .9em; letter-spacing: 0; }
@keyframes frieze { to { transform: translateX(-50%); } }

/* ---------- intro ---------- */
.intro { padding: clamp(90px, 11vw, 150px) 0 clamp(20px, 3vw, 40px); text-align: center; }
.divider { width: min(520px, 90%); margin: 0 auto 40px; mix-blend-mode: multiply; }
.statement { font-family: var(--display); font-size: clamp(46px, 6.4vw, 88px); line-height: 1; letter-spacing: -.01em; }
.dropcap { text-align: left; margin: 44px auto 0; max-width: 660px; font-size: 21px; color: var(--ink-2); }
.dropcap::first-letter {
  float: left; font-family: var(--caps); font-weight: 500; color: var(--gold);
  font-size: 4.4em; line-height: .82; margin: .07em .1em 0 0;
}

/* ---------- framed cards ---------- */
.frame { position: relative; background: var(--card); border: 1px solid var(--gold-line); }
.frame::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--rule); pointer-events: none; }
.corner { position: absolute; width: 30px; height: 30px; background: url("assets/corner.svg") center / contain no-repeat; pointer-events: none; }
.corner.tl { top: 3px; left: 3px; }
.corner.tr { top: 3px; right: 3px; transform: scaleX(-1); }
.corner.bl { bottom: 3px; left: 3px; transform: scaleY(-1); }
.corner.br { bottom: 3px; right: 3px; transform: scale(-1, -1); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 10vw, 140px) 0; }
.sec-head { text-align: center; max-width: 780px; margin: 0 auto clamp(48px, 6vw, 76px); }

.plates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(22px, 3vw, 40px); }
.plate-card { padding: 44px 34px 42px; text-align: center; transition: transform .45s ease, box-shadow .45s ease; }
.plate-card:hover { transform: translateY(-6px); box-shadow: 0 24px 40px -26px rgba(40, 32, 16, .45); }
.plate-card img { width: min(250px, 100%); margin: 6px auto 18px; mix-blend-mode: multiply; }
.numeral { display: block; font-family: var(--caps); font-size: 20px; color: var(--gold); letter-spacing: .12em; }
.numeral::before, .numeral::after { content: ""; display: inline-block; width: 26px; height: 1px; background: var(--gold-line); vertical-align: middle; margin: 0 12px; }
.plate-card p { margin: 14px auto 0; max-width: 320px; color: var(--ink-2); font-size: 18px; }

/* ---------- figures ---------- */
.figures {
  position: relative; color: var(--cream);
  background-color: var(--teal-deep);
  background-image: repeating-linear-gradient(0deg, rgba(243, 233, 211, .045) 0 1px, transparent 1px 4px);
  padding: clamp(70px, 8vw, 110px) 0;
  border-block: 1px solid var(--gold-line);
}
.figures-in { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(194, 164, 104, .45); border-bottom: 1px solid rgba(194, 164, 104, .45); }
.fig { padding: 40px 18px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.fig + .fig { border-left: 1px solid rgba(194, 164, 104, .3); }
.fig-n { font-family: var(--caps); font-weight: 500; font-size: clamp(42px, 5vw, 66px); line-height: 1; color: var(--cream); }
.fig-n.gold { color: var(--gold-2); }
.fig-l { font-family: var(--caps); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(243, 233, 211, .72); }
.quote { margin: clamp(50px, 6vw, 72px) auto 0; text-align: center; font-family: var(--display); font-style: italic; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.2; color: var(--cream); }

/* ---------- ledger ---------- */
.ledger { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.note { margin: 22px 0 0; color: var(--ink-2); font-size: 20px; }
.ledger-art { width: min(380px, 100%); margin: 30px 0 0 -14px; mix-blend-mode: multiply; }
.calc { padding: 38px 44px 34px; }
.field { display: block; padding: 18px 0 22px; border-bottom: 1px solid var(--rule); }
.field-k { display: block; font-family: var(--caps); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.field input[type="text"] {
  width: 100%; margin: 6px 0 2px; padding: 2px 0;
  border: 0; border-bottom: 1px dashed transparent; background: transparent; color: var(--ink);
  font-family: var(--display); font-size: clamp(34px, 3.8vw, 46px); font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
}
.field input[type="text"]:hover { border-bottom-color: var(--rule); }
.field input[type="text"]:focus { outline: none; border-bottom-color: var(--gold); }
.field small { display: block; font-size: 16px; font-style: italic; color: var(--muted); }
.range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 6px 0 4px; background: transparent; cursor: pointer; --p: 50%; }
.range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--gold) var(--p), var(--rule) var(--p)); }
.range::-moz-range-track { height: 2px; background: var(--rule); }
.range::-moz-range-progress { height: 2px; background: var(--gold); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -13px; border: 0; border-radius: 50%;
  background: url("assets/coin-96.webp") center / cover; box-shadow: 0 2px 4px rgba(40, 30, 10, .35);
  transition: transform .2s;
}
.range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: url("assets/coin-96.webp") center / cover; box-shadow: 0 2px 4px rgba(40, 30, 10, .35); }
.range:active::-webkit-slider-thumb { transform: scale(1.12) rotate(20deg); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--teal); outline-offset: 2px; }
.out { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid var(--rule); }
.out div { padding: 24px 0 22px; }
.out div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.out dt { font-family: var(--caps); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.out dd { margin: 8px 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(27px, 2.6vw, 35px); line-height: 1.05; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.out dd.long { font-size: clamp(22px, 2vw, 27px); }
.out dd.longer { font-size: clamp(18px, 1.6vw, 22px); }
.fine { font-size: 15px; color: var(--muted); margin: 18px 0 0; line-height: 1.5; }

/* ---------- charter ---------- */
.charter-sec { background: var(--paper-2); border-block: 1px solid var(--rule); padding-bottom: clamp(110px, 12vw, 170px); }
.charter { max-width: 900px; margin: 0 auto; padding: clamp(46px, 6vw, 72px) clamp(26px, 6vw, 80px) 92px; }
.charter-head { text-align: center; margin-bottom: 40px; }
.charter-head h2 { font-family: var(--caps); font-size: clamp(28px, 3.4vw, 42px); letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; }
.charter-sub { margin: 14px 0 0; font-style: italic; color: var(--muted); font-size: 19px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin: 0; }
.facts div { display: flex; align-items: baseline; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--caps); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0 0 0 auto; text-align: right; font-size: 19px; }
.ca { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 12px 16px; margin-top: 34px; text-align: center; }
.ca-k { font-family: var(--caps); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.ca code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 16px; color: var(--ink-2); overflow-wrap: anywhere; }
.copy {
  font-family: var(--caps); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
  background: none; border: 1px solid var(--ink); border-radius: 1px; color: var(--ink); padding: 7px 14px; cursor: pointer;
}
.copy:hover { background: var(--ink); color: var(--cream); }
.seal {
  position: absolute; left: 50%; bottom: -44px; width: 88px; height: 88px; margin-left: -44px;
  transform: rotate(-8deg); filter: drop-shadow(0 6px 10px rgba(40, 30, 10, .3));
}

/* ---------- close ---------- */
.close { position: relative; overflow: hidden; padding: clamp(150px, 15vw, 220px) 0 clamp(110px, 12vw, 170px); }
.close-bg { position: absolute; inset: 0; }
.close-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.close-in { position: relative; }
.close-card { max-width: 620px; margin: 0 auto; padding: 150px 40px 52px; text-align: center; box-shadow: 0 30px 60px -30px rgba(15, 35, 38, .55); }
.close-card h2 { margin-bottom: 34px; }
.medal { position: absolute; left: 50%; top: -100px; width: 220px; height: 220px; margin-left: -110px; perspective: 700px; z-index: 2; }
.medal-in { position: relative; width: 100%; height: 100%; transition: transform .25s ease-out; transform-style: preserve-3d; }
.medal img { width: 100%; height: 100%; border-radius: 50%; filter: drop-shadow(0 16px 22px rgba(30, 24, 8, .38)); }
.sheen { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; }
.sheen::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 248, 225, .55), transparent);
  transform: skewX(-12deg); animation: sheen 7s ease-in-out infinite 2s; mix-blend-mode: soft-light;
}
@keyframes sheen { 0%, 70% { left: -60%; } 88%, 100% { left: 130%; } }
.close .hero-cap { bottom: 14px; }

/* ---------- footer ---------- */
.foot { background: var(--teal-deep); color: var(--cream); padding: 64px 0 60px; text-align: center; border-top: 1px solid var(--gold-line); }
.foot-orn { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 26px; }
.foot-orn span { width: 90px; height: 1px; background: var(--gold-line); opacity: .7; }
.foot-orn i { font-style: normal; color: var(--gold-2); font-size: 22px; }
.foot-brand { margin: 0; font-family: var(--caps); font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 30px; margin: 22px 0 0; }
.foot-links a { font-family: var(--caps); font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: rgba(243, 233, 211, .8); }
.foot-links a:hover { color: var(--gold-2); }
.foot-fine { margin: 30px auto 0; max-width: 620px; font-size: 15px; color: rgba(243, 233, 211, .6); }

/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 1s ease, transform 1s ease; }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .plates [data-reveal]:nth-child(2) { transition-delay: .12s; }
.js .plates [data-reveal]:nth-child(3) { transition-delay: .24s; }
.js .figures-in [data-reveal]:nth-child(2) { transition-delay: .1s; }
.js .figures-in [data-reveal]:nth-child(3) { transition-delay: .2s; }
.js .figures-in [data-reveal]:nth-child(4) { transition-delay: .3s; }
.js .plate-card.in:hover { transform: translateY(-6px); }

[hidden] { display: none !important; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .nav { display: none; }
  .plates { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .figures-in { grid-template-columns: repeat(2, 1fr); }
  .fig:nth-child(3) { border-left: 0; }
  .fig:nth-child(n+3) { border-top: 1px solid rgba(194, 164, 104, .3); }
  .ledger { grid-template-columns: 1fr; }
  .ledger-art { display: none; }
  .cartouche { width: min(600px, 80vw); }
  .hero-actions { margin-left: calc(min(600px, 80vw) * .14); }
}
@media (max-width: 700px) {
  :root { --top-h: 64px; }
  body { font-size: 18px; }
  .wrap, .wrap.narrow { width: calc(100% - 32px); }
  .top-in { gap: 14px; }
  .brand span { font-size: 14px; letter-spacing: .06em; }
  .brand img { width: 34px; height: 34px; }
  .hero { min-height: 0; display: block; }
  .hero-bg { position: relative; height: 118vw; max-height: 640px; }
  .slip { display: none; }
  .hero-in { padding: 0 0 52px; margin-top: -16vw; }
  .cartouche { width: calc(100% + 12px); margin-left: -6px; }
  .hero-actions { margin: 22px 0 0; justify-content: center; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-cap { display: none; }
  .frieze { padding: 16px 0; }
  .frieze span { font-size: 13px; }
  .dropcap { font-size: 19px; }
  .plate-card { padding: 38px 24px 36px; }
  .calc { padding: 28px 22px 26px; }
  .out { grid-template-columns: 1fr; }
  .out div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .facts { grid-template-columns: 1fr; }
  .close { padding: 140px 0 90px; }
  .close-card { padding: 124px 22px 40px; }
  .medal { width: 180px; height: 180px; margin-left: -90px; top: -86px; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .kicker { font-size: max(9.5px, 2.05cqi); letter-spacing: .22em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kb, .slip, .frieze-track, .sheen::after { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
