/* ─── tokens ─── */

:root {
  --paper: #faf7f1;
  --paper-alt: #f1ece0;
  --card: #fff;
  --ink: #0e0e10;
  --ink-soft: #474747;

  --fg: #0e0e10;
  --fg-muted: #55555c;
  --fg-dim: #96969c;
  --fg-invert: #faf7f1;

  --rule: rgba(14, 14, 16, 0.16);
  --rule-soft: rgba(14, 14, 16, 0.08);
  --rule-strong: #0e0e10;

  --blue: #0088ff;
  --blue-soft: rgba(0, 136, 255, 0.12);
  --red: #f7535b;
  --yellow: #f7c83a;
  --yellow-soft: rgba(247, 200, 58, 0.20);

  --shadow-card: 0 1px 0 rgba(14, 14, 16, 0.04), 0 2px 6px -1px rgba(14, 14, 16, 0.06);
  --shadow-window: 0 2px 0 rgba(14, 14, 16, 0.05), 0 30px 60px -20px rgba(14, 14, 16, 0.22);
  --shadow-stamp: 6px 6px 0 var(--ink);

  --radius: 4px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Inter", "Noto Sans JP", sans-serif;
  --font-display: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

:lang(ja) {
  --font-sans: "Noto Sans JP", "Geist", -apple-system, sans-serif;
}

/* ─── reset ─── */

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

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

body {
  background: var(--paper);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Global blueprint grid + warm grain: treemap-friendly atmosphere. */
  background-image:
    linear-gradient(rgba(14, 14, 16, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 14, 16, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

main > section + section { border-top: 1px solid var(--rule-soft); }

/* ─── shared section heading + eyebrow ─── */

.section-head { margin-bottom: 44px; }

.section-head--center {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.section-head--center .section-desc { margin-left: auto; margin-right: auto; }

.section-serial,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.section-serial {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.section-serial::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--rule-strong);
}
.section-serial-num { color: var(--blue); font-weight: 600; }

.eyebrow { font-size: 0.7rem; letter-spacing: 0.1em; }
.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--fg);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 640px;
  letter-spacing: -0.003em;
}

.section-body {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 640px;
  letter-spacing: -0.003em;
}

:lang(ja) .section-title,
:lang(ja) .hero-title,
:lang(ja) .cta-heading {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

/* ─── buttons ─── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.003em;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-out), background 0.2s var(--ease-out), box-shadow 0.2s, color 0.2s, border-color 0.2s;
}

.btn--large { padding: 15px 22px; font-size: 0.98rem; }

.btn--primary {
  background: var(--ink);
  color: var(--fg-invert);
  box-shadow: 0 2px 0 rgba(14, 14, 16, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn--primary::before,
.site-header-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--blue);
  border-radius: var(--radius) 0 0 var(--radius);
}
.btn--primary::before { width: 4px; }
.site-header-cta::before { width: 3px; }

.btn--primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(14, 14, 16, 0.25), 0 10px 24px -8px rgba(0, 136, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 11px 17px;
}
.btn--ghost:hover { background: var(--card); border-color: var(--ink); }

/* ─── sticky header ─── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease-out), backdrop-filter 0.25s, border-color 0.25s;
}

.site-header.is-scrolled {
  background: rgba(250, 247, 241, 0.78);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom-color: var(--rule);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.site-logo-icon { border-radius: 6px; }

.site-nav {
  display: flex;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.site-nav a { position: relative; transition: color 0.2s; }
.site-nav a:hover { color: var(--fg); }
.site-nav a::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}
.site-nav a:hover::before { opacity: 0.8; }

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.lang-switch:hover { color: var(--fg); border-color: var(--ink); }

.site-header-cta {
  position: relative;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--fg-invert);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.003em;
  transition: background 0.2s, box-shadow 0.2s;
}
.site-header-cta:hover {
  background: #000;
  box-shadow: 0 6px 18px -6px rgba(0, 136, 255, 0.5);
}

/* ─── screenshots ─── */

/* Source PNGs ship with transparent backgrounds and baked-in drop shadows,
   so these wrappers just handle layout. */
.screenshot-frame,
.screenshot-frame--small {
  position: relative;
  transition: transform 0.4s var(--ease-out);
}
.screenshot-frame img,
.screenshot-frame--small img {
  width: 100%;
  height: auto;
  display: block;
}
.screenshot-frame:hover { transform: translateY(-4px); }

/* ─── HERO ─── */

.hero {
  position: relative;
  padding: 130px 0 80px;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}

/* Hero treemap — CSS grid of proportionally-sized blocks behind content,
   masked out so the type stays crisp. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-auto-rows: 42px;
  gap: 2px;
  padding: 8px;
  opacity: 0.9;
  mask-image: radial-gradient(ellipse 75% 70% at 60% 30%, transparent 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.7) 75%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 30%, transparent 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.7) 75%, black 100%);
}
.hero-bg span { display: block; opacity: 0.55; }

.hero-bg span:nth-child(1)  { grid-column: 1 / span 6;  grid-row: 1 / span 3; background: var(--blue);   opacity: 0.3; }
.hero-bg span:nth-child(2)  { grid-column: 7 / span 4;  grid-row: 1 / span 2; background: #191919;       opacity: 0.2; }
.hero-bg span:nth-child(3)  { grid-column: 11 / span 5; grid-row: 1 / span 4; background: var(--yellow); opacity: 0.35; }
.hero-bg span:nth-child(4)  { grid-column: 16 / span 3; grid-row: 1 / span 2; background: var(--red);    opacity: 0.25; }
.hero-bg span:nth-child(5)  { grid-column: 19 / span 6; grid-row: 1 / span 5; background: var(--blue);   opacity: 0.2; }
.hero-bg span:nth-child(6)  { grid-column: 7 / span 4;  grid-row: 3 / span 4; background: var(--blue);   opacity: 0.15; }
.hero-bg span:nth-child(7)  { grid-column: 16 / span 3; grid-row: 3 / span 3; background: #474747;       opacity: 0.15; }
.hero-bg span:nth-child(8)  { grid-column: 1 / span 3;  grid-row: 4 / span 2; background: var(--red);    opacity: 0.18; }
.hero-bg span:nth-child(9)  { grid-column: 4 / span 3;  grid-row: 4 / span 3; background: var(--yellow); opacity: 0.15; }
.hero-bg span:nth-child(10) { grid-column: 11 / span 3; grid-row: 5 / span 3; background: var(--blue);   opacity: 0.18; }
.hero-bg span:nth-child(11) { grid-column: 14 / span 2; grid-row: 5 / span 2; background: #191919;       opacity: 0.12; }
.hero-bg span:nth-child(12) { grid-column: 19 / span 4; grid-row: 6 / span 3; background: var(--yellow); opacity: 0.22; }
.hero-bg span:nth-child(13) { grid-column: 23 / span 2; grid-row: 6 / span 2; background: var(--red);    opacity: 0.2; }
.hero-bg span:nth-child(14) { grid-column: 1 / span 2;  grid-row: 6 / span 2; background: var(--blue);   opacity: 0.15; }
.hero-bg span:nth-child(15) { grid-column: 3 / span 5;  grid-row: 7 / span 2; background: var(--blue);   opacity: 0.2; }
.hero-bg span:nth-child(16) { grid-column: 8 / span 3;  grid-row: 7 / span 3; background: var(--red);    opacity: 0.18; }
.hero-bg span:nth-child(17) { grid-column: 11 / span 5; grid-row: 8 / span 3; background: var(--yellow); opacity: 0.18; }
.hero-bg span:nth-child(18) { grid-column: 16 / span 3; grid-row: 8 / span 2; background: #474747;       opacity: 0.1; }
.hero-bg span:nth-child(19) { grid-column: 19 / span 6; grid-row: 9 / span 3; background: var(--blue);   opacity: 0.12; }
.hero-bg span:nth-child(20) { grid-column: 1 / span 7;  grid-row: 9 / span 3; background: var(--blue);   opacity: 0.1; }

.hero-corner {
  position: absolute;
  top: 84px;
  right: 28px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-align: right;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0.7;
}
.hero-corner-row { display: block; }
.hero-corner-row + .hero-corner-row { margin-top: 2px; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
  min-height: 520px;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-copy-serial {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  text-transform: uppercase;
}
.hero-copy-serial::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--ink);
}
.hero-copy-serial strong { color: var(--blue); font-weight: 600; }

.hero-icon-inline {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-icon-inline img { width: 72px; height: 72px; border-radius: 14px; }
.hero-icon-inline span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--fg);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: var(--fg);
  max-width: 640px;
}
.hero-title .accent { color: var(--blue); }

.hero-subtitle {
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 520px;
  letter-spacing: -0.003em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-screenshot {
  position: relative;
  width: 100%;
  transform: rotate(2deg);
  transition: transform 0.6s var(--ease-out);
}
.hero-screenshot:hover { transform: rotate(0deg); }
.hero-screenshot img { width: 100%; display: block; }

.hero-screenshot-label {
  position: absolute;
  top: -22px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.hero-screenshot-label::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--rule);
  vertical-align: middle;
  margin-left: 8px;
}

/* ─── stats strip ─── */

.stats-strip { padding: 0 0 90px; background: var(--paper); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-stamp);
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  min-height: 160px;
  padding: 28px 24px 24px;
  background: var(--paper);
}
.stat:not(:last-child) { border-right: 1px solid var(--ink); }
.stat:nth-child(1) { background: var(--blue);   color: var(--fg-invert); }
.stat:nth-child(3) { background: var(--yellow); color: var(--ink); }
.stat:nth-child(4) { background: var(--red);    color: var(--fg-invert); }

.stat::before {
  content: attr(data-serial);
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.8vw, 3.4rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  max-width: 180px;
  line-height: 1.35;
}

/* ─── views section ─── */

.views-section { position: relative; padding: 110px 0; background: var(--paper-alt); }

.views-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule);
  background: var(--rule);
}

