:root {
    --paper: #F6F1E7;
    --paper-raised: #FFFCF5;
    --ink: #1B1614;
    --ink-soft: #453D35;
    --muted: #6E6459;
    --rule: #E2D9C9;
    --laurel: #A3B18A;
    --laurel-deep: #5C6B4B;
    --laurel-mist: #E5E9DA;
    --forest: #22301C;
    --cherry: #7A1F32;
    --cherry-mist: #F2E2E4;
    --lamp: rgba(0, 0, 0, 0);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --measure: 62ch;
    --gutter: clamp(1.25rem, 5vw, 5rem);

    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #11170F;
      --paper-raised: #182015;
      --ink: #EDE5D4;
      --ink-soft: #CFC6B2;
      --muted: #9A9482;
      --rule: #2C3726;
      --laurel: #BFCBA8;
      --laurel-deep: #A3B18A;
      --laurel-mist: #1F2A1A;
      --forest: #0C1209;
      --cherry: #E4A2A8;
      --cherry-mist: #2A1A1D;
      --lamp: rgba(243, 202, 126, 0.16);
      color-scheme: dark;
    }
  }

  :root[data-theme="dark"] {
    --paper: #11170F;
    --paper-raised: #182015;
    --ink: #EDE5D4;
    --ink-soft: #CFC6B2;
    --muted: #9A9482;
    --rule: #2C3726;
    --laurel: #BFCBA8;
    --laurel-deep: #A3B18A;
    --laurel-mist: #1F2A1A;
    --forest: #0C1209;
    --cherry: #E4A2A8;
    --cherry-mist: #2A1A1D;
    --lamp: rgba(243, 202, 126, 0.16);
    color-scheme: dark;
  }

  *, *::before, *::after { box-sizing: inherit; }

  html { scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .5s ease, color .5s ease;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(70% 45% at 50% 0%, var(--lamp), transparent 70%);
    transition: background .6s ease;
    z-index: 0;
  }

  .shell { position: relative; z-index: 1; }

  a { color: var(--cherry); text-underline-offset: 3px; }
  a:hover { color: var(--ink); }
  :focus-visible { outline: 2px solid var(--cherry); outline-offset: 3px; border-radius: 4px; }

  h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; margin: 0; }

  .wrap { max-width: 76rem; margin: 0 auto; padding-inline: var(--gutter); }

  /* ---------- nav ---------- */
  .nav {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    border-bottom: 1px solid var(--rule);
  }
  .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; }
  .wordmark { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
  .nav-links { display: flex; align-items: center; gap: clamp(.75rem, 2.4vw, 1.75rem); }
  .nav-links a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
  .nav-links a:hover { color: var(--cherry); }
  .nav-right { display: flex; align-items: center; gap: clamp(.75rem, 2.4vw, 1.75rem); }

  /* hamburger: hidden until the row stops fitting */
  .burger {
    display: none;
    width: 40px; height: 36px;
    padding: 0; border: 0; background: none; cursor: pointer;
    position: relative;
  }
  .burger span {
    position: absolute; left: 9px; right: 9px; height: 1.5px; border-radius: 2px;
    background: var(--ink-soft);
    transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .18s ease;
  }
  .burger span:nth-child(1) { top: 12px; }
  .burger span:nth-child(2) { top: 17px; }
  .burger span:nth-child(3) { top: 22px; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  @media (prefers-reduced-motion: reduce) { .burger span { transition: none; } }

  @media (max-width: 52rem) {
    .burger { display: block; }
    .nav-links {
      position: absolute;
      top: 100%; right: clamp(1rem, 5vw, 2.5rem); left: clamp(1rem, 5vw, 2.5rem);
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      background: var(--paper-raised);
      border: 1px solid var(--rule);
      border-radius: 16px;
      box-shadow: 0 18px 40px rgba(0,0,0,.16);
      padding: .4rem;
      opacity: 0;
      transform: translateY(-8px);
      pointer-events: none;
      transition: opacity .2s ease, transform .25s cubic-bezier(.2,.8,.3,1);
    }
    .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
    .nav-links a {
      padding: .75rem .85rem;
      border-radius: 10px;
      font-size: 1rem;
    }
    .nav-links a + a { border-top: 1px solid var(--rule); }
    .nav-links a:hover, .nav-links a:focus-visible { background: var(--laurel-mist); color: var(--cherry); }
    .nav-inner { position: relative; }
    @media (prefers-reduced-motion: reduce) { .nav-links { transition: none; } }
  }

  .cord {
    position: relative;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 44px;
    height: 52px;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    align-items: flex-start;
    margin-block: -.4rem;
  }
  .cord .line {
    position: absolute;
    top: 0;
    width: 1.5px;
    height: 26px;
    background: var(--rule);
    transform-origin: top center;
    transition: height .18s ease;
  }
  .cord .knob {
    position: absolute;
    top: 24px;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: var(--laurel-deep);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--laurel) 30%, transparent);
    transition: transform .18s cubic-bezier(.3,1.6,.6,1), background-color .3s ease;
  }
  .cord:hover .line { height: 30px; }
  .cord:hover .knob { transform: translateY(4px); }
  .cord.pulling .line { height: 38px; }
  .cord.pulling .knob { transform: translateY(12px); }
  :root[data-theme="dark"] .cord .knob, :root:not([data-theme="light"]) .cord .knob { background: #F3CA7E; box-shadow: 0 0 0 3px rgba(243, 202, 126, .22), 0 0 16px 4px rgba(243, 202, 126, .35); }
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .cord .knob { background: var(--laurel-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--laurel) 30%, transparent); } }
  .cord-text { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); align-self: center; }

  /* ---------- hero ---------- */
  .hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4rem); }
  .hero p.standfirst { max-width: var(--measure); font-size: clamp(1.05rem, 1.9vw, 1.2rem); color: var(--ink-soft); margin: 1.6rem 0 0; }
  .hero h1 {
    font-size: clamp(2.6rem, 7.2vw, 5.1rem);
    line-height: 1.02;
    max-width: 18ch;
  }
  .hero h1 em { font-style: italic; font-weight: 600; color: var(--cherry); }
  .role {
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .05em;
    color: var(--laurel-deep);
    margin-bottom: 1.4rem;
    display: block;
  }
  .actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2.2rem; }
  .btn {
    display: inline-flex; align-items: center; min-height: 46px;
    padding: 0 1.4rem; border-radius: 999px; text-decoration: none;
    font-size: .98rem; font-weight: 500;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: transparent;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
  }
  .btn:hover { transform: translateY(-2px); }
  .btn-solid { background: var(--forest); border-color: var(--forest); color: #F6F1E7; }
  :root[data-theme="dark"] .btn-solid, :root:not([data-theme="light"]) .btn-solid { color: #EDE5D4; border-color: var(--laurel-deep); background: #1C2718; }
  .btn-solid:hover { color: #F6F1E7; }

  .reveal { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.22,.8,.3,1) forwards; }
  .reveal-2 { animation-delay: .12s; }
  .reveal-3 { animation-delay: .24s; }
  .reveal-4 { animation-delay: .36s; }
  @keyframes rise { to { opacity: 1; transform: none; } }

  /* ---------- sections ---------- */
  section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.1rem; margin-bottom: 2rem; }
  .section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
  .section-head .count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }

  /* ---------- work ---------- */
  .case {
    display: grid; gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: 1fr;
    align-items: center;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: 20px;
    padding: clamp(1.5rem, 3.4vw, 2.6rem);
    text-decoration: none; color: inherit;
    transition: border-color .25s ease, transform .25s ease;
  }
  .case:hover { border-color: var(--laurel-deep); transform: translateY(-3px); }
  .case:hover h3 { color: var(--cherry); }
  @media (min-width: 60rem) { .case.feature { grid-template-columns: 1.15fr .85fr; } }
  /* stacked: every card reads image, chips, title, description */
  @media (max-width: 59.99rem) {
    .case.feature { gap: 1.3rem; }
    .case.feature .thumb { order: -1; }
  }
  .case h3 { font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.15; transition: color .2s ease; }
  .case p { color: var(--ink-soft); margin: .7rem 0 0; max-width: 46ch; }
  .meta { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-top: 1.3rem; }
  .tags { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1rem; }
  .tag { font-family: var(--font-mono); font-size: .72rem; padding: .35rem .7rem; border-radius: 7px; background: var(--laurel-mist); color: var(--laurel-deep); }
  .tag.ship { background: var(--cherry-mist); color: var(--cherry); }
  .tag.alt { background: transparent; border: 1px solid var(--rule); color: var(--muted); padding: calc(.35rem - 1px) calc(.7rem - 1px); }
  :root[data-theme="dark"] .tag.ship, :root:not([data-theme="light"]) .tag.ship { color: var(--cherry); }

  .thumb { border-radius: 14px; overflow: hidden; background: var(--laurel-mist); aspect-ratio: 16 / 10; display: grid; place-items: center; }
  .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .thumb span { font-family: var(--font-mono); font-size: .72rem; color: var(--laurel-deep); padding: .8rem; text-align: center; }
  .grid-3 { display: grid; gap: 1.2rem; grid-template-columns: 1fr; margin-top: 1.2rem; }
  @media (min-width: 52rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
  .grid-3 .case h3 { font-size: 1.35rem; }
  .grid-3 .case { align-content: start; gap: 1.3rem; }

  /* ---------- about ---------- */
  .about { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
  @media (min-width: 60rem) { .about { grid-template-columns: 1.1fr .9fr; align-items: baseline; } }
  .about p { max-width: var(--measure); color: var(--ink-soft); }
  .about p.lead { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.35; color: var(--ink); }
  .principles { display: grid; gap: 1.6rem; }
  .principle { border-left: 2px solid var(--laurel); padding-left: 1.1rem; }
  .principle h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; margin: 0 0 .3rem; }
  .principle p { font-size: .96rem; margin: 0; }

  /* ---------- shelf ---------- */
  .shelf-intro {
    display: flex;
    align-items: flex-end;
    gap: clamp(.6rem, 2vw, 1.4rem);
    padding-left: clamp(.2rem, 2.5vw, 2rem);
    position: relative;
    z-index: 2;
  }
  .reader-btn {
    width: clamp(104px, 15vw, 178px);
    flex: none;
    margin-bottom: -1.2rem;
    padding: 0; border: 0; background: none; line-height: 0;
    cursor: pointer;
    border-radius: 14px;
    transition: transform .3s cubic-bezier(.2,.8,.3,1);
  }
  .reader-btn img { width: 100%; height: auto; display: block; }
  .reader-btn:hover, .reader-btn:focus-visible { transform: translateY(-4px) rotate(-1.2deg); }
  @media (prefers-reduced-motion: reduce) {
    .reader-btn { transition: none; }
    .reader-btn:hover, .reader-btn:focus-visible { transform: none; }
  }
  .whisper .ch { opacity: 0; transition: opacity .09s linear; }
  .whisper.typed .ch, .whisper.done .ch { opacity: 1; }
  .whisper .caret { display: inline-block; width: 0; height: 1em; position: relative; vertical-align: -.12em; }
  .whisper .caret::after {
    content: ""; position: absolute; left: 0; top: 0;
    width: 1px; height: 100%; background: currentColor;
    animation: caret-blink .9s steps(1) infinite;
  }
  @keyframes caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .whisper .caret::after { animation: none; } }
  .shelf-say { padding-bottom: clamp(.9rem, 2.6vw, 2rem); max-width: 44ch; }
  .shelf-say .bridge { margin: 0; color: var(--ink-soft); }
  .whisper {
    margin: .55rem 0 0;
    font-family: var(--font-mono);
    font-size: .8rem;
    line-height: 1.5;
    text-align: left;
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 1px dashed var(--rule);
    padding: 0 0 .2rem;
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
  }
  .whisper:hover, .whisper:focus-visible { color: var(--cherry); border-bottom-color: var(--cherry); }
  /* narrow: she sits above the line instead of beside it */
  @media (max-width: 44rem) {
    .shelf-intro { flex-direction: column; align-items: flex-start; gap: .35rem; padding-left: .25rem; }
    .reader-btn { width: clamp(126px, 32vw, 180px); margin-bottom: 0; }
    .shelf-say { padding-bottom: clamp(.9rem, 3vw, 1.4rem); max-width: none; }
  }
  .shelf { background: var(--forest); border-radius: 22px; padding: clamp(1.6rem, 4vw, 3rem); color: #EDE5D4; display: grid; gap: 2rem; }
  @media (min-width: 60rem) { .shelf { grid-template-columns: 1fr 1fr; align-items: center; } }
  .shelf h2 { color: #F6F1E7; font-size: clamp(1.5rem, 3vw, 2rem); }
  .shelf p { color: #C4CDB4; max-width: 42ch; }
  .books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; align-items: end; perspective: 1100px; }
  /* keep the spines from ballooning, and go two per row before they get thin */
  .book-slot { max-width: 158px; width: 100%; margin-inline: auto; }
  /* narrow: a shelf you slide along, instead of a stack that runs down the page */
  @media (max-width: 34rem) {
    .books {
      grid-template-columns: none;
      grid-auto-flow: column;
      grid-auto-columns: 118px;
      gap: .75rem;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x proximity;
      padding: 6px 0 .7rem;
      scrollbar-width: thin;
      scrollbar-color: rgba(237,229,212,.28) transparent;
    }
    .books::-webkit-scrollbar { height: 5px; }
    .books::-webkit-scrollbar-track { background: transparent; }
    .books::-webkit-scrollbar-thumb { background: rgba(237,229,212,.28); border-radius: 3px; }
    .book-slot { max-width: none; scroll-snap-align: start; }
  }
  .book-slot { position: relative; transform-style: preserve-3d; }
  .pages {
    position: absolute;
    inset: 0 -2px 0 7px;
    border-radius: 2px 5px 5px 2px;
    background: linear-gradient(90deg, #DCD0B4 0%, #F3EBD8 25%, #EDE3CC 60%, #F6F0DE 100%);
    box-shadow: inset -3px 0 6px rgba(0,0,0,.12);
    opacity: 0;
    transition: opacity .35s ease;
  }
  .book-slot:hover .pages { opacity: 1; }
  .book-slot:hover .book { transform: rotateY(-34deg); box-shadow: 6px 8px 22px rgba(0,0,0,.38); }
  .book {
    position: relative;
    aspect-ratio: 5 / 8;
    transform-origin: left center;
    transition: transform .55s cubic-bezier(.2,.75,.25,1), box-shadow .55s ease;
    border-radius: 3px 6px 6px 3px;
    background:
      repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px),
      linear-gradient(105deg, #35452B 0%, #2A3722 45%, #3B4C30 100%);
    border-left: 5px solid rgba(0,0,0,.35);
    box-shadow: inset -2px 0 0 rgba(255,255,255,.06), 0 6px 14px rgba(0,0,0,.28);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: .35rem;
    padding: 1.4rem .45rem;
    color: #E2CFA2;
    font-family: var(--font-display);
    font-size: clamp(.58rem, 1.45vw, .76rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    text-align: center;
  }
  .book::before, .book::after {
    content: "";
    position: absolute;
    inset-inline: 6px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C9A961, transparent);
    opacity: .75;
  }
  .book::before { top: 12%; box-shadow: 0 5px 0 -3.5px #C9A961; }
  .book::after { bottom: 12%; box-shadow: 0 -5px 0 -3.5px #C9A961; }
  .book span { display: block; max-width: 100%; }
  .book-slot:nth-child(2) .book { background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px), linear-gradient(105deg, #2C3A44 0%, #22303A 45%, #33434E 100%); }
  .book-slot:nth-child(2) { margin-bottom: .6rem; }
  .book-slot:nth-child(3) .book { background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px), linear-gradient(105deg, #4A3A22 0%, #3A2D1A 45%, #52402A 100%); }
  .book-slot:nth-child(4) { margin-bottom: .25rem; }
  .book-done {
    background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px), linear-gradient(105deg, #5A2228 0%, #461A20 45%, #642A31 100%);
    color: #F0D5B8;
    padding-bottom: 2.1rem;
  }
  .book-done .stamp {
    position: absolute;
    inset-inline: .3rem;
    bottom: .7rem;
    font-family: var(--font-mono);
    font-size: .52rem;
    letter-spacing: .04em;
    color: #D8A98C;
    border-top: 1px solid rgba(216,169,140,.4);
    padding-top: .35rem;
  }

  /* ---------- playground + guestbook ---------- */
  .two { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
  @media (min-width: 52rem) { .two { grid-template-columns: 1fr 1fr; } }
  .panel { border: 1px dashed var(--laurel); border-radius: 20px; padding: clamp(1.5rem, 3.4vw, 2.4rem); background: var(--paper-raised); }
  .panel h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
  .panel p { color: var(--ink-soft); max-width: 42ch; }
  .soon { font-family: var(--font-mono); font-size: .75rem; color: var(--laurel-deep); }
  .card-line { display: flex; gap: 1rem; margin-top: 1.4rem; }
  .card-line div { flex: 1; border-bottom: 1px solid var(--rule); padding-bottom: .5rem; font-size: .85rem; color: var(--muted); }
  .card-line div.date { flex: 0 0 6.5rem; font-family: var(--font-mono); }

  .empty-shelf { margin-top: 1.6rem; }
  .plank {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .7rem;
    align-items: end;
    padding-bottom: .7rem;
    border-bottom: 5px solid var(--rule);
    border-radius: 2px;
  }
  .slot {
    aspect-ratio: 5 / 8;
    border: 1px dashed var(--rule);
    border-radius: 3px 6px 6px 3px;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--laurel-mist) 60%, transparent));
  }
  .slot:nth-child(2) { margin-bottom: .5rem; }
  .slot:nth-child(4) { margin-bottom: .3rem; }

  /* ---------- contact ---------- */
  .contact { text-align: left; }
  .contact .section-head h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
  .contact .invite { font-family: var(--font-display); font-size: clamp(1.05rem, 2.1vw, 1.35rem); line-height: 1.4; color: var(--ink-soft); max-width: 34ch; margin: 0; }
  .contact-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

  footer { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; }

  /* ---------- panda, the companion ---------- */
.panda {
  position: fixed;
  right: clamp(.5rem, 3vw, 2.5rem);
  bottom: 0;
  width: clamp(96px, 11vw, 142px);
  z-index: 9;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  line-height: 0;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.18));
  transition: transform .45s cubic-bezier(.2,.8,.3,1);
}
.panda img { width: 100%; height: auto; display: none; }
.panda .p-peek { display: block; width: 56%; margin-inline: auto; transform: translateY(10%); }
.panda:hover .p-peek, .panda:focus-visible .p-peek { display: none; }
.panda:hover .p-sit, .panda:focus-visible .p-sit { display: block; width: 80%; margin-inline: auto; transform: translateY(6%); }
.panda.sleeping .p-peek, .panda.sleeping .p-sit { display: none !important; }
.panda.sleeping .p-sleep { display: block; width: 92%; margin-inline: auto; transform: translateY(6%); }
.panda.hiding { transform: translateY(112%); }
.panda .zzz {
  position: absolute;
  right: -6%;
  top: -6%;
  display: none;
  font-family: var(--font-display);
  color: var(--muted);
  line-height: 1;
  pointer-events: none;
}
.panda.sleeping .zzz { display: block; }
.panda .zzz span { position: absolute; opacity: 0; animation: float-z 3.4s ease-in-out infinite; }
.panda .zzz span:nth-child(1) { font-size: 1.05rem; right: 0; bottom: 0; }
.panda .zzz span:nth-child(2) { font-size: .8rem; right: 1.1rem; bottom: .7rem; animation-delay: 1.1s; }
.panda .zzz span:nth-child(3) { font-size: .62rem; right: 2rem; bottom: 1.3rem; animation-delay: 2.2s; }
@keyframes float-z { 0% { opacity: 0; transform: translate(0, 6px); } 35% { opacity: .85; } 100% { opacity: 0; transform: translate(8px, -16px); } }
@media (prefers-reduced-motion: reduce) { .panda .zzz span { animation: none; opacity: .7; } }
@media (max-width: 30rem) { .panda { width: 86px; right: .35rem; } }
@media (prefers-reduced-motion: reduce) { .panda { transition: none; } }

/* ---------- section drawer (tablet & mobile) ---------- */
.toc-tab {
  position: fixed;
  left: 0;
  top: 38%;
  transform: translateY(-50%);
  z-index: 12;
  border: 1px solid var(--rule);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--paper-raised);
  color: var(--ink);
  padding: .9rem .6rem;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  box-shadow: 4px 0 14px rgba(0,0,0,.08);
  transition: transform .3s ease, opacity .2s ease;
}
@media (min-width: 62rem) { .toc-tab { display: none; } }

.toc-sheet {
  position: fixed;
  inset: 0;
  z-index: 13;
  background: color-mix(in srgb, var(--forest) 42%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  display: flex;
  justify-content: flex-start;
}
.toc-sheet.is-open { opacity: 1; pointer-events: auto; }

.toc-sheet-inner {
  background: var(--paper);
  width: min(20rem, 84vw);
  height: 100%;
  border-right: 1px solid var(--rule);
  padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1.3rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.2,.8,.3,1);
  box-shadow: 10px 0 30px rgba(0,0,0,.14);
}
.toc-sheet.is-open .toc-sheet-inner { transform: none; }

.toc-sheet h2 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 0; }
.toc-sheet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.toc-sheet a { display: block; text-decoration: none; color: var(--ink); font-size: 1rem; padding: .75rem; border-radius: 10px; min-height: 44px; }
.toc-sheet a:hover, .toc-sheet a.active { background: var(--laurel-mist); }
.toc-sheet .sheet-progress { margin-top: auto; border-top: 1px solid var(--rule); padding-top: 1rem; }
.toc-sheet .progress { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.toc-sheet .progress span { display: block; height: 100%; width: 0; background: var(--cherry); transition: width .15s linear; }
.toc-sheet .read { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-top: .5rem; }
.toc-sheet .close { width: 100%; justify-content: center; margin-top: .8rem; }

/* figures whose artwork is transparent: no tinted frame, dimmed a touch at night */
.figure-plain .frame { background: transparent; aspect-ratio: auto; }
.figure-plain .frame img { width: 100%; height: auto; display: block; object-fit: contain; }
:root[data-theme="dark"] .figure-plain .frame img,
:root:not([data-theme="light"]) .figure-plain .frame img { filter: invert(1) hue-rotate(180deg) brightness(.94); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .figure-plain .frame img { filter: none; } }
.figure figcaption strong { color: var(--ink); font-weight: 700; }

/* light / dark artwork pairs */
.only-dark { display: none; }
:root[data-theme="dark"] .only-light, :root:not([data-theme="light"]) .only-light { display: none; }
:root[data-theme="dark"] .only-dark, :root:not([data-theme="light"]) .only-dark { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .only-light { display: block; }
  :root:not([data-theme="dark"]) .only-dark { display: none; }
}
:root[data-theme="dark"] .figure-plain .frame .only-dark,
:root[data-theme="dark"] .figure-plain .frame .only-light,
:root:not([data-theme="light"]) .figure-plain .frame .only-dark,
:root:not([data-theme="light"]) .figure-plain .frame .only-light { filter: none; }

/* tall artwork: let it breathe full column width, capped so it never dwarfs the page */
.figure-tall .frame img { max-height: 120vh; width: 100%; height: auto; object-fit: contain; }

/* ---------- subpage layout ---------- */
.page-head { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head .kicker { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .05em; color: var(--laurel-deep); }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.05; margin-top: 1rem; max-width: 20ch; }
.page-head .sub { font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--laurel-deep); margin-top: .9rem; max-width: 44ch; line-height: 1.35; }
.summary { max-width: var(--measure); font-size: 1.1rem; color: var(--ink-soft); margin-top: 1.6rem; }

.factbar { display: grid; grid-template-columns: 1fr; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--paper-raised); margin-top: 1.5rem; }
@media (min-width: 46rem) { .factbar { grid-template-columns: repeat(4, 1fr); } }
.fact { padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule); }
.fact:last-child { border-bottom: 0; }
@media (min-width: 46rem) { .fact { border-bottom: 0; border-right: 1px solid var(--rule); } .fact:last-child { border-right: 0; } }
.fact dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted); margin: 0; }
.fact dd { margin: .4rem 0 0; font-weight: 500; font-size: .98rem; }
.fact.shipped dd { color: var(--cherry); }
.fact a { text-decoration: none; }
.fact a:hover { text-decoration: underline; }

