/* Molehill — site system v3: "The Field Guide to Small Problems".
   Print register: hairline rules, numbered specimens, mono metadata,
   Anybody display, Wix Madefor body, Martian Mono metadata; paper ground,
   one dark burrow (footer + chapter). */

@font-face {
  font-family: 'Anybody';
  src: url('/assets/fonts/anybody-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Wix Madefor';
  src: url('/assets/fonts/wix-madefor-var.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('/assets/fonts/martian-mono-var.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@view-transition { navigation: auto; }
body {
  font-family: var(--font-body);
  background: var(--paper); color: var(--ink);
  line-height: 1.65; font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}
/* paper fibre */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::before { opacity: .05; } }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-3); }
.narrow { max-width: var(--maxw-text); }

/* ---------- type ---------- */
h1, h2, .display {
  font-family: var(--font-display);
  font-variation-settings: 'wght' 780; font-weight: 780;
  letter-spacing: -0.012em; line-height: 1.02;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); font-variation-settings: 'wght' 740; font-weight: 740; letter-spacing: -0.01em; line-height: 1.08; }
h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; }
.lede { font-size: clamp(18px, 1.7vw, 21px); color: var(--ink-soft); max-width: 640px; }
.lede em, p em { color: var(--ink); font-style: italic; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
p + p { margin-top: var(--sp-2); }
::selection { background: var(--accent-soft); color: var(--night); }

/* mono metadata voice */
.eyebrow, .meta, .chip, .no, .fig {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); display: block; margin-bottom: var(--sp-2);
}
.meta { font-size: var(--fs-meta); color: var(--ink-faint); letter-spacing: .02em; }
.meta b { color: var(--ink-soft); font-weight: 600; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; gap: var(--sp-2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-variation-settings:'wght' 700; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 28px); font-size: var(--fs-sm); align-items: center; }
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-cta { font-size: 13.5px; font-weight: 650; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--r-pill); padding: 7px 14px; white-space: nowrap; }
.nav-cta:hover { background: var(--accent); color: #fff; text-decoration: none; }
@media (max-width: 560px) { .nav-cta { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: var(--fs-sm);
  padding: 12px 22px; border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.btn:hover { background: var(--accent-deep); color:#fff; text-decoration: none; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent-tint); transform: translateY(-1px); }
.btn[aria-disabled="true"] { background: var(--paper-sunken); color: var(--ink-faint); border-color: var(--rule); cursor: default; pointer-events: none; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- layout ---------- */
main { display: block; }
section.sect { padding: var(--sp-8) 0; }
section.sect + section.sect { border-top: 1px solid var(--rule); }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }

/* metadata chip row (replaces pill chips) */
.chips { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: var(--fs-meta); color: var(--ink-soft); }
.chip { white-space: nowrap; }
.chip::before { content: "·"; color: var(--accent); margin-right: 8px; }

/* ---------- the specimen index (replaces card grids) ---------- */
.idx { border-top: 1px solid var(--rule-strong); }
.idx-row {
  display: grid; grid-template-columns: 76px 44px 1fr auto 28px;
  gap: 16px; align-items: center;
  padding: 18px 6px; border-bottom: 1px solid var(--rule);
  color: var(--ink); position: relative;
  transition: background var(--dur) var(--ease);
}
.idx-row:hover { background: var(--paper-plate); text-decoration: none; }
.no { font-size: var(--fs-meta); color: var(--ink-faint); letter-spacing: .04em; }
.idx-row:hover .no { color: var(--accent); }
.icon-tile {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: 0 0 auto;
  background: var(--paper-plate); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); font-family: var(--font-display);
  transition: transform .16s var(--ease-out);
}
.icon-tile img { width: 30px; height: 30px; }
.idx-row:hover .icon-tile { transform: translateY(-2px) rotate(-3deg); }
.idx-name { font-weight: 650; font-size: 16.5px; line-height: 1.25; letter-spacing: -0.01em; }
.idx-blurb { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; margin-top: 2px; }
.idx-meta { text-align: right; }
.idx-arrow { color: var(--ink-faint); transition: transform .16s var(--ease-out), color .16s; font-size: 17px; }
.idx-row:hover .idx-arrow { transform: translateX(4px); color: var(--accent); }
@media (max-width: 760px) {
  .idx-row { grid-template-columns: 44px 44px 1fr 22px; }
  .idx-meta { display: none; }
  .no { font-size: 12px; }
}
@media (max-width: 480px) { .idx-row { grid-template-columns: 44px 1fr 20px; } .idx-row .no { display:none; } }

/* category divider inside the index */
.idx-cat { display: flex; align-items: baseline; gap: 12px; padding: var(--sp-4) 6px 10px; }
.idx-cat h2 { font-size: 13px; font-family: var(--font-mono); font-variation-settings: normal; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.idx-cat .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

/* ---------- field note (pull quote) ---------- */
.pull {
  border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
  background: var(--paper-plate); padding: var(--sp-3) var(--sp-4);
  font-size: 19px; font-weight: 600; margin-top: var(--sp-3);
  box-shadow: 3px 3px 0 var(--rule);
}

/* ---------- specimen data table ---------- */
table.facts { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: var(--sp-2); }
table.facts td { padding: 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.facts td:first-child { color: var(--ink-faint); width: 38%; font-family: var(--font-mono); font-size: 11.5px; }

/* ---------- feature list ---------- */
.feat { list-style: none; padding: 0; margin-top: var(--sp-2); display: grid; gap: 12px; }
.feat li { padding-left: 28px; position: relative; }
.feat li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* ---------- pricing tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; margin-top: var(--sp-4); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); overflow: hidden; }
.tier { padding: var(--sp-4); background: var(--paper-plate); }
.tier + .tier { border-left: 1px solid var(--rule); }
.tier.featured { background: var(--accent-tint); }
.tier h3 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.tier .price { font-family: var(--font-display); font-size: 38px; font-variation-settings:'wght' 700; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.tier .per { color: var(--ink-soft); font-size: var(--fs-meta); font-family: var(--font-mono); }
.tier p.muted { margin-top: 10px; font-size: var(--fs-sm); }
@media (max-width: 720px) { .tier + .tier { border-left: 0; border-top: 1px solid var(--rule); } }

.draft { font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--ink-faint); border: 1px dashed var(--rule-strong); border-radius: var(--r-sm); padding: 8px 12px; margin-top: var(--sp-2); display: inline-block; }

/* ---------- illustration plate ---------- */
.plate { border: 1px solid var(--rule-strong); border-radius: var(--r-lg); background: #fff; padding: var(--sp-2); box-shadow: 4px 4px 0 var(--rule); }
.plate img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); }
.plate figcaption { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); padding: 10px 4px 2px; }

/* ---------- footer: the burrow ---------- */
footer.site { margin-top: var(--sp-12); background: var(--night); color: var(--night-ink-soft); overflow: hidden; }
.foot-rule { height: 6px; background: repeating-linear-gradient(90deg, var(--accent-soft) 0 14px, transparent 14px 24px); opacity: .5; }
.foot-top { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-sm); }
.foot-links { display: flex; gap: 12px 26px; flex-wrap: wrap; }
.foot-links a { color: var(--night-ink-soft); }
.foot-links a:hover { color: var(--accent-soft); }
.ticker { border-block: 1px solid var(--night-rule); padding: 10px 0; overflow: hidden; white-space: nowrap; }
.ticker-inner { display: inline-block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--night-ink-soft); animation: tick 52s linear infinite; }
.ticker-inner span { margin-right: 3.2em; }
.ticker-inner span::after { content: "·"; color: var(--accent-soft); margin-left: 3.2em; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-inner { animation: none; } }
.bigmark { position: relative; display: block; text-align: center; padding: var(--sp-4) 0 0; line-height: .78; }
.bigmark .word {
  font-family: var(--font-display); font-variation-settings:'wght' 750; font-weight: 750;
  font-size: clamp(64px, 13.5vw, 218px); letter-spacing: -0.03em;
  color: transparent; -webkit-text-stroke: 1.5px var(--night-rule);
  display: inline-block; transform: translateY(.14em);
}
.bigmark .foot-mole { position: absolute; right: .045em; top: -0.155em; width: .40em; }
.foot-note { text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--night-ink-soft); padding: var(--sp-3) 0 6px; }
.bigmark { overflow: hidden; }

