/* zine-md site. A cutting mat with paper on it: green self-healing mat,
   white sheets, black ink, one highlighter yellow and one magenta cut line.
   Type: Unbounded (display), Atkinson Hyperlegible (text), Courier Prime (labels). */
:root {
  --mat: #1c4a3b;
  --mat-deep: #143a2e;
  --mat-line: rgba(255, 255, 255, .08);
  --mat-line-2: rgba(255, 255, 255, .16);
  --paper: #fbfaf6;
  --ink: #141414;
  --ink-soft: #4a4a46;
  --yellow: #ffe14d;
  --cut: #ff2d87;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, 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 { font: 18px/1.55 var(--text); color: var(--ink); background: var(--paper); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
:focus-visible { outline: 3px solid var(--cut); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--yellow); color: var(--ink); padding: 10px 14px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* The cutting mat: a fine grid, a coarse grid and a ruler edge. */
.mat {
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-2) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: var(--paper);
}

/* Header */
.top { position: relative; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); text-decoration: none; letter-spacing: -.01em; }
.wordmark svg { width: 30px; height: 30px; }
.nav { list-style: none; display: flex; gap: 6px 22px; flex-wrap: wrap; font: 700 15px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--yellow); }

/* Hero */
.hero { padding: 40px 0 96px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.eyebrow { font: 700 14px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--yellow); }
.hero h1 { font: 800 clamp(40px, 5.2vw, 70px)/.98 var(--display); letter-spacing: -.035em; margin: 18px 0 24px; }
.hero h1 .cutline { display: inline-block; position: relative; }
.hero h1 .cutline::after { content: ""; position: absolute; left: -2%; right: -2%; top: 54%; border-top: 4px dashed var(--cut); transform: rotate(-2deg); }
.lede { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; max-width: 31em; }
.mat .lede { color: #e6eee9; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 16px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: 16px 20px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn-quiet { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.btn-quiet:hover { box-shadow: none; background: rgba(255, 255, 255, .08); }
.hero-art { position: relative; aspect-ratio: 1.18; }
.hero-art figure { position: absolute; margin: 0; }
.hero-sheet { left: 0; top: 4%; width: 92%; transform: rotate(-3deg); box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 30px 60px rgba(0, 0, 0, .35); }
.hero-cover { right: 0; bottom: 0; width: 30%; transform: rotate(6deg); box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 24px 48px rgba(0, 0, 0, .4); }
.hero-art img { width: 100%; height: auto; }
.tag { position: absolute; font: 700 13px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; background: var(--paper); color: var(--ink); padding: 6px 9px; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.tag-sheet { left: 3%; bottom: 12%; transform: rotate(-3deg); }
.tag-cover { right: 4%; bottom: -14px; transform: rotate(4deg); background: var(--yellow); }

/* Sections */
.section { padding: 104px 0; }
.section-head { max-width: 760px; margin-bottom: 52px; }
.kicker { font: 700 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--cut); display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 28px; border-top: 3px dashed currentColor; }
.mat .kicker { color: var(--yellow); }
h2 { font: 800 clamp(32px, 4.2vw, 54px)/1.02 var(--display); letter-spacing: -.03em; margin: 16px 0 18px; }
h3 { font: 700 21px/1.2 var(--display); letter-spacing: -.01em; }
.section-head p { font-size: 20px; color: var(--ink-soft); }
.mat .section-head p { color: #d9e5df; }

/* How it works */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 22px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); font: 800 20px/1 var(--display); margin-bottom: 18px; }
.steps p { margin-top: 10px; color: var(--ink-soft); }
.steps code, .install code, p code { font-family: var(--mono); font-size: .92em; background: #efede4; padding: .05em .3em; }

/* Fold guide */
.fold { background: var(--paper); }
.fold-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.sheetmap { background: #fff; border: 2px solid var(--ink); padding: 22px; box-shadow: 8px 8px 0 var(--ink); position: sticky; top: 24px; }
.sheetmap svg { width: 100%; height: auto; }
.sheetmap figcaption { margin-top: 16px; font-size: 16px; color: var(--ink-soft); }
.sheetmap figcaption b { color: var(--ink); }
.fold-steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 28px; counter-reset: fold; }
.fold-steps li { counter-increment: fold; }
.fold-steps .pic { background: #f1efe6; border: 2px solid var(--ink); aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 10px; position: relative; }
.fold-steps .pic::before { content: counter(fold); position: absolute; left: -2px; top: -2px; background: var(--ink); color: var(--paper); font: 800 15px/1 var(--display); padding: 8px 10px; }
.fold-steps .pic svg { width: 100%; height: 100%; }
.fold-steps h3 { font-size: 18px; margin-top: 14px; }
.fold-steps p { font-size: 16px; color: var(--ink-soft); margin-top: 6px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 32px; }
.theme { margin: 0; grid-column: span 2; }
.theme:nth-child(1), .theme:nth-child(2) { grid-column: span 3; }
.theme a { display: block; text-decoration: none; }
.theme .shot { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 36px rgba(0, 0, 0, .35); transition: transform .18s; }
.theme:nth-child(odd) .shot { transform: rotate(-1deg); }
.theme:nth-child(even) .shot { transform: rotate(1deg); }
.theme a:hover .shot { transform: rotate(0) translateY(-4px); }
.theme img { width: 100%; height: auto; }
.theme figcaption { margin-top: 20px; }
.theme figcaption b { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; background: var(--yellow); color: var(--ink); padding: 5px 8px; }
.theme figcaption h3 { margin: 12px 0 6px; font-size: 20px; }
.theme figcaption p { font-size: 16px; color: #d9e5df; }

/* Layouts */
.layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.layout { border: 2px solid var(--ink); background: #fff; display: flex; flex-direction: column; }
.layout .pic { border-bottom: 2px solid var(--ink); background: #e9e7de; aspect-ratio: 1.414; overflow: hidden; display: grid; place-items: center; padding: 18px; }
.layout .pic img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .22)); }
.layout .body { padding: 22px 22px 26px; }
.layout p { margin-top: 8px; color: var(--ink-soft); font-size: 16px; }
.layout .mono { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--cut); }

/* Examples */
.examples { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.example .cover { display: block; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 28px rgba(0, 0, 0, .2); transition: transform .18s; }
.example .cover:hover { transform: translateY(-4px) rotate(-1deg); }
.example img { width: 100%; height: auto; aspect-ratio: 804 / 1136; object-fit: cover; object-position: top; }
.example h3 { font-size: 17px; margin-top: 16px; }
.example p { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.example .links { font: 700 13px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; display: flex; gap: 4px 14px; flex-wrap: wrap; }

/* Install */
.install-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.install-card { background: var(--paper); color: var(--ink); padding: 26px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--mat-deep); }
.install-card p { font-size: 16px; color: var(--ink-soft); margin: 8px 0 16px; }
pre { font: 14px/1.6 var(--mono); background: var(--ink); color: #f4f2ea; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask { margin-top: 44px; max-width: 820px; border-left: 4px solid var(--yellow); padding-left: 22px; font-size: 20px; }
.ask b { font: 700 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--yellow); display: block; margin-bottom: 10px; }

/* Footer */
.foot { background: var(--ink); color: #e9e7de; padding: 64px 0 48px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.foot h2 { font-size: 22px; margin: 0 0 14px; }
.foot ul { list-style: none; display: grid; gap: 8px; }
.foot li span { color: #a9a79e; }
.foot .fine { margin-top: 48px; font-size: 15px; color: #a9a79e; border-top: 1px dashed #55534c; padding-top: 22px; }

/* 404 */
.lost { padding: 72px 0 120px; min-height: calc(100vh - 220px); }
.lost h1 { font: 800 clamp(40px, 6vw, 72px)/1 var(--display); letter-spacing: -.03em; margin: 18px 0; }

@media (max-width: 1020px) {
  .hero-grid, .fold-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 680px; }
  .sheetmap { position: static; max-width: 560px; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme, .theme:nth-child(1), .theme:nth-child(2) { grid-column: span 1; }
  .examples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .install-grid, .layouts { grid-template-columns: minmax(0, 1fr); }
  .layout { flex-direction: row; }
  .layout .pic { flex: 0 0 44%; border-bottom: 0; border-right: 2px solid var(--ink); }
}
@media (max-width: 700px) {
  body { font-size: 17px; }
  .section { padding: 72px 0; }
  .hero { padding: 20px 0 72px; }
  .steps, .fold-steps, .themes, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .layout { flex-direction: column; }
  .layout .pic { flex: none; border-right: 0; border-bottom: 2px solid var(--ink); }
  .nav { gap: 6px 16px; font-size: 13px; }
  .tag-cover { bottom: -10px; }
}