.case-body { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 3.5vw, 3rem); align-items: start; padding-bottom: 4rem; }
@media (min-width: 62rem) { .case-body { grid-template-columns: 14rem minmax(0, 1fr); } }
.case-main { min-width: 0; }
.case-main .page-head { padding-top: clamp(1rem, 2vw, 1.6rem); padding-bottom: clamp(1rem, 2vw, 1.5rem); }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6rem); display: none; }
@media (min-width: 62rem) { .toc { display: block; } }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a { display: block; text-decoration: none; color: var(--muted); font-size: .9rem; padding: .5rem .7rem; border-radius: 8px; }
.toc a:hover { color: var(--ink); background: var(--laurel-mist); }
.toc a.active { color: var(--ink); background: var(--laurel-mist); font-weight: 500; }
.toc .progress { height: 3px; background: var(--rule); border-radius: 2px; margin-top: 1.2rem; overflow: hidden; }
.toc .progress span { display: block; height: 100%; width: 0; background: var(--cherry); transition: width .15s linear; }
.toc .read { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-top: .5rem; }

.prose { max-width: 52rem; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 3rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; margin-top: 1.8rem; }
.prose p { color: var(--ink-soft); }
.prose ul { color: var(--ink-soft); padding-left: 1.1rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--laurel-deep); }
.prose .lede { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; color: var(--ink); }

