/* ── Worlds ────────────────────────────────────────────────────────────
   The frame owns no accent; each project brings its app's own palette.
   The masthead swaps worlds as each band passes under it (script.js). */
:root,
[data-theme="frame"] {
  --bg: #e7e7e3;
  --ink: #121316;
  --muted: #4f5257;
  --line: rgba(18, 19, 22, 0.16);
  --accent: #121316;
  --on-accent: #f3f3ef;
}

[data-theme="liftrix"] {
  --bg: #0f1115;
  --ink: #f5f5f7;
  --muted: #9aa1ac;
  --line: rgba(245, 245, 247, 0.14);
  --accent: #f97316;
  --on-accent: #0f1115;
}

[data-theme="linaw"] {
  --bg: #04341f;
  --ink: #f4f2ea;
  --muted: #a6dcbc;
  --line: rgba(244, 242, 234, 0.16);
  --accent: #00c46a;
  --on-accent: #04341f;
}

[data-theme="dropcove"] {
  --bg: #000;
  --ink: #fff;
  --muted: #a3a3a3;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #fff;
  --on-accent: #000;
}

[data-theme="tortui"] {
  --bg: #161d27;
  --ink: #e6edf3;
  --muted: #9aaabb;
  --line: rgba(230, 237, 243, 0.14);
  --accent: #5fd7ff;
  --on-accent: #161d27;
}

:root {
  --font-display: "Bricolage Grotesque", "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 82rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --world: 650ms var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: color-mix(in srgb, var(--ink) 35%, transparent) transparent;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--world), color var(--world);
}

/* Each band paints its own world; the masthead takes on the band beneath it. */
main [data-theme],
.footer {
  background: var(--bg);
  color: var(--ink);
}

.masthead {
  color: var(--ink);
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img,
video {
  display: block;
  max-width: 100%;
}

code,
.meta,
.stack,
.index-stack {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 60;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.icon {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
}

/* ── Type ─────────────────────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 96, "wdth" 90;
  font-size: clamp(2.75rem, 7vw, 5.75rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 40ch;
  transition: color var(--world);
}

.meta {
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color var(--world);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 72, "wdth" 85;
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.section-lede {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 48ch;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.875rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  transition: background-color var(--world), color var(--world), border-color var(--world),
    transform 200ms var(--ease-out);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost:hover {
  border-color: var(--ink);
}

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
  transition: background-color var(--world), box-shadow 300ms var(--ease-out);
}

.masthead.condensed {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 24, "wdth" 85;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.wm-fold {
  display: inline-block;
  overflow: hidden;
  max-width: 6.5em;
  transition: max-width 450ms var(--ease-out), opacity 300ms var(--ease-out);
}

.masthead.condensed .wm-fold {
  max-width: 0;
  opacity: 0;
}

.masthead.condensed .wordmark:hover .wm-fold,
.masthead.condensed .wordmark:focus-visible .wm-fold {
  max-width: 6.5em;
  opacity: 1;
}

.masthead nav {
  display: flex;
  gap: clamp(0.25rem, 2vw, 1.75rem);
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms var(--ease-out);
}

.masthead nav a:hover {
  color: var(--ink);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(6.5rem, 14vh, 8.5rem) var(--gutter) clamp(3.5rem, 8vh, 5.5rem);
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
  display: grid;
  gap: clamp(2.5rem, 5vw, 3rem);
}

.hero-copy {
  display: grid;
  gap: 1.75rem;
  align-self: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

/* One featured product, painted in its own world. The slot holds any media
   (screen, phone or terminal), so the hero never grows with the shelf. */
.hero-latest {
  align-self: center;
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: clamp(0.875rem, 1.6vw, 1.25rem);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0, 0, 0, 0.45);
}

.latest-tag {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.5rem;
  padding-inline: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.latest-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Inside the card the card is the frame, so the bezel slims down. Its
   control moves up into the tag row, off the capture. */
.latest-media.screen {
  padding: 0.375rem;
  border-radius: 14px;
}

.latest-media .loop-toggle {
  top: calc(-1rem - 44px);
  right: 0;
  bottom: auto;
}

.latest-media.phone {
  width: min(60%, 17rem);
  justify-self: center;
  margin-bottom: 58px;
}

.latest-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.875rem;
  min-height: 44px;
  padding: 0.25rem;
  text-decoration: none;
  border-radius: 14px;
}

.latest-link img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 22.5%;
}

