/* ============================================================
   ohdeer.wtf — Base & shared primitives
   load AFTER tokens.css
   ============================================================ */

/* ── Display-Webfont: Source Serif 4 (Variable, self-hosted) ── */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin.woff2') format('woff2-variations');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--tool-accent); color: var(--tool-accent-ink); }

/* — Paper grain: subtle, fixed, ignores pointer — */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .04; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; opacity: .04; }
}
body > * { position: relative; z-index: 1; }

/* ── Typography ───────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.mono-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lead { font-size: 1.28rem; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--xs); }
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--tool-accent); display: inline-block;
}

/* ── Layout ───────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--c-max); margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); }
.col-narrow { max-width: var(--c-narrow); }
.col { max-width: var(--c); }
.col-wide { max-width: var(--c-wide); }
.section { padding-block: clamp(56px, 9vw, 100px); }
.prose { max-width: 65ch; }
.prose p + p { margin-top: 1.1em; }

/* ── Logo mark (inline SVG, recolored via currentColor) ───── */
.mark, .wordmark { display: inline-block; color: var(--fg); line-height: 0; }
.mark { aspect-ratio: 531 / 534; }
.wordmark { aspect-ratio: 646 / 627; }
.mark svg, .wordmark svg { width: 100%; height: 100%; display: block; }
.mark.accent { color: var(--tool-accent); }

/* ── Visier crosshair (geometric, recurring anchor) ───────── */
.visier { display: inline-block; color: var(--tool-accent); }
.visier svg { width: 100%; height: 100%; }
.visier circle, .visier line { stroke: currentColor; fill: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r);
  font-family: var(--font-body); font-size: .98rem; font-weight: 600;
  border: 1px solid transparent; background: transparent; color: var(--fg);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--tool-accent); color: var(--tool-accent-ink); border-color: var(--tool-accent); }
.btn-primary:hover { background: color-mix(in oklch, var(--tool-accent) 86%, black); }
[data-theme="dark"] .btn-primary:hover { background: color-mix(in oklch, var(--tool-accent) 86%, white); }
.btn-secondary { border-color: var(--border); color: var(--fg); background: var(--surface); }
.btn-secondary:hover { border-color: var(--fg); background: var(--bg); }
.btn-ghost { color: var(--fg); }
.btn-ghost:hover { background: color-mix(in oklch, var(--fg) 8%, transparent); }
.btn-text { min-height: 0; padding: 0; gap: 6px; color: var(--tool-accent); font-weight: 600; }
.btn-text .arr { transition: transform .2s ease; }
.btn-text:hover .arr { transform: translateX(4px); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ── Cards (hairline, no shadow) ──────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted);
  background: var(--bg);
}
.hairline { height: 1px; background: var(--border); border: 0; }

/* ── Site header ──────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--lg); height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .mark { width: 30px; height: 30px; }
.brand b { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -.02em; }
.brand .wtf { color: var(--muted); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 8px 13px; border-radius: var(--r-sm); font-size: .94rem; font-weight: 500; color: var(--muted);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--fg); background: color-mix(in oklch, var(--fg) 6%, transparent); }
.nav a.active { color: var(--fg); }
.header-actions { display: flex; align-items: center; gap: var(--xs); flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border);
  display: grid; place-items: center; background: var(--surface); color: var(--muted);
}
.icon-btn:hover { color: var(--fg); border-color: var(--fg); }
.nav-toggle { display: none; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--3xl); }
.site-footer .wrap { padding-block: var(--2xl) var(--xl); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--xl); }
.footer-grid h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: var(--md); }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--muted); font-size: .95rem; }
.footer-links a:hover { color: var(--fg); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--md); align-items: center; justify-content: space-between; margin-top: var(--2xl); padding-top: var(--lg); border-top: 1px solid var(--border); }
.footer-bottom .mono-label { font-size: .68rem; }

/* ── Placeholder media (no stock clichés) ─────────────────── */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in oklch, var(--fg) 5%, transparent) 11px 12px),
    var(--camel);
  border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--coffee);
}
[data-theme="dark"] .ph { background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in oklch, var(--fg) 6%, transparent) 11px 12px),
    color-mix(in oklch, var(--coffee) 55%, var(--bg)); color: var(--sand); }
.ph .ph-label {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em; padding: 6px 12px;
  border: 1px solid color-mix(in oklch, currentColor 35%, transparent); border-radius: 999px;
  background: color-mix(in oklch, var(--bg) 30%, transparent);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── App-UI mock (replaceable placeholder for real screenshots) ── */
.appui { position: absolute; inset: 0; background: var(--surface); display: flex; flex-direction: column; text-align: left; }
.appui .au-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex: none; }
.appui .au-top .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tool-accent); }
.appui .au-top b { font-family: var(--font-display); font-size: .92rem; letter-spacing: -.01em; }
.appui .au-top .au-meta { margin-left: auto; font-family: var(--font-mono); font-size: .58rem; color: var(--muted); letter-spacing: .04em; }
.appui .au-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; overflow: hidden; }
.au-card { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: var(--bg); }
.au-pill { display: inline-block; font-family: var(--font-mono); font-size: .56rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--tool-accent-light); color: var(--tool-accent); }
.au-line { height: 9px; border-radius: 5px; background: color-mix(in oklch, var(--fg) 10%, transparent); }
.au-line.sh { width: 70%; } .au-line.md { width: 88%; }
.au-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.au-bar i { display: block; height: 100%; background: var(--tool-accent); border-radius: 999px; }
.au-row { display: flex; align-items: center; gap: 10px; }
.au-btn { text-align: center; padding: 10px; border-radius: 8px; font-weight: 600; font-size: .8rem; }
.au-btn.primary { background: var(--tool-accent); color: var(--tool-accent-ink); }
.au-btn.ghost { border: 1px solid var(--border); color: var(--muted); }
.au-h { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.01em; }
.au-sub { font-family: var(--font-mono); font-size: .58rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* ── Scroll reveal (only hides when JS active & motion allowed) ─ */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.in { opacity: 1; transform: none; }
}
/* GSAP owns the animation when loaded — kill the CSS transition to avoid double-easing */
.gsap .reveal { transition: none !important; }
@media print { .reveal { opacity: 1 !important; transform: none !important; } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--lg); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  /* Primary CTA lives in the mobile drawer — keep the bar uncluttered.
     Secondary (e.g. shop "Korb") stays reachable. */
  .header-actions .btn-primary { display: none; }
}

