/* gndigitize: project page. Mobile-first; see docs/CLAUDE.md for the design rules. */

:root {
  /* palette: a notebook page */
  --paper: #F5F1E8;     /* page background */
  --sheet: #FBF9F4;     /* raised surfaces, the traced sheet */
  --ink: #1D1C1A;       /* text, dark section */
  --graphite: #5E5A52;  /* secondary text */
  --rule: #C9D5E3;      /* hairlines: ruled-paper blue */
  --margin: #B8371F;    /* the one accent: notebook margin red */

  --rule-ink: #3A3833;  /* hairlines on the dark section */
  --paper-dim: #CFC9BC; /* secondary text on the dark section */

  /* type */
  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-display: clamp(2.6rem, 1.6rem + 4.6vw, 5.25rem);
  --t-h2: clamp(1.9rem, 1.35rem + 2.3vw, 3.1rem);
  --t-h3: 1.0625rem;
  --t-lede: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --t-body: 1.0625rem;
  --t-small: 0.8125rem;

  /* space */
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(72px, 9vw, 140px);
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

a { color: inherit; text-decoration-color: var(--margin); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

code { font-family: var(--f-mono); font-size: 0.88em; }

:focus-visible { outline: 2px solid var(--margin); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  letter-spacing: 0.02em;
  color: var(--graphite);
  margin-bottom: 1.1rem;
}
.eyebrow code { font-size: 1em; color: var(--ink); }

h1, h2 {
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-weight: 380;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h1 { font-size: var(--t-display); line-height: 1.02; }
h2 { font-size: var(--t-h2); line-height: 1.08; }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }

.caption {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--graphite);
}
.caption strong { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ masthead */

.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead__row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 24px; }

.wordmark {
  font-family: var(--f-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
}
.wordmark em { font-style: italic; font-weight: 340; }
.wordmark--small { font-size: 1.125rem; }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px;
  background: none; border: 0; color: var(--ink);
  font: 500 var(--t-small)/1 var(--f-mono); letter-spacing: 0.02em; cursor: pointer;
}
.menu-toggle__bars, .menu-toggle__bars::before {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative;
  transition: transform 0.2s ease;
}
.menu-toggle__bars { top: -3px; }
.menu-toggle__bars::before { content: ""; position: absolute; top: 6px; left: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(-6px) rotate(-90deg); }

.nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 8px var(--gutter) 20px;
  flex-direction: column;
}
.nav.is-open { display: flex; }
.nav a {
  display: flex; align-items: center; min-height: 48px;
  text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--rule);
}
.nav a:last-child { border-bottom: 0; }
.nav__ext::after { content: "\2197"; margin-left: 6px; color: var(--margin); }

@media (min-width: 820px) {
  .menu-toggle { display: none; }
  .nav {
    display: flex; position: static; flex-direction: row; gap: 28px;
    padding: 0; border: 0; background: none;
  }
  .nav a { min-height: 44px; border: 0; font-size: 0.9375rem; font-weight: 500; }
  .nav a:hover { text-decoration: underline; }
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  gap: 48px;
  padding-top: clamp(40px, 7vw, 96px);
  padding-bottom: var(--section);
}