.latest-text {
  display: grid;
  line-height: 1.35;
}

.latest-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 36, "wdth" 90;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.latest-text span {
  font-size: 0.9375rem;
  color: var(--muted);
}

.latest-link .icon {
  width: 1.375rem;
  height: 1.375rem;
  margin-right: 0.5rem;
  transition: transform 250ms var(--ease-out);
}

.latest-link:hover .icon {
  transform: translateY(3px);
}

.latest-link:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.availability {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Play/pause for every loop (WCAG 2.2.2), added by script.js. */
.media {
  position: relative;
}

.loop-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--ink);
  cursor: pointer;
  opacity: 0.8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.loop-toggle:hover,
.loop-toggle:focus-visible {
  opacity: 1;
}

.loop-toggle:active {
  transform: scale(0.94);
}

.loop-toggle svg {
  width: 18px;
  height: 18px;
}

/* Controls sit under the device, never on the app UI it demonstrates. */
.phone .loop-toggle {
  right: auto;
  left: 50%;
  bottom: -58px;
  translate: -50% 0;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.project-phone {
  margin-bottom: 58px;
}

/* The terminal's control sits at the end of its caption row, clear of the label. */
.terminal .loop-toggle {
  bottom: 4px;
  right: 6px;
}

.terminal.project-terminal figcaption {
  padding-block: 0.9375rem;
  padding-right: 64px;
  min-height: 52px;
}

/* ── Device frames ────────────────────────────────────────────────────── */
.phone {
  position: relative;
  aspect-ratio: 600 / 1304;
  padding: 1.7%;
  border-radius: 14.5% / 6.7%;
  background: #050506;
  box-shadow: 0 0 0 1.5px #4a4c52, 0 0 0 2.5px #1b1c1f, inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 60px -20px rgba(0, 0, 0, 0.5), 0 10px 20px -10px rgba(0, 0, 0, 0.3);
}

/* Dynamic Island: the captures leave the status bar's centre empty for it. */
.phone::before {
  content: "";
  position: absolute;
  top: 3.1%;
  left: 50%;
  width: 29%;
  height: 3.9%;
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
  z-index: 2;
  pointer-events: none;
}

.phone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12.8% / 5.9%;
  background: #000;
  cursor: pointer;
}

/* A Mac display: the capture already carries its own menu bar and notch. */
.screen {
  padding: 0.625rem;
  border-radius: 18px;
  background: #0b0b0c;
  box-shadow: 0 0 0 1px #3a3b40, inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 60px -24px rgba(255, 255, 255, 0.08);
}

.screen video {
  width: 100%;
  /* Trim empty desktop at both sides: the crop lands in a menu-bar gap,
     hides the clock and keeps the whole notch panel. */
  aspect-ratio: 21 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: #f7f7f7;
  cursor: pointer;
}

/* Screen controls sit off the capture (the notch panel and result files
   reach the corners), on the world ground where the accent focus ring shows. */