/* mole eyes (shared): CSS blink + JS pupil track */
@media (prefers-reduced-motion: no-preference) {
  @keyframes mole-blink { 0%, 93.5%, 100% { transform: scaleY(1); } 95%, 96.5% { transform: scaleY(.12); } }
  .eyeball { transform-box: fill-box; transform-origin: center; animation: mole-blink 7.4s infinite; }
}

/* ---------- reveals & links ---------- */
.motion .reveal { opacity: 0; transform: translateY(14px); }
.motion .reveal.in { opacity: 1; transform: none; transition: opacity .5s var(--ease-out), transform .55s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .motion .reveal { opacity: 1; transform: none; } }
.u-link { background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-size: 0% 1.5px; background-position: 0 100%; transition: background-size .18s var(--ease-out); padding-bottom: 2px; }
.u-link:hover { background-size: 100% 1.5px; text-decoration: none; }

/* ---------- apps-index filter + app page bits ---------- */
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: var(--sp-4); }
.fpill { font-family: var(--font-mono); font-size: 11.5px; padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--rule-strong); background: var(--paper-plate); color: var(--ink-soft); cursor: pointer; transition: all var(--dur) var(--ease); }
.fpill:hover { border-color: var(--accent); color: var(--accent); }
.fpill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.qfind { width: 100%; margin-top: var(--sp-2); font-family: var(--font-mono); font-size: 13.5px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--paper-plate); color: var(--ink); }
.qfind:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.idx-empty { padding: var(--sp-3) 6px; }
.fclear { background: none; border: none; cursor: pointer; color: var(--accent); font-family: inherit; font-size: inherit; padding: 0; }

.app-head { display: flex; align-items: center; gap: 18px; margin-top: var(--sp-3); }
.icon-tile.icon-xl { width: 84px; height: 84px; border-radius: 18px; }
.icon-tile.icon-xl img { width: 56px; height: 56px; }
.cta-row { margin-top: var(--sp-3); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.subsect { margin-top: var(--sp-6); }
.subsect h2 { font-size: clamp(22px, 2.6vw, 30px); }
