/* flashcard-md site: a green cutting mat, a yellow ruler, cut marks. */
:root {
  --mat: #164536;
  --mat-deep: #0f3328;
  --grid: rgba(222, 255, 236, .09);
  --grid-strong: rgba(222, 255, 236, .2);
  --ruler: #f5d43a;
  --paper: #f6f6f1;
  --card: #ffffff;
  --ink: #10201b;
  --muted: #4c5c56;
  --line: #d9ddd6;
  --red: #d8433f;
  --head: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--paper); color: var(--ink); font: 18px/1.55 var(--body); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--ruler); outline-offset: 3px; border-radius: 2px; }
.paperband :focus-visible, main > section:not(.mat) :focus-visible { outline-color: var(--ink); }
code, pre, kbd { font-family: var(--mono); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--ruler); color: var(--ink); padding: 10px 16px; font-weight: 700; border-radius: 4px; }
.skip:focus { top: 12px; }

/* The cutting mat: a fine grid, a stronger grid every 5, and a ruler edge. */
.mat {
  position: relative;
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: #eef6f1;
}
.ruler { height: 22px; background: var(--ruler) repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px) bottom / 100% 7px no-repeat; position: relative; }
.ruler::after { content: ""; position: absolute; inset: auto 0 0; height: 12px; background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 60px); }

.top { position: relative; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 800 20px/1 var(--head); font-stretch: 112%; letter-spacing: -.01em; text-decoration: none; }
.wordmark img { width: 28px; height: 28px; }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; font: 500 15px/1 var(--mono); }
.nav a { text-decoration: none; padding: 6px 0; display: inline-block; }
.nav a:hover { text-decoration: underline; text-decoration-color: var(--ruler); }

