/* Invention Notebook landing — "Patentzeichnung": graph paper, drawing frame, title block, figures with
   reference numerals. Colours and type follow the app (paper, ink, patina, copper; Zilla Slab, IBM Plex). */

@font-face { font-family: "Zilla Slab"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/zilla-slab-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/zilla-slab-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --paper: #f4f0e6;
  --sheet: #fffdf8;
  --grid: #e3dbcb;
  --grid-strong: #d6ccb6;
  --ink: #1f2a2e;
  --soft: #55646a;
  --line: #d7cfbe;
  --patina: #2d6a5a;
  --patina-dark: #1f4f43;
  --patina-tint: #dceae3;
  --copper: #a04a24;
  --copper-tint: #f4e2d7;
  --slab: "Zilla Slab", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --max: 1120px;
  --pad: clamp(16px, 4vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  background-color: var(--paper);
  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;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--slab);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
  overflow-wrap: anywhere;
  hyphens: auto;
}
h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); letter-spacing: -0.01em; }
@media (min-width: 900px) { h1 { hyphens: manual; } }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 600; }
p, li, dd, td, th, summary { overflow-wrap: break-word; }
p { margin: 0 0 1em; }
a { color: var(--patina-dark); text-underline-offset: 3px; }
a:hover { color: var(--copper); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 10; }
.skip:focus { left: 16px; top: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.kicker {
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 0.75rem;
}

/* ---------- Title block header ---------- */
.titleblock { padding: var(--pad) var(--pad) 0; }
.titleblock__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border: 3px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  background: var(--sheet);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--ink);
  border-right: 2px solid var(--ink);
  flex: 1 1 auto;
  min-width: 0;
}
.brand img { width: 40px; height: 40px; flex: none; }
.brand__name { font: 700 1.35rem/1.1 var(--slab); }
.nav { display: flex; flex-wrap: wrap; }
.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  font: 600 0.82rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-right: 2px solid var(--ink);
}
.nav a:last-child { border-right: 0; }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav a:hover { background: var(--copper-tint); color: var(--ink); }
@media (max-width: 640px) {
  .brand { border-right: 0; border-bottom: 2px solid var(--ink); flex-basis: 100%; }
  .nav { flex-basis: 100%; }
  .nav a { flex: 1 1 auto; justify-content: center; padding: 0 8px; font-size: 0.74rem; letter-spacing: 0.04em; }
}