.screen .loop-toggle {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  color: var(--ink);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.project-screen {
  margin-bottom: 58px;
}

.project-screen .loop-toggle {
  top: calc(100% + 14px);
  right: 0;
  bottom: auto;
}

.terminal {
  border-radius: 12px;
  overflow: hidden;
  background: #161d27;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 24px 48px -18px rgba(0, 0, 0, 0.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: #0e131a;
  color: #8a9bb0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.terminal-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2b3542;
}

.terminal-bar span {
  margin-left: 8px;
}

.terminal video {
  width: 100%;
  aspect-ratio: 1100 / 440;
  object-fit: cover;
  background: #161d27;
  cursor: pointer;
}

.terminal figcaption {
  padding: 0.625rem 0.875rem 0.75rem;
  font-size: 0.8125rem;
  color: #9aaabb;
  border-top: 1px solid rgba(230, 237, 243, 0.08);
}

.terminal figcaption code {
  color: #5fd7ff;
}

/* ── Work: sticky summary, scrolling detail ──────────────────────────── */
.project {
  padding: clamp(5rem, 12vh, 8rem) var(--gutter);
  display: grid;
  gap: 3rem;
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}

.project + .project {
  box-shadow: 0 -1px 0 var(--line);
}

.project-summary {
  display: grid;
  gap: 1.125rem;
  align-content: start;
  justify-items: start;
}

.app-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

.project-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 88;
  font-size: clamp(3.5rem, 8.5vw, 5.75rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.mono-name {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(3rem, 7.5vw, 5rem);
  letter-spacing: -0.04em;
}

.mono-name::after {
  content: "_";
  color: var(--accent);
  animation: caret 1.1s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.project-line {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  max-width: 30ch;
  text-wrap: pretty;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.project-detail {
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  align-content: start;
  min-width: 0;
}

.project-phone {
  width: min(78%, 22rem);
  justify-self: center;
}

.notes {
  display: grid;
  border-top: 1px solid var(--line);
}

.notes > div {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line);
}

.notes dt {
  font-weight: 600;
}

.notes dd {
  color: var(--muted);
  max-width: 58ch;
  transition: color var(--world);
}

.stack {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
  transition: color var(--world);
}

/* ── Capabilities index ───────────────────────────────────────────────── */
.capabilities {
  padding: clamp(5rem, 14vh, 9rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}

.index {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--ink);
}

.index details {
  border-bottom: 1px solid var(--line);
}

.index summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1.5rem;
  align-items: center;
  padding: 1.125rem 0;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.index summary::-webkit-details-marker {
  display: none;
}

.index-area {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 36, "wdth" 90;
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.index-stack {
  grid-column: 1;
  font-size: 0.8125rem;
  color: var(--muted);
}

.chev {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 350ms var(--ease-out);
}

.index details[open] .chev {
  transform: rotate(45deg);
}

.index summary:hover .index-area {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.index details p {
  padding: 0 0 1.5rem;
  max-width: 62ch;
  color: var(--muted);
}

.index details[open] p {
  animation: reveal 400ms var(--ease-out);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.stack-strip {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}

.stack-strip h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.stack-strip p {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--muted);
  max-width: 110ch;
}

/* ── Contact ──────────────────────────────────────────────────────────── */
.contact {
  padding: clamp(4rem, 12vh, 8rem) var(--gutter) clamp(5rem, 14vh, 9rem);
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}

.portrait {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

.contact-title {
  max-width: 12ch;
}

.footer {
  padding: 1.5rem var(--gutter) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}

/* ── Layouts ──────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 5fr 6fr;
    gap: clamp(3rem, 5vw, 5rem);
    min-height: min(88svh, 54rem);
    align-items: center;
  }

  .project {
    grid-template-columns: 5fr 7fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }

  .project-summary {
    position: sticky;
    top: 6.5rem;
  }

  /* Bands alternate sides by position, so reordering the shelf keeps the rhythm. */
  .project:nth-child(even) {
    grid-template-columns: 7fr 5fr;
  }

  .project:nth-child(even) .project-summary {
    order: 2;
  }

  .project-phone {
    width: min(62%, 22rem);
  }

  .notes-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0 1.5rem;
  }

  .index summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    padding: 1.375rem 0;
  }

  .index-stack {
    grid-column: 2;
  }

  .chev {
    grid-column: 3;
    grid-row: 1;
  }

  .index details p {
    margin-left: 50%;
    max-width: 48ch;
  }

  .contact {
    justify-items: center;
    text-align: center;
  }

  .contact .lede {
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  /* Crop the 80-column recording to its left pane so the glyphs stay readable. */
  .project-terminal video {
    aspect-ratio: 5 / 4;
    object-position: left top;
  }
}

@media (max-width: 480px) {
  /* The palette and the scroll reach Capabilities; the bar keeps its trigger. */
  .masthead nav a[href="#capabilities"] {
    display: none;
  }
}

@media (max-width: 420px) {
  .masthead nav a {
    font-size: 0.875rem;
    padding-inline: 0.25rem;
  }

  .wordmark {
    font-size: 1.125rem;
  }
}

/* Reduced motion: the system setting, or the visitor's choice in the command
   palette (script.js sets data-motion). Without script, the media query rules. */
:root[data-motion="reduce"] {
  scroll-behavior: auto;
}

:root[data-motion="reduce"] *,
:root[data-motion="reduce"] *::before,
:root[data-motion="reduce"] *::after {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  html:not(.js) {
    scroll-behavior: auto;
  }

  html:not(.js) *,
  html:not(.js) *::before,
  html:not(.js) *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ══ Interactive layer ════════════════════════════════════════════════
   Every playground reads the band's six world tokens, except the parts
   that are a product's own chrome (the notch, the terminal, Linaw's card). */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.75em;
  line-height: 1.3;
  color: inherit;
}

/* Demos need script; without it the bands keep their loops and notes. */
html:not(.js) [data-demo],
html:not(.js) .palette-trigger,
html:not(.js) .hero-play,
html:not(.js) .now {
  display: none;
}

/* ── Now strip ────────────────────────────────────────────────────────── */
.now {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
  min-width: 0;
  border-block: 1px solid var(--line);
}

.now-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.now-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.now-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  animation: now-ping 2.4s var(--ease-out) infinite;
}

@keyframes now-ping {
  from {
    opacity: 0.6;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.now-list {
  display: flex;
  min-width: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}

.now-list::-webkit-scrollbar {
  display: none;
}

.now-list li {
  display: flex;
  flex-shrink: 0;
}

.now-list li + li {
  border-left: 1px solid var(--line);
}

.now-list li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.now-list li:first-child > a,
.now-list li:first-child:not(:has(a)) {
  padding-left: 0.25rem;
}

.now-list li:not(:has(a)) {
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.now-tag {
  color: var(--muted);
}

.now-text {
  font-weight: 500;
}

.now-detail {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}

.now-list a:hover .now-text {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.now-list .icon {
  width: 0.95em;
  height: 0.95em;
  color: var(--muted);
}

.hero-play {
  flex-basis: 100%;
  font-size: 0.9375rem;
  color: var(--muted);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ── Command palette ──────────────────────────────────────────────────── */
.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 44px;
  margin-left: 0.25rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}

.palette-trigger:hover {
  color: var(--ink);
}

.palette-trigger svg {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
}

.palette-trigger kbd {
  min-width: 1.75rem;
  min-height: 1.75rem;
  font-size: 0.8125rem;
}

.palette {
  --bg: #e7e7e3;
  --ink: #121316;
  --muted: #4f5257;
  --line: rgba(18, 19, 22, 0.16);
  --accent: #121316;
  --on-accent: #f3f3ef;
  position: fixed;
  inset: min(14vh, 8rem) 0 auto;
  width: min(38rem, calc(100% - 2rem));
  max-height: min(34rem, calc(100svh - 6rem));
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}

.palette[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: palette-in 220ms var(--ease-out);
}

.palette::backdrop {
  background: rgba(18, 19, 22, 0.5);
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
}

.palette-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}

.palette-field .icon {
  color: var(--muted);
}

.palette-field input {
  flex: 1;
  min-width: 0;
  min-height: 3.5rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  outline: none;
}

.palette-field input::placeholder {
  color: var(--muted);
}

.palette-field:focus-within {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.palette ul {
  list-style: none;
  overflow-y: auto;
  padding: 0.375rem;
  overscroll-behavior: contain;
}

.palette-group {
  padding: 0.75rem 0.75rem 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.palette [role="option"] {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
}

.palette [role="option"] > span:first-child {
  flex: 1;
  min-width: 0;
}

.palette [aria-selected="true"] {
  background: var(--ink);
  color: var(--bg);
}

.palette-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.palette [aria-selected="true"] .palette-hint {
  color: color-mix(in srgb, var(--bg) 70%, transparent);
}

.palette-empty {
  padding: 1.25rem 0.75rem;
  color: var(--muted);
}

.palette-foot {
  display: flex;
  gap: 1.25rem;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}

.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Shared playground frame ──────────────────────────────────────────── */
.play > *,
.ln-card > * {
  min-width: 0;
}

.play {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.play-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 36, "wdth" 90;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.play-title code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8em;
  letter-spacing: -0.03em;
}

.play-sub,
.play-note {
  max-width: 58ch;
  color: var(--muted);
}

.play-note {
  font-size: 0.875rem;
}

.play[data-failed] > :not(.play-title):not(.play-sub) {
  display: none;
}

/* ── DropCove: the notch ──────────────────────────────────────────────── */
.project-notched {
  padding-top: 0;
}

.dc-stage {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-bottom: clamp(1rem, 4vh, 2.5rem);
}

.dc-notch {
  --dc-tile: #141414;
  --dc-edge: #2a2a2a;
  --dc-ash: #a3a3a3;
  position: relative;
  width: 12.5rem;
  max-width: 100%;
  border-radius: 0 0 18px 18px;
  background: #000;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 24px 60px -24px rgba(255, 255, 255, 0.12);
  interpolate-size: allow-keywords;
  transition: width 520ms var(--ease-out), border-radius 520ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.dc-notch[data-open] {
  width: min(100%, 50rem);
  border-radius: 0 0 28px 28px;
}

.dc-notch[data-state="drag"] {
  box-shadow: 0 0 0 1px #fff, 0 24px 60px -24px rgba(255, 255, 255, 0.25);
}

.dc-lip {
  display: grid;
  place-items: center;
  width: 100%;
  height: 2.375rem;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  cursor: pointer;
}

.dc-lip:focus-visible {
  outline-offset: -4px;
}

.dc-cam {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2b3a55, #0b0d12 70%);
  box-shadow: 0 0 0 1px #1a1a1a;
  transition: box-shadow 300ms var(--ease-out);
}

.dc-notch:not([data-open]) .dc-lip:hover .dc-cam {
  box-shadow: 0 0 0 1px #1a1a1a, 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.dc-panel {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 0 clamp(0.875rem, 2.5vw, 1.5rem) clamp(0.875rem, 2.5vw, 1.5rem);
  animation: dc-in 380ms var(--ease-out) both;
}

.dc-panel[hidden] {
  display: none;
}

@keyframes dc-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.dc-hint {
  max-width: 46ch;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

.dc-hint-tap {
  display: none;
}

@media (hover: none) {
  .dc-hint-drag {
    display: none;
  }

  .dc-hint-tap {
    display: inline;
  }
}

.dc-key {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #0d0d0d;
  color: var(--dc-ash);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

button.dc-key {
  cursor: pointer;
}

button.dc-key::after {
  content: "";
  position: absolute;
  inset: -10px;
}

.dc-close {
  position: absolute;
  top: 0;
  right: clamp(0.875rem, 2.5vw, 1.5rem);
}

.dc-drop {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem 1.5rem;
  border: 1.5px dashed #3a3a3a;
  border-radius: 18px;
  text-align: center;
  transition: border-color 200ms var(--ease-out), background-color 200ms var(--ease-out);
}

.dc-drop.is-over {
  border-color: #fff;
  background: #0d0d0d;
}

.dc-drop svg {
  width: 2rem;
  height: 2rem;
  color: var(--dc-ash);
}

.dc-drop-title {
  font-weight: 600;
  font-size: 1.0625rem;
}

.dc-drop-sub {
  font-size: 0.875rem;
  color: var(--dc-ash);
}

.dc-drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.125rem;
  border: 0;
  border-radius: 10px;
  background: #1f1f1f;
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}

.dc-btn:hover {
  background: #2a2a2a;
}

.dc-btn.primary {
  background: #fff;
  color: #0a0a0a;
}

.dc-btn:active {
  transform: scale(0.98);
}

.dc-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.875rem;
}

.dc-thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  object-fit: cover;
  background: var(--dc-tile);
  box-shadow: 0 0 0 1px var(--dc-edge);
}

.dc-file {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.dc-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.dc-file span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dc-ash);
}

.dc-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.dc-tile {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.875rem;
  border: 1px solid var(--dc-edge);
  border-radius: 16px;
  background: var(--dc-tile);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}

.dc-tile:hover {
  border-color: #555;
  background: #191919;
}

.dc-tile.is-top {
  border-color: #fff;
  box-shadow: inset 0 0 0 1px #fff;
}

.dc-tile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.dc-tile:active {
  transform: scale(0.985);
}

.dc-tile[disabled] {
  cursor: progress;
}

.dc-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.dc-tile-top svg {
  width: 1.25rem;
  height: 1.25rem;
}

.dc-tile strong {
  font-weight: 600;
  font-size: 1.0625rem;
}

.dc-tile-line {
  font-size: 0.875rem;
  color: var(--dc-ash);
}

.dc-tile-data {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #e5e5e5;
}

.dc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--dc-edge);
  font-size: 0.8125rem;
  color: var(--dc-ash);
}

.dc-foot > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-keys {
  display: flex;
  gap: 0.375rem;
}

.dc-result {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
  padding: 1rem;
  border: 1px solid var(--dc-edge);
  border-radius: 18px;
  background: var(--dc-tile);
  animation: dc-in 380ms var(--ease-out) both;
}

.dc-out {
  width: 100%;
  max-height: 10rem;
  object-fit: contain;
  border-radius: 10px;
  background: #0a0a0a;
  box-shadow: 0 0 0 1px var(--dc-edge);
}

.dc-result-text {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  min-width: 0;
}

.dc-result-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.dc-result-size {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.dc-result-size span {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #e5e5e5;
}

.dc-result-size strong {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wdth" 88;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.dc-result-note {
  font-size: 0.8125rem;
  color: var(--dc-ash);
}

.dc-result .dc-drop-actions {
  justify-content: flex-start;
}

.dc-private {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--dc-ash);
}

.dc-private::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
}

@media (max-width: 640px) {
  .dc-tiles {
    grid-template-columns: 1fr;
  }

  .dc-tile {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon title key" "icon line line" "icon data data";
    column-gap: 0.75rem;
    padding: 0.75rem 0.875rem;
  }

  .dc-tile-top {
    display: contents;
  }

  .dc-tile-top svg {
    grid-area: icon;
    align-self: start;
    margin-top: 0.15rem;
  }

  .dc-tile-top .dc-key {
    grid-area: key;
  }

  .dc-tile strong {
    grid-area: title;
  }

  .dc-tile-line {
    grid-area: line;
  }

  .dc-tile-data {
    grid-area: data;
  }

  .dc-keys {
    display: none;
  }

  .dc-result {
    grid-template-columns: 1fr;
  }
}

/* ── Liftrix: workout clock ───────────────────────────────────────────── */
.lx-modes {
  display: inline-flex;
  justify-self: start;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lx-modes label {
  position: relative;
}

.lx-modes input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.lx-modes span {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 clamp(0.75rem, 2.5vw, 1.125rem);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 250ms var(--ease-out), color 250ms var(--ease-out);
}

.lx-modes input:checked + span {
  background: var(--accent);
  color: var(--on-accent);
}

.lx-modes input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lx-modes input:disabled {
  cursor: not-allowed;
}

.lx-modes input:disabled:not(:checked) + span {
  opacity: 0.45;
}

.lx-face {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: clamp(1.25rem, 4vw, 2rem) 1rem;
  border-block: 1px solid var(--line);
  text-align: center;
  border-radius: 4px;
}

.lx-phase,
.lx-round {
  font-size: 0.9375rem;
  color: var(--muted);
}

.lx-round {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink);
}

.lx-round.is-bump {
  animation: lx-bump 400ms var(--ease-out);
}

@keyframes lx-bump {
  40% {
    color: var(--accent);
    transform: scale(1.12);
  }
}

.lx-digits {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 80;
  font-variant-numeric: tabular-nums;
  font-size: clamp(5rem, 19vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.lx-digits.is-lead {
  color: var(--ink);
}

.lx-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.lx-controls .button {
  font-family: inherit;
  cursor: pointer;
}

.lx-controls .button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

#lx-start {
  min-width: 7rem;
  justify-content: center;
}

.lx-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.25rem;
}

.lx-stepper p {
  min-width: 4.75rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.lx-stepper output {
  font-size: 1rem;
  color: var(--ink);
}

.lx-step,
.lx-sound {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.lx-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lx-sound {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.lx-sound[aria-pressed="false"] svg path:last-child {
  opacity: 0.2;
}

/* ── Linaw: the logging flow ──────────────────────────────────────────── */
.ln-card {
  --ln-paper: #f4f2ea;
  --ln-forest: #04341f;
  --ln-soft: #496a59;
  --ln-leaf: #00c46a;
  --ln-rule: rgba(4, 52, 31, 0.12);
  display: grid;
  gap: 0.75rem;
  max-width: 30rem;
  padding: 1.25rem;
  border-radius: 24px;
  background: var(--ln-paper);
  color: var(--ln-forest);
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

.ln-card ::selection {
  background: var(--ln-forest);
  color: var(--ln-paper);
}

.ln-card :focus-visible {
  outline-color: var(--ln-forest);
}

.ln-total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ln-rule);
}

.ln-count {
  grid-row: 2;
  font-size: 0.875rem;
  color: var(--ln-soft);
}

.ln-total-label {
  grid-column: 2;
  justify-self: end;
  font-size: 0.875rem;
  color: var(--ln-soft);
}

.ln-total-value {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 90;
  font-variant-numeric: tabular-nums;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ln-list {
  display: grid;
  list-style: none;
}

.ln-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--ln-rule);
}

.ln-list li.is-new {
  animation: ln-in 450ms var(--ease-out);
}

@keyframes ln-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
    background: rgba(0, 196, 106, 0.18);
  }
}

.ln-glyph {
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: rgba(0, 196, 106, 0.16);
}

.ln-glyph svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ln-row-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.ln-row-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.ln-row-text span {
  font-size: 0.8125rem;
  color: var(--ln-soft);
}

.ln-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ln-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--ln-rule);
}