.hero__text { max-width: 34rem; }
.hero h1 { margin-bottom: 1.5rem; }
.lede { font-size: var(--t-lede); line-height: 1.55; color: #34322E; max-width: 31rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #000; }
.btn--line { color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }

.hero__meta { margin-top: 1.5rem; font-family: var(--f-mono); font-size: var(--t-small); color: var(--graphite); }
.hero__meta span { white-space: nowrap; }
.hero__meta span:not(:last-child)::after { content: "\00b7"; margin: 0 0.45em; }

/* the specimen: the flattened page with its strokes, and the photo as taken tossed on top
   of its empty lower-left corner */
.specimen { position: relative; }
.specimen__stage { --overhang: clamp(44px, 9vw, 112px); position: relative; padding-left: 9%; }

.specimen__snap {
  position: absolute; left: 0; bottom: calc(-1 * var(--overhang)); width: 27%; z-index: 2;
  transform: rotate(-5deg); transform-origin: 20% 80%;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(29, 28, 26, 0.2), 0 12px 28px -14px rgba(29, 28, 26, 0.45);
  background: var(--sheet); padding: 5px 5px 26px;
}
.specimen__snap .tag {
  position: absolute; left: 8px; bottom: 6px;
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.02em; color: var(--graphite);
  white-space: nowrap;
}

.compare {
  position: relative;
  aspect-ratio: 1100 / 1379;
  overflow: hidden;
  background: var(--sheet);
  box-shadow: 0 1px 2px rgba(29, 28, 26, 0.12), 0 24px 48px -28px rgba(29, 28, 26, 0.45);
  touch-action: pan-y;
}
.compare__photo, .compare__ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare__photo { object-fit: cover; }
.compare__ink {
  background: var(--sheet);
  clip-path: inset(0 0 0 var(--pos));
}
.compare__ink > img, .compare__ink > svg { width: 100%; height: 100%; }
.compare__ink .hl { stroke-opacity: 0.55; mix-blend-mode: multiply; }

.compare__label {
  position: absolute; top: 12px;
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 4px 8px; background: var(--sheet); color: var(--ink);
  pointer-events: none;
}
.compare__label--l { left: 12px; }
.compare__label--r { right: 12px; }

.compare__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 1.5px; margin-left: -0.75px; background: var(--margin);
  pointer-events: none;
}
.compare__handle span {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--sheet); border: 1.5px solid var(--margin);
}
.compare__handle span::before, .compare__handle span::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px;
  border: solid var(--margin); border-width: 0 0 1.5px 1.5px;
}
.compare__handle span::before { left: 11px; transform: translateY(-50%) rotate(45deg); }
.compare__handle span::after { right: 11px; transform: translateY(-50%) rotate(-135deg); }

.compare__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.compare:has(.compare__range:focus-visible) .compare__handle span {
  outline: 2px solid var(--margin); outline-offset: 3px;
}

.specimen .caption { margin-top: calc(var(--overhang, 0px) + 18px); margin-left: 31%; max-width: 30rem; }
.specimen { --overhang: clamp(44px, 9vw, 112px); }
@media (min-width: 600px) and (max-width: 959px) {
  .specimen { max-width: 600px; margin-left: auto; width: 100%; }
}