.figure { margin: 2.4rem 0; width: 100%; }
.figure .frame { border-radius: 14px; background: var(--laurel-mist); aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.figure .frame img { width: 100%; height: 100%; object-fit: cover; }
.figure .frame span { font-family: var(--font-mono); font-size: .72rem; color: var(--laurel-deep); padding: 1rem; text-align: center; }
.figure figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; }
.figure figcaption strong { color: var(--ink); font-weight: 700; }

.hero-figure { margin: 0 0 .25rem; }
.hero-figure .frame { aspect-ratio: auto; width: 100%; border-radius: 16px; }
.hero-figure .frame img { width: 100%; height: auto; display: block; object-fit: contain; }

.pull { background: var(--forest); color: #F6F1E7; border-radius: 18px; padding: clamp(1.6rem, 4vw, 2.6rem); margin: 2.5rem 0; }
.pull p { font-family: var(--font-display); font-size: clamp(1.3rem, 2.8vw, 1.9rem); line-height: 1.3; color: #F6F1E7; margin: 0; }
.pull .label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; color: var(--laurel); margin-bottom: .8rem; display: block; }

.insight-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 44rem) { .insight-grid { grid-template-columns: 1fr 1fr; } }
.insight {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s ease, border-color .3s ease;
}
.insight:hover { transform: translateY(-4px) rotate(-.5deg); border-color: var(--laurel); box-shadow: 0 10px 24px rgba(0,0,0,.09); }
.insight:nth-child(even):hover { transform: translateY(-4px) rotate(.5deg); }
:root[data-theme="dark"] .insight:hover, :root:not([data-theme="light"]) .insight:hover { box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.insight h4 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 .5rem; font-weight: 600; line-height: 1.25; }
.insight p { margin: 0; font-size: .96rem; }

