/* ===========================================================
   MarkAll — multi-theme UI (2026)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --aqua-1: #eafdfa;
  --aqua-2: #b8ece6;
  --aqua-3: #4ec9bd;
  --teal:   #1aa79a;
  --sky-1:  #cfe9f7;
  --sky-2:  #7fbfe6;
  --blue:   #1f7fc0;
  --accent: #1f7fc0;
  --deep:   #0d5390;
  --grass:  #7fb86a;
  --ink:    #0d2c40;
  --ink-soft: #4a6b80;
  --white:  #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.16);
  --glass-bg-2: rgba(255, 255, 255, 0.10);
  --glass-stroke: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 16px 44px rgba(8, 50, 95, 0.22);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;

  --font-head: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, #dcf1fb 0%, #d2ecf6 35%, #d6f3ee 75%, #e6f6ec 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.svg-defs { position: absolute; width: 0; height: 0; }

/* ===================== Background ===================== */
.aero-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.sky {
  position: absolute; inset: 0;
  background: var(--page, linear-gradient(180deg, #fbfbfd, #f3f5f8));
  transition: background .6s ease;
}

/* ===================== Glass primitive ===================== */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -16px 36px rgba(8,50,95,.05);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  overflow: hidden;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.05) 26%, transparent 50%);
}

/* ===================== Topbar ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0));
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-bubble {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, var(--aqua-3) 55%, var(--blue));
  box-shadow: inset 0 1px 4px rgba(255,255,255,.85), 0 3px 10px rgba(31,127,192,.35);
}
/* MarkAll logo + wordmark are fixed — never themed */
.brand-text { font-family: 'Outfit', system-ui, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.2px; color: #16202a; }
.brand-text b { color: #1f7fc0; font-weight: 800; }
.nav { display: flex; align-items: center; gap: 8px; }
.pill {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: var(--ink); text-decoration: none;
  padding: 8px 15px; border-radius: 999px;
  background: var(--glass-bg); border: 1px solid var(--glass-stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 10px rgba(8,50,95,.1);
  backdrop-filter: blur(8px);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.pill:hover { transform: translateY(-2px); background: rgba(255,255,255,.32); }
.key-pill { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.key-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #d06262; box-shadow: 0 0 7px #d06262; }
.key-pill.on .dot { background: var(--aqua-3); box-shadow: 0 0 9px var(--aqua-3); }
.key-pill b { color: var(--blue); }

/* ===================== Buttons (refined gloss) ===================== */
.btn {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; text-decoration: none; display: inline-block;
  padding: 13px 26px; border-radius: 999px;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  position: relative; overflow: hidden; will-change: transform;
}
.btn.sm { padding: 9px 17px; font-size: 13.5px; }
.btn-glossy {
  color: #06324f;
  background: linear-gradient(180deg, #ffffff 0%,
    color-mix(in srgb, var(--accent) 22%, #fff) 34%,
    color-mix(in srgb, var(--accent) 55%, #fff) 64%,
    var(--accent) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -7px 14px rgba(13,83,144,.22), 0 8px 18px color-mix(in srgb, var(--accent) 40%, transparent);
  border: 1px solid rgba(255,255,255,.5);
}
.btn-glossy::after {
  content: ""; position: absolute; left: 7%; right: 7%; top: 6%; height: 34%;
  border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
  pointer-events: none;
}
.btn-glossy:hover { filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -7px 14px rgba(13,83,144,.32), 0 13px 26px rgba(31,127,192,.42); }
.btn-glossy:active { transform: scale(.97); }
.btn-glossy:disabled { filter: grayscale(.5) brightness(.96); opacity: .5; cursor: pointer; }
.btn-ghost {
  color: var(--blue);
  background: rgba(255,255,255,.28); border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 5px 12px rgba(8,50,95,.12);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,.42); }
.btn-ghost:disabled { opacity: .4; }

/* click ripple */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.65), rgba(255,255,255,0) 70%);
  transform: translate(-50%, -50%) scale(0); animation: ripple .6s ease-out forwards;
}
@keyframes ripple { to { transform: translate(-50%,-50%) scale(1); opacity: 0; } }

/* ===================== Sections ===================== */
section { position: relative; }
.section-head { text-align: center; padding: 34px 20px 8px; }
.section-head h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 4vw, 38px); margin: 0; color: var(--ink); letter-spacing: -.5px; }
.section-head p { color: var(--ink-soft); font-size: 16px; margin: 8px 0 0; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===================== Hero (landing) ===================== */
.hero { padding: clamp(48px, 9vh, 100px) clamp(16px, 5vw, 64px); display: flex; justify-content: center; }
.hero-glass { max-width: 880px; padding: clamp(30px, 5vw, 60px); text-align: center; }
.kicker { font-family: var(--font-head); font-weight: 600; letter-spacing: 3px; font-size: 12px; color: var(--ink-soft); margin: 0 0 16px; }
.title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(34px, 6vw, 62px); line-height: 1.05; margin: 0 0 20px;
  color: var(--ink); letter-spacing: -1.2px;
}
.liquid-word { color: var(--accent); }
.lede { font-size: clamp(15px, 2.2vw, 18px); color: var(--ink-soft); max-width: 600px; margin: 0 auto 28px; line-height: 1.65; }
.hero-cta { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.hero-chips { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-family: var(--font-head); font-weight: 500; font-size: 12px; color: var(--ink-soft);
  padding: 6px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 18%, #fff);
}

/* ===================== Feature row (landing) ===================== */
.features { padding: 10px clamp(16px, 4vw, 56px) 30px; }
.feat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; max-width: 1100px; margin: 18px auto 0; }
@media (max-width: 820px) { .feat-grid { grid-template-columns: 1fr; } }
.feat { padding: 26px; }
.feat .ic {
  width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent);
  box-shadow: none; margin-bottom: 14px;
}
.feat h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 7px; color: var(--ink); }
.feat p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: 15px; }