.view-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), background 0.2s, box-shadow 0.25s;
}
.view-card::before {
  content: attr(data-serial);
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}
.view-card:hover {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--ink), 0 12px 30px -12px rgba(14, 14, 16, 0.18);
  z-index: 1;
}

.view-card-shot {
  padding: 24px 24px 0;
  display: flex;
  align-items: flex-end;
}
.view-card-shot img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--rule), 0 4px 12px -3px rgba(14, 14, 16, 0.1);
}

.view-card-body { flex: 1; padding: 24px 26px 28px; }

.view-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--fg);
  margin-bottom: 10px;
}
.view-card p {
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}

/* ─── file types — signature treemap ─── */

.types-callout { position: relative; padding: 120px 0; background: var(--paper); }

.types-callout-inner {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 64px;
  align-items: stretch;
}

.types-callout-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.types-callout-copy .section-title { margin-bottom: 14px; }
.types-callout-copy .section-desc { margin-bottom: 28px; max-width: 520px; }

.types-callout-value {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}

.types-callout-number {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.types-callout-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Signature treemap surface: 20 real categories laid out as a packed
   12×6 sub-grid. Each cell rotates through its actual extension list. */
.types-chips {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-stamp);
  min-height: 460px;
  height: 100%;
}

.types-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  min-width: 0;
  /* Container queries to responsively size text to the cell */
  container-type: inline-size;
  container-name: chip;
  transition: filter 0.2s var(--ease-out), transform 0.2s, z-index 0s;
}

