/* SnippetLab one-pager. Self-hosted fonts only, no external requests. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/archivo-latin-ext-var.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/archivo-latin-var.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f4f8fd;
  --paper-2: #e8f0fa;
  --ink: #0b1d3f;
  --ink-soft: #4a5a76;
  --line: rgba(11, 29, 63, 0.07);
  --card: #ffffff;
  --brand: #087bfa;
  --accent: #00d9c5;
  --brand-ink: #0564d4; /* brand blue for small text, AA on light paper */
  --grad: linear-gradient(100deg, var(--brand), var(--accent));
  --shadow: var(--ink);
  --band: #0b1d3f; /* dark bands (ticker, method) in both themes */
  --band-ink: #e8eefc;

  --br: #a8431b; /* Brennerly */
  --kl: #b7791f; /* Klafterly */
  --bw: #1e5aa8; /* Brunnwart */
  --pp: #3f7d2c; /* Pflanzpass */
  --pw: #5b3e8c; /* Punktwerk */
  --tw: #0f766e; /* Teichwart */
  --ju: #b0306a; /* Justage */
  --ka: #4a5563; /* Kalibo */

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #071224;
    --paper-2: #0b1a33;
    --ink: #e8eefc;
    --ink-soft: #9db0cf;
    --line: rgba(232, 238, 252, 0.06);
    --card: #0e1f3b;
    --brand-ink: #4aa3ff;
    --band: #0b1a33;
    --shadow: #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #071224;
  --paper-2: #0b1a33;
  --ink: #e8eefc;
  --ink-soft: #9db0cf;
  --line: rgba(232, 238, 252, 0.06);
  --card: #0e1f3b;
  --brand-ink: #4aa3ff;
  --band: #0b1a33;
  --shadow: #000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); color: var(--paper); padding: 8px 12px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--paper) 82%, transparent); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 115%; font-size: 1.15rem; letter-spacing: -0.01em; }
.logo-mark { width: 26px; height: 36px; flex: none; }
.nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.nav a { text-decoration: none; font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .nav a:not(:last-child) { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (max-width: 940px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }
h1 {
  position: relative; z-index: 0;
  margin: 18px 0 22px;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 0.98;
  font-weight: 850;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 .hl { position: relative; white-space: nowrap; }
h1 .hl::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: 0.06em; height: 0.28em; background: var(--grad); z-index: -1; transform: skewX(-12deg); opacity: 0.85; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 36rem; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 2px solid var(--ink); border-radius: 0;
  font-weight: 700; font-stretch: 105%; text-decoration: none;
  background: var(--card); color: var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--shadow); }
.btn-primary { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn, :root[data-theme="dark"] .card, :root[data-theme="dark"] .tile { border-color: #3a3d44; }

/* ---------- Periodic table ---------- */
.table { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.4vw, 14px); }
.table-caption { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--ink-soft); margin-bottom: 2px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1 / 0.9; padding: clamp(8px, 1.2vw, 12px) clamp(9px, 1.3vw, 14px); min-width: 0;
  background: var(--c, var(--ink)); color: #fff; text-decoration: none;
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1.4), box-shadow 0.2s ease;
  animation: drop 0.55s cubic-bezier(.2,.8,.2,1.2) both;
}
/* Child 1 is the caption, so tile k is child k+1; staggered row by row. */
.table .tile:nth-child(2) { animation-delay: 0.00s; }
.table .tile:nth-child(3) { animation-delay: 0.07s; }
.table .tile:nth-child(4) { animation-delay: 0.14s; }
.table .tile:nth-child(5) { animation-delay: 0.21s; }
.table .tile:nth-child(6) { animation-delay: 0.28s; }
.table .tile:nth-child(7) { animation-delay: 0.35s; }
.table .tile:nth-child(8) { animation-delay: 0.42s; }
.table .tile:nth-child(9) { animation-delay: 0.49s; }
.table .tile:nth-child(10) { animation-delay: 0.56s; }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) rotate(-2deg); } }
.tile:hover { transform: translate(-3px, -3px) rotate(-1.5deg); box-shadow: 8px 8px 0 var(--shadow); }
.tile-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; opacity: 0.85; }
.tile-sym { font-size: clamp(1.8rem, 4.2vw, 3.3rem); font-weight: 800; font-stretch: 112%; line-height: 1; letter-spacing: -0.03em; }
.tile-name { font-weight: 700; font-size: clamp(0.78rem, 1.2vw, 0.95rem); font-stretch: 92%; line-height: 1.2; }
.tile-field { font-family: var(--mono); font-size: clamp(0.56rem, 0.8vw, 0.66rem); opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.35; }
.tile.empty { background: transparent; color: var(--ink-soft); border-style: dashed; box-shadow: none; }
.tile.empty:hover { transform: none; color: var(--brand-ink); border-color: var(--brand); }
.tile.empty .tile-sym { font-weight: 500; }