/* Hero */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { font: 600 13px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ruler); }
h1 { font: 800 clamp(40px, 6.4vw, 80px)/.96 var(--head); font-stretch: 118%; letter-spacing: -.03em; margin: 18px 0 22px; text-wrap: balance; }
h1 em { font-style: normal; background: var(--ruler); color: var(--ink); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lede { font-size: clamp(18px, 2vw, 21px); max-width: 34em; color: #cfe1d8; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 16px/1 var(--body); padding: 15px 22px; border-radius: 6px; text-decoration: none; background: var(--ruler); color: var(--ink); border: 2px solid var(--ruler); }
.btn:hover { background: #ffe15e; }
.btn-quiet { background: transparent; color: inherit; border-color: currentColor; }
.btn-quiet:hover { background: rgba(255, 255, 255, .08); }
.one-liner { margin-top: 22px; font-size: 15px; color: #cfe1d8; }
.one-liner code { background: var(--mat-deep); border: 1px solid var(--grid-strong); padding: 6px 10px; border-radius: 4px; color: #fff; word-break: break-all; }

/* The hero desk: real cards, scattered, with crop marks around the top one. */
.desk { position: relative; aspect-ratio: 1 / .92; }
.desk a { position: absolute; display: block; box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 24px 50px rgba(0, 0, 0, .38); transition: transform .35s cubic-bezier(.3, .7, .2, 1); }
.desk a:hover, .desk a:focus-visible { transform: translateY(-6px) rotate(var(--r)) scale(1.02); z-index: 3; }
.desk .d1 { --r: -5deg; width: 62%; left: 0; top: 4%; transform: rotate(var(--r)); }
.desk .d2 { --r: 4deg; width: 30%; right: 2%; top: 0; transform: rotate(var(--r)); }
.desk .d3 { --r: -2deg; width: 54%; left: 8%; top: 47%; transform: rotate(var(--r)); }
.desk .d4 { --r: 7deg; width: 36%; right: 3%; top: 58%; transform: rotate(var(--r)); z-index: 2; }
.crop { position: absolute; inset: -14px; pointer-events: none; }
.crop i { position: absolute; width: 12px; height: 12px; border: 0 solid var(--ruler); }
.crop i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.crop i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.crop i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.crop i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

/* Sections on paper */
section { scroll-margin-top: 12px; }
.sec { padding: clamp(56px, 8vw, 104px) 0; }
.sec + .sec { border-top: 1px dashed #b9c2bc; }
.kicker { font: 600 13px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
h2 { font: 800 clamp(30px, 4.2vw, 48px)/1.02 var(--head); font-stretch: 112%; letter-spacing: -.025em; margin: 12px 0 16px; text-wrap: balance; }
h3 { font: 800 21px/1.2 var(--head); font-stretch: 108%; letter-spacing: -.01em; }
.section-lede { max-width: 40em; color: var(--muted); font-size: 19px; }

.pitch { padding: clamp(40px, 6vw, 72px) 0; background: var(--card); border-bottom: 1px solid var(--line); }
.pitch p { font: 700 clamp(24px, 3.4vw, 38px)/1.18 var(--head); font-stretch: 104%; letter-spacing: -.015em; max-width: 26em; text-wrap: balance; }
.pitch mark { background: linear-gradient(transparent 58%, var(--ruler) 58%); color: inherit; }

/* How it works */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 32px); margin-top: 40px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.steps li::before { content: counter(step); font: 800 15px/1 var(--mono); width: 34px; height: 34px; display: grid; place-items: center; background: var(--mat); color: var(--ruler); border-radius: 50%; }
.steps p { color: var(--muted); font-size: 17px; }
.steps pre { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; overflow-x: auto; white-space: pre; }
.steps .shot { display: block; max-width: 440px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }

/* Duplex proof: the front sheet and its back sheet */
.duplex { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(18px, 3vw, 36px); align-items: start; margin-top: 40px; }
.duplex figure { background: var(--card); border: 1px solid var(--line); padding: 10px; border-radius: 4px; }
.duplex figcaption, .gallery figcaption, .fold figcaption { font: 500 14px/1.45 var(--mono); color: var(--muted); margin-top: 10px; }
.duplex figcaption b, .gallery figcaption b { color: var(--ink); }
.duplex .copy { display: flex; flex-direction: column; gap: 14px; color: var(--muted); }
.duplex .copy strong { color: var(--ink); }

/* Themes: each card flips to its back */
.gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(22px, 3vw, 40px) clamp(18px, 2.4vw, 32px); margin-top: 44px; align-items: end; }
.gallery figure { grid-column: span 2; }
.gallery figure.wide { grid-column: span 3; }
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1400px; text-align: start; font: inherit; color: inherit; border-radius: 4px; }
.flip-inner { display: grid; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.flip-inner img { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 14px 32px rgba(16, 32, 27, .18); }
.flip-inner img + img { transform: rotateY(180deg); }
.flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } .flip[aria-pressed="true"]:hover .flip-inner { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }
.gallery .label { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gallery .label span { color: var(--red); }

/* Features */
.facts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 36px; border-top: 2px solid var(--ink); }
.facts li { padding: 20px 22px 22px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.facts li b { display: block; color: var(--ink); font: 800 18px/1.25 var(--head); font-stretch: 106%; margin-bottom: 6px; }

/* Study mode on the mat */
.study-band { padding: clamp(56px, 8vw, 104px) 0; }
.study-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.study-grid .lede { margin-top: 8px; }
.study-grid h2 { color: #fff; }
.study-grid .kicker { color: var(--ruler); }
.keys { list-style: none; margin-top: 22px; display: grid; gap: 10px; color: #cfe1d8; font-size: 17px; }
kbd { display: inline-block; min-width: 2.1em; text-align: center; font-size: 13px; padding: 3px 7px; border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 #9fb0a8; margin-inline-end: 8px; }
.screen { border-radius: 8px; overflow: hidden; border: 1px solid var(--grid-strong); box-shadow: 0 30px 70px rgba(0, 0, 0, .4); }
.study-band a.btn { margin-top: 26px; }

/* Install */
.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.install > div { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--mat); border-radius: 4px; padding: 22px; min-width: 0; }
.install pre { margin-top: 14px; background: var(--mat-deep); color: #e9f5ee; padding: 14px 16px; border-radius: 4px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.install p { color: var(--muted); font-size: 16px; margin-top: 10px; }
.note { margin-top: 18px; color: var(--muted); }

/* Examples */
.decks { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-top: 32px; border-top: 2px solid var(--ink); }
.decks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.decks h3 { font-size: 19px; }
.decks p { grid-column: 1 / -1; color: var(--muted); font-size: 16px; }
.decks .links { display: flex; gap: 14px; font: 500 14px/1 var(--mono); flex-wrap: wrap; }
.decks .links a { padding: 4px 0; }
.decks .theme { font: 500 12.5px/1 var(--mono); color: var(--red); letter-spacing: .06em; text-transform: uppercase; }

/* Footer */
.foot { padding: 48px 0 56px; }
.foot-row { display: grid; grid-template-columns: auto 1fr; gap: 14px 48px; align-items: start; }
.foot p { color: #cfe1d8; font-size: 16px; }
.foot .more { grid-column: 2; }
.foot .more a { color: #fff; }

/* 404 */
body:has(.lost) { background: var(--mat-deep); }
.lost { padding: clamp(56px, 10vw, 120px) 0; min-height: 60vh; }

@media (max-width: 980px) {
  .hero-grid, .study-grid { grid-template-columns: minmax(0, 1fr); }
  .desk { max-width: 620px; aspect-ratio: 1 / .8; }
  .steps, .install { grid-template-columns: minmax(0, 1fr); }
  .duplex { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .duplex .copy { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery figure, .gallery figure.wide { grid-column: span 1; }
  .gallery figure.wide { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .nav { font-size: 13.5px; gap: 4px 16px; }
  .facts, .decks { grid-template-columns: minmax(0, 1fr); }
  .decks li { grid-template-columns: minmax(0, 1fr); }
  .foot-row { grid-template-columns: minmax(0, 1fr); }
  .foot .more { grid-column: auto; }
  .desk { aspect-ratio: 1 / 1.02; }
}