.types-chip-num {
  font-size: 0.6rem;
  opacity: 0.55;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  align-self: flex-end;
}

.types-chip-name {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-top: auto;
  line-height: 1.12;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

@container chip (max-width: 180px) {
  .types-chip-name { font-size: 0.76rem; letter-spacing: -0.02em; }
}
@container chip (max-width: 130px) {
  .types-chip-name { font-size: 0.7rem; line-height: 1.08; }
  .types-chip-ext { font-size: 0.64rem; }
}
@container chip (max-width: 100px) {
  .types-chip { padding: 8px 10px 10px; }
  .types-chip-name { font-size: 0.66rem; }
  .types-chip-num { font-size: 0.56rem; }
}

/* Rotating extension display — only one visible at a time. */
.types-chip-ext {
  position: relative;
  display: block;
  width: 100%;
  height: 1.1em;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  opacity: 0.72;
}

.types-chip-ext-item {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateY(4px);
  white-space: nowrap;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.types-chip-ext-item.is-active { opacity: 1; transform: translateY(0); }

.types-chip:hover {
  filter: brightness(1.08) saturate(1.15);
  z-index: 5;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(14, 14, 16, 0.25);
}

/* Explicit grid placement — every cell of the 12×6 grid is covered. */
.types-chip:nth-child(1)  { grid-area: 1 / 1 / 3 / 6;   background: var(--blue);     color: #fff; }
.types-chip:nth-child(2)  { grid-area: 1 / 6 / 3 / 10;  background: var(--red);      color: #fff; }
.types-chip:nth-child(3)  { grid-area: 1 / 10 / 3 / 13; background: var(--yellow); }
.types-chip:nth-child(4)  { grid-area: 3 / 1 / 5 / 5;   background: #474747;         color: #fff; }
.types-chip:nth-child(5)  { grid-area: 3 / 5 / 5 / 8;   background: var(--paper); }
.types-chip:nth-child(6)  { grid-area: 3 / 8 / 5 / 10;  background: var(--ink);      color: var(--fg-invert); }
.types-chip:nth-child(7)  { grid-area: 3 / 10 / 4 / 13; background: var(--yellow); opacity: 0.85; }
.types-chip:nth-child(8)  { grid-area: 4 / 10 / 5 / 13; background: var(--blue); opacity: 0.55; color: #fff; }
.types-chip:nth-child(9)  { grid-area: 5 / 1 / 6 / 3;   background: var(--paper-alt); }
.types-chip:nth-child(10) { grid-area: 5 / 3 / 6 / 5;   background: var(--red); opacity: 0.7; color: #fff; }
.types-chip:nth-child(11) { grid-area: 5 / 5 / 6 / 7;   background: #2c2c2f; color: var(--fg-invert); }
.types-chip:nth-child(12) { grid-area: 5 / 7 / 6 / 9;   background: var(--yellow); opacity: 0.65; }
.types-chip:nth-child(13) { grid-area: 5 / 9 / 6 / 11;  background: var(--blue); opacity: 0.7; color: #fff; }
.types-chip:nth-child(14) { grid-area: 5 / 11 / 6 / 13; background: #474747; opacity: 0.85; color: #fff; }
.types-chip:nth-child(15) { grid-area: 6 / 1 / 7 / 3;   background: var(--paper); }
.types-chip:nth-child(16) { grid-area: 6 / 3 / 7 / 5;   background: var(--yellow); opacity: 0.5; }
.types-chip:nth-child(17) { grid-area: 6 / 5 / 7 / 7;   background: var(--paper-alt); }
.types-chip:nth-child(18) { grid-area: 6 / 7 / 7 / 9;   background: var(--blue); opacity: 0.35; color: #fff; }
.types-chip:nth-child(19) { grid-area: 6 / 9 / 7 / 11;  background: var(--red); opacity: 0.42; color: #fff; }
.types-chip:nth-child(20) { grid-area: 6 / 11 / 7 / 13; background: var(--ink); color: var(--fg-invert); }

/* ─── smart-folder grouping (treemap) ─── */

.treemap-section { padding: 120px 0; background: var(--paper-alt); }

.treemap-showcase {
  position: relative;
  margin-bottom: 56px;
  aspect-ratio: 2400 / 697;
}

.treemap-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease-out);
}
.treemap-slide.is-active { opacity: 1; pointer-events: auto; }
.treemap-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.treemap-toggle-labels {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(28, 28, 30, 0.75);
  backdrop-filter: saturate(1.8) blur(20px);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.treemap-toggle-label {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.003em;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.treemap-toggle-label:hover { color: #fff; }
.treemap-toggle-label.is-active { background: #fff; color: var(--fg); }

.treemap-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.treemap-copy .section-body { margin-bottom: 18px; }

.treemap-footnote {
  padding: 14px 16px;
  background: var(--yellow-soft);
  border-left: 3px solid var(--yellow);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--fg-muted);
  letter-spacing: -0.005em;
}

.treemap-groups {
  list-style: none;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.treemap-groups li {
  position: relative;
  padding: 14px 18px;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--fg);
  line-height: 1.45;
  letter-spacing: -0.003em;
  transition: background 0.15s, box-shadow 0.15s;
}
.treemap-groups li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--blue);
  transition: width 0.15s;
}
.treemap-groups li:hover { background: var(--paper); }
.treemap-groups li:hover::before { width: 3px; }

/* ─── search section ─── */

.search-section { padding: 120px 0; background: var(--paper); }

.search-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.speed-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 5px 12px;
  background: var(--yellow-soft);
  color: #8f6a00;
  border: 1px solid var(--yellow);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.speed-dot {
  width: 6px;
  height: 6px;
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(247, 200, 58, 0.3);
  animation: speed-pulse 1.6s var(--ease-soft) infinite;
}

@keyframes speed-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

.query-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.query-row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease-out);
}
.query-row:hover { border-color: var(--ink); transform: translateX(2px); }

.query-row.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--fg-invert);
}
.query-row.is-active .query-code { background: var(--blue); color: #fff; }
.query-row.is-active .query-desc { color: rgba(250, 247, 241, 0.7); }

.query-hint {
  display: block;
  margin-bottom: 32px;
  padding-left: 16px;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--fg-dim);
}

.query-code {
  flex-shrink: 0;
  padding: 3px 8px;
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.query-desc {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--fg-muted);
}

.legend {
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.legend h4 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
}
.legend ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
.legend li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}
.legend strong {
  padding: 1px 6px;
  background: var(--paper-alt);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fg);
}

.search-visual {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Interactive results panel beneath the screenshot, mirrors app list view */
.search-results-panel {
  position: relative;
  min-height: 380px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(14, 14, 16, 0.06), 0 14px 30px -14px rgba(14, 14, 16, 0.18);
  overflow: hidden;
}
.search-results-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  width: 100%;
  height: 3px;
  background: var(--blue);
}

.search-results-set { display: none; }
.search-results-set.is-active {
  display: block;
  animation: results-set-in 0.32s var(--ease-out);
}

@keyframes results-set-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper-alt);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.search-results-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.search-results-query {
  flex: 1;
  padding: 3px 9px;
  background: var(--blue-soft);
  border: 1px solid rgba(0, 136, 255, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results-count {
  min-width: 26px;
  padding: 3px 9px;
  background: var(--yellow);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.02em;
}

.search-results-list { list-style: none; }

.result-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-mono);
  transition: background 0.15s;
  animation: result-row-in 0.35s var(--ease-out) backwards;
}

.search-results-set.is-active .result-row:nth-child(1) { animation-delay: 60ms; }
.search-results-set.is-active .result-row:nth-child(2) { animation-delay: 110ms; }
.search-results-set.is-active .result-row:nth-child(3) { animation-delay: 160ms; }
.search-results-set.is-active .result-row:nth-child(4) { animation-delay: 210ms; }
.search-results-set.is-active .result-row:nth-child(5) { animation-delay: 260ms; }
.search-results-set.is-active .result-row:nth-child(6) { animation-delay: 310ms; }
.search-results-set.is-active .result-row:nth-child(7) { animation-delay: 360ms; }
.search-results-set.is-active .result-row:nth-child(8) { animation-delay: 410ms; }

@keyframes result-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-row:last-child { border-bottom: 0; }
.result-row:hover { background: var(--paper-alt); }

.result-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.result-icon--video,
.result-icon--archive { background: var(--red); }
.result-icon--image,
.result-icon--data    { background: var(--blue); }
.result-icon--code    { background: var(--yellow); color: var(--ink); }
.result-icon--log     { background: var(--ink-soft); }

.result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.003em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-path {
  font-size: 0.7rem;
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-size {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.result-modified {
  min-width: 58px;
  font-size: 0.74rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: 0.02em;
}

/* ─── batch rename ─── */

.rename-section { padding: 120px 0; background: var(--paper); }

.rename-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.rename-figure {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rename-figure figcaption { padding: 0 4px; }
.rename-figure figcaption strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.rename-figure figcaption span {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* Interactive rename editor (auto-typing demo, mirrors the app sheet) */
.rename-editor {
  position: relative;
  margin: 44px auto 0;
  padding: 22px 24px;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(14, 14, 16, 0.08), 0 14px 34px -14px rgba(14, 14, 16, 0.2);
  overflow: hidden;
}
.rename-editor::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--blue);
}

.rename-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.rename-editor-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.rename-editor-eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--blue);
}

.rename-editor-selected {
  padding: 3px 8px;
  background: var(--paper-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}

.rename-editor-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.rename-editor-row { margin-bottom: 16px; }

.template-line {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fg-invert);
  white-space: pre;
  overflow: hidden;
}
.template-literal { white-space: pre; }

.template-token {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.template-token.is-fresh {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px currentColor;
}

.template-token--num   { background: rgba(247, 200, 58, 0.2);  color: var(--yellow); }
.template-token--date  { background: rgba(247, 83, 91, 0.2);   color: var(--red); }
.template-token--name  { background: rgba(0, 136, 255, 0.2);   color: var(--blue); }
.template-token--path  { background: rgba(250, 247, 241, 0.12); color: #e8dfcd; }
.template-token--other { background: rgba(250, 247, 241, 0.1);  color: #c7c2b5; }

.template-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--blue);
  animation: cursor-blink 1.05s step-end infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.rename-editor-preview { margin-top: 4px; }

.preview-rows {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.preview-row {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 32px;
  background: var(--card);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.preview-from,
.preview-to {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-from { color: var(--fg-muted); }
.preview-arrow { color: var(--fg-dim); text-align: center; font-size: 0.8rem; }
.preview-to {
  color: var(--fg);
  font-weight: 500;
  transition: color 0.2s var(--ease-out), background 0.25s var(--ease-out);
}
.preview-to.is-pulsed { animation: preview-flash 0.35s var(--ease-out); }

@keyframes preview-flash {
  0%   { background: rgba(0, 136, 255, 0.18); }
  100% { background: transparent; }
}

/* ─── cleanup section ─── */

.cleanup-section {
  padding: 120px 0;
  background: var(--paper-alt);
  overflow: hidden;
}

.cleanup-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.cleanup-copy .section-title { margin-top: 16px; }
.cleanup-copy .section-desc  { margin-top: 12px; max-width: 520px; }

.cleanup-phases {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}

.cleanup-phase {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 20px 0;
  align-items: baseline;
  border-top: 1px solid var(--rule);
}
.cleanup-phase:last-child { border-bottom: 1px solid var(--rule); }

.cleanup-phase-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
}

.cleanup-phase-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cleanup-phase-body strong {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cleanup-phase-body span {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

.cleanup-screenshot-wrap { position: relative; }
.cleanup-screenshot-wrap .screenshot-frame {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}

.cleanup-reclaim-pill {
  position: absolute;
  bottom: -16px;
  right: 24px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 20px;
  background: var(--red);
  color: var(--fg-invert);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-stamp);
  font-family: var(--font-display);
  opacity: 0;
}
.cleanup-reclaim-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cleanup-reclaim-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Pill pops in once the cleanup-visual reveal triggers. */
.cleanup-visual.is-visible .cleanup-reclaim-pill {
  animation: cleanup-pill-pop 0.5s var(--ease-out) 0.6s forwards;
}

@keyframes cleanup-pill-pop {
  0%   { opacity: 0; transform: translateY(12px) scale(0.9); }
  60%  { transform: translateY(-4px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cleanup-suggestions {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.cleanup-suggestions-title {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.cleanup-suggestions-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cleanup-suggestions-list li {
  padding: 4px 10px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* ─── head-to-head race ─── */

.race-section {
  position: relative;
  padding: 120px 0;
  background: var(--paper-alt);
  overflow: hidden;
  isolation: isolate;
}

.race-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.race-bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 800px;
  height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 136, 255, 0.08), transparent 65%);
  filter: blur(60px);
}

.race-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 56px;
}
.race-heading .section-desc { margin: 0 auto 24px; }

.race-test-config {
  display: inline-block;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.race-card {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 36px 30px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-stamp);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.race-card + .race-card { margin-top: 24px; }
.race-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.race-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--blue);
}
.race-card:nth-of-type(2)::before { background: var(--yellow); }

.race-card[data-race-index]::after {
  content: "0" attr(data-race-index);
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.race-scenario {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  padding: 5px 10px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.003em;
}

.race-scenario-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 136, 255, 0.25);
  animation: race-dot-pulse 1.6s var(--ease-soft) infinite;
}

@keyframes race-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

.race-track {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.race-lane {
  display: grid;
  grid-template-columns: 170px 1fr 70px;
  align-items: center;
  gap: 20px;
}

.race-lane-label strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.race-lane-label span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}
.race-lane--tare .race-lane-label strong { color: var(--blue); }

.race-bar {
  position: relative;
  height: 20px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  overflow: hidden;
  isolation: isolate;
}

.race-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  transform-origin: left;
}
.race-bar-fill--tare {
  background: var(--blue);
  box-shadow: 0 0 14px rgba(0, 136, 255, 0.5);
}
.race-bar-fill--competitor { background: var(--ink-soft); }

.race-is-running .race-bar-fill--tare {
  width: var(--fill);
  transition: width var(--duration) cubic-bezier(0.25, 0.8, 0.4, 1);
}
.race-is-running .race-bar-fill--competitor {
  width: var(--fill);
  transition: width var(--duration) cubic-bezier(0.3, 0, 0.5, 1);
}

.race-finish {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%) scale(0.9);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.race-lane--tare.is-finished .race-finish {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.race-time {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.race-time--tare       { color: var(--blue); }
.race-time--competitor { color: var(--fg-muted); }

.race-factor {
  display: flex;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.race-factor-pill {
  padding: 6px 14px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.4s var(--ease-out) 0.9s, opacity 0.4s var(--ease-out) 0.9s;
}
.race-is-running .race-factor-pill { transform: scale(1); opacity: 1; }

.race-supporting {
  max-width: 980px;
  margin: 64px auto 0;
  text-align: center;
}
.race-supporting > .eyebrow { margin-bottom: 20px; color: var(--fg-muted); }

.race-supporting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: left;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.race-support-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 28px;
  background: var(--card);
  transition: background 0.2s;
}
.race-support-card:hover { background: var(--paper-alt); }

.race-support-time {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.race-support-number {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--blue);
}

.race-support-unit {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

.race-support-body strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.race-support-body span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}

/* ─── native comparison ─── */

.compare-section {
  position: relative;
  padding: 120px 0;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

.compare-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 56px;
}
.compare-heading .section-desc { margin: 0 auto 16px; }

.compare-scale {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.compare-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.compare-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding: 22px 28px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.compare-row:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 -2px var(--blue);
}

.compare-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.compare-op {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--fg);
}

.compare-tool {
  align-self: flex-start;
  max-width: 100%;
  padding: 3px 10px;
  background: var(--paper-alt);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-row-scale {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--fg-dim);
}

.compare-numbers {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.compare-native-time {
  font-size: 0.95rem;
  color: var(--fg-dim);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(60, 60, 67, 0.4);
}
.compare-arrow { color: var(--fg-dim); font-size: 0.95rem; }

.compare-tare-time {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.045em;
}

.compare-factor {
  padding: 3px 10px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: -0.003em;
}

.compare-footnote {
  max-width: 720px;
  margin: 36px auto 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}
.compare-footnote code {
  padding: 1px 6px;
  background: var(--paper-alt);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg);
}

/* ─── file operations grid ─── */

.ops-section { padding: 120px 0; background: var(--paper-alt); }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--ink);
  border: 1px solid var(--ink);
}

.op-card {
  position: relative;
  padding: 22px;
  background: var(--card);
  transition: background 0.2s var(--ease-out);
}
.op-card:hover { background: var(--paper-alt); }
.op-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: var(--blue);
  transition: width 0.2s var(--ease-out);
}
.op-card:hover::before { width: 100%; }

.op-card strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--fg);
}
.op-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}

/* ─── privacy / tech ─── */

.privacy-section { padding: 120px 0; background: var(--paper); }

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--rule);
  border: 1px solid var(--rule);
}

.privacy-card {
  position: relative;
  padding: 28px 26px;
  background: var(--card);
  transition: background 0.2s;
}
.privacy-card:hover { background: var(--paper); }
.privacy-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 24px;
  width: 6px;
  height: 6px;
  background: var(--blue);
}
.privacy-card:nth-child(2)::before { background: var(--red); }
.privacy-card:nth-child(3)::before { background: var(--yellow); }
.privacy-card:nth-child(4)::before { background: var(--ink); }