.next { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.6rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.next a { font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 600; text-decoration: none; }
.next span { color: var(--muted); font-size: .9rem; }

.detail-list { display: grid; gap: 1.4rem; margin-top: 1.2rem; }
.detail { border-left: 2px solid var(--laurel); padding-left: 1.1rem; }
.detail h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; margin: 0 0 .2rem; }
.detail .when { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.detail p { margin: .4rem 0 0; font-size: .96rem; }

details.certs { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
details.certs summary { cursor: pointer; font-size: .95rem; color: var(--cherry); min-height: 44px; display: flex; align-items: center; }
details.certs ul { columns: 2; column-gap: 2rem; font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 40rem) { details.certs ul { columns: 1; } }

.proto-cta { margin: 1.6rem 0 2rem; }

/* ---------- about page ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3.5rem); padding-bottom: 4rem; align-items: start; }
@media (min-width: 62rem) { .about-grid { grid-template-columns: minmax(0, 1fr) 19rem; } }
.about-side { display: grid; gap: 1.4rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5.5rem); }
.head-grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 52rem) { .head-grid { grid-template-columns: minmax(0, 1fr) 15rem; } }
@media (min-width: 62rem) { .head-grid { grid-template-columns: minmax(0, 1fr) 18rem; } }
.portrait { display: grid; place-items: center; position: relative; }
button.portrait {
  padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.8,.3,1);
}
button.portrait:hover, button.portrait:focus-visible { transform: translateY(-5px) rotate(-1deg); }
@media (prefers-reduced-motion: reduce) {
  button.portrait { transition: none; }
  button.portrait:hover, button.portrait:focus-visible { transform: none; }
}
.portrait img { width: auto; max-width: 100%; max-height: 26rem; height: auto; display: block; }
.portrait span { font-family: var(--font-mono); font-size: .7rem; color: var(--laurel-deep); text-align: center; padding: 1rem; }
.side-facts { margin: 0; display: grid; gap: .9rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.about-side .portrait { display: none; }
.side-facts dt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; color: var(--muted); }
.side-facts dd { margin: .25rem 0 0; font-size: .95rem; font-weight: 500; }
.side-links { display: grid; gap: .6rem; }
.side-links .btn { justify-content: center; }
.side-note { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- feature switcher ---------- */
.features { display: grid; gap: clamp(1.2rem, 3vw, 2.4rem); grid-template-columns: 1fr; margin: 2rem 0 2.5rem; align-items: start; }
@media (min-width: 52rem) { .features { grid-template-columns: minmax(0, 1fr) 17rem; } }
.feature-list { display: grid; gap: .7rem; }
.feature-btn {
  text-align: left; border: 1px solid var(--rule); background: var(--paper-raised);
  border-radius: 14px; padding: 1rem 1.1rem; cursor: pointer; display: grid; gap: .35rem;
  font-family: var(--font-body); color: var(--ink);
  transition: border-color .25s ease, background-color .25s ease, transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s ease;
}
.feature-btn:hover { border-color: var(--laurel); transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.feature-btn:nth-child(even):hover { transform: translateY(-3px) rotate(.4deg); }
:root[data-theme="dark"] .feature-btn:hover, :root:not([data-theme="light"]) .feature-btn:hover { box-shadow: 0 8px 20px rgba(0,0,0,.32); }
.feature-btn.is-active { border-color: var(--laurel-deep); background: var(--laurel-mist); }
.ft-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1.25; }
.ft-body { font-size: .93rem; color: var(--ink-soft); line-height: 1.5; }
.feature-screen { margin: 0; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6rem); }
.phone { aspect-ratio: 9 / 19; border-radius: 26px; border: 1px solid var(--rule); background: var(--laurel-mist); display: grid; place-items: center; overflow: hidden; padding: .5rem; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.phone span { font-family: var(--font-mono); font-size: .68rem; color: var(--laurel-deep); text-align: center; padding: 1rem; }
.feature-screen figcaption { font-size: .82rem; color: var(--muted); margin-top: .6rem; text-align: center; }

/* ---------- footer note ---------- */
.made { display: inline-flex; align-items: center; gap: .45rem; }
.made::before {
  content: "";
  width: 13px;
  height: 11px;
  flex: none;
  background:
    radial-gradient(circle at 1.5px 50%, transparent 0 2.2px, var(--muted) 2.2px 3.4px, transparent 3.4px) 9px 0 / 4px 11px no-repeat,
    linear-gradient(var(--muted), var(--muted)) 0 0 / 9px 11px no-repeat;
  border-radius: 1px 1px 3px 3px;
}

/* ---------- playground empty shelf ---------- */
.empty-shelf { margin-top: 1.6rem; }
.plank { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; align-items: end; padding-bottom: .7rem; border-bottom: 5px solid var(--rule); border-radius: 2px; }
.slot { aspect-ratio: 5 / 8; border: 1px dashed var(--rule); border-radius: 3px 6px 6px 3px; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--laurel-mist) 60%, transparent)); }
.slot:nth-child(2) { margin-bottom: .5rem; }
.slot:nth-child(4) { margin-bottom: .3rem; }

