:root {
  color-scheme: dark;
  --bg: #0b0915;
  --bg-deep: #06050d;
  --surface: rgba(17, 14, 30, 0.82);
  --surface-solid: #12101e;
  --text: #f7eee9;
  --muted: #ada5b3;
  --faint: #6e6879;
  --line: rgba(247, 238, 233, 0.14);
  --line-strong: rgba(247, 238, 233, 0.26);
  --pink: #ff4fa3;
  --pink-soft: #ff9fcf;
  --cyan: #51e9e2;
  --amber: #ffbd69;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5ecea;
  --bg-deep: #eee0df;
  --surface: rgba(255, 250, 247, 0.85);
  --surface-solid: #fffaf7;
  --text: #21172c;
  --muted: #6c6173;
  --faint: #918692;
  --line: rgba(40, 24, 47, 0.13);
  --line-strong: rgba(40, 24, 47, 0.25);
  --pink: #d32172;
  --pink-soft: #f46da8;
  --cyan: #087f86;
  --amber: #b25b17;
  --shadow: 0 28px 80px rgba(69, 35, 64, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 350ms ease, color 350ms ease;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; position: relative; z-index: 2; }

.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 18%, rgba(118, 58, 127, .21), transparent 33%), linear-gradient(180deg, transparent 55%, rgba(255, 79, 163, .035)); }
.moon { position: absolute; width: 290px; height: 290px; right: 7vw; top: 92px; border-radius: 50%; opacity: .22; background: linear-gradient(155deg, var(--pink-soft), #9068f4 55%, var(--cyan)); filter: blur(.2px); box-shadow: 0 0 80px rgba(255, 79, 163, .2); }
.moon::after { content: ""; position: absolute; inset: 8px; border-radius: inherit; background: var(--bg); transform: translate(-32px, -15px); }
.horizon-glow { position: absolute; left: 0; right: 0; bottom: 0; height: 42vh; background: radial-gradient(ellipse at 50% 100%, rgba(255,79,163,.14), transparent 63%); }
.stars { position: absolute; inset: 0; opacity: .28; background-image: radial-gradient(circle, var(--text) 0 1px, transparent 1.2px); background-size: 97px 97px; mask-image: linear-gradient(to bottom, black, transparent 55%); }
.city { position: absolute; left: -2%; right: -2%; bottom: 0; height: 22vh; opacity: .13; background: repeating-linear-gradient(90deg, transparent 0 22px, var(--text) 23px 56px, transparent 57px 72px); clip-path: polygon(0 80%, 3% 80%, 3% 46%, 7% 46%, 7% 68%, 11% 68%, 11% 25%, 14% 25%, 14% 58%, 19% 58%, 19% 72%, 25% 72%, 25% 35%, 30% 35%, 30% 64%, 36% 64%, 36% 17%, 40% 17%, 40% 62%, 48% 62%, 48% 43%, 54% 43%, 54% 67%, 60% 67%, 60% 28%, 65% 28%, 65% 56%, 71% 56%, 71% 12%, 75% 12%, 75% 62%, 81% 62%, 81% 40%, 85% 40%, 85% 70%, 91% 70%, 91% 30%, 95% 30%, 95% 75%, 100% 75%, 100% 100%, 0 100%); }
.city-front { height: 14vh; opacity: .1; transform: scaleX(-1); }
.rain { position: absolute; inset: -30%; opacity: .045; background-image: repeating-linear-gradient(113deg, transparent 0 38px, var(--text) 39px, transparent 40px 83px); transform: translate3d(0,0,0); animation: rain 18s linear infinite; }
@keyframes rain { to { transform: translate3d(-120px, 160px, 0); } }

.nav { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.04em; font-size: 19px; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--pink); font-family: var(--serif); font-style: italic; }
.brand-dot { color: var(--pink); }
.nav-actions { display: flex; gap: 28px; align-items: center; }
.model-state { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.model-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px currentColor; }
.model-state.ready i { background: var(--cyan); }
.model-state.error i { background: #ff5e67; }
.theme-toggle { border: 0; background: transparent; color: var(--muted); padding: 5px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-track { width: 38px; height: 21px; border: 1px solid var(--line-strong); border-radius: 20px; padding: 3px; display: block; }
.toggle-orb { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 12px rgba(255,79,163,.6); transition: transform 300ms ease, background 300ms ease; }
[data-theme="light"] .toggle-orb { transform: translateX(17px); background: var(--cyan); box-shadow: none; }
.theme-label { width: 52px; text-align: left; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }

.hero { padding: 112px 0 72px; display: grid; grid-template-columns: 2fr 1fr; align-items: end; gap: 60px; }
.eyebrow { grid-column: 1 / -1; color: var(--pink-soft); text-transform: uppercase; letter-spacing: .22em; font-size: 10px; display: flex; align-items: center; gap: 14px; margin-bottom: -32px; }
.eyebrow::before { content: ""; width: 42px; height: 1px; background: currentColor; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(68px, 9.2vw, 136px); font-weight: 400; line-height: .78; letter-spacing: -.075em; }
h1 em, .about h2 em { color: var(--pink-soft); font-weight: 400; }
.intro { margin: 0 0 3px; color: var(--muted); font-family: var(--serif); font-size: 20px; line-height: 1.55; max-width: 360px; }

.detector { display: grid; grid-template-columns: 1.13fr .87fr; border: 1px solid var(--line-strong); background: var(--surface); backdrop-filter: blur(24px); box-shadow: var(--shadow); }
.panel { min-height: 600px; padding: 42px; }
.input-panel { border-right: 1px solid var(--line-strong); }
.panel-head, .result-topline { display: flex; justify-content: space-between; align-items: flex-start; }
.step { color: var(--pink-soft); text-transform: uppercase; letter-spacing: .2em; font-size: 9px; font-weight: 700; }
.panel h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; }
.panel-head h2 { margin: 10px 0 28px; font-size: 28px; }
.text-button { background: transparent; border: 0; padding: 4px; color: var(--faint); cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.text-button:hover { color: var(--pink); }
.editor-wrap { position: relative; }
textarea { resize: none; display: block; width: 100%; min-height: 286px; padding: 23px; border: 1px solid var(--line); background: rgba(0,0,0,.09); color: var(--text); line-height: 1.72; font-size: 16px; border-radius: 0; transition: border-color 180ms ease, background 180ms ease; }
[data-theme="light"] textarea { background: rgba(255,255,255,.28); }
textarea::placeholder { color: var(--faint); }
textarea:focus { border-color: var(--pink-soft); background: transparent; outline: none; }
.editor-corner { position: absolute; width: 18px; height: 18px; right: 0; bottom: 0; border-right: 2px solid var(--pink); border-bottom: 2px solid var(--pink); pointer-events: none; }
.input-meta { display: flex; gap: 18px; margin: 12px 0 22px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.input-meta strong { color: var(--muted); font-weight: 600; }
.length-hint { margin-left: auto; }
.length-hint.good { color: var(--cyan); }
.sample-row { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 11px; margin-bottom: 22px; }
.sample { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 10px; cursor: pointer; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sample:hover { border-color: var(--pink); color: var(--text); }
.analyze-button { width: 100%; height: 61px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px 0 26px; border: 1px solid var(--pink); background: var(--pink); color: #140913; cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.analyze-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255,79,163,.23); }
.analyze-button:disabled { cursor: not-allowed; opacity: .34; filter: saturate(.25); }
.button-arrow { font-size: 19px; font-weight: 400; }
.error-message { min-height: 18px; margin: 10px 0 -28px; color: #ff7588; font-size: 12px; }

.result-panel { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 47%, rgba(255,79,163,.08), transparent 36%); }
.result-panel::after { content: ""; position: absolute; inset: 18px; border: 1px solid var(--line); pointer-events: none; }
.result-empty, .result-loading { max-width: 310px; text-align: center; position: relative; z-index: 1; }
.result-empty h2, .result-loading h2 { margin: 24px 0 12px; font-size: 31px; }
.result-empty p, .result-loading p { color: var(--muted); line-height: 1.6; font-size: 13px; }
.orbital { width: 120px; height: 120px; margin: 0 auto 34px; border: 1px solid var(--line-strong); border-radius: 50%; position: relative; animation: drift 7s ease-in-out infinite; }
.orbital::before, .orbital::after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; transform: rotate(38deg); }
.orbital::before { inset: 18px -18px; }
.orbital::after { inset: 37px -29px; }
.orbital span { position: absolute; inset: 42px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 35px rgba(255,79,163,.65); }
.orbital i { position: absolute; top: 18px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
@keyframes drift { 50% { transform: translateY(-8px) rotate(3deg); } }
.scan-lines { width: 220px; height: 140px; display: flex; align-items: center; gap: 10px; margin: 0 auto 34px; }
.scan-lines i { display: block; flex: 1; height: 18%; background: var(--pink); opacity: .55; animation: pulse 1.1s ease-in-out infinite alternate; }
.scan-lines i:nth-child(2) { height: 48%; animation-delay: .16s; }
.scan-lines i:nth-child(3) { height: 92%; animation-delay: .32s; }
.scan-lines i:nth-child(4) { height: 61%; animation-delay: .48s; }
.scan-lines i:nth-child(5) { height: 29%; animation-delay: .64s; }
@keyframes pulse { to { transform: scaleY(.35); opacity: .2; } }
.result-content { width: 100%; position: relative; z-index: 1; align-self: stretch; }
.timing { color: var(--faint); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.score-ring { --score-angle: 0deg; width: 208px; height: 208px; margin: 35px auto 24px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--pink) 0 var(--score-angle), var(--line) var(--score-angle) 360deg); position: relative; box-shadow: 0 0 45px rgba(255,79,163,.1); }
.score-ring::before { content: ""; position: absolute; inset: 5px; border-radius: inherit; background: var(--surface-solid); }
.score-inner { position: relative; text-align: center; display: flex; flex-direction: column; }
.score { font-family: var(--serif); font-size: 59px; line-height: 1; letter-spacing: -.06em; }
.score-label { margin-top: 9px; color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .16em; }
.result-content h2 { text-align: center; margin: 0 auto 26px; max-width: 360px; font-size: 25px; line-height: 1.2; }
.signal-scale { margin: 0 8px 26px; }
.scale-bar { height: 5px; background: linear-gradient(90deg, var(--cyan), var(--line) 50%, var(--pink)); position: relative; }
.scale-bar i { display: block; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; border: 2px solid var(--surface-solid); border-radius: 50%; background: var(--text); transform: translate(-50%, -50%); transition: left 900ms cubic-bezier(.2,.8,.2,1); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 9px; color: var(--faint); text-transform: uppercase; letter-spacing: .09em; font-size: 8px; }
.result-note { display: flex; gap: 13px; padding: 15px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.52; }
.result-note > span { color: var(--amber); font-size: 17px; }
.result-note p { margin: 0; }
.result-note strong { color: var(--text); font-weight: 600; }
.again-button { display: block; margin: 20px auto 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.again-button:hover { color: var(--pink); }

.about { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 54px; padding: 150px 0 140px; border-bottom: 1px solid var(--line); }
.about-number { font-family: var(--serif); color: var(--line-strong); font-size: 76px; line-height: .8; }
.about h2 { margin: 18px 0 0; font-family: var(--serif); font-size: clamp(40px, 4.4vw, 59px); font-weight: 400; line-height: .95; letter-spacing: -.05em; }
.about-body { padding-top: 1px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.about-body p:first-child { margin-top: 0; }
.about-body a { color: var(--text); text-decoration-color: var(--pink); text-underline-offset: 3px; }
.about-body dl { margin: 30px 0 0; border-top: 1px solid var(--line); }
.about-body dl div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.about-body dt { color: var(--faint); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.about-body dd { margin: 0; color: var(--text); font-size: 12px; }
.footer { height: 98px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.footer span { color: var(--pink-soft); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 820px) {
  .shell { width: min(100% - 30px, 680px); }
  .nav { height: 78px; }
  .model-state { display: none; }
  .hero { padding: 86px 0 50px; grid-template-columns: 1fr; gap: 34px; }
  .eyebrow { margin: 0 0 -10px; }
  h1 { font-size: clamp(65px, 20vw, 108px); }
  .intro { font-size: 18px; max-width: 500px; }
  .detector { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .panel { min-height: auto; padding: 30px; }
  .result-panel { min-height: 560px; }
  .about { grid-template-columns: 70px 1fr; gap: 30px; padding: 100px 0; }
  .about-body { grid-column: 2; }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 22px); }
  .theme-label { display: none; }
  .nav-actions { gap: 8px; }
  .hero { padding-top: 68px; }
  h1 { font-size: clamp(59px, 19vw, 90px); }
  .panel { padding: 23px 18px; }
  textarea { min-height: 260px; padding: 17px; }
  .input-meta { gap: 11px; flex-wrap: wrap; }
  .length-hint { width: 100%; margin-left: 0; }
  .sample-row { align-items: flex-start; flex-wrap: wrap; }
  .result-panel { min-height: 570px; }
  .result-panel::after { inset: 9px; }
  .score-ring { width: 190px; height: 190px; }
  .about { grid-template-columns: 1fr; gap: 25px; padding: 90px 6px; }
  .about-number { font-size: 50px; }
  .about-body { grid-column: 1; }
  .footer { height: auto; padding: 30px 0; flex-direction: column; align-items: flex-start; gap: 10px; }
}

