@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --h: 258;
  --accent: hsl(var(--h) 96% 72%);
  --accent-soft: hsl(var(--h) 96% 72% / 14%);
  --bg: #090a12;
  --surface: #11121d;
  --surface-raised: #171827;
  --field: #0d0e18;
  --line: #292a3a;
  --text: #f2f0fb;
  --muted: #9292a8;
  --subtle: #66677e;
  --good: #78e0b0;
  --bad: #ff8297;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
  --speed: 180ms;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; padding: 28px 22px 20px; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { color: #090a12; background: var(--accent); }

.ambient { position: fixed; z-index: -1; width: 440px; height: 440px; border-radius: 50%; filter: blur(110px); opacity: .13; pointer-events: none; }
.ambient-one { top: -250px; left: -180px; background: #7b5cff; }
.ambient-two { right: -260px; bottom: -250px; background: #18c9d5; opacity: .09; }
.shell { width: min(100%, 850px); margin: 0 auto; }
.topbar, .brand, .top-note, .section-heading, .preview-caption, .score-row, .footer { display: flex; align-items: center; justify-content: space-between; }
.topbar { min-height: 36px; }
.brand { justify-content: flex-start; gap: 10px; color: var(--text); font-size: 17px; font-weight: 800; letter-spacing: -.07em; text-decoration: none; }
.brand-dot { color: var(--accent); }
.brand-mark { display: flex; align-items: end; gap: 2px; width: 20px; height: 20px; padding: 3px; border: 1px solid #45435f; border-radius: 6px; transform: rotate(-10deg); }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 7px; opacity: .55; }
.brand-mark i:nth-child(2) { height: 12px; opacity: .8; }
.brand-mark i:nth-child(3) { height: 8px; }
.top-note, .eyebrow, .step, .auto-tag, .micro-label, .preview-caption, .sample-label, .score-label, .footer { font-family: var(--mono); letter-spacing: .1em; }
.top-note { justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 9px; }
.top-index { color: var(--subtle); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px #78e0b077; }

.hero { padding: 72px 0 34px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 10px; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(46px, 8vw, 76px); line-height: .99; font-weight: 700; letter-spacing: -.075em; }
h1 span { color: transparent; background: linear-gradient(100deg, #b7a8ff 5%, #78dce8 55%, #f5a8cf 100%); background-clip: text; -webkit-background-clip: text; }
.intro { max-width: 510px; margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.tabs { display: flex; width: fit-content; gap: 5px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #10111b; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: color var(--speed), background var(--speed), transform var(--speed); }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); background: #27263a; box-shadow: inset 0 0 0 1px #393650; }
.tab-symbol { color: var(--accent); font-size: 16px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.view { display: grid; gap: 12px; }
.card { position: relative; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgb(24 24 39 / 96%), rgb(15 16 26 / 98%)); box-shadow: 0 18px 55px #00000020; }
.section-heading { gap: 16px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 16px; }
.section-heading h2 { margin: 5px 0 0; font-size: 16px; font-weight: 700; letter-spacing: -.04em; }
.step, .micro-label { color: var(--subtle); font-size: 9px; }
.auto-tag { flex: none; padding: 7px 9px; border: 1px solid #343149; border-radius: 5px; color: var(--accent); background: var(--accent-soft); font-size: 9px; }
label { display: block; margin-bottom: 8px; color: #c7c5d7; font-size: 11px; font-weight: 700; }
.input-wrap { display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 0 14px; border: 1px solid #343449; border-radius: 8px; background: var(--field); transition: border-color var(--speed), box-shadow var(--speed); }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-prefix { color: var(--accent); font-family: var(--mono); }
input { width: 100%; min-width: 0; min-height: 45px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 13px; }
input:focus-visible { outline: 0; }
.field-group input { padding: 0 12px; border: 1px solid #343449; border-radius: 7px; background: var(--field); transition: border-color var(--speed), box-shadow var(--speed); }
.field-group input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.help { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
code { color: #c9bcff; font-family: var(--mono); font-size: .94em; }
.preview-wrap { margin-top: 20px; }
.preview { height: 126px; border: 1px solid #ffffff20; border-radius: 9px; background: #7968f7; box-shadow: inset 0 0 0 1px #0000000b; transition: background var(--speed); }
.preview-caption { margin-top: 9px; color: var(--subtle); font-size: 9px; }
.preview-caption span:last-child { color: var(--muted); letter-spacing: 0; }
.gamut-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.gamut-item { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #10111b; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.gamut-indicator { display: grid; width: 17px; height: 17px; flex: none; place-items: center; border-radius: 50%; color: var(--good); background: #78e0b014; font-size: 10px; }
.gamut-item[data-ok="false"] .gamut-indicator { color: var(--bad); background: #ff829714; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 37px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; font-size: 10px; font-weight: 800; cursor: pointer; transition: transform var(--speed), filter var(--speed), border-color var(--speed); }
.button:hover { filter: brightness(1.1); }
.button:active, .swap-button:active { transform: translateY(1px); }
.button-primary { color: #11101a; background: var(--accent); }
.button-primary:disabled { opacity: .5; cursor: not-allowed; }
.output-list { display: grid; }
.output-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 45px; border-top: 1px solid #28283a; }
.output-row:first-child { border-top: 0; }
.output-name { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.output-value { min-width: 0; color: #e1def1; font-family: var(--mono); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.copy-button { min-width: 54px; min-height: 29px; padding: 0 8px; border: 1px solid #343449; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.copy-button:hover { border-color: var(--accent); color: var(--text); }
.error { min-height: 16px; margin: 9px 0 0; color: var(--bad); font-size: 11px; line-height: 1.5; }

.pair-grid { display: grid; grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); align-items: end; gap: 12px; }
.swap-button { width: 38px; height: 38px; margin-bottom: 4px; border: 1px solid #3a3850; border-radius: 7px; background: #211f32; color: var(--accent); font-size: 19px; cursor: pointer; transition: transform var(--speed), background var(--speed); }
.swap-button:hover { background: #302b49; }
.sample { display: grid; gap: 10px; min-height: 145px; margin-top: 20px; padding: 18px; border: 1px solid #ffffff1a; border-radius: 9px; background: #171326; color: #f5f3ff; }
.sample-label { opacity: .65; font-size: 8px; }
.sample strong { font-size: 28px; letter-spacing: -.06em; }
.sample > span:last-child { font-size: 12px; line-height: 1.6; }
.score-row { align-items: end; padding: 2px 0 18px; border-bottom: 1px solid #28283a; }
.score-row > div { display: grid; gap: 7px; }
.score-label { color: var(--subtle); font-size: 9px; }
.score { font-size: 37px; line-height: 1; letter-spacing: -.07em; }
.apca-score { text-align: right; }
.apca-score strong { color: #c7baff; font-family: var(--mono); font-size: 22px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; }
.check { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #10111b; font-size: 10px; }
.check span:first-child { color: var(--muted); }
.check b { font-family: var(--mono); font-size: 9px; font-weight: 500; }
.check[data-ok="true"] b { color: var(--good); }
.check[data-ok="false"] b { color: var(--bad); }
.apca-note { max-width: 610px; margin-top: 14px; }
.footer { gap: 12px; padding: 22px 2px 0; color: var(--subtle); font-size: 8px; }
.footer b { color: var(--accent); font-size: 12px; }

@media (min-width: 760px) {
  .view#view-convert { grid-template-columns: minmax(0, 1.15fr) minmax(230px, .85fr); align-items: stretch; }
  .input-card { grid-row: span 2; }
  .output-card { grid-column: 1 / -1; }
  .view#view-contrast { grid-template-columns: minmax(0, 1.1fr) minmax(270px, .9fr); align-items: start; }
}
@media (max-width: 560px) {
  body { padding: 20px 14px 16px; }
  .hero { padding: 58px 0 28px; }
  .card { padding: 18px; }
  .top-note { font-size: 8px; }
  .gamut-list, .checks { grid-template-columns: 1fr; }
  .output-row { grid-template-columns: 82px minmax(0, 1fr) auto; gap: 7px; }
  .output-name, .output-value { font-size: 9px; }
  .pair-grid { grid-template-columns: 1fr 38px 1fr; gap: 7px; }
  .field-group input { font-size: 10px; padding: 0 8px; }
  .swap-button { width: 34px; }
  .footer { align-items: flex-start; flex-direction: column; font-size: 8px; }
}
@media (max-width: 370px) {
  .pair-grid { grid-template-columns: 1fr; }
  .swap-button { justify-self: center; transform: rotate(90deg); }
  .swap-button:active { transform: rotate(90deg) translateY(1px); }
  .output-row { grid-template-columns: 1fr auto; padding: 8px 0; }
  .output-name { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