/* ---------- contact ---------- */
.contact { text-align: left; }
.contact .section-head h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.contact .invite { font-family: var(--font-display); font-size: clamp(1.05rem, 2.1vw, 1.35rem); line-height: 1.4; color: var(--ink-soft); max-width: 34ch; margin: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

/* ---------- problem set: phone + signage ---------- */
.problem-set { display: grid; gap: clamp(1.4rem, 3vw, 2.4rem); grid-template-columns: 1fr; align-items: start; margin: 2.4rem 0; }
@media (min-width: 52rem) { .problem-set { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); } }
.phone-figure { margin: 0; }
.phone-figure .frame { background: transparent; aspect-ratio: auto; }
.phone-figure .frame img { width: 100%; height: auto; object-fit: contain; }
.signage-figure { margin: 0; }
.signage {
  background: #E6E0D4;
  border-radius: 16px;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  display: grid;
  gap: .9rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .signage { grid-template-columns: repeat(3, 1fr); align-items: center; } }
:root[data-theme="dark"] .signage, :root:not([data-theme="light"]) .signage { background: #23301F; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .signage { background: #E6E0D4; } }
.signage img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s ease;
}
.signage img:hover { transform: scale(1.14); box-shadow: 0 14px 30px rgba(0,0,0,.24); position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .signage img { transition: none; } .signage img:hover { transform: none; } }