.privacy-card h3 {
  margin: 20px 0 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.privacy-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}

/* ─── FAQ ─── */

.faq-section { padding: 120px 0; background: var(--paper-alt); }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s;
}
.faq-item:hover { border-color: var(--ink); }
.faq-item[open] {
  border-color: var(--ink);
  box-shadow: 0 4px 0 -1px var(--blue);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; content: ""; }

.faq-q {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.035em;
  color: var(--fg);
}
.faq-item:hover .faq-q { color: var(--blue); }

.faq-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--paper-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--fg-muted);
  transition: transform 0.3s var(--ease-out), background 0.2s, color 0.2s;
}
.faq-item[open] .faq-chevron {
  transform: rotate(45deg);
  background: var(--blue);
  color: #fff;
}

.faq-a {
  padding: 0 24px 22px;
  animation: faq-open 0.35s var(--ease-out);
}
.faq-a p {
  max-width: 680px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--fg-muted);
  letter-spacing: -0.003em;
}
.faq-a code {
  padding: 1px 6px;
  background: var(--paper-alt);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
}

@keyframes faq-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CTA — giant yellow plate ─── */

.cta-section {
  position: relative;
  padding: 110px 0 130px;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

.cta-block {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  padding: 64px 56px 56px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}
.cta-block::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--ink);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.cta-block::after {
  content: "10";
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-invert);
}

