/* Greetingcard MD: a cutting-mat look. Cool paper, a fine blue grid, ruler ticks, crop marks. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400;1,9..144,600&family=Hanken+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --paper: #f1f3f5;
  --card: #fbfcfd;
  --ink: #101319;
  --ink-2: #454c57;
  --blue: #1d3cf5;
  --blue-soft: #dfe4ff;
  --sun: #ffd23f;
  --rose: #ff4d6d;
  --line: #cfd5dc;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.7rem, 7.2vw, 5.6rem); }
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--blue); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.45rem; letter-spacing: -0.01em; }
.eyebrow { font: 500 .8rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin: 0 0 18px; }
.lede { font-size: 1.25rem; color: var(--ink-2); max-width: 34rem; margin: 22px 0 0; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(241,243,245,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; }
.wordmark img { width: 30px; height: 30px; }
.nav { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--blue-soft); }
.nav .gh { background: var(--ink); color: #fff; }
.nav .gh:hover { background: var(--blue); }

/* Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-block; padding: 14px 22px; border-radius: 999px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:hover { color: #fff; transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn { min-height: 48px; }
.btn-quiet { background: var(--card); color: var(--ink); }
.btn-quiet:hover { color: var(--ink); }

/* Crop-marked sections */
section { padding: 88px 0; position: relative; }
.ticks { height: 14px; background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px); opacity: .35; -webkit-mask: linear-gradient(transparent 0, #000 0); border-top: 1px solid var(--ink); }
.sec-head { max-width: 46rem; margin-bottom: 44px; }
.sec-head p { color: var(--ink-2); font-size: 1.15rem; margin: 16px 0 0; }

/* Hero */
.hero { padding: 64px 0 96px; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.snip { margin-top: 34px; background: var(--ink); color: #e9edf5; border-radius: 14px; padding: 18px 20px; font: 400 .88rem/1.65 var(--mono); max-width: 34rem; box-shadow: 6px 6px 0 var(--blue); white-space: pre-wrap; overflow-wrap: anywhere; }
.snip b { color: var(--sun); font-weight: 500; }
.snip i { color: #8fa0ff; font-style: normal; }
.snip s { color: #7c8594; text-decoration: none; }
.fan { position: relative; aspect-ratio: 1 / 1; max-width: 560px; margin-inline: auto; width: 100%; }
.fan figure { position: absolute; margin: 0; width: 46%; background: #fff; box-shadow: 0 2px 4px rgba(16,19,25,.18), 0 22px 40px rgba(16,19,25,.22); }
.fan figure:nth-child(1) { left: 0; top: 14%; transform: rotate(-9deg); }
.fan figure:nth-child(2) { left: 27%; top: 0; transform: rotate(2deg); z-index: 2; }
.fan figure:nth-child(3) { right: 0; top: 18%; transform: rotate(10deg); z-index: 1; }
.fan::after { content: ""; position: absolute; left: 50%; top: -4%; bottom: -4%; width: 0; border-left: 2px dashed var(--blue); opacity: .45; z-index: 0; }
.fan-note { position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font: 500 .78rem var(--mono); color: var(--ink-2); letter-spacing: .06em; }

/* Pitch */
.pitch { padding: 40px 0 70px; }
.pitch p { font: 400 clamp(1.7rem, 4vw, 3rem)/1.15 var(--serif); letter-spacing: -.02em; max-width: 56rem; margin: 0; }
.pitch mark { background: linear-gradient(transparent 58%, var(--sun) 58%); color: inherit; }

/* Steps */
.steps { display: grid; gap: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: s; list-style: none; padding: 0; margin: 0; }
.step { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 26px; box-shadow: 6px 6px 0 var(--ink); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step::before { counter-increment: s; content: counter(s); width: 38px; height: 38px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); display: grid; place-items: center; font: 600 1.1rem var(--serif); }
.step p { margin: 0; color: var(--ink-2); }
.step pre { margin: 0; background: var(--ink); color: #e9edf5; border-radius: 10px; padding: 14px 16px; font: 400 .8rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.step img { border: 1px solid var(--line); border-radius: 6px; }

/* Folds */
.folds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.fold { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 26px; min-width: 0; }
.fold h3 { margin-bottom: 8px; }
.fold p { color: var(--ink-2); margin: 0 0 16px; }
.fold .pair { display: grid; gap: 12px; }
.fold .pair.two { grid-template-columns: 1fr 1fr; }
.fold img { border: 1px solid var(--line); box-shadow: 0 10px 24px rgba(16,19,25,.14); border-radius: 4px; }
.fold figcaption, .cap { font: 500 .78rem/1.4 var(--mono); color: var(--ink-2); margin-top: 8px; }
.fold figure { margin: 0; min-width: 0; }
.fold ol { margin: 18px 0 0; padding-left: 1.2em; color: var(--ink-2); }
.fold ol li + li { margin-top: 4px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.theme { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.theme .imgs { position: relative; }
.theme .imgs img { border-radius: 6px; border: 1px solid var(--line); }
.theme .in2 { position: absolute; right: -6px; bottom: -10px; width: 46%; border: 2px solid var(--ink) !important; box-shadow: 3px 3px 0 var(--ink); background: #fff; }
.theme h3 { font-size: 1.2rem; margin-top: 8px; }
.theme p { margin: 0; font-size: .92rem; color: var(--ink-2); line-height: 1.45; }
.theme .more { font: 500 .78rem var(--mono); margin-top: auto; }

/* Check */
.check { background: var(--ink); color: #eef1f6; }
.check h2 { color: #fff; }
.check h2 em { color: var(--sun); }
.check .sec-head p { color: #b8c0cd; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.checks li { border: 1px solid #3a4350; border-radius: 14px; padding: 18px 20px; font-size: 1rem; color: #d7dce5; }
.checks li strong { display: block; font: 600 1.15rem var(--serif); color: #fff; margin-bottom: 4px; }
.check code { font: 500 .85rem var(--mono); color: var(--sun); }

/* Install */
.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.inst { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 22px; min-width: 0; }
.inst h3 { font-size: 1.25rem; margin-bottom: 4px; }
.inst p { color: var(--ink-2); margin: 0 0 14px; font-size: .95rem; }
.inst pre, .code { margin: 0; background: var(--ink); color: #e9edf5; border-radius: 10px; padding: 14px 16px; font: 400 .84rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.inst pre + pre { margin-top: 8px; }
.note { margin-top: 26px; color: var(--ink-2); }
code { font-family: var(--mono); font-size: .9em; background: var(--blue-soft); padding: .1em .4em; border-radius: 5px; }

/* Examples */
.examples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.ex { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.ex img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border: 2px solid var(--ink); border-radius: 8px; background: #fff; transition: transform .15s; }
.ex:hover img { transform: translateY(-4px) rotate(-1deg); }
.ex strong { font: 600 1.1rem var(--serif); }
.ex span { font: 500 .78rem var(--mono); color: var(--ink-2); }

/* Footer */
.foot { padding: 56px 0 70px; border-top: 2px solid var(--ink); background: var(--card); }
.foot h2 { font-size: 1.6rem; margin-bottom: 16px; }
.more-skills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 30px; }
.more-skills a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; background: #fff; }
.more-skills a:hover { background: var(--sun); }
.foot p { color: var(--ink-2); margin: 0; }
.lost { padding: 120px 0; flex: 1; display: flex; align-items: center; }
.lost .wrap { width: min(1160px, 100% - 40px); }
.check :focus-visible, .snip:focus-visible { outline-color: var(--sun); }
.theme .more, .ex { min-height: 44px; }
.theme .more { display: inline-flex; align-items: center; }

@media (max-width: 1100px) {
  .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .examples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  section { padding: 64px 0; }
  .hero-grid, .folds { grid-template-columns: minmax(0, 1fr); }
  .steps, .install, .checks { grid-template-columns: minmax(0, 1fr); }
  .themes, .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fan { max-width: 440px; margin-bottom: 30px; }
}
@media (max-width: 520px) {
  .nav li:not(:last-child) { display: none; }
  .themes, .examples { gap: 12px; }
  .step, .fold, .inst { padding: 18px; }
  .btn { padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