main { display: block; }
section { scroll-margin-top: 16px; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--pad) clamp(32px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.hero h1 em { font-style: normal; color: var(--copper); }
.lead { font-size: clamp(1.1rem, 2vw, 1.25rem); color: var(--soft); max-width: 36em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 28px 0 32px; }
.textlink { font: 600 0.95rem/1.3 var(--mono); color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.facts div { padding: 12px 12px 12px 0; }
.facts div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.facts dt { font: 600 0.72rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.hero__figure { position: relative; }
.refs { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; font-size: 0.95rem; color: var(--soft); }
.refs li { display: flex; gap: 12px; align-items: baseline; }
.ref {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--patina);
  color: #fff;
  font: 600 0.85rem/1 var(--mono);
}

/* ---------- CTA ---------- */
.cta {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  padding: 10px 22px;
  margin: 0;
  background: var(--ink);
  color: #fff;
  border-bottom: 5px solid var(--copper);
  text-decoration: none;
}
a.cta:hover { background: var(--patina-dark); color: #fff; }
.cta__small { font: 500 0.75rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.cta__big { font: 700 1.3rem/1.2 var(--slab); }
.cta--soon { background: var(--sheet); color: var(--ink); border: 2px dashed var(--ink); border-bottom: 5px solid var(--copper); }

/* ---------- Figures (screens as drawn figures with break line) ---------- */
.fig { margin: 0; }
.fig__sheet {
  background: var(--sheet);
  border: 3px solid var(--ink);
  border-bottom: 0;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 95% 97.6%, 90% 100%, 85% 97.6%, 80% 100%, 75% 97.6%, 70% 100%, 65% 97.6%, 60% 100%, 55% 97.6%, 50% 100%, 45% 97.6%, 40% 100%, 35% 97.6%, 30% 100%, 25% 97.6%, 20% 100%, 15% 97.6%, 10% 100%, 5% 97.6%, 0 100%);
  padding-bottom: 2.4%;
}
.fig__sheet img { width: 100%; aspect-ratio: 480 / 840; object-fit: cover; object-position: top; }
.fig__label { font: 600 0.8rem/1 var(--mono); letter-spacing: 0.14em; color: var(--copper); margin-top: 12px; text-align: right; }
.fig--large { max-width: 380px; margin-left: auto; }

/* ---------- Sheets ---------- */
.sheet, .figures, .seal, .private, .download { max-width: var(--max); margin: 0 auto clamp(48px, 8vw, 96px); padding: 0 var(--pad); }
.sheet__head { max-width: 44em; margin-bottom: 28px; }
.sheet__head p:last-child { color: var(--soft); }

.parts { width: 100%; border-collapse: collapse; background: var(--sheet); border: 3px solid var(--ink); }
.parts th, .parts td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.parts thead th { font: 600 0.75rem/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; border-bottom: 2px solid var(--ink); background: var(--paper); }
.parts tbody th { font: 600 1.15rem/1.3 var(--slab); white-space: nowrap; }
.parts__pos { font: 600 1rem/1.4 var(--mono); color: var(--copper); width: 4.5em; }
.parts tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 640px) {
  .parts thead { display: none; }
  .parts, .parts tbody, .parts tr, .parts th, .parts td { display: block; }
  .parts tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .parts tr:last-child { border-bottom: 0; }
  .parts th, .parts td { padding: 0; border: 0; }
  .parts tbody th { white-space: normal; margin: 2px 0 6px; }
  .parts__pos { width: auto; }
}

.figrow { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.figrow--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
.figrow--flip .fig { order: 2; }
.figrow--flip .figrow__text { justify-self: end; }
.figrow__text { max-width: 30em; }
.figrow__text p:last-child { color: var(--soft); font-size: 1.1rem; }

.seal { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.note { border-left: 4px solid var(--copper); padding: 10px 14px; background: var(--copper-tint); font-size: 0.95rem; }
.seal__stamp {
  border: 2px dashed var(--copper);
  background: var(--copper-tint);
  padding: 22px;
  transform: rotate(-2deg);
  display: grid;
  gap: 10px;
}
.seal__label { font: 600 0.85rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); }
.seal__stamp code { font-size: 0.95rem; line-height: 1.6; overflow-wrap: anywhere; color: var(--ink); }

.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 40px; border-top: 2px solid var(--ink); }
.more div { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.more div:not(:nth-child(3n + 1)) { padding-left: 20px; border-left: 1px solid var(--line); }
.more dt { font: 700 1.2rem/1.3 var(--slab); margin-bottom: 4px; }
.more dd { margin: 0; color: var(--soft); }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }

.private, .download { width: min(calc(100% - 2 * var(--pad)), calc(var(--max) - 2 * var(--pad))); }
.private { background: var(--ink); color: #fff; padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(32px, 5vw, 56px); outline: 1px solid var(--ink); outline-offset: 6px; }
.private h2 { color: #fff; }
.private a { color: #f2c9b4; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 34px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border: 2px solid currentColor; }
.checks li::after { content: ""; position: absolute; left: 6px; top: calc(0.3em + 2px); width: 6px; height: 11px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.private .checks li::before, .private .checks li::after { border-color: #8fc7b6; }

.download { text-align: center; border: 3px solid var(--ink); background: var(--sheet); padding-top: 48px; padding-bottom: 48px; }
.download p { color: var(--soft); }
.download .cta { margin: 8px auto 20px; }
.download__contact { margin: 0; }

/* ---------- Documents (help, privacy, 404) ---------- */
.doc { max-width: 820px; margin: clamp(32px, 6vw, 72px) auto clamp(48px, 8vw, 96px); padding: clamp(24px, 4vw, 48px) var(--pad); background: var(--sheet); border: 3px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 5px; }
@media (max-width: 860px) { .doc { margin-left: var(--pad); margin-right: var(--pad); } }
.doc h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.doc h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin-top: 1.8em; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font: 600 1.15rem/1.35 var(--slab); min-height: 48px; }
.faq summary::marker { color: var(--copper); }
.faq p { color: var(--soft); }
.contact__mail { font: 600 1.1rem/1.4 var(--mono); overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer { padding: 0 var(--pad) var(--pad); }
.footer__inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 3px solid var(--ink); background: var(--sheet); }
.footer__block { padding: 18px 20px; border-right: 2px solid var(--ink); font-size: 0.95rem; }
.footer__block:last-child { border-right: 0; }
.footer__block p { margin: 0 0 4px; }
.footer__block a { overflow-wrap: anywhere; }
.footer__name { font: 700 1.2rem/1.2 var(--slab); }
.footer__label { font: 600 0.72rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.footer__links { display: flex; flex-direction: column; gap: 6px; }
.footer__links a { min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .fig--large { margin: 0 auto; max-width: 340px; }
  .seal { grid-template-columns: minmax(0, 1fr); }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more div:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .more div:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--line); }
  .footer__inner { grid-template-columns: minmax(0, 1fr); }
  .footer__block { border-right: 0; border-bottom: 2px solid var(--ink); }
  .footer__block:last-child { border-bottom: 0; }
}
@media (max-width: 680px) {
  .figrow, .figrow--flip { grid-template-columns: minmax(0, 1fr); }
  .figrow--flip .figrow__text { justify-self: start; }
  .figrow .fig, .figrow--flip .fig { order: 0; max-width: 300px; margin: 0 auto; width: 100%; }
  .more { grid-template-columns: minmax(0, 1fr); }
  .more div:nth-child(2n) { padding-left: 0; border-left: 0; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .strip .fig__label { font-size: 0.7rem; letter-spacing: 0.06em; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .seal__stamp { transform: none; }
}
