:root {
    --bg: #f3efe7;
    --bg-deep: #ebe5d9;
    --ink: #1a1916;
    --ink-soft: #5a564e;
    --ink-faint: #8a8479;
    --rule: rgba(26, 25, 22, 0.12);
    --accent: #b8551f;
    --canvas-tint: rgba(26, 25, 22, 0.04);
  }

  html[data-theme="dark"] {
    --bg: #0f0e0c;
    --bg-deep: #171613;
    --ink: #eae5db;
    --ink-soft: #9e988c;
    --ink-faint: #5e584d;
    --rule: rgba(234, 229, 219, 0.14);
    --accent: #d98248;
    --canvas-tint: rgba(234, 229, 219, 0.04);
  }

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

  html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter Tight', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.6s ease, color 0.6s ease;
  }

  body {
    min-height: 100vh;
    position: relative;
  }

  /* ── BACKGROUND STAGE ─────────────────────────────── */
  .bg-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .bg-stage canvas, .bg-stage svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* ── PAGE CONTENT ─────────────────────────────── */
  .page {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
  }

  /* ── NAV ─────────────────────────────── */
  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    mix-blend-mode: normal;
  }
  .wordmark {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 22px;
    letter-spacing: -0.02em;
    font-style: italic;
  }
  .wordmark::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 4px;
    transform: translateY(-8px);
  }
  .nav-links {
    display: flex;
    gap: 36px;
    font-size: 13.5px;
    color: var(--ink-soft);
    font-weight: 400;
  }
  .nav-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--ink); }

  /* ── HERO ─────────────────────────────── */
  .hero {
    padding: 140px 0 160px;
    max-width: 900px;
  }
  .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--ink-faint);
  }
  h1 {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(48px, 7vw, 92px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 40px;
    text-wrap: balance;
  }
  h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
  }
  .hero-sub {
    font-size: 19px;
    line-height: 1.5;
    color: var(--ink-soft);
    max-width: 560px;
    font-weight: 300;
    text-wrap: pretty;
  }

  /* ── SECTION HEADER ─────────────────────────────── */
  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 48px;
  }
  .section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .section-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
  }

  /* ── PRODUCTS ─────────────────────────────── */
  .products {
    padding: 40px 0 120px;
  }
  .product-list {
    display: flex;
    flex-direction: column;
  }
  .product {
    display: grid;
    grid-template-columns: 40px 56px 1fr 2fr 180px 20px;
    gap: 28px;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--rule);
    cursor: pointer;
    position: relative;
    transition: padding 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
    overflow: hidden;
  }
  .product:hover {
    padding-left: 24px;
    padding-right: 24px;
  }
  /* sliding wipe */
  .product::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--canvas-tint);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1);
    pointer-events: none;
  }
  .product:hover::before { transform: scaleX(1); }
  /* accent vertical bar that grows in */
  .product::after {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
    pointer-events: none;
  }
  .product:hover::after { transform: scaleY(1); }

  .product-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
  }

  /* icon */
  .product-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--rule);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    position: relative;
    z-index: 1;
    transition: border-color 0.5s, transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1), color 0.5s;
    flex-shrink: 0;
  }
  .product-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1);
  }
  .product:hover .product-icon {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(-8deg);
  }
  .product:hover .product-icon svg {
    transform: rotate(16deg) scale(1.1);
  }

  /* Name (static, no flip) */
  .product-name {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    line-height: 1.1;
    transition: color 0.4s ease;
  }
  .product:hover .product-name {
    color: var(--ink);
  }
  .product-name em {
    font-style: italic;
    color: var(--accent);
  }

  .product-desc {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.4;
    font-weight: 300;
    position: relative;
    z-index: 1;
    transition: color 0.5s, transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
  }
  .product:hover .product-desc {
    color: var(--ink);
    transform: translateX(4px);
  }

  .product-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
    text-align: right;
    position: relative;
    z-index: 1;
  }
  .product-arrow {
    font-family: serif;
    font-size: 20px;
    color: var(--ink-faint);
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1), color 0.3s;
    position: relative;
    z-index: 1;
  }
  .product:hover .product-arrow {
    transform: translateX(8px);
    color: var(--accent);
  }

  /* ── ABOUT STRIP ─────────────────────────────── */
  .about {
    padding: 80px 0 140px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 80px;
    align-items: start;
  }
  .about-body {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-wrap: pretty;
  }
  .about-body em {
    font-style: italic;
    color: var(--accent);
  }

  /* ── FOOTER ─────────────────────────────── */
  footer {
    border-top: 1px solid var(--rule);
    padding: 48px 0 56px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    font-size: 13.5px;
  }
  footer h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 400;
    margin-bottom: 20px;
  }
  footer ul { list-style: none; }
  footer li { margin-bottom: 10px; color: var(--ink-soft); font-weight: 300; }
  footer a { color: inherit; text-decoration: none; }
  footer a:hover { color: var(--ink); }
  .foot-brand {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 20px;
    font-style: italic;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
  }
  .foot-brand::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 4px;
    transform: translateY(-8px);
  }
  .foot-copy {
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 300;
    max-width: 280px;
    line-height: 1.5;
  }
  footer .foot-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--rule);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
  }
  footer .foot-meta .foot-controls {
    justify-self: center;
    margin-top: 0;
  }

  /* ── FOOTER CONTROLS ─────────────────────────────── */
  .foot-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 16px;
  }
  .foot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 3px;
    background: transparent;
  }
  .foot-toggle button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.25s, color 0.25s;
    padding: 0;
  }
  .foot-toggle button svg {
    width: 14px;
    height: 14px;
  }
  .foot-toggle button:hover {
    color: var(--ink);
  }
  .foot-toggle button.active {
    background: var(--ink);
    color: var(--bg);
  }
  /* accent swatches */
  .foot-accent {
    padding: 6px 10px;
    gap: 10px;
  }
  .foot-accent button {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--swatch, #888);
    border: 1px solid rgba(0,0,0,0.1);
    position: relative;
    display: block;
    flex-shrink: 0;
  }
  .foot-accent button span { display:none; }
  .foot-accent button.active {
    background: var(--swatch, #888);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink);
    transform: scale(1.05);
  }
  .foot-control-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-right: 10px;
    align-self: center;
  }
  .foot-control-group {
    display: inline-flex;
    align-items: center;
  }

  /* ── TWEAKS PANEL ─────────────────────────────── */
  .tweaks {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 18px 20px;
    width: 280px;
    font-family: 'Inter Tight', sans-serif;
    font-size: 13px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .tweaks.visible { display: block; }
  .tweaks h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 400;
    margin-bottom: 14px;
  }
  .tweak-group { margin-bottom: 16px; }
  .tweak-group:last-child { margin-bottom: 0; }
  .tweak-label {
    font-size: 11px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .bg-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
  .bg-swatch {
    aspect-ratio: 1;
    border: 1px solid var(--rule);
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg-deep);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }
  .bg-swatch:hover { border-color: var(--ink-soft); color: var(--ink); }
  .bg-swatch.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--canvas-tint);
  }
  .theme-toggle {
    display: flex;
    gap: 4px;
  }
  .theme-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.2s;
  }
  .theme-btn.active {
    border-color: var(--ink);
    color: var(--ink);
  }
  .accent-row {
    display: flex;
    gap: 6px;
  }
  .accent-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
  }
  .accent-dot.active {
    border-color: var(--ink);
  }

  @media (max-width: 768px) {
    .page { padding: 0 24px; }
    .product {
      grid-template-columns: 28px 40px 1fr 20px;
      gap: 14px;
    }
    .product-desc, .product-meta { display: none; }
    .product-icon { width: 36px; height: 36px; }
    .product-icon svg { width: 16px; height: 16px; }
    .about { grid-template-columns: 1fr; gap: 24px; }
    footer { grid-template-columns: 1fr 1fr; }
  }