/* ===================== Manifesto ===================== */
.manifesto { padding: 30px clamp(16px, 5vw, 64px) 50px; display: flex; justify-content: center; }
.manifesto-card { max-width: 800px; padding: clamp(28px, 4vw, 50px); }
.manifesto-card h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 4vw, 34px); margin: 0 0 14px; letter-spacing: -.6px; }
.big { font-size: clamp(16px, 2.4vw, 21px); line-height: 1.55; color: var(--ink); }
.manifesto-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 11px; }
.manifesto-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-soft); line-height: 1.5; }
.manifesto-list b { color: var(--ink); font-weight: 600; }
.manifesto-list .mk { color: var(--accent); font-weight: 700; }
.sign { font-family: var(--font-head); font-weight: 600; color: var(--accent); margin: 8px 0 0; }

/* ===================== How ===================== */
.how { padding: 10px clamp(16px, 4vw, 56px) 60px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1100px; margin: 18px auto 0; }
@media (max-width: 820px) { .how-grid { grid-template-columns: 1fr; } }
.how-card { padding: 26px; }
.how-card .num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #fff;
  background: var(--accent); box-shadow: none; margin-bottom: 13px;
}
.how-card h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 7px; color: var(--ink); }
.how-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: 15px; }

/* ===================== App shell ===================== */
.app-main { padding: 18px clamp(16px, 4vw, 56px) 30px; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 1280px; margin: 0 auto; align-items: start; }
@media (max-width: 980px) { .studio-grid { grid-template-columns: 1fr; } }
.panel { padding: 20px; }
.panel-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--ink);
  margin-bottom: 14px;
}
.led { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent), inset 0 1px 1px rgba(255,255,255,.8); }
.led-amber { background: #f0b54a; box-shadow: 0 0 9px #f0b54a, inset 0 1px 1px rgba(255,255,255,.8); }
.out-actions { margin-left: auto; display: flex; gap: 7px; }

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(31,127,192,.4); border-radius: var(--r-md);
  background: rgba(255,255,255,.18);
  padding: 24px; text-align: center;
  transition: background .2s, border-color .2s, transform .2s;
}
.dropzone.over { background: rgba(120,224,212,.28); border-color: var(--teal); transform: scale(1.01); }
.drop-orb {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, var(--aqua-3) 55%, var(--blue));
  box-shadow: inset 0 2px 6px rgba(255,255,255,.85), 0 6px 14px rgba(31,127,192,.32);
  animation: float 7s ease-in-out infinite;
}
.drop-main { font-family: var(--font-head); font-weight: 600; font-size: 17px; margin: 0 0 6px; color: var(--ink); }
.drop-sub { color: var(--ink-soft); font-size: 13px; margin: 6px 0; }
.drop-actions { display: flex; gap: 9px; justify-content: center; }