@media (min-width: 960px) {
  .hero { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  .hero__text { grid-column: 1 / span 5; padding-top: clamp(8px, 4vw, 64px); }
  .specimen { grid-column: 6 / span 7; }
}
@media (min-width: 1280px) {
  .hero__text { grid-column: 1 / span 5; }
  .specimen { grid-column: 7 / span 6; }
}

/* ------------------------------------------------------------------ the output */

.ink { border-top: 1px solid var(--rule); }
.ink__grid { display: grid; gap: 40px; }
.ink__head p:not(.eyebrow) { margin-top: 1.25rem; max-width: 30rem; color: #34322E; }

.facts { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.facts > div { padding: 20px 0 24px; border-bottom: 1px solid var(--rule); }
.facts dt {
  font-family: var(--f-mono); font-size: var(--t-small); color: var(--margin);
  letter-spacing: 0.02em; margin-bottom: 6px;
}
.facts dd { color: #34322E; }

.pens { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 6px; font-family: var(--f-mono); font-size: var(--t-small); color: var(--graphite); }
.pens li { display: flex; align-items: center; gap: 10px; }
.pens code { color: var(--ink); font-size: 1em; }
.swatch { width: 22px; height: 6px; border-radius: 3px; background: var(--c); flex: none; }
.swatch--hl { height: 12px; border-radius: 6px; opacity: 0.75; }


@media (min-width: 768px) {
  .facts { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}
@media (min-width: 1024px) {
  .ink__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; align-items: start; }
  .ink__head { grid-column: 1 / span 4; position: sticky; top: 104px; }
  .facts { grid-column: 6 / span 7; grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

/* ------------------------------------------------------------------ process (dark) */

.process { background: var(--ink); color: var(--paper); }
.process .eyebrow { color: var(--paper-dim); }
.process__head { display: grid; gap: 1rem; margin-bottom: clamp(40px, 6vw, 72px); }
.process__head h2 { max-width: 16ch; }
.process__note { font-family: var(--f-mono); font-size: var(--t-small); color: var(--paper-dim); }

.steps { list-style: none; padding: 0; display: grid; gap: 44px; }
.step img { width: 100%; background: #f6f4ee; }
.step h3 { margin-top: 18px; display: flex; align-items: baseline; gap: 10px; }
.step__n { font-family: var(--f-mono); font-weight: 500; font-size: var(--t-small); color: #E0735A; }
.step p { margin-top: 8px; color: var(--paper-dim); font-size: 0.96875rem; line-height: 1.6; }
.step code { color: var(--paper); }

@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; column-gap: 28px; } }
@media (min-width: 1024px) {
  .process__head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; align-items: end; }
  .process__head .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
  .process__head h2 { grid-column: 1 / span 7; }
  .process__note { grid-column: 9 / span 4; justify-self: end; text-align: right; }
  .steps { grid-template-columns: repeat(4, 1fr); column-gap: 24px; }
}

/* ------------------------------------------------------------------ scope */

.scope__grid { display: grid; gap: 40px; }
.scope__title { max-width: 18ch; }
.scope__col h3 {
  font-family: var(--f-mono); font-size: var(--t-small); font-weight: 500; letter-spacing: 0.02em;
  padding-bottom: 12px; border-bottom: 1px solid var(--ink); margin-bottom: 4px;
}
.ticks, .dashes { list-style: none; padding: 0; }
.ticks li, .dashes li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--rule); position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 1.15em; width: 9px; height: 5px;
  border: solid var(--ink); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg);
}
.dashes li { color: #34322E; }
.dashes li::before { content: ""; position: absolute; left: 2px; top: 1.3em; width: 10px; height: 1.5px; background: var(--margin); }
.scope__col--limits h3 { color: var(--margin); border-bottom-color: var(--margin); }

@media (min-width: 768px) {
  .scope__grid { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .scope__title { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .scope__col--limits { grid-column: 1 / -1; }
  .scope__col--limits .dashes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
}
@media (min-width: 1024px) {
  .scope__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 56px; }
  .scope__title { grid-column: 1 / -1; }
  .scope__col { grid-column: span 4; }
}

/* ------------------------------------------------------------------ install */

.install { background: var(--sheet); border-top: 1px solid var(--rule); }
.install__grid { display: grid; gap: 40px; }
.install__head p:not(.eyebrow) { margin-top: 1.25rem; color: #34322E; max-width: 28rem; }
.install__block h3 { margin-bottom: 10px; }
.install__block > p { color: #34322E; margin-bottom: 14px; max-width: 34rem; }

.code {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  margin-bottom: 12px; background: var(--ink); border-radius: 6px;
}
.code pre {
  margin: 0; padding: 16px 0 16px 18px;
  color: var(--paper);
  font-family: var(--f-mono); font-size: 0.84375rem; line-height: 1.65;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: #4A4842 transparent;
}
.code pre code { font-size: 1em; white-space: pre; padding-right: 18px; }
.copy {
  margin: 10px 10px 10px 12px;
  min-width: 72px; min-height: 36px; padding: 0 12px;
  font: 500 0.75rem/1 var(--f-mono); letter-spacing: 0.02em;
  color: var(--paper); background: #2E2D2A; border: 1px solid #4A4842; border-radius: 4px; cursor: pointer;
}
.copy:hover { background: #3A3833; }
.copy.is-done { color: #9FD39B; }
@media (pointer: coarse) { .copy { min-height: 44px; } }

@media (min-width: 1024px) {
  .install__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 48px; }
  .install__grid { grid-template-rows: auto 1fr; align-items: start; }
  .install__head { grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .install__block { grid-column: 6 / span 7; }
}

/* ------------------------------------------------------------------ footer */

.footer { border-top: 1px solid var(--rule); padding-block: 36px 48px; font-size: 0.875rem; color: var(--graphite); }
.footer__row { display: grid; gap: 10px; }
.footer .wordmark { color: var(--ink); }
.footer a { color: var(--ink); }
@media (min-width: 1024px) {
  .footer__row { grid-template-columns: auto 1fr auto; align-items: baseline; gap: 32px; }
}

/* ------------------------------------------------------------------ margin line (desktop) */

@media (min-width: 1360px) {
  body::before {
    content: ""; position: fixed; top: 0; bottom: 0; z-index: 30; pointer-events: none;
    left: max(28px, calc((100vw - var(--wrap)) / 2 - 28px));
    width: 1px; background: var(--margin); opacity: 0.45;
  }
}

/* ------------------------------------------------------------------ motion */

.compare__ink path { transition: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