.ln-form:focus-within {
  box-shadow: inset 0 0 0 2px var(--ln-forest);
}

.ln-form input {
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.5rem 0 0.75rem;
  border: 0;
  background: none;
  color: var(--ln-forest);
  font: inherit;
  outline: none;
}

.has-voice .ln-form input {
  padding-left: 0.25rem;
}

.ln-form input::placeholder {
  color: #7d917f;
}

.ln-mic {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--ln-leaf);
  color: var(--ln-forest);
  cursor: pointer;
}

.ln-mic svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ln-mic[hidden] {
  display: none;
}

.is-listening .ln-mic::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--ln-leaf);
  animation: now-ping 1.4s var(--ease-out) infinite;
}

.ln-log {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 1.125rem;
  border: 0;
  border-radius: 999px;
  background: var(--ln-forest);
  color: var(--ln-paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ln-hint {
  margin-top: -0.25rem;
  min-height: 1.2em;
  font-size: 0.8125rem;
  color: var(--ln-soft);
}

.ln-hint.is-error {
  color: #9a3412;
}

.ln-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ln-chips button {
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 200ms var(--ease-out);
}

.ln-chips button:hover {
  border-color: var(--ink);
}

.ln-chips .ln-clear {
  color: var(--muted);
  border-style: dashed;
}

.ln-chips [hidden] {
  display: none;
}

/* ── tortui: the in-page terminal ─────────────────────────────────────── */
.tt-window {
  --tt-ink: #e6edf3;
  --tt-dim: #9aaabb;
  --tt-cyan: #5fd7ff;
  --tt-warn: #f2cc60;
  --tt-ok: #7ee787;
  --tt-line: rgba(230, 237, 243, 0.1);
  min-width: 0;
}

.tt-term {
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  height: clamp(22rem, 52vh, 27rem);
  padding: 0.875rem 1rem 0.75rem;
  overflow: hidden;
  color: var(--tt-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.65;
  cursor: text;
}

.tt-term:focus-visible {
  outline: 2px solid var(--tt-cyan);
  outline-offset: -4px;
  border-radius: 6px;
}

.tt-term p {
  overflow-wrap: anywhere;
}

.tt-tab {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tt-tab:hover {
  color: var(--tt-ink);
}

.tt-banner,
.tt-cyan,
.tt-tabs .is-on {
  color: var(--tt-cyan);
}

.tt-tabs,
.tt-dim {
  color: var(--tt-dim);
}

.tt-warn {
  color: var(--tt-warn);
}

.tt-ok {
  color: var(--tt-ok);
}

.tt-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tt-search[hidden] {
  display: none;
}

.tt-search input {
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--tt-line);
  background: none;
  color: var(--tt-ink);
  caret-color: var(--tt-cyan);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

.tt-search input:focus {
  border-bottom-color: var(--tt-cyan);
}

.tt-search input::placeholder {
  color: #5d6b7c;
}

.tt-screen {
  display: grid;
  align-content: start;
  gap: 0.375rem;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.tt-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tt-cyan);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.tt-table {
  display: grid;
}

.tt-tr {
  display: grid;
  grid-template-columns: 1.5ch minmax(0, 1fr) 8ch 7ch 5.5ch 12ch;
  gap: 1.25ch;
  padding: 0.15rem 0.375rem;
  border-radius: 3px;
  cursor: pointer;
}

.tt-th {
  color: var(--tt-dim);
  cursor: default;
}

.tt-tr .r {
  text-align: right;
}

.tt-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-tr.is-cursor {
  background: rgba(95, 215, 255, 0.14);
  color: var(--tt-cyan);
}

.tt-src {
  color: var(--tt-dim);
}

.is-cursor .tt-src {
  color: inherit;
}

.tt-title-big {
  font-size: 0.875rem;
}

.tt-dl {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 0.1rem 1rem;
}

.tt-dl dt {
  color: var(--tt-dim);
}

.tt-dl-item {
  margin-bottom: 0.5rem;
}

.tt-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25ch;
}

.tt-bar-fill {
  color: var(--tt-ink);
}

.tt-bar-rest {
  color: #3a4656;
}

.tt-quit {
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--tt-warn);
  border-radius: 4px;
}

.tt-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25ch;
  padding-top: 0.5rem;
  border-top: 1px solid var(--tt-line);
}

.tt-keys {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--tt-line);
}