/* artwork that needs a light panel behind it in both modes */
.figure-panel .frame {
  background: #FFFCF5;
  aspect-ratio: auto;
  padding: clamp(.9rem, 2vw, 1.6rem);
  border-radius: 16px;
}
.figure-panel .frame img { width: 100%; height: auto; object-fit: contain; display: block; }
:root[data-theme="dark"] .figure-panel .frame, :root:not([data-theme="light"]) .figure-panel .frame { background: #182015; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .figure-panel .frame { background: #FFFCF5; } }

/* panel artwork that bleeds off the bottom edge, like the hero */
.figure-panel-flush .frame { padding-bottom: 0; overflow: hidden; }
.figure-panel-flush .frame img { display: block; margin-bottom: -1px; }

/* ---------- boarding group picker ---------- */
.group-picker { margin: 2rem 0 2.6rem; }
.group-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.group-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .22s ease, color .22s ease, transform .28s cubic-bezier(.2,.8,.3,1), box-shadow .28s ease;
}
.group-chip .chip-dot {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: var(--chip);
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.group-chip:hover { transform: translateY(-2px); border-color: var(--chip); color: var(--ink); }
.group-chip.is-active {
  border-color: var(--chip);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--chip);
}
.group-chip.is-active .chip-dot { width: 15px; height: 15px; }
.group-figure { margin: 0; }
.group-figure .frame { position: relative; }
.group-figure .frame .group-shot { width: 100%; height: auto; display: block; margin-bottom: -1px; }
.group-figure .frame .group-shot.is-hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .group-chip:hover { transform: none; } }