.cta-icon {
  width: 128px;
  height: 128px;
  border-radius: 24px;
  box-shadow: var(--shadow-stamp);
}

.cta-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.cta-heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.cta-body {
  max-width: 460px;
  font-size: 1.05rem;
  color: rgba(14, 14, 16, 0.78);
  letter-spacing: -0.003em;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.cta-section .btn--primary { background: var(--ink); color: var(--paper); }
.cta-section .btn--primary::before { background: var(--blue); }
.cta-section .btn--primary:hover { background: #000; transform: translateY(-1px); }

.cta-note {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: rgba(14, 14, 16, 0.55);
  letter-spacing: 0.03em;
}

/* ─── footer ─── */

.site-footer {
  padding: 28px 0;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer-brand img { border-radius: 5px; }

.site-footer-logo {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--fg);
}

.site-footer-copy {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

.site-footer-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.site-footer-link:hover { color: var(--blue); }

/* ─── reveal animations ─── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal--slow { transition-duration: 1s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ─── reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal--slow { opacity: 1 !important; transform: none !important; transition: none; }
  .types-chip-ext-item { transition: none; }
  .types-chip:hover { transform: none; }
  .speed-dot,
  .race-scenario-dot { animation: none; }
  .template-cursor { animation: none; opacity: 1; }
  .template-token.is-fresh { transform: none; box-shadow: none; }
  .preview-to.is-pulsed { animation: none; }
  .search-results-set.is-active,
  .result-row { animation: none !important; }
  .race-bar-fill--tare,
  .race-bar-fill--competitor { width: var(--fill); transition: none; }
  .race-factor-pill { transform: none; opacity: 1; transition: none; }
  .race-lane--tare .race-finish { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* ─── responsive ─── */

@media (max-width: 1024px) {
  .site-nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero-title { font-size: clamp(2.4rem, 7vw, 3.6rem); max-width: none; }
  .hero-corner { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .views-grid { grid-template-columns: 1fr; }
  .types-callout-inner { grid-template-columns: 1fr; gap: 40px; }
  .treemap-split { grid-template-columns: 1fr; gap: 32px; }
  .search-split { grid-template-columns: 1fr; gap: 48px; }
  .search-visual { position: static; }
  .rename-visuals { grid-template-columns: 1fr; }
  .ops-grid { grid-template-columns: repeat(2, 1fr); }
  .privacy-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .cleanup-split { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 860px) {
  .race-card { padding: 32px 28px 28px; }
  .race-lane { grid-template-columns: 130px 1fr 60px; gap: 14px; }
  .race-lane-label strong { font-size: 0.95rem; }
  .race-lane-label span { font-size: 0.85rem; }
  .race-time { font-size: 1rem; }
  .race-supporting-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .compare-row { grid-template-columns: 1fr; gap: 14px; padding: 20px 22px; }
  .compare-numbers { justify-self: flex-start; flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .cta-block { grid-template-columns: 1fr; padding: 40px 32px 36px; gap: 28px; }
  .cta-icon { width: 96px; height: 96px; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .site-header { padding: 10px 0; }
  .site-header-cta { display: none; }
  .hero { padding-top: 110px; padding-bottom: 50px; }
  .hero-icon-inline img { width: 56px; height: 56px; }
  .hero-icon-inline span { font-size: 1.2rem; }
  .hero-title { font-size: clamp(2.1rem, 10vw, 2.9rem); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { min-height: 120px; }
  .types-chips { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 48px; }
  .types-chip:nth-child(n) { grid-column: span 3; grid-row: span 1; }
  .views-section, .treemap-section, .search-section, .rename-section,
  .ops-section, .privacy-section, .faq-section, .compare-section,
  .race-section, .types-callout { padding: 80px 0; }
  .ops-grid, .privacy-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 90px 0; }
  .cta-icon { width: 72px; height: 72px; }
  .faq-item summary { padding: 18px 20px; gap: 16px; }
  .faq-q { font-size: 0.95rem; }
  .faq-a { padding: 0 20px 20px; }
}

@media (max-width: 580px) {
  .result-row { grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto; gap: 8px 10px; }
  .result-modified { grid-column: 2 / 4; grid-row: 2; text-align: left; min-width: 0; }
  .result-size { grid-column: 3; grid-row: 1; }
  .rename-editor { padding: 18px; }
  .template-line { font-size: 0.85rem; padding: 9px 12px; }
  .preview-row { font-size: 0.78rem; grid-template-columns: 1fr 16px 1fr; }
  .cleanup-section { padding: 80px 0; }
  .cleanup-phase { grid-template-columns: 32px 1fr; gap: 12px; padding: 16px 0; }
  .cleanup-phase-num { font-size: 1.2rem; }
  .cleanup-reclaim-pill { right: 12px; bottom: -12px; padding: 8px 16px; }
  .cleanup-reclaim-value { font-size: 1rem; }
  .cleanup-suggestions { padding: 16px; }
  .race-lane { grid-template-columns: 1fr; gap: 6px; }
  .race-time { text-align: left; }
  .race-finish { display: none; }
  .race-support-number { font-size: 2rem; }
}

@media (max-width: 480px) {
  .compare-tool { font-size: 0.74rem; }
  .compare-tare-time { font-size: 1.1rem; }
}

