/* Gozi.to — brand kit v1.1 (gozi-brand-kit/). Ink #13251E · Lime #D7FC70 · Paper #FFF · Mist #F2F5EF */

:root {
  --ink: #13251e;
  --lime: #d7fc70;
  --paper: #fff;
  --mist: #f2f5ef;
  --font: Arial, Helvetica, sans-serif;
  --mono: "Courier New", monospace;
  --radius: 20px;
  --radius-panel: 32px;
  --radius-input: 10px;
  --pill: 999px;

  /* light semantic tokens */
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f2f5ef;
  --text: #13251e;
  --text-secondary: #546159;
  --border: #dce3da;
  --danger: #a52c27;
  --ok: #2f6b1f;
  --warn-bg: #fff4d6;
  --warn: #6b4a00;
  --focus: #64851a;
  --input-border: #879383;
  --chart: #5f8a1c; /* validated single-series mark color (light) */
  --grid: #e6ebe3;
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-hover: #2c4337;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --canvas: #0b1410;
  --surface: #14221a;
  --surface-raised: #1c2e23;
  --text: #f1f7ed;
  --text-secondary: #b0bfb1;
  --border: #34483a;
  --danger: #ffaaa2;
  --ok: #b7e35a;
  --warn-bg: #2a2a12;
  --warn: #f0e08a;
  --focus: var(--lime);
  --input-border: #69816b;
  --chart: #7d9f27; /* validated single-series mark color (dark) */
  --grid: #243629;
  --btn-bg: var(--lime);
  --btn-fg: var(--ink);
  --btn-hover: #e3ff9c;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--canvas); color: var(--text); font: 16px/1.6 var(--font);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 4px;
}
img { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.1; font-weight: 800; }
h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -2.5px; }
h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -1.2px; }
h3 { font-size: 20px; letter-spacing: -.4px; line-height: 1.25; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); }
.muted { color: var(--text-secondary); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -100px; left: 8px; padding: 8px 12px; background: var(--lime); color: var(--ink); border-radius: 8px; z-index: 60; }
.skip:focus { top: 8px; }
.eyebrow { font: 700 12px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 2px; color: var(--text-secondary); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.narrow { max-width: 760px; }
main { flex: 1; padding: 40px 0 72px; }

.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo-link { text-decoration: none; display: inline-flex; align-items: center; }
.logo-link img { width: 165px; height: 66px; object-fit: contain; display: block; }
.logo-dark { display: none; font-size: 30px; font-weight: 800; letter-spacing: -2px; color: var(--text); line-height: 1; }
.logo-dark span { color: var(--lime); }
[data-theme="dark"] .logo-link img { display: none; }
[data-theme="dark"] .logo-dark { display: inline-block; }
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav > a:not(.btn) { text-decoration: none; font-size: 14px; font-weight: 700; color: var(--text); }
.nav > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .user { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.theme-toggle {
  border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface); color: var(--text);
  padding: 8px 14px; min-height: 40px; white-space: nowrap; cursor: pointer; font-size: 14px; font-weight: 700;
}
.theme-toggle:hover { background: var(--surface-raised); }

.site-footer { border-top: 1px solid var(--border); padding: 36px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer nav a { font-size: 13px; color: var(--text-secondary); }
.wordmark { font-size: 28px; font-weight: 800; letter-spacing: -1.5px; text-decoration: none; line-height: 1; color: var(--text); }
.wordmark small { font-size: inherit; color: #526737; }
[data-theme="dark"] .wordmark small { color: var(--lime); }

/* ---------- Buttons ---------- */
.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: var(--pill); padding: 14px 24px; min-height: 44px;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s, background .18s;
}
.btn:hover, .button:hover { transform: translateY(-2px); background: var(--btn-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.small { padding: 8px 16px; min-height: 36px; font-size: 14px; gap: 8px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-raised); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }
.btn.danger:hover { background: var(--surface-raised); }

/* ---------- Forms ---------- */
input[type="text"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-width: 0; padding: 13px 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--input-border); border-radius: var(--radius-input);
}
[data-theme="dark"] input[type="text"], [data-theme="dark"] input[type="url"], [data-theme="dark"] input[type="search"],
[data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--surface-raised); }
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: .85; }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.field + .field { margin-top: 16px; }
.hint, .form-note { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin-top: 8px; }
.error-text { color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.error-text:empty { margin: 0; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card + .card { margin-top: 20px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.notice { border-radius: 14px; padding: 14px 16px; font-size: 14px; background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--surface-raised); color: var(--text); border-left: 4px solid var(--chart); }
.notice.lime { background: var(--lime); color: var(--ink); }
.notice.lime a { color: var(--ink); }

.pill { display: inline-block; font: 700 11px/1.6 var(--mono); letter-spacing: 1px; text-transform: uppercase; padding: 2px 10px; border-radius: var(--pill); border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.pill.active { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.pill.preview { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.disabled { color: var(--danger); }

.short-url { font-weight: 800; font-size: 22px; letter-spacing: -.5px; overflow-wrap: anywhere; color: var(--text); }
.dest { color: var(--text-secondary); font-size: 14px; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tabs button { background: none; border: 0; color: var(--text-secondary); padding: 12px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--lime); }
[data-theme="light"] .tabs button[aria-selected="true"] { border-bottom-color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font: 700 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--lime); color: var(--ink); padding: 12px 18px; border-radius: var(--pill); font-size: 14px; font-weight: 700;
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #a52c27; color: #fff; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 28px; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(5 12 9 / .6); }

.empty { text-align: center; padding: 40px 16px; color: var(--text-secondary); }
.avatar { width: 28px; height: 28px; border-radius: 50%; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; padding: 36px 0 64px; }
.hero h1 { font-size: clamp(56px, 7.3vw, 104px); line-height: .99; letter-spacing: -6px; margin: 18px 0 24px; }
.hero h1 span { display: inline-block; background: var(--lime); color: var(--ink); padding: 0 9px 9px; margin-left: -9px; border-radius: 12px; transform: rotate(-2deg); }
.lead { max-width: 460px; font-size: 19px; line-height: 1.55; color: var(--text-secondary); }
.shorten { display: flex; gap: 10px; margin-top: 8px; }
.shorten input { font-size: 17px; padding: 15px 16px; }
.shorten .btn { padding: 15px 26px; }
.micro { font-size: 13px; color: var(--text-secondary); margin-top: 12px; }

.visual {
  background: var(--ink); color: #fff; border-radius: var(--radius-panel); min-height: 440px; padding: 36px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
[data-theme="dark"] .visual { background: #16291e; border: 1px solid #40573b; }
.visual .eyebrow { color: var(--lime); }
.long-url { font: 14px/1.8 var(--mono); overflow-wrap: anywhere; color: #b6c4b6; border: 1px solid #4b5c4f; border-radius: 14px; padding: 18px; margin-top: 24px; }
.connector { height: 56px; width: 1px; background: #6b7d64; margin-left: 30px; position: relative; }
.connector::after { content: "↓"; position: absolute; bottom: -8px; left: -6px; color: var(--lime); }
.visual .big-link { font-size: clamp(28px, 3.4vw, 46px); font-weight: 800; letter-spacing: -2px; background: var(--lime); color: var(--ink); padding: 22px 18px; border-radius: 14px; transform: rotate(-4deg); white-space: nowrap; display: inline-block; }
.visual-bottom { display: flex; justify-content: space-between; align-items: end; margin-top: 32px; }
.visual-bottom p { font-size: 14px; line-height: 1.5; margin: 0; color: #d4dfd2; }
.visual-bottom strong { font-size: 44px; line-height: 1; }

.result { margin-top: 24px; }
.result .qr { width: 132px; height: 132px; background: #fff; border-radius: 14px; padding: 8px; flex: none; }
.result .qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.strap { display: flex; justify-content: space-between; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 22px 0; gap: 12px 20px; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.strap span::before { content: "↗"; margin-right: 12px; }
.section { padding: 80px 0; }
.section-top { display: flex; justify-content: space-between; gap: 32px; align-items: end; }
.section-top p { max-width: 360px; color: var(--text-secondary); }
.section h2 { font-size: clamp(36px, 4vw, 56px); letter-spacing: -2.5px; margin: 12px 0 24px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.feature { padding: 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature .number { font: 14px var(--mono); color: var(--text-secondary); }
.feature h3 { font-size: 24px; letter-spacing: -.7px; margin: 36px 0 12px; }
.feature p { color: var(--text-secondary); margin: 0; }
.faq { max-width: 820px; margin: 0 auto; }
details { border-bottom: 1px solid var(--border); padding: 20px 0; }
summary { font-weight: 700; cursor: pointer; font-size: 18px; }
details p { color: var(--text-secondary); max-width: 690px; margin: 12px 0 0; }
.closing { background: var(--lime); color: var(--ink); padding: 48px; border-radius: 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.closing h2 { margin: 0; font-size: 44px; line-height: 1.15; letter-spacing: -2px; }
.closing .btn { background: var(--ink); color: #fff; }
.closing .btn:hover { background: #2c4337; }
.closing a:focus-visible { outline-color: var(--ink); }

/* ---------- Stats ---------- */
.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 24px; }
.stat-tile { background: var(--surface-raised); border-radius: 14px; padding: 16px 18px; }
.stat-tile .v { font-size: 32px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-tile .k { font: 700 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; overflow: visible; }
.chart-wrap .bar { fill: var(--chart); }
.chart-wrap .bar.hover { filter: brightness(1.15); }
.chart-wrap .gridline { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .axis-label { fill: var(--text-secondary); font-size: 11px; font-family: var(--font); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--canvas); font-size: 13px; font-weight: 700;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.breakdowns { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 28px; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 14px; padding: 5px 0; }
.hbars .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.hbars .value { font-variant-numeric: tabular-nums; font-weight: 700; }
.hbars .track { grid-column: 1 / -1; height: 6px; background: var(--surface-raised); border-radius: 0 4px 4px 0; }
.hbars .fill { height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; }
.range { display: inline-flex; gap: 4px; background: var(--surface-raised); padding: 3px; border-radius: var(--pill); }
.range button { border: 0; background: none; font-size: 13px; padding: 5px 12px; border-radius: var(--pill); color: var(--text-secondary); cursor: pointer; font-weight: 700; }
.range button[aria-pressed="true"] { background: var(--lime); color: var(--ink); }

/* ---------- Dashboard ---------- */
.link-row .code { font-weight: 800; }
.link-row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Prose pages ---------- */
.prose h2 { margin-top: 1.6em; font-size: 26px; letter-spacing: -.8px; }
.prose p, .prose li { color: var(--text-secondary); }
.prose strong { color: var(--text); }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--text); text-underline-offset: 3px; }
.prose pre { background: var(--ink); color: var(--lime); padding: 20px 22px; border-radius: 14px; overflow-x: auto; font-size: 14px; }
.prose code { font-size: .92em; }
[data-theme="dark"] .prose pre { background: #0f1c15; border: 1px solid var(--border); }

/* ---------- Responsive (kit breakpoints: 900 / 650) ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { letter-spacing: -4px; }
  .visual { min-height: 360px; padding: 26px; }
  .features { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section-top { display: block; }
}
@media (max-width: 650px) {
  .site-header .wrap { min-height: 72px; }
  .logo-link img { width: 125px; height: 50px; }
  .logo-dark { font-size: 26px; }
  .nav { gap: 10px; }
  .nav > a:not(.btn):not(#nav-account) { display: none; }
  .hero h1 { font-size: 60px; letter-spacing: -3.5px; }
  .lead { font-size: 17px; }
  .shorten { flex-direction: column; }
  .visual .big-link { font-size: 32px; }
  .feature h3 { margin-top: 20px; }
  .closing { padding: 28px; display: block; }
  .closing h2 { font-size: 34px; margin-bottom: 20px; }
  .card { padding: 20px; }
}
@media (max-width: 360px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Ink button for use on Lime surfaces (never white text on Lime). */
.btn.inkish { background: var(--ink); color: #fff; }
.btn.inkish:hover { background: #2c4337; }

/* Scrollable table box: keeps the sections below it in view. */
.scroll-box { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.scroll-box table { border-collapse: separate; border-spacing: 0; }
.scroll-box thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.scroll-box td:first-child, .scroll-box th:first-child { padding-left: 14px; }

/* QR code: miniature inside the "QR code" button, and the panel shown after creating a link. */
.qr-btn .qr-thumb { width: 20px; height: 20px; background: #fff; padding: 2px; border-radius: 4px; image-rendering: pixelated; box-sizing: content-box; }
.created { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.created .qr { width: 120px; height: 120px; background: #fff; border-radius: 14px; padding: 8px; flex: none; }
.created .qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