/* ---------- Ticker ---------- */
.ticker { background: var(--band); color: var(--band-ink); overflow: hidden; border-block: 2px solid var(--line); }
.ticker-track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker span { padding: 14px 0; white-space: nowrap; font-family: var(--mono); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.ticker span::after { content: "✳"; color: var(--accent); margin: 0 22px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section { padding: clamp(64px, 10vw, 120px) 0; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.section-no { font-family: var(--mono); font-size: 0.85rem; color: var(--brand-ink); grid-row: 1; }
h2 { grid-column: 1 / -1; margin: 0; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.02; font-weight: 850; font-stretch: 110%; letter-spacing: -0.03em; text-wrap: balance; }
.section-head p { grid-column: 1 / -1; margin: 6px 0 0; color: var(--ink-soft); max-width: 40rem; font-size: 1.1rem; }

/* ---------- Product cards ---------- */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) { .products { grid-template-columns: 1fr; } }
.card {
  --c: var(--ink);
  display: grid; grid-template-columns: 96px 1fr; gap: 20px;
  padding: 22px; background: var(--card);
  border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow);
  scroll-margin-top: 90px;
}
@media (max-width: 480px) { .card { grid-template-columns: 60px 1fr; gap: 14px; padding: 16px; } .card .tile { padding: 6px 7px; } .card .tile-sym { font-size: 1.3rem; font-stretch: 100%; } .card .tile-top { font-size: 0.6rem; } .card h3 { font-size: 1.35rem; } }
.card .tile { aspect-ratio: 1 / 1.08; padding: 8px 10px; box-shadow: none; animation: none; }
.card .tile:hover { transform: none; box-shadow: none; }
.card .tile-sym { font-size: 2.3rem; }
.card h3 { margin: 0; font-size: 1.6rem; font-weight: 800; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1.1; }
.card .for { margin: 4px 0 12px; color: var(--c); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
:root[data-theme="dark"] .card .for { filter: brightness(1.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card .for { filter: brightness(1.6); } }
.card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 1rem; }
.card ul { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.95rem; }
.card li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.card li::before { content: ""; width: 8px; height: 8px; margin-top: 0.6em; background: var(--c); }
.card .link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--c); padding-bottom: 2px; }
.card .link:hover { color: var(--c); }
:root[data-theme="dark"] .card .link:hover { color: var(--ink); }
.card .replaces { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 14px; }
.card .replaces s { text-decoration-color: var(--brand); text-decoration-thickness: 2px; }

/* ---------- Method ---------- */
.method { --paper: var(--band-ink); background: var(--band); color: var(--band-ink); background-image: none; }
.method .section-no { color: var(--accent); }
.method .section-head p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid color-mix(in srgb, var(--paper) 25%, transparent); counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 26px 22px 30px; border-right: 2px solid color-mix(in srgb, var(--paper) 25%, transparent); position: relative; }
.step:last-child { border-right: 0; }
@media (max-width: 900px) { .step { border-bottom: 2px solid color-mix(in srgb, var(--paper) 25%, transparent); } .step:nth-child(2n) { border-right: 0; } .step:nth-last-child(-n+2) { border-bottom: 0; } }
@media (max-width: 520px) { .step { border-right: 0; border-bottom: 2px solid color-mix(in srgb, var(--paper) 25%, transparent); } .step:nth-last-child(2) { border-bottom: 2px solid color-mix(in srgb, var(--paper) 25%, transparent); } .step:last-child { border-bottom: 0; } }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.step h3 { margin: 14px 0 8px; font-size: 1.3rem; font-weight: 800; font-stretch: 108%; line-height: 1.15; }
.step p { margin: 0; color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 0.98rem; }
.step code { font-family: var(--mono); font-size: 0.82rem; background: color-mix(in srgb, var(--paper) 12%, transparent); padding: 1px 6px; }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--ink); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--brand); }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }
.principle { background: var(--card); padding: clamp(22px, 3vw, 34px); }
.principle h3 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 800; font-stretch: 110%; letter-spacing: -0.02em; display: flex; gap: 12px; align-items: baseline; }
.principle h3 .mono { color: var(--brand-ink); }
.principle p { margin: 0; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: 1fr; } }
.contact h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.contact h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact p { color: var(--ink-soft); font-size: 1.1rem; max-width: 34rem; }
.mail-card { border: 2px solid var(--ink); background: var(--card); box-shadow: 8px 8px 0 var(--shadow); padding: 26px; }
.mail-card .mono { color: var(--ink-soft); }
.mail-card a.mail { display: block; margin: 8px 0 18px; font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 800; font-stretch: 105%; word-break: break-word; text-decoration: none; border-bottom: 3px solid; border-image: var(--grad) 1; width: fit-content; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--ink); padding: 28px 0 36px; background: var(--paper-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { text-decoration: none; font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.site-footer a:hover { color: var(--brand-ink); }
.site-footer small { font-family: var(--mono); color: var(--ink-soft); font-size: 0.78rem; }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(48px, 8vw, 96px) 0; }
.legal .wrap { max-width: 820px; }
.legal article { background: var(--card); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--shadow); padding: clamp(22px, 5vw, 48px); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-top: 0; }
.legal h2 { font-size: 1.35rem; margin: 32px 0 8px; letter-spacing: -0.01em; font-stretch: 105%; }
.legal p, .legal li { color: var(--ink-soft); font-size: 1rem; }
.legal a { color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 2px; }

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