.url-row { display: flex; gap: 8px; margin-top: 13px; }
.field {
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 2px 5px rgba(8,50,95,.1); outline: none;
  transition: box-shadow .16s, border-color .16s;
}
.field:focus { border-color: var(--teal); box-shadow: inset 0 2px 5px rgba(8,50,95,.1), 0 0 0 3px rgba(78,201,189,.28); }
.field::placeholder { color: #7a96a6; }
.select { cursor: pointer; }

.preview-wrap { position: relative; margin-top: 15px; border-radius: var(--r-md); overflow: hidden; background: rgba(8,50,95,.05); min-height: 110px; }
.preview { width: 100%; height: auto; display: block; }
.preview-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 14px; pointer-events: none; }
.preview-hint.hidden { display: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 24px; }
.swatch {
  width: 44px; height: 44px; border-radius: 11px;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 3px 9px rgba(8,50,95,.18), inset 0 2px 4px rgba(255,255,255,.45);
  position: relative; cursor: pointer; transition: transform .14s ease;
}
.swatch:hover { transform: translateY(-3px) scale(1.06); }
.swatch span { position: absolute; left: -4px; right: -4px; bottom: -16px; text-align: center; font-family: var(--font-mono); font-size: 9px; color: var(--ink-soft); }

/* live preview mock */
.live-card {
  margin-top: 6px; border-radius: var(--r-md); padding: 18px; transition: background .4s, color .4s;
  background: #ffffff; color: #0d2c40; border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 8px 20px rgba(8,50,95,.14);
}
.live-card .lc-tag { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; opacity: .7; }
.live-card .lc-title { font-family: var(--font-head); font-weight: 700; font-size: 20px; margin: 6px 0 8px; }
.live-card .lc-body { font-size: 13.5px; line-height: 1.5; opacity: .85; margin: 0 0 14px; }
.live-card .lc-btn { display: inline-block; padding: 9px 18px; border-radius: 999px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: #fff; transition: background .4s; }
.live-label { font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; color: var(--ink-soft); margin: 18px 0 8px; text-transform: uppercase; }

.gen-row { display: flex; gap: 10px; margin-top: 8px; }
.gen-row .field { flex: 1; }
.status { margin-top: 11px; font-size: 13px; color: var(--ink-soft); min-height: 18px; }
.status.work { color: var(--blue); }
.status.err { color: #c0392b; }

/* Output */
.output-panel { display: flex; flex-direction: column; position: sticky; top: 78px; }
@media (max-width: 980px) { .output-panel { position: static; } }
.markdown-out {
  flex: 1; margin: 0; padding: 17px; border-radius: var(--r-md);
  background: rgba(7,34,58,.85); color: #cdeefb;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  overflow: auto; max-height: 70vh; min-height: 360px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 2px 12px rgba(0,0,0,.32);
  outline: none;
}
.markdown-out::selection { background: var(--teal); color: #042; }

/* ===================== Footer ===================== */
.foot { text-align: center; padding: 30px 20px 50px; color: var(--ink-soft); font-size: 13px; }
.foot a { color: var(--blue); text-decoration: none; }


/* ===================== Toast ===================== */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  font-family: var(--font-head); font-weight: 600; font-size: 14px; color: #06324f;
  padding: 11px 20px; border-radius: 999px;
  background: linear-gradient(180deg, #f3fbff, #cdedfa);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 8px 22px rgba(31,127,192,.32), inset 0 1px 0 rgba(255,255,255,.9);
  animation: toast-in .3s ease, toast-out .3s ease 1.7s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }

/* ===================== Modal ===================== */
.modal-back { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(8,40,70,.42); backdrop-filter: blur(7px); padding: 20px; }
.modal-back[hidden] { display: none; }
.modal { max-width: 460px; width: 100%; padding: 28px; }
.modal h3 { font-family: var(--font-head); font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.modal p { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.modal .field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.modal-note { font-size: 12px !important; color: var(--ink-soft); opacity: .8; margin-top: 14px !important; }

[data-tilt] { transform-style: preserve-3d; transition: transform .2s ease; will-change: transform; }

/* ===================== Brand logo ===================== */
.brand-logo { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; box-shadow: 0 3px 9px rgba(8,50,95,.28), inset 0 0 0 1px rgba(255,255,255,.5); display: block; flex: 0 0 auto; }
.novato-logo { display: inline-block; line-height: 0; }
.novato-logo svg { width: 100%; height: 100%; display: block; }
.foot-credit { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.foot-logo { width: 22px; height: 22px; color: var(--ink); flex: 0 0 auto; }

/* ===================== Segmented toggle ===================== */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.3); border: 1px solid rgba(255,255,255,.6); box-shadow: inset 0 1px 3px rgba(8,50,95,.12); }
.seg-btn {
  font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: var(--ink-soft);
  border: none; background: transparent; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.seg-btn.active { color: #06324f; background: linear-gradient(180deg,#f3fbff,#cdedfa); box-shadow: 0 2px 7px rgba(31,127,192,.28), inset 0 1px 0 rgba(255,255,255,.9); }

/* ===================== Rendered markdown (GitHub-like, themed) ===================== */
.md-rendered {
  flex: 1; margin: 0; padding: 24px 26px; border-radius: var(--r-md);
  background: rgba(255,255,255,.72); color: var(--ink);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 18px rgba(8,50,95,.1);
  overflow: auto; max-height: 70vh; min-height: 360px;
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.65;
}
.md-rendered > *:first-child { margin-top: 0; }
.md-rendered h1, .md-rendered h2, .md-rendered h3, .md-rendered h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; margin: 1.5em 0 .5em; letter-spacing: -.3px; }
.md-rendered h1 { font-size: 1.7em; font-weight: 700; padding-bottom: .3em; border-bottom: 2px solid rgba(31,127,192,.2); }
.md-rendered h2 { font-size: 1.35em; font-weight: 700; padding-bottom: .25em; border-bottom: 1px solid rgba(31,127,192,.16); }
.md-rendered h3 { font-size: 1.12em; font-weight: 600; color: var(--deep); }
.md-rendered h4 { font-size: 1em; font-weight: 600; color: var(--ink-soft); }
.md-rendered p { margin: .7em 0; }
.md-rendered a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.md-rendered a:hover { border-bottom-color: var(--accent); }
.md-rendered strong { color: var(--ink); font-weight: 700; }
.md-rendered ul, .md-rendered ol { padding-left: 1.5em; margin: .6em 0; }
.md-rendered li { margin: .3em 0; }
.md-rendered img { max-width: 100%; border-radius: var(--r-sm); box-shadow: 0 6px 16px rgba(8,50,95,.18); margin: .6em 0; }
.md-rendered hr { border: none; height: 1px; background: rgba(31,127,192,.18); margin: 1.6em 0; }
.md-rendered blockquote {
  margin: .9em 0; padding: .6em 1em; border-left: 4px solid var(--aqua-3);
  background: rgba(120,224,212,.14); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-soft);
}
.md-rendered code {
  font-family: var(--font-mono); font-size: .86em;
  background: rgba(13,83,144,.1); color: var(--deep); padding: .15em .4em; border-radius: 6px;
}
.md-rendered pre {
  background: rgba(7,34,58,.92); color: #cdeefb; padding: 15px 17px; border-radius: var(--r-sm);
  overflow: auto; margin: 1em 0; box-shadow: inset 0 2px 10px rgba(0,0,0,.3);
}
.md-rendered pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; line-height: 1.55; }
.md-rendered table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 13.5px; overflow: hidden; border-radius: var(--r-sm); box-shadow: 0 3px 10px rgba(8,50,95,.1); }
.md-rendered th, .md-rendered td { padding: 9px 13px; text-align: left; border: 1px solid rgba(31,127,192,.14); }
.md-rendered th { background: color-mix(in srgb, var(--accent) 14%, #fff); font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.md-rendered tr:nth-child(even) td { background: rgba(255,255,255,.4); }
.md-rendered td code { font-size: .92em; }

/* ===================== Theme structural ===================== */
body.no-blur .glass, body.no-blur .pill, body.no-blur .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* --- variable-driven theme engine (applies to every theme) --- */
body[data-theme] .glass { background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--theme-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
body[data-theme] .glass::before { display: none; }
body[data-theme] .btn-glossy::after { display: none; }
body[data-theme] .btn { border-radius: var(--btn-radius); }
body[data-theme] .btn-glossy { color: var(--accent-ink); background: var(--accent); border: none; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
body[data-theme] .btn-ghost { background: transparent; border: 1px solid var(--hairline); color: var(--accent); box-shadow: none; backdrop-filter: none; }
body[data-theme] .pill, body[data-theme] .theme-badge { background: var(--surface); border: 1px solid var(--hairline); box-shadow: none; backdrop-filter: none; color: var(--ink); }
body[data-theme] .topbar { background: var(--surface); border-bottom: 1px solid var(--hairline); backdrop-filter: none; }
body[data-theme] .field, body[data-theme] .dropzone { background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); box-shadow: none; }
body[data-theme] .field::placeholder { color: var(--ink-soft); }
body[data-theme] .tab, body[data-theme] .seg-btn, body[data-theme] .src-modes .tab { color: var(--ink-soft); }
body[data-theme] .tab.active, body[data-theme] .seg-btn.active, body[data-theme] .src-modes .tab.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
body[data-theme] .seg { background: var(--surface); border: 1px solid var(--hairline); }
body[data-theme] .md-rendered { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
body[data-theme] .markdown-out { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
body[data-theme] .drop-orb { background: var(--accent); box-shadow: none; animation: none; filter: none; }
body[data-theme] .led { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
body[data-theme] .hist-item, body[data-theme] .score, body[data-theme] .a-chip { background: var(--surface); border-color: var(--hairline); }

/* --- dark themes (Binance, Spotify, Bugatti, dark custom) --- */
body.theme-dark .md-rendered h1, body.theme-dark .md-rendered h2, body.theme-dark .md-rendered h3, body.theme-dark .md-rendered strong { color: var(--ink); }
body.theme-dark .md-rendered a { color: var(--accent); }
body.theme-dark .md-rendered code { background: rgba(255,255,255,.08); color: var(--ink); }
body.theme-dark .md-rendered th { background: rgba(255,255,255,.06); color: var(--ink); }
body.theme-dark .md-rendered td, body.theme-dark .md-rendered th { border-color: var(--hairline); }
body.theme-dark .ds-sec h2, body.theme-dark .ds-spec-l, body.theme-dark .ds-sw i, body.theme-dark .ds-bar b { color: var(--ink-soft); }
body.theme-dark .ds-sec h2 { border-color: var(--hairline); }
body.theme-dark .ds-spec, body.theme-dark .ds-foot { border-color: var(--hairline); }
body.theme-dark .dna-track, body.theme-dark .ds-bar-t, body.theme-dark .score .ring i { background: rgba(255,255,255,.12); }
body.theme-dark .score .ring i { color: var(--ink); }
body.theme-dark .preview-wrap { background: rgba(255,255,255,.05); }
body.theme-dark .brand-text { color: #fff; }      /* keep MarkAll wordmark legible on dark */

/* --- signature touches --- */
body[data-theme="glass"] .glass { backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
body[data-theme="glass"] .glass::before { display: block; }
body[data-theme="spotify"] .btn-glossy { text-transform: uppercase; letter-spacing: 1.4px; font-size: 13px; }
body[data-theme="bugatti"] .btn-glossy { background: transparent; color: #fff; border: 1px solid #fff; }
body[data-theme="bugatti"] .title, body[data-theme="bugatti"] .section-head h2, body[data-theme="bugatti"] .ds-h1, body[data-theme="bugatti"] .md-rendered h1, body[data-theme="bugatti"] .md-rendered h2 { text-transform: uppercase; letter-spacing: 3px; font-weight: 400; }
body[data-theme="ibm"] .btn-glossy, body[data-theme="ibm"] .btn-ghost, body[data-theme="tesla"] .btn-glossy { box-shadow: none; }

/* ===================== Theme badge ===================== */
.theme-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 10px 6px 12px; border-radius: 999px;
  background: var(--glass-bg); border: 1px solid var(--glass-stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 10px rgba(8,50,95,.1);
  font-family: var(--font-head); cursor: pointer;
}
.theme-badge .tb-text { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.theme-badge .tb-label { font-size: 8px; letter-spacing: 1.5px; color: var(--ink-soft); text-transform: uppercase; }
.theme-badge .tb-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.theme-badge .tb-from { font-size: 9px; color: var(--ink-soft); }
.theme-dice { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  background: linear-gradient(180deg, color-mix(in srgb,var(--accent) 20%,#fff), var(--accent)); color: #fff; border: none; cursor: pointer; }
.theme-dice:hover { transform: rotate(20deg); }
.theme-pick-btn { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: var(--ink); background: none; border: none; border-left: 1px solid rgba(15,30,50,.12); padding: 4px 0 4px 10px; margin-left: 4px; cursor: pointer; }

/* theme picker menu */
.theme-menu {
  position: fixed; z-index: 400; width: 250px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid rgba(15,30,50,.12); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(8,40,70,.22); padding: 8px;
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .16s ease, transform .16s ease;
}
.theme-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.tm-head { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); padding: 6px 8px; }
.theme-opt { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; padding: 9px 8px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.theme-opt:hover { background: rgba(15,30,50,.06); }
.theme-opt.sel { background: color-mix(in srgb, var(--accent) 12%, #fff); }
.theme-opt.sel::after { content: "✓"; margin-left: auto; color: var(--accent); font-weight: 700; }
.to-sw { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.to-t { display: flex; flex-direction: column; line-height: 1.15; }
.to-t b { font-family: var(--font-head); font-size: 13.5px; color: #16202a; }
.to-t i { font-style: normal; font-size: 11px; color: #6a7a86; }
.theme-rand { border-top: 1px solid rgba(15,30,50,.08); margin-top: 4px; border-radius: 0 0 9px 9px; }

/* ===================== Output tabs ===================== */
.tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.tab {
  font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: var(--ink-soft);
  border: 1px solid transparent; background: rgba(255,255,255,.28); padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { background: rgba(255,255,255,.45); }
.tab.active { color: #06324f; background: linear-gradient(180deg,#fff,color-mix(in srgb,var(--accent) 18%,#fff)); box-shadow: 0 2px 8px color-mix(in srgb,var(--accent) 30%,transparent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* DNA bars (#3) */
.dna-row { display: grid; grid-template-columns: 96px 1fr 38px; align-items: center; gap: 10px; margin: 9px 0; }
.dna-row .dna-k { font-family: var(--font-head); font-size: 12.5px; color: var(--ink); }
.dna-track { height: 10px; border-radius: 999px; background: rgba(8,50,95,.1); overflow: hidden; }
.dna-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb,var(--accent) 50%,#fff), var(--accent)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.dna-v { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); text-align: right; }

/* scores (#13) */
.score-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 6px; }
.score { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--r-sm); background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.6); }
.score .ring { --p: 0; width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--accent) calc(var(--p)*1%), rgba(8,50,95,.12) 0); display: grid; place-items: center; }
.score .ring i { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 700 11px/1 var(--font-mono); color: var(--ink); font-style: normal; }
.score .s-k { font-family: var(--font-head); font-size: 12.5px; color: var(--ink); }
.score.overall { grid-column: 1 / -1; }
.score.overall .ring { width: 54px; height: 54px; }
.score.overall .ring i { width: 42px; height: 42px; font-size: 14px; }

/* analysis chips + lists */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.a-chip { font-family: var(--font-head); font-weight: 600; font-size: 12px; color: var(--deep); padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb,var(--accent) 14%,#fff); border: 1px solid color-mix(in srgb,var(--accent) 22%,#fff); }
.a-block { margin: 0 0 16px; }
.a-block h4 { font-family: var(--font-head); font-weight: 700; font-size: 13px; margin: 0 0 6px; color: var(--ink); text-transform: uppercase; letter-spacing: .5px; }
.a-block p, .a-block li { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.a-locked { font-size: 12.5px; color: var(--ink-soft); font-style: italic; opacity: .8; }

/* prompt + token blocks */
.code-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.code-block { background: rgba(7,34,58,.9); color: #cdeefb; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; padding: 14px; border-radius: var(--r-sm); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; border: 1px solid rgba(255,255,255,.14); }

/* history (#16) */
.hist-panel { padding: 18px; margin-top: 22px; }
.hist-empty { color: var(--ink-soft); font-size: 13px; }
.hist-list { display: grid; gap: 8px; }
.hist-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.6); cursor: pointer; transition: transform .14s; }
.hist-item:hover { transform: translateX(3px); }
.hist-sw { display: flex; gap: 3px; flex: 0 0 auto; }
.hist-sw i { width: 14px; height: 22px; border-radius: 3px; display: block; }
.hist-meta { flex: 1; min-width: 0; }
.hist-title { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-size: 11px; color: var(--ink-soft); }
.hist-x { font-size: 15px; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 4px; }

/* compare/blend extra source */
.src-modes { display: flex; gap: 5px; margin-bottom: 12px; }
.mini-drop { border: 2px dashed rgba(31,127,192,.4); border-radius: var(--r-sm); padding: 12px; text-align: center; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; background: rgba(255,255,255,.18); margin-top: 10px; }
.mini-drop.has { border-style: solid; color: var(--ink); }

/* ===================== Design-system showcase (Preview) ===================== */
.ds { font-family: var(--font-body); color: var(--ink); }
.ds-hero { display: flex; gap: 20px; align-items: stretch; margin-bottom: 26px; }
.ds-hero-txt { flex: 1; min-width: 0; }
.ds-kick { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); margin: 0 0 6px; }
.ds-h1 { font-family: var(--font-head); font-weight: 800; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; margin: 0 0 8px; letter-spacing: -.5px; }
.ds-sub { color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; margin: 0 0 12px; }
.ds-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-tags span { font-family: var(--font-head); font-weight: 600; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ds-accent) 14%, #fff); color: var(--ds-accent); }
.ds-hero-art { width: 180px; flex: 0 0 auto; border-radius: 16px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.ds-hero-art span { width: 64%; height: 64%; border-radius: 50%; }
@media (max-width: 560px) { .ds-hero { flex-direction: column; } .ds-hero-art { width: 100%; height: 120px; } }

.ds-sec { margin: 0 0 26px; }
.ds-sec h2 { font-family: var(--font-head); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); border-bottom: 1px solid rgba(0,0,0,.08); padding-bottom: 6px; margin: 0 0 14px; }

.ds-swgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.ds-sw { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.ds-chip { height: 56px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); margin-bottom: 4px; }
.ds-sw b { font-family: var(--font-mono); font-size: 11px; color: var(--ink); }
.ds-sw i { font-style: normal; font-size: 11px; color: var(--ink-soft); }

.ds-type { display: flex; flex-direction: column; gap: 12px; }
.ds-spec { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px dashed rgba(0,0,0,.08); padding-bottom: 10px; }
.ds-spec-t { font-family: var(--font-head); color: var(--ink); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-spec-l { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); flex: 0 0 auto; }

.ds-preview { padding: 22px; }
.ds-pv-tag { font-family: var(--font-head); font-weight: 700; font-size: 10px; letter-spacing: 2px; }
.ds-preview h3 { font-family: var(--font-head); font-weight: 700; font-size: 20px; margin: 6px 0 6px; }
.ds-preview p { font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; }
.ds-pv-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ds-pv-row button { font-family: var(--font-head); font-weight: 600; font-size: 14px; padding: 10px 20px; cursor: pointer; }
.ds-preview input { width: 100%; padding: 11px 14px; font-size: 14px; outline: none; margin-bottom: 16px; box-sizing: border-box; }
.ds-pv-card { padding: 16px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.ds-pv-card b { font-family: var(--font-head); font-size: 15px; }
.ds-pv-card span { font-size: 12.5px; }
.ds-pv-chip { position: absolute; top: 14px; right: 14px; font-family: var(--font-head); font-weight: 600; font-size: 11px; padding: 4px 10px; border-radius: 999px; }

.ds-radii { display: flex; gap: 16px; flex-wrap: wrap; }
.ds-radii span { width: 86px; height: 86px; display: grid; place-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); grid-template-rows: 1fr auto; padding: 12px; }
.ds-radii span i { width: 100%; height: 100%; border-radius: inherit; }

.ds-dna { display: grid; gap: 8px; }
.ds-bar { display: grid; grid-template-columns: 100px 1fr 32px; align-items: center; gap: 10px; }
.ds-bar > span:first-child { font-family: var(--font-head); font-size: 12.5px; }
.ds-bar-t { height: 10px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; }
.ds-bar-t i { display: block; height: 100%; border-radius: 999px; }
.ds-bar b { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); text-align: right; }
.ds-foot { font-size: 12px; color: var(--ink-soft); border-top: 1px solid rgba(0,0,0,.08); padding-top: 14px; }

/* ===================== Mobile ===================== */
@media (max-width: 720px) {
  .studio-grid { grid-template-columns: 1fr; }
  .output-panel { position: static; }
  .feat-grid, .how-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .nav { width: 100%; justify-content: center; gap: 6px; flex-wrap: wrap; }
  .brand-text { font-size: 18px; }
  .brand-bubble { width: 26px; height: 26px; }
  .pill { font-size: 12.5px; padding: 7px 12px; }

  .hero { padding: 28px 14px 44px; }
  .hero-glass { padding: 24px 18px; }
  .title { font-size: clamp(28px, 9vw, 40px); letter-spacing: -.6px; }
  .lede { font-size: 15px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; }
  .btn { font-size: 14.5px; padding: 13px 22px; }

  .section-head { padding: 24px 14px 6px; }
  .section-head h2 { font-size: clamp(22px, 6vw, 30px); }
  .features, .how { padding: 8px 14px 30px; }
  .manifesto { padding: 20px 14px 36px; }
  .feat, .how-card, .manifesto-card, .panel { padding: 18px; }
  .big { font-size: 17px; }
  .manifesto-list li { font-size: 14.5px; }

  .app-main { padding: 12px 12px 24px; }
  .studio-grid { gap: 16px; }
  .dropzone { padding: 18px; }
  .drop-main { font-size: 16px; }
  .url-row { flex-wrap: wrap; }
  .url-row .field { flex: 1 1 100%; }
  .url-row .btn { flex: 1 1 100%; }
  .gen-row { flex-wrap: wrap; }
  .gen-row .field, .gen-row .btn { flex: 1 1 100%; }
  .swatch { width: 40px; height: 40px; }
  .markdown-out { font-size: 11.5px; max-height: none; min-height: 300px; }
  .md-rendered { padding: 18px; font-size: 13.5px; max-height: none; min-height: 300px; }
  .out-actions { flex-wrap: wrap; }
  .panel-title { flex-wrap: wrap; }

  .modal { padding: 22px; }
  .toast-wrap { bottom: 16px; }
  .foot { padding: 24px 16px 40px; }
  .theme-menu { right: 8px !important; left: 8px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