/* ── Accessibility: keyboard focus ────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--tool-accent);
  outline-offset: 2px;
  border-radius: 3px;
}
.btn:focus-visible, .icon-btn:focus-visible, .cart-btn:focus-visible {
  outline-offset: 3px;
}

/* Skip-to-content (injected by ohdeer.js) */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  transform: translateY(-150%);
  background: var(--accent); color: var(--accent-ink);
  padding: 11px 18px; border-radius: var(--r);
  font-weight: 600; font-size: .95rem;
  transition: transform .2s ease;
}
.skip-link:focus { transform: none; outline: 2px solid var(--tool-accent); outline-offset: 2px; }

/* ── Mobile-nav header (brand + close, injected by ohdeer.js) ── */
.mobile-nav { padding-top: 0 !important; }
.mn-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; margin: 0 calc(var(--md) * -1) var(--sm);
  padding: 0 var(--md); border-bottom: 1px solid var(--border);
}
.mn-head .brand .mark { width: 28px; height: 28px; }
.mn-head .brand b { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.mn-head .brand .wtf { color: var(--muted); }
.mn-close {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--fg); font-size: 1.3rem; line-height: 1;
}
.mn-close:hover { border-color: var(--fg); }

/* ── Add-to-cart confirmation ─────────────────────────────── */
.btn.is-added, .btn.is-ok { background: var(--success); border-color: var(--success); color: #fff; }
@keyframes cart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.cart-badge.pop { animation: cart-pop .4s ease; }

/* ════════════════════════════════════════════════════════════
   INTERACTION LAYER — modern, restrained motion. All progressive.
   ════════════════════════════════════════════════════════════ */

/* — Smooth in-page navigation + sticky-header anchor offset — */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
:where([id]) { scroll-margin-top: 92px; }

/* — Refined easing on buttons + tactile press — */
.btn { transition: background .22s cubic-bezier(.2,.7,.2,1), color .22s ease, border-color .22s ease, transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease; }
.btn-primary { box-shadow: 0 1px 1px oklch(20% .02 75 / .04); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px -8px color-mix(in oklch, var(--tool-accent) 55%, transparent); }
.btn-primary:active { transform: translateY(0); }
.btn-lg:hover { transform: translateY(-2px); }
.icon-btn { transition: color .18s, border-color .18s, background .18s, transform .18s cubic-bezier(.34,1.56,.64,1); }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.94); }

/* — Ken-burns zoom on framed imagery (hover, desktop pointers) — */
.ph img { transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .7s ease; will-change: transform; }
@media (hover: hover) {
  a:hover .ph img, .card:hover .ph img, .product:hover .ph img,
  .rel-card:hover .ph img, .featured:hover .ph img, .post-item:hover .ph img,
  .gallery-main:hover img { transform: scale(1.045); }
}

/* — Card hover: refined lift + accent hairline — */
.card, .product, .rel-card, .tool-card, .cat { transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s ease, box-shadow .3s ease; }

/* — Animated nav underline — */
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 1.5px;
  background: var(--tool-accent); transform: scaleX(0); transform-origin: left;
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover::after { transform: scaleX(1); }
.nav a.active::after { transform: scaleX(1); background: var(--fg); }

/* — Sticky header: elevate + subtly shrink on scroll, hide on scroll-down — */
.site-header { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, background .3s ease; will-change: transform; }
.site-header .wrap { transition: height .35s cubic-bezier(.2,.7,.2,1); }
.site-header.scrolled { background: color-mix(in oklch, var(--bg) 92%, transparent); box-shadow: 0 10px 30px -22px oklch(20% .02 75 / .55); }
.site-header.scrolled .wrap { height: 58px; }
.site-header.hide { transform: translateY(-101%); }

/* — Reading-progress bar (scroll-driven, blog article) — */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: var(--tool-accent); transform: scaleX(0); transform-origin: 0 50%; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .read-progress { animation: read-progress linear both; animation-timeline: scroll(root block); }
  }
}
@keyframes read-progress { to { transform: scaleX(1); } }

/* — Reveal: add a subtle focus-in (blur) to the existing fade/slide — */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { filter: blur(5px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1), filter .7s ease; }
  .js .reveal.in { filter: none; }
}

/* ── View Transition: theme circular clip-reveal ──────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Theme switch: circular clip-reveal from the toggle button */
  html[data-vt="theme"]::view-transition-old(root) { animation: none; }
  html[data-vt="theme"]::view-transition-new(root) {
    animation: vt-theme-clip .55s cubic-bezier(.2,.7,.2,1) both;
  }
  @keyframes vt-theme-clip {
    from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
    to   { clip-path: circle(160% at var(--vt-x, 50%) var(--vt-y, 0)); }
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
