:root {
  color-scheme: dark;
  --night: #0a0f1e;
  --navy: #10172a;
  --panel: #141d33;
  --panel-2: #19243e;
  --ink: #f6f8ff;
  --muted: #a9b3ca;
  --line: #2a3858;
  --teal: #2dd4bf;
  --teal-dark: #0d9488;
  --purple: #818cf8;
  --orange: #fbbf24;
  --danger: #fb7185;
  --paper: #f5f7fb;
  --paper-ink: #11182b;
  --paper-muted: #5c6579;
  --paper-line: #dde2ec;
  --shadow: 0 28px 80px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--night); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; padding: .75rem 1rem; color: var(--paper-ink); background: white; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(10,15,30,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.nav { max-width: 1160px; min-height: 68px; margin: auto; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: white; text-decoration: none; font-weight: 850; letter-spacing: -.025em; }
.brand-mark { width: 36px; height: 36px; display: grid; grid-template-columns: 1fr 1fr; place-items: center; color: var(--teal); background: var(--panel-2); border: 1px solid #364668; border-radius: 10px; font: 800 .9rem/1 ui-monospace, monospace; }
.brand-mark span { color: var(--purple); }
.nav-links { display: flex; gap: 1.2rem; }
.nav-links a { color: #dce3f3; text-decoration: none; font-weight: 650; font-size: .94rem; }
.hero { overflow: hidden; background: radial-gradient(circle at 72% 18%, rgba(99,102,241,.23), transparent 30%), radial-gradient(circle at 90% 70%, rgba(45,212,191,.12), transparent 30%), var(--night); }
.hero-inner { max-width: 1160px; min-height: 620px; margin: auto; padding: 5.7rem 1.25rem; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 4rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; color: #9cf4e9; font: 750 .76rem/1.2 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow i { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 5px rgba(45,212,191,.1); }
.eyebrow.dark { color: #176d69; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; }
.hero h1 { margin: .65rem 0 1.25rem; font-size: clamp(3.1rem, 7.2vw, 5.9rem); }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero-copy > p { max-width: 650px; margin: 0; color: #c1cada; font-size: 1.14rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .65rem 1.3rem; margin: 1.8rem 0; color: #dfe6f4; font-weight: 700; }
.trust-row span::before { content: "✓"; margin-right: .4rem; color: var(--teal); }
.button { min-height: 49px; padding: .72rem 1.15rem; border: 0; border-radius: 9px; color: #071712; background: var(--teal); font-weight: 850; cursor: pointer; }
.button:hover { background: #5eead4; }
.button.secondary { color: white; background: #37456c; }
.button.secondary:hover { background: #465782; }
.hero-button { display: inline-flex; align-items: center; gap: .7rem; color: #071712; text-decoration: none; }
.code-window { overflow: hidden; background: rgba(16,23,42,.9); border: 1px solid #344362; border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px rgba(129,140,248,.08); transform: rotate(1.5deg); }
.window-bar { min-height: 46px; padding: 0 1rem; display: flex; align-items: center; gap: .45rem; background: #151e34; border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #fb7185; }
.window-bar i:nth-child(2) { background: var(--orange); }
.window-bar i:nth-child(3) { background: var(--teal); }
.window-bar span { margin-left: .5rem; color: #8490a9; font: .78rem ui-monospace, monospace; }
.code-window pre { min-height: 330px; margin: 0; padding: 2rem; overflow: auto; color: #dbe3f5; font: clamp(.78rem, 1.6vw, .98rem)/1.85 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dim { color: #6f7b95; }
.purple { color: #a5b4fc; }
.green { color: #5eead4; }
.orange { color: #fcd34d; }
.cursor { display: inline-block; width: 8px; height: 1.1em; margin-left: 3px; background: var(--teal); vertical-align: middle; }
.wrap { color: var(--paper-ink); background: var(--paper); padding: 5.2rem max(1.25rem, calc((100vw - 1160px)/2)); }
.section-head { max-width: 720px; margin-bottom: 2.4rem; }
.section-head h2 { margin: .5rem 0 .75rem; font-size: clamp(2.3rem, 5vw, 4rem); }
.section-head p { color: var(--paper-muted); font-size: 1.1rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.card { padding: 1.45rem; color: var(--paper-ink); text-decoration: none; background: white; border: 1px solid var(--paper-line); border-radius: 16px; box-shadow: 0 5px 22px rgba(17,24,43,.05); transition: transform .15s, border-color .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); border-color: #9aa5bb; box-shadow: 0 15px 38px rgba(17,24,43,.09); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-top i { min-width: 44px; height: 44px; padding: 0 .6rem; display: grid; place-items: center; color: #0b6f68; background: #ddf8f4; border-radius: 10px; font: 800 .82rem ui-monospace, monospace; font-style: normal; }
.card-top small { color: #9aa3b5; font: .78rem ui-monospace, monospace; }
.card h3 { margin: 1.15rem 0 .45rem; font-size: 1.3rem; }
.card p { margin: 0 0 .85rem; color: var(--paper-muted); }
.card b { color: #166d68; font-size: .9rem; }
.proof { max-width: 1160px; margin: 0 auto; padding: 4rem 1.25rem; display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.proof > div { padding: 1.5rem; border-left: 1px solid var(--line); }
.proof span { display: block; color: var(--teal); font: .75rem ui-monospace, monospace; }
.proof strong { display: block; margin: .5rem 0; font-size: 1.35rem; }
.proof p { margin: 0; color: var(--muted); }
.tool-heading { max-width: 900px; margin: auto; padding: 3.4rem 1.25rem 2rem; text-align: center; }
.back-link { display: block; width: fit-content; margin: 0 auto 1.5rem; color: var(--muted); text-decoration: none; font-weight: 700; }
.tool-symbol { min-width: 58px; height: 58px; padding: 0 .7rem; display: inline-grid; place-items: center; color: var(--teal); background: var(--panel-2); border: 1px solid #344362; border-radius: 13px; font: 850 .9rem ui-monospace, monospace; }
.tool-heading h1 { margin: .9rem 0 .7rem; font-size: clamp(2.4rem, 5vw, 4.3rem); }
.tool-heading > p { max-width: 700px; margin: auto; color: var(--muted); font-size: 1.08rem; }
.micro-trust { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.micro-trust span { padding: .3rem .65rem; color: #c9d3e6; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 700; }
.tool-shell { max-width: 1160px; margin: auto; padding: 0 1.25rem 4rem; }
.tool-panel { padding: clamp(1rem, 3vw, 1.6rem); background: var(--panel); border: 1px solid #33415f; border-radius: 18px; box-shadow: var(--shadow); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor { overflow: hidden; background: #0d1425; border: 1px solid var(--line); border-radius: 11px; }
.editor-label { min-height: 43px; padding: .65rem .8rem; display: flex; justify-content: space-between; gap: 1rem; color: #dbe3f4; background: #151e34; border-bottom: 1px solid var(--line); font: 700 .79rem ui-monospace, monospace; }
.editor-label small { color: #7f8ba3; }
textarea { width: 100%; min-height: 270px; padding: 1rem; resize: vertical; color: #e9eef9; background: #0d1425; border: 0; outline: 0; font: .9rem/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
textarea[readonly] { color: #b8f4eb; }
textarea:focus { box-shadow: inset 0 0 0 2px var(--teal-dark); }
input, select { width: 100%; min-height: 47px; padding: .65rem .75rem; color: white; background: #0d1425; border: 1px solid #415070; border-radius: 9px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(45,212,191,.28); outline-offset: 2px; border-color: var(--teal); }
.field { display: grid; gap: .4rem; font-weight: 700; }
.field small { color: var(--muted); font-weight: 450; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.copy-button { min-height: 45px; margin-left: auto; padding: .65rem 1rem; color: #dce4f5; background: transparent; border: 1px solid #465473; border-radius: 9px; font-weight: 750; cursor: pointer; }
.copy-button:disabled { opacity: .42; cursor: not-allowed; }
.status { min-height: 1.4rem; margin: .9rem 0 0; color: #8f9bb2; font: .82rem ui-monospace, monospace; }
.status[data-kind=success] { color: var(--teal); }
.status[data-kind=error] { color: var(--danger); }
.inline-option { max-width: 260px; margin: 1rem 0 0; }
.direction { margin: 0 0 1rem; }
.single-panel, .password-panel { max-width: 760px; margin: auto; }
.single-panel textarea { min-height: 250px; margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.panel-symbol { width: 70px; height: 70px; margin: 0 auto 1.2rem; display: grid; place-items: center; color: var(--teal); background: #0d1425; border: 1px solid var(--line); border-radius: 15px; font: 850 1.1rem ui-monospace, monospace; }
.compact-fields { max-width: 230px; margin: auto; }
.jwt-grid { margin-top: 1rem; }
.jwt-grid textarea { min-height: 220px; }
.regex-fields { display: grid; grid-template-columns: 1fr 180px; gap: 1rem; margin-bottom: 1rem; }
.pattern-input { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; color: var(--purple); font: 800 1.1rem ui-monospace, monospace; }
.match-output { min-height: 100px; max-height: 280px; margin-top: 1rem; padding: 1rem; overflow: auto; color: #dce5f4; background: #0d1425; border: 1px solid var(--line); border-radius: 10px; font: .84rem/1.55 ui-monospace, monospace; }
.match-output span { color: #7f8ba3; }
.match-output ol { margin: 0; padding-left: 1.5rem; }
.match-output li + li { margin-top: .6rem; }
.match-output code { color: #8ef1e3; white-space: pre-wrap; overflow-wrap: anywhere; }
.password-output { display: grid; grid-template-columns: 1fr auto; gap: .7rem; }
.password-output input { min-height: 58px; color: #b8f4eb; font: 1rem ui-monospace, monospace; }
.password-output .copy-button { margin: 0; }
.password-settings { margin: 1rem 0; display: grid; grid-template-columns: 180px 1fr; gap: 1rem; }
fieldset { margin: 0; padding: .7rem .9rem; display: flex; gap: .7rem 1.2rem; flex-wrap: wrap; border: 1px solid #415070; border-radius: 9px; }
fieldset legend { padding: 0 .3rem; font-weight: 700; }
fieldset label { display: flex; align-items: center; gap: .4rem; }
fieldset input { width: 18px; min-height: auto; height: 18px; }
.full { width: 100%; }
.content { max-width: 850px; margin: auto; padding: 1rem 1.25rem 4.5rem; }
.content.standalone { min-height: 65vh; padding-top: 4rem; }
.content h1 { font-size: clamp(2.5rem, 5vw, 4.2rem); }
.content h2 { margin-top: 2.5rem; font-size: 1.8rem; }
.content li + li { margin-top: .55rem; }
.notice { padding: 1.1rem 1.2rem; color: #dce5f5; background: var(--panel); border-left: 4px solid var(--orange); border-radius: 9px; }
.notice p { margin: .25rem 0 0; color: var(--muted); }
.mini-grid { display: grid; gap: .7rem; }
.mini-card { padding: 1rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; color: white; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.mini-card > i { min-width: 43px; height: 43px; padding: 0 .5rem; display: grid; place-items: center; color: var(--teal); background: #0d1425; border-radius: 9px; font: 800 .75rem ui-monospace, monospace; font-style: normal; }
.mini-card strong, .mini-card small { display: block; }
.mini-card small { margin-top: .2rem; color: var(--muted); }
.mini-card b { color: var(--teal); }
.ad-slot { max-width: 970px; min-height: 110px; margin: 2rem auto; display: grid; place-items: center; color: #7f8ba3; background: #10172a; border: 1px dashed #344362; border-radius: 11px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.ad-slot[data-active=false] { display: none; }
.ad-separation { padding: 0 1.25rem; }
.site-footer { background: #080c18; border-top: 1px solid #202b43; }
.footer-inner { max-width: 1160px; margin: auto; padding: 2rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: #8995ad; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 780px) {
  .hero-inner { min-height: auto; padding: 4.3rem 1.25rem; grid-template-columns: 1fr; }
  .code-window { display: none; }
  .grid, .proof, .editor-grid, .regex-fields, .password-settings { grid-template-columns: 1fr; }
  .proof { padding-top: 3rem; }
  .proof > div { border-left: 0; border-top: 1px solid var(--line); }
  .nav-links a:not(:first-child) { display: none; }
  .editor-grid { gap: .7rem; }
  textarea { min-height: 220px; }
  .copy-button { margin-left: 0; }
  .actions > * { flex: 1 1 auto; }
}

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