:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --paper-deep: #ebe2d2;
  --ink: #1d211e;
  --muted: #65675f;
  --line: #cfc5b5;
  --panel: rgba(255, 252, 246, 0.76);
  --accent: #d65138;
  --shadow: 0 24px 70px rgba(48, 39, 26, 0.12);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171a18;
  --paper-deep: #222723;
  --ink: #f0eee7;
  --muted: #a9ada6;
  --line: #3a403b;
  --panel: rgba(31, 35, 32, 0.86);
  --accent: #f07b5f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, #f2c14e 16%, transparent), transparent 28rem),
    radial-gradient(circle at 88% 9%, color-mix(in srgb, #9b5de5 11%, transparent), transparent 26rem),
    var(--paper);
  color: var(--ink);
  min-width: 320px;
  overflow-x: hidden;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1rem;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1440px, calc(100% - 3rem));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 780;
  letter-spacing: -.03em;
  font-size: 1.15rem;
}
.brand-mark { width: 32px; height: 32px; position: relative; display: inline-block; }
.brand-mark i { position: absolute; inset: 3px; border: 2px solid currentColor; border-radius: 50%; }
.brand-mark i:nth-child(2) { inset: 8px; border-color: var(--accent); }
.brand-mark i:nth-child(3) { inset: 13px; }
nav { display: flex; align-items: center; gap: 1.4rem; }
nav a { text-decoration: none; color: var(--muted); font-size: .92rem; }
nav a:hover { color: var(--ink); }
.icon-button { border: 1px solid var(--line); background: transparent; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }

main { overflow: hidden; }
.hero {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
  text-align: center;
}
.kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .15em;
}
h1, h2, h3, p { text-wrap: pretty; }
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3.5rem, 9.5vw, 8.5rem);
  line-height: .88;
  letter-spacing: -.065em;
}
h1 em { color: var(--accent); font-weight: 400; }
.mobile-break { display: none; }
.hero-copy {
  width: min(710px, 100%);
  margin: 2rem auto 2.2rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
  color: var(--muted);
}
.primary-button {
  display: inline-flex;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  padding: .95rem 1.3rem;
  border-radius: 999px;
  font-weight: 750;
}

.workspace-shell, .output-section, .explanation, .origin-note {
  width: min(1440px, calc(100% - 3rem));
  margin: 0 auto;
}
.workspace-shell {
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.4rem;
}
.section-heading h2, .explanation h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.view-switch, .domain-picker {
  display: inline-flex;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}
.view-switch button, .domain-picker button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: .6rem .9rem;
  cursor: pointer;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}
.view-switch button.is-active, .domain-picker button.is-active {
  background: var(--ink);
  color: var(--paper);
}
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); gap: clamp(2rem, 4vw, 4rem); }
.tool-layout > * { min-width: 0; }
.search-wrap { position: relative; z-index: 4; }
.search-wrap label { display: block; margin-bottom: .65rem; font-size: .82rem; font-weight: 750; color: var(--muted); }
.search-field { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 0 1rem; }
.search-field span { color: var(--muted); font-size: 1.3rem; }
.search-field input { border: 0; outline: 0; background: transparent; color: var(--ink); padding: .95rem 0; width: 100%; }
.search-field:focus-within, .add-avoid:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.search-results {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
}
.search-results.has-results { display: block; }
.search-result { width: 100%; display: grid; grid-template-columns: 12px 1fr auto; gap: .75rem; align-items: center; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: .75rem .9rem; text-align: left; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result:focus { background: var(--paper-deep); }
.search-result-dot { width: 9px; height: 9px; border-radius: 50%; }
.search-result strong { display: block; }
.search-result small { color: var(--muted); }
.search-result > small { text-align: right; }

.wheel-stage { position: relative; min-height: 680px; display: grid; place-items: center; }
.feel-wheel { width: min(100%, 720px); max-height: 720px; overflow: visible; filter: drop-shadow(0 18px 24px rgba(51, 42, 28, .12)); }
.wheel-segment { stroke: color-mix(in srgb, var(--paper) 80%, #000); stroke-width: 2; cursor: pointer; transition: opacity .16s ease, transform .16s ease, filter .16s ease; transform-origin: center; }
.wheel-segment:hover, .wheel-segment:focus-visible { filter: brightness(1.08); outline: none; transform: scale(1.008); stroke: var(--ink); stroke-width: 5; }
.wheel-segment.is-selected { stroke: var(--ink); stroke-width: 5; filter: brightness(1.08); }
.wheel-label { fill: #171916; font-weight: 760; font-size: 13px; pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.wheel-label.family { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; }
.wheel-label.group { font-size: 14px; }
.wheel-center { fill: var(--paper); stroke: var(--line); stroke-width: 2; }
.wheel-center-label { fill: var(--ink); text-anchor: middle; font-weight: 900; letter-spacing: .16em; font-size: 18px; }
.wheel-tip { position: absolute; bottom: .4rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 90%; color: var(--muted); font-size: .78rem; text-align: center; }

.vibe-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; padding-top: 1.5rem; max-height: 700px; overflow: auto; }
.list-family { grid-column: 1 / -1; margin: 1rem 0 .1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.list-family:first-child { margin-top: 0; }
.list-vibe { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: .9rem; text-align: left; cursor: pointer; }
.list-vibe strong, .list-vibe small { display: block; }
.list-vibe small { color: var(--muted); margin-top: .3rem; line-height: 1.4; }

.direction-panel { min-width: 0; border-left: 1px solid var(--line); padding-left: clamp(1.5rem, 3vw, 3rem); }
.domain-picker { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); border-radius: 14px; }
.domain-picker button { min-width: 0; }
.domain-picker button:focus-visible { outline-offset: -2px; }
.panel-block { margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.block-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.block-heading h3 { margin: 0; font-size: .95rem; }
.block-heading span { color: var(--muted); font-size: .74rem; }
.blend-list { display: grid; gap: .75rem; min-height: 3rem; }
.empty-state { color: var(--muted); font-size: .88rem; line-height: 1.5; border: 1px dashed var(--line); border-radius: 12px; padding: .9rem; }
.blend-item { display: grid; grid-template-columns: 12px 1fr auto; gap: .7rem; align-items: center; }
.blend-dot { width: 10px; height: 10px; border-radius: 50%; }
.blend-meta { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: center; }
.blend-meta strong { font-size: .88rem; }
.blend-meta output { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.blend-item input[type="range"] { grid-column: 2; accent-color: var(--ink); width: 100%; }
.remove-button { grid-column: 3; grid-row: 1 / span 2; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.vibe-detail { margin-top: 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; }
.detail-path { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; }
.detail-path i { width: 8px; height: 8px; border-radius: 50%; }
.vibe-detail h3 { margin: .55rem 0 .4rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.vibe-detail p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .88rem; }
.failure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.failure-pair button { border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: .65rem; text-align: left; cursor: pointer; font-size: .75rem; }
.failure-pair button span { display: block; color: var(--muted); margin-bottom: .2rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .45rem .7rem; font-size: .76rem; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.add-avoid { display: grid; grid-template-columns: 1fr auto; margin-top: .8rem; }
.add-avoid input { min-width: 0; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--paper); color: var(--ink); padding: .75rem; outline: 0; }
.add-avoid button { border: 1px solid var(--ink); border-radius: 0 10px 10px 0; background: var(--ink); color: var(--paper); padding: 0 .9rem; cursor: pointer; }

.output-section { padding: clamp(5rem, 10vw, 9rem) 0; }
.output-heading { align-items: center; }
.output-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.output-actions button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .65rem .85rem; cursor: pointer; font-size: .78rem; font-weight: 700; }
.output-actions button:hover { border-color: var(--ink); }
.output-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1.5rem; align-items: stretch; }
.preview-card, .compiled-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 460px; }
.preview-card { padding: clamp(1.5rem, 4vw, 3rem); background: var(--ink); color: var(--paper); display: flex; flex-direction: column; }
.preview-chrome { display: flex; gap: .35rem; margin-bottom: auto; }
.preview-chrome span { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; opacity: .5; }
.preview-eyebrow { margin: 3rem 0 .7rem; color: color-mix(in srgb, var(--paper) 65%, transparent); text-transform: uppercase; letter-spacing: .13em; font-size: .7rem; font-weight: 800; }
.preview-card h3 { margin: 0 0 1rem; max-width: 15ch; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.preview-card > p:not(.preview-eyebrow) { color: color-mix(in srgb, var(--paper) 76%, transparent); line-height: 1.65; max-width: 54ch; }
.preview-dials { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: auto; padding-top: 2rem; }
.dial { min-width: 0; }
.dial span { display: block; color: color-mix(in srgb, var(--paper) 55%, transparent); font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; }
.dial-track { height: 3px; margin-top: .4rem; background: color-mix(in srgb, var(--paper) 20%, transparent); }
.dial-track i { display: block; height: 100%; background: var(--paper); }
.compiled-card { background: #191b19; color: #e8e5dc; display: grid; grid-template-rows: auto 1fr; }
.compiled-label { padding: .85rem 1rem; color: #9da099; border-bottom: 1px solid #343834; font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.compiled-card pre { margin: 0; padding: 1.4rem; overflow: auto; white-space: pre-wrap; font: .78rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.status-message { min-height: 1.2rem; color: var(--muted); text-align: right; font-size: .78rem; }

.explanation { padding: 0 0 clamp(5rem, 9vw, 8rem); display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(3rem, 8vw, 8rem); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.steps article { border-top: 1px solid var(--line); padding-top: 1rem; }
.steps span { color: var(--accent); font-size: .72rem; font-weight: 800; }
.steps h3 { margin: 1.2rem 0 .6rem; font-size: 1rem; }
.steps p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.origin-note { max-width: 900px; border-top: 1px solid var(--line); padding: 3rem 0 clamp(5rem, 9vw, 8rem); }
.origin-note > p:last-child { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.3rem, 2.5vw, 2rem); line-height: 1.45; }
footer { width: min(1440px, calc(100% - 3rem)); margin: 0 auto; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .75rem; }
noscript { display: block; padding: 1rem; background: #fff3cd; color: #3d3319; text-align: center; }

@media (max-width: 1050px) {
  .tool-layout { grid-template-columns: 1fr; }
  .direction-panel { border-left: 0; border-top: 1px solid var(--line); padding: 2rem 0 0; }
  .wheel-stage { min-height: 610px; }
  .output-grid { grid-template-columns: 1fr; }
  .explanation { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header, .workspace-shell, .output-section, .explanation, .origin-note, footer { width: min(100% - 1.5rem, 1440px); }
  .site-header { min-height: 68px; }
  nav a { display: none; }
  .hero { width: min(100% - 1.5rem, 1120px); padding-top: 5rem; }
  .hero h1 { font-size: clamp(2.85rem, 14vw, 4rem); line-height: .92; }
  .mobile-break { display: block; }
  .hero .kicker { font-size: .66rem; letter-spacing: .11em; }
  .hero-copy { font-size: 1rem; }
  .workspace-shell { padding: 1.1rem; border-radius: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .view-switch { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .wheel-stage { min-height: calc(100vw - 2.5rem); }
  .feel-wheel { width: 100%; max-width: 100%; }
  .discovery-panel { overflow: hidden; }
  .vibe-list { grid-template-columns: 1fr; }
  .domain-picker button { border-radius: 10px; padding: .65rem .5rem; font-size: .78rem; }
  .output-actions { justify-content: flex-start; }
  .steps { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