/* ---------- palette evolution ---------- */
.palette-figure { margin: 2.4rem 0; }
.palette-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.7rem, 1.6vw, 1.1rem);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: clamp(1rem, 2.2vw, 1.7rem);
}
@media (min-width: 34rem) { .palette-track { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 52rem) { .palette-track { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.palette-card { margin: 0; display: grid; gap: .55rem; }
.palette-card figcaption {
  display: grid;
  gap: .12rem;
  margin: 0;
  line-height: 1.25;
}
.palette-card .pal-owner {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--laurel-deep);
}
.palette-card .pal-step {
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}
.palette-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: #FFFFFF;
  transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s ease;
}
.palette-card:hover img {
  transform: scale(1.5);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  position: relative;
  z-index: 3;
}
.palette-card:first-child:hover img { transform: scale(1.5) translateX(14%); }
.palette-card:last-child:hover img { transform: scale(1.5) translateX(-14%); }
@media (prefers-reduced-motion: reduce) {
  .palette-card img { transition: none; }
  .palette-card:hover img, .palette-card:first-child:hover img, .palette-card:last-child:hover img { transform: none; }
}

/* ---------- sentiment scale ---------- */
:root {
  --sent-1: #7A1F32;
  --sent-2: #A85C4E;
  --sent-3: #9A8F6E;
  --sent-4: #5C6B4B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sent-1: #E4A2A8;
    --sent-2: #D8A08D;
    --sent-3: #C4B892;
    --sent-4: #A3B18A;
  }
}
:root[data-theme="dark"] {
  --sent-1: #E4A2A8;
  --sent-2: #D8A08D;
  --sent-3: #C4B892;
  --sent-4: #A3B18A;
}

.sentiment {
  margin: 2.4rem 0;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: clamp(1.3rem, 3vw, 2.2rem);
}
.sent-question {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 1.4rem;
  max-width: 34ch;
}
.sentiment-scale {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.2rem, 2.4vw, 1.6rem);
  align-items: start;
}
@media (min-width: 34rem) { .sentiment-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56rem) { .sentiment-scale { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sent-step { display: grid; gap: .6rem; align-content: start; }
.sent-bar { display: block; height: 4px; border-radius: 2px; background: var(--tone); }
.sent-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--tone);
  margin-bottom: .1rem;
}
.sent-step blockquote {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: .85rem 1rem;
}
.sent-step blockquote p {
  margin: 0;
  font-size: .93rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.sent-step blockquote p::before { content: "“"; }
.sent-step blockquote p::after { content: "”"; }
.sent-step blockquote strong { color: var(--ink); font-weight: 700; }
.sent-note { font-size: .85rem; color: var(--muted); margin: -1.6rem 0 2.4rem; }