.tt-keys button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 0;
  border-right: 1px solid var(--tt-line);
  background: #0e131a;
  color: var(--tt-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

.tt-keys button:last-child {
  border-right: 0;
}

.tt-keys button:hover {
  color: var(--tt-cyan);
}

.tt-keys button:focus-visible {
  outline-offset: -3px;
  outline-color: var(--tt-cyan);
}

@container (max-width: 40rem) {
  .tt-tr {
    grid-template-columns: 1.5ch minmax(0, 1fr) 7ch 6ch;
  }

  .tt-age,
  .tt-src,
  .tt-hide-sm {
    display: none;
  }
}

/* The terminal band now carries an interactive replica; its demo sits
   full width under the recording, with the notes in three columns. */
@media (min-width: 900px) {
  .hero {
    grid-template-rows: auto 1fr;
  }

  .now {
    align-self: start;
    margin-bottom: clamp(0.5rem, 3vh, 2rem);
  }
}

@media (max-width: 600px) {
  .masthead nav {
    gap: 0;
  }

  .palette-trigger {
    min-width: 44px;
    justify-content: center;
    margin-left: 0;
  }

  .palette-trigger kbd,
  .hero-play kbd {
    display: none;
  }

  .palette-trigger svg {
    display: block;
  }

  .palette-hint {
    display: none;
  }
}
