:root {
  --paper: #f7f4ec;
  --desk: #e4dfd2;
  --ink: #111111;
  --soft: #2b2a26;
  --mute: #7a7566;
  --line: #c9c4b5;
  --gold: #e0a82e;
  --red: #d1432f;
  --art: #efebdd;
  --serif: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1100px 640px at 50% -8%, rgba(224, 168, 46, 0.16), transparent 58%),
    radial-gradient(800px 520px at 100% 110%, rgba(209, 67, 47, 0.07), transparent 46%),
    var(--desk);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(17, 17, 17, 0.45) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
}

.sheet {
  position: relative;
  width: min(1040px, calc(100% - 2rem));
  margin: 2.25rem auto 3rem;
  padding: clamp(1.4rem, 4vw, 2.8rem) clamp(1.2rem, 4vw, 3rem) clamp(1.6rem, 4vw, 2.6rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 90px),
    var(--paper);
  border-radius: 2px 3px 2px 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 18px 40px rgba(60, 48, 30, 0.1);
}

.top {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
}

.titles { min-width: 0; }

.mark svg {
  display: block;
  width: 92px;
  height: 92px;
}

.titles h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede {
  margin: 0.45rem 0 0;
  color: var(--mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
}

.rule {
  display: block;
  width: 100%;
  height: 14px;
  margin: 0.85rem 0 0.2rem;
}

form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: end;
  margin-top: 1.35rem;
  min-width: 0;
}

.name {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.name label,
.animate {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

input[type="text"] {
  width: 100%;
  margin: 0;
  padding: 0.15rem 0 0.4rem;
  border: none;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  line-height: 1.2;
}

input[type="text"]::placeholder {
  color: #b7b1a4;
  font-style: italic;
}

input[type="text"]:focus {
  outline: none;
  border-bottom-color: var(--red);
}

.actions {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding-bottom: 0.35rem;
}

.animate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.14em;
}

.animate input {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.animate input:checked::after {
  content: "";
  width: 0.55rem;
  height: 0.28rem;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg) translate(0, -1px);
}

.animate input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

button {
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.62rem 1.2rem 0.68rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--gold);
}

button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--gold);
}

button:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--gold);
}

.error {
  margin: 1rem 0 0;
  color: var(--red);
  font-family: var(--serif);
  font-style: italic;
}

.result {
  margin-top: 2rem;
  padding-top: 0.4rem;
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 440px);
  gap: 2rem 2.4rem;
  align-items: start;
  justify-content: center;
}

figure {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.portrait svg,
.trading svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.portrait svg {
  background: var(--art);
  border: 3px solid var(--soft);
  border-radius: 18px 14px 20px 16px;
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.06);
}

.trading svg {
  filter: drop-shadow(7px 12px 0 rgba(43, 42, 38, 0.06));
}

figcaption {
  margin-top: 0.7rem;
  text-align: center;
}

figcaption a {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

figcaption a:hover {
  color: var(--red);
}

.colophon {
  margin: 2.4rem 0 0;
  color: #9a9482;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

@media (max-width: 720px) {
  .sheet { margin: 0.75rem auto 1.5rem; }
  .mark svg { width: 64px; height: 64px; }
  .titles h1 { font-size: 1.85rem; }
  form { grid-template-columns: minmax(0, 1fr); }
  .actions { justify-content: space-between; padding-bottom: 0; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .portrait { max-width: 280px; }
}

@media print {
  body { background: white; }
  body::before { display: none; }
  .sheet { box-shadow: none; margin: 0; width: 100%; }
  form, .rule, .lede, figcaption, .error { display: none; }
  .mark { display: none; }
  .pair { grid-template-columns: 160px 1fr; }
}
