@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "LD Script";
  src: url("fonts/LDScript-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fbf3f0;
  --paper: #fffdfb;
  --ink: #1d2433;
  --ink-2: #4b5165;
  --muted: #747a8a;
  --line: rgba(29, 36, 51, .1);
  --crimson: #d81f55;
  --crimson-deep: #b0153f;
  --t-fast: 160ms;
  --t-enter: 520ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "LD Script", "Snell Roundhand", "Apple Chancery", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Mesh gradient with fine grain. Fixed, painted once, never animated. */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 88% 8%, rgba(244, 102, 138, .5), transparent 70%),
    radial-gradient(45% 50% at 100% 78%, rgba(255, 176, 138, .5), transparent 70%),
    radial-gradient(50% 55% at 4% 100%, rgba(216, 31, 85, .2), transparent 70%),
    radial-gradient(45% 45% at 0% 0%, rgba(255, 214, 224, .9), transparent 70%),
    radial-gradient(40% 40% at 48% 46%, rgba(255, 244, 232, .9), transparent 75%),
    var(--bg);
}
.mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .32;
  mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
}
.brand { display: block; line-height: 0; border-radius: 6px; }
.brand img { height: 36px; width: auto; }
.draft {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.draft .sep { color: var(--crimson); padding: 0 2px; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: "intro sheet" "links sheet";
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 64px;
  row-gap: 36px;
  padding: 32px 0 40px;
}
.intro { grid-area: intro; align-self: end; }
.links { grid-area: links; align-self: start; }
.sheet { grid-area: sheet; align-self: center; }

h1 {
  margin: 0 0 24px;
  font-weight: 800;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: .98;
  letter-spacing: -.035em;
}
h1 .sans { display: block; }
h1 .script {
  position: relative;
  display: inline-block;
  margin: .06em 0 0 .04em;
  font: 400 1.3em/1 var(--script);
  letter-spacing: 0;
  color: var(--crimson);
  transform: rotate(-3deg);
  transform-origin: 0 100%;
  padding-right: .1em;
}
h1 .script svg {
  position: absolute;
  left: 2%;
  right: 0;
  bottom: -.08em;
  width: 96%;
  height: .16em;
  overflow: visible;
}
h1 .script path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: .75;
}
.lede {
  margin: 0;
  max-width: 30em;
  color: var(--ink-2);
  font-size: 18px;
  text-wrap: pretty;
}

/* The sheet of paper the quill draws on */
.sheet {
  position: relative;
  margin: 0;
  padding: 12px 12px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(29, 36, 51, .05), 0 24px 48px -24px rgba(29, 36, 51, .28);
  transform: rotate(1.2deg);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
#draw { display: block; width: 100%; height: auto; overflow: visible; }
.ink path { stroke: var(--crimson-deep); stroke-width: 2.2; }
.ink .bold path { stroke-width: 7; stroke: var(--ink); }
.ink .thin path { stroke-width: 1.6; stroke: var(--muted); }
#quill { pointer-events: none; }
#blots path, #blots circle { fill: var(--ink); }
.blot { transform-box: fill-box; transform-origin: center; animation: splat 220ms var(--ease) both; }
.blot.old { opacity: 0; transition: opacity 400ms linear; }
@keyframes splat { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: .92; } }

.meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: baseline;
  padding: 12px 8px 16px;
  font-size: 15px;
  color: var(--ink-2);
}
.status { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pct { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: rgba(29, 36, 51, .08);
  overflow: hidden;
}
#bar {
  display: block;
  height: 100%;
  background: var(--crimson);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.wet {
  position: absolute;
  top: -18px;
  right: 20px;
  padding: 2px 16px 4px;
  background: var(--ink);
  color: #fff6f3;
  font: 400 22px/1.3 var(--script);
  border-radius: 6px;
  transform: rotate(4deg);
}

/* Links */
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.links-title { grid-column: 1 / -1; margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 16px 44px 16px 20px;
  background: rgba(255, 253, 251, .72);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.card-name { font-weight: 700; font-size: 22px; letter-spacing: -.01em; line-height: 1.2; }
.card-sub { font-size: 14px; color: var(--ink-2); }
.arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  fill: none;
  stroke: var(--crimson-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-fast) var(--ease);
}
.card:active { transform: scale(.98); }
.more {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}
.more a {
  display: inline-block;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(176, 21, 63, .45);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
@media (hover: hover) {
  .card:hover { background: var(--paper); border-color: rgba(176, 21, 63, .4); }
  .card:hover .arrow { transform: translateX(3px); }
  .more a:hover { color: var(--crimson-deep); text-decoration-color: currentColor; }
}
a:focus-visible, .sheet:focus-visible { outline: 2px solid var(--crimson-deep); outline-offset: 3px; }

.foot { padding: 16px 0 max(24px, env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }

/* One entrance on load */
.intro, .links, .sheet { animation: rise var(--t-enter) var(--ease) both; }
.sheet { animation-name: rise-sheet; animation-delay: 80ms; }
.links { animation-delay: 140ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise-sheet { from { opacity: 0; transform: translateY(14px) rotate(0deg); } }

@media (max-width: 860px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "sheet" "links";
    row-gap: 32px;
    padding: 20px 0 32px;
  }
  .intro { align-self: auto; }
  .sheet { max-width: 560px; width: 100%; justify-self: center; transform: rotate(.8deg); border-radius: 16px; padding: 8px 8px 0; }
  .links { max-width: none; }
  h1 { font-size: clamp(44px, 13.4vw, 72px); margin-bottom: 20px; }
  .lede { font-size: 17px; }
  .top { padding-top: max(16px, env(safe-area-inset-top)); }
  .brand img { height: 30px; }
  .draft { font-size: 13px; }
  .wet { font-size: 19px; top: -14px; right: 14px; }
  .meter { font-size: 14px; padding: 8px 8px 14px; }
  .card { padding: 14px 36px 14px 16px; }
  .arrow { right: 14px; }
}
@media (max-width: 380px) {
  .links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .links, .sheet, .blot { animation: none; }
  .card, .arrow, .more a, .blot.old { transition: none; }
  .card:active { transform: none; }
  .card:hover .arrow { transform: none; }
}
