:root {
  color-scheme: dark;
  --ink: #f3f7f1;
  --muted: #90a39d;
  --bg: #07110f;
  --panel: #0b1714;
  --panel-2: #0e1c18;
  --line: #233a33;
  --mint: #7cf6c6;
  --acid: #eaff80;
  --danger: #ff8d7a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 12%, rgba(124, 246, 198, .08), transparent 28rem),
    radial-gradient(circle at 10% 80%, rgba(234, 255, 128, .045), transparent 24rem),
    var(--bg);
}

button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  z-index: 10;
}

.topbar, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--mint); border-radius: 9px; color: var(--mint); font: 700 12px/1 ui-monospace, monospace; }
.privacy-pill { display: flex; gap: 8px; align-items: center; padding: 7px 12px; color: var(--muted); background: rgba(124,246,198,.04); border: 1px solid var(--line); border-radius: 999px; font: 600 12px/1 ui-monospace, monospace; }
.privacy-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.github-link { justify-self: end; color: var(--muted); text-decoration: none; font-size: 14px; }
.github-link:hover { color: var(--mint); }

main { padding-block: 76px 48px; }
.intro { max-width: 840px; margin-bottom: 52px; }
.eyebrow { margin: 0 0 18px; color: var(--mint); font: 700 12px/1 ui-monospace, monospace; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(3rem, 7.2vw, 6.5rem); line-height: .92; letter-spacing: -.07em; font-weight: 790; }
h1 em { color: var(--acid); font-family: Georgia, serif; font-weight: 400; }
.lede { max-width: 650px; margin: 28px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }

.workspace { display: grid; grid-template-columns: .88fr 1.12fr; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.panel { min-width: 0; padding: 26px; }
.source-panel { border-right: 1px solid var(--line); }
.output-panel { display: flex; flex-direction: column; background: var(--panel-2); }
.panel-head { min-height: 38px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.panel-head > div:first-child { display: flex; align-items: baseline; gap: 11px; }
.step { color: var(--mint); font: 700 11px/1 ui-monospace, monospace; }
h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.text-button:hover { color: var(--mint); }

.drop-zone {
  min-height: 212px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #385a50;
  border-radius: 13px;
  background: rgba(124,246,198,.025);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging { border-color: var(--mint); background: rgba(124,246,198,.065); outline: none; transform: translateY(-2px); }
.drop-zone input { display: none; }
.drop-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 50%; color: var(--acid); font: 400 22px/1 ui-monospace, monospace; }
.drop-zone strong { font-size: 15px; }
.drop-zone small { margin-top: 8px; color: var(--muted); font-size: 12px; }

.repo-summary { min-height: 212px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: #091310; }
.repo-summary > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.repo-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-summary > div:first-child span { color: var(--muted); font: 12px ui-monospace, monospace; }
.meter { height: 5px; margin: 30px 0; overflow: hidden; border-radius: 10px; background: var(--line); }
.meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--mint), var(--acid)); transition: width .45s ease; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-grid div { display: flex; flex-direction: column; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.summary-grid span { font: 700 18px/1.2 ui-monospace, monospace; }
.summary-grid small { margin-top: 6px; color: var(--muted); font-size: 11px; }

.settings { margin-top: 16px; border-top: 1px solid var(--line); }
.switch-row, .field-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.switch-row > span, .field-row > span { display: flex; flex-direction: column; gap: 4px; }
.switch-row strong, .field-row strong { font-size: 13px; font-weight: 650; }
.switch-row small, .field-row small { color: var(--muted); font-size: 11px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border: 1px solid #436057; border-radius: 999px; background: #12241f; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch-row input:checked + i { border-color: var(--mint); background: rgba(124,246,198,.15); }
.switch-row input:checked + i::after { left: 19px; background: var(--mint); }
.switch-row input:focus-visible + i { outline: 2px solid var(--acid); outline-offset: 2px; }
.field-row { align-items: flex-start; flex-direction: column; justify-content: center; gap: 10px; padding: 13px 0; }
.field-row input { width: 100%; padding: 9px 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; outline: none; background: #08110f; font: 12px ui-monospace, monospace; }
.field-row input:focus { border-color: var(--mint); }

.format-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.format { padding: 5px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.format.active { color: var(--ink); background: #1b2d28; }
.output-wrap { position: relative; flex: 1; min-height: 460px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #050c0a; }
pre { height: 100%; max-height: 540px; margin: 0; padding: 24px; overflow: auto; color: #adc6bd; font: 12px/1.7 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; word-break: break-word; scrollbar-color: #36564d transparent; }
.empty-badge { position: absolute; right: 16px; top: 16px; padding: 6px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; font: 700 9px/1 ui-monospace, monospace; letter-spacing: .12em; }
.output-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; }
.token-count { display: flex; flex-direction: column; gap: 3px; }
.token-count strong { font: 700 14px ui-monospace, monospace; }
.token-count span { color: var(--muted); font-size: 10px; }
.actions { display: flex; gap: 8px; }
.actions button { min-height: 42px; padding: 0 16px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; }
.actions button:disabled { cursor: not-allowed; opacity: .38; }
.secondary { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.primary { border: 1px solid var(--acid); color: #07110f; background: var(--acid); }
.primary span { margin-left: 10px; opacity: .55; font: 10px ui-monospace, monospace; }
.actions button:not(:disabled):hover { transform: translateY(-1px); }

.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 22px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--line); }
.trust-strip > div { display: flex; gap: 15px; padding: 19px; background: var(--panel); }
.trust-strip b { color: var(--mint); font: 700 10px ui-monospace, monospace; }
.trust-strip span { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.trust-strip strong { color: var(--ink); font-size: 12px; }

footer { min-height: 94px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
footer a { color: var(--mint); text-decoration: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 12px 16px; color: #07110f; border-radius: 8px; background: var(--mint); box-shadow: 0 16px 40px rgba(0,0,0,.35); font-size: 13px; font-weight: 750; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 850px) {
  .topbar { grid-template-columns: 1fr auto; }
  .privacy-pill { display: none; }
  main { padding-top: 54px; }
  .workspace { grid-template-columns: 1fr; }
  .source-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .output-wrap { min-height: 400px; }
  .trust-strip { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar, main, footer { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 66px; }
  .github-link { font-size: 12px; }
  main { padding-block: 42px 34px; }
  .intro { margin-bottom: 36px; }
  .lede { font-size: 16px; }
  .panel { padding: 18px; }
  .panel-head { align-items: center; }
  .output-footer { align-items: flex-end; }
  .actions button { padding: 0 12px; }
  .primary span { display: none; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
