/* Kalta.uz — design system. One file, no framework, no CDN. */

/* ---------- Fonts (self-hosted Inter, split by script) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Same metrics as Inter, so text does not jump when the font arrives */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.2%;
  descent-override: 22.5%;
  line-gap-override: 0%;
  size-adjust: 107.4%;
}

/* ---------- Tokens ---------- */
:root {
  --brand: #ff7500;
  --brand-strong: #e86a00;
  --brand-ink: #a84a00;       /* brand colour for text on light backgrounds (AA) */
  --brand-soft: #fff0df;
  --brand-wordmark: #db5800;  /* large brand text: 3:1+ on the cream background */
  --on-brand: #1b1510;

  --bg: #fffaf3;
  --bg-alt: #fff3e4;
  --surface: #ffffff;
  --surface-2: #fcf7ef;
  --ink: #1b1510;
  --ink-soft: #4a4036;
  --muted: #6b6155;
  --line: #eadfce;
  --line-strong: #d6c6ab;

  --ok: #157a3c;
  --ok-bg: #e7f6ec;
  --err: #b42318;
  --err-bg: #fdeceb;

  --ring: rgb(255 117 0 / 0.38);
  --shadow-1: 0 1px 2px rgb(74 48 12 / 0.06), 0 2px 8px rgb(74 48 12 / 0.05);
  --shadow-2: 0 14px 34px -14px rgb(120 60 0 / 0.3), 0 2px 8px rgb(74 48 12 / 0.06);

  --code-bg: #fbf6ee;
  --code-ink: #2b2218;
  --hl-keyword: #b4231b;
  --hl-string: #0a7a3d;
  --hl-number: #a35200;
  --hl-comment: #6c6256;
  --hl-title: #1a5fb4;
  --hl-type: #7b3fa0;

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;

  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand-wordmark: #ff7500;
  --brand-ink: #ffa44d;
  --brand-soft: #35210f;
  --bg: #15110d;
  --bg-alt: #1b1611;
  --surface: #1f1a14;
  --surface-2: #251f18;
  --ink: #f7efe4;
  --ink-soft: #d3c7b6;
  --muted: #a99d8d;
  --line: #342d25;
  --line-strong: #4b4136;
  --ok: #5ed38a;
  --ok-bg: #12301f;
  --err: #ff8a80;
  --err-bg: #3a1714;
  --ring: rgb(255 140 40 / 0.45);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 14px 34px -14px rgb(0 0 0 / 0.7), 0 2px 8px rgb(0 0 0 / 0.4);
  --code-bg: #17130f;
  --code-ink: #ece3d6;
  --hl-keyword: #ff8a80;
  --hl-string: #7ee2a0;
  --hl-number: #ffb067;
  --hl-comment: #8d8273;
  --hl-title: #7db6ff;
  --hl-type: #d2a2f0;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-wordmark: #ff7500;
    --brand-ink: #ffa44d;
    --brand-soft: #35210f;
    --bg: #15110d;
    --bg-alt: #1b1611;
    --surface: #1f1a14;
    --surface-2: #251f18;
    --ink: #f7efe4;
    --ink-soft: #d3c7b6;
    --muted: #a99d8d;
    --line: #342d25;
    --line-strong: #4b4136;
    --ok: #5ed38a;
    --ok-bg: #12301f;
    --err: #ff8a80;
    --err-bg: #3a1714;
    --ring: rgb(255 140 40 / 0.45);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 14px 34px -14px rgb(0 0 0 / 0.7), 0 2px 8px rgb(0 0 0 / 0.4);
    --code-bg: #17130f;
    --code-ink: #ece3d6;
    --hl-keyword: #ff8a80;
    --hl-string: #7ee2a0;
    --hl-number: #ffb067;
    --hl-comment: #8d8273;
    --hl-title: #7db6ff;
    --hl-type: #d2a2f0;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; outline: none; }
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 750; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand); color: var(--on-brand); }
[hidden] { display: none !important; }

.icon { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; transition: top 0.2s; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: 780px; }
.container.tight { max-width: 600px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: 14px;
  font-weight: 700; font-size: 1rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 18px -8px rgb(255 117 0 / 0.85); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgb(255 117 0 / 0.9); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-soft); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--ink); }
.btn-danger { background: #b42318; color: #fff; } /* a fixed red: --err turns light in dark mode, which white text cannot sit on */
.btn-danger:hover { background: #9a1d14; color: #fff; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 0.9rem; border-radius: 12px; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.65; cursor: progress; pointer-events: none; }
.btn.is-done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--ink-soft); background: var(--surface-2); }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-moon { display: none; }
  :root:not([data-theme="light"]) .theme-sun { display: inline; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* The blur is costly on phones; keep it for larger screens only */
@media (min-width: 720px) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}
.header-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-uz { margin-left: 1px; color: var(--brand-wordmark); }
.logo-mark { flex: none; border-radius: 10px; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-btn { width: auto; padding: 0 12px; font-weight: 700; font-size: 0.85rem; }
.header-login span { display: none; }
.header-login { min-width: 42px; padding: 0 12px; }

.tools-nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding: 0 20px 10px; -webkit-overflow-scrolling: touch; }
.tools-nav::-webkit-scrollbar { display: none; }
.tools-nav ul { display: flex; gap: 6px; width: max-content; margin: 0; padding: 0; list-style: none; }
.tools-nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tools-nav a:hover { border-color: var(--brand); color: var(--ink); }
.tools-nav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 180px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); }
.menu-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.menu-list a:hover { background: var(--brand-soft); }
.menu-list a[aria-current] { color: var(--brand-ink); }

@media (min-width: 640px) {
  .header-login span { display: inline; }
  .header-login { padding: 0 14px; }
}
@media (min-width: 1200px) {
  .header-row { flex-wrap: nowrap; min-height: 72px; }
  .tools-nav { order: 0; flex: 1; display: flex; justify-content: center; overflow: visible; margin: 0; padding: 0; }
  .tools-nav ul { width: auto; gap: 2px; }
  .tools-nav a { border-color: transparent; background: transparent; padding: 0 11px; }
  .tools-nav a:hover { background: var(--brand-soft); border-color: transparent; }
  .tools-nav a .icon { display: none; }
}

/* ---------- Alerts, toast ---------- */
.flash { padding-top: 16px; }
.alert { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 12px 16px; border: 1px solid; border-radius: 12px; font-weight: 600; }
.alert .icon { margin-top: 3px; }
.alert-success { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.alert-error { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.flash .alert { margin: 0 0 12px; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90;
  max-width: calc(100% - 32px); padding: 12px 18px;
  background: var(--ink); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-2);
  font-weight: 600; text-align: center;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.suggest {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 85;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  max-width: 560px; margin-inline: auto; padding: 12px 14px 12px 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-2);
  font-weight: 600;
}
.suggest .actions { display: flex; gap: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(32px, 7vw, 84px) 0 clamp(28px, 5vw, 56px); text-align: center; overflow: clip; }
.hero::before, .page-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 560px; z-index: -2; pointer-events: none;
  background:
    radial-gradient(55% 70% at 50% 0%, rgb(255 117 0 / 0.2), transparent 72%),
    radial-gradient(35% 45% at 92% 8%, rgb(255 190 90 / 0.18), transparent 72%),
    radial-gradient(35% 45% at 6% 14%, rgb(255 140 60 / 0.12), transparent 72%);
}
.hero::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 520px; z-index: -1; opacity: 0.55; pointer-events: none;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(65% 60% at 50% 0%, #000, transparent 78%);
  mask-image: radial-gradient(65% 60% at 50% 0%, #000, transparent 78%);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-1);
  color: var(--ink-soft); font-size: 0.85rem; font-weight: 600;
}
.eyebrow .icon { color: var(--brand); }
.hero h1 { margin: 18px auto 20px; font-size: clamp(1.85rem, 6.6vw, 3.9rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; }
.h1-line { display: block; }
.mark { padding-inline: 0.12em; background: linear-gradient(transparent 62%, rgb(255 117 0 / 0.4) 62% 92%, transparent 92%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lead { max-width: 62ch; margin-inline: auto; color: var(--ink-soft); font-size: clamp(1.05rem, 2.4vw, 1.25rem); }

.shortener { max-width: 780px; margin: 30px auto 0; text-align: left; }
.shortener-field {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 20px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shortener-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring), var(--shadow-2); }
.shortener-icon { color: var(--muted); }
.shortener-field input { flex: 1; min-width: 0; padding: 14px 4px; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 1.1rem; }
.shortener-field input::placeholder { color: var(--muted); opacity: 0.85; }
@media (max-width: 560px) {
  .shortener-field { flex-wrap: wrap; padding: 12px; border-radius: 20px; }
  .shortener-field .shortener-icon { display: none; }
  .shortener-field input { flex: 1 0 100%; padding: 10px 6px; }
  .shortener-field .btn { width: 100%; }
}
.hero-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

.result {
  display: grid; gap: 18px; max-width: 780px; margin: 22px auto 0; padding: 20px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
  animation: rise 0.3s ease both;
}
@media (min-width: 640px) { .result { grid-template-columns: 1fr 172px; align-items: center; padding: 24px; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-label { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.copy-field { display: flex; gap: 8px; }
.copy-field input {
  flex: 1; min-width: 0; padding: 12px; overflow: hidden; background: var(--surface-2); color: var(--ink); text-overflow: ellipsis;
  border: 1.5px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 1rem; font-weight: 700;
}
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qr-box { display: grid; justify-items: center; gap: 8px; }
.qr { width: 156px; height: 156px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-actions { display: flex; gap: 6px; }

.history { max-width: 780px; margin: 30px auto 0; text-align: left; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.eyebrow-label { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.history ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.history .h-main { flex: 1; min-width: 0; }
.history .h-short { display: block; color: var(--ink); font-weight: 700; text-decoration: none; }
.history .h-long { display: block; overflow: hidden; color: var(--muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 700px; margin: 0 auto clamp(28px, 5vw, 48px); text-align: center; }
.section-head h2 { font-size: clamp(1.65rem, 4.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.035em; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 1.1rem; }

.tools { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-2); }
.tool-icon { display: grid; flex: none; place-items: center; width: 48px; height: 48px; background: var(--brand-soft); color: var(--brand-ink); border-radius: 14px; }
.tool-card h3 { margin: 8px 0 0; font-size: 1.18rem; }
.tool-card p { flex: 1; margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.tool-card .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--brand-ink); font-weight: 700; text-decoration: none; }
.tool-card .more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tool-card:hover .more .icon { transform: translateX(3px); }
.tool-card .more .icon { transition: transform 0.15s; }

.steps { display: grid; gap: 18px; counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; background: var(--ink); color: var(--bg); border-radius: 50%; font-weight: 800; }
.step h3 { font-size: 1.1rem; }
.step p { margin: 0; color: var(--ink-soft); }

.features { display: grid; gap: 26px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature { display: flex; gap: 16px; }
.feature .tool-icon { width: 44px; height: 44px; border-radius: 12px; }
.feature h3 { margin: 0 0 4px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--ink-soft); }

.faq { display: grid; gap: 10px; max-width: 800px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 14px 18px; cursor: pointer; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .answer { padding: 0 18px 18px; color: var(--ink-soft); }
.faq .answer p:last-child { margin-bottom: 0; }

.cta { padding-bottom: clamp(40px, 6vw, 80px); }
.cta-card { position: relative; overflow: hidden; padding: clamp(30px, 6vw, 60px); background: linear-gradient(135deg, #1d150e, #4a2a0c); color: #fff4e3; border-radius: var(--r-lg); text-align: center; }
.cta-card::before { content: ""; pointer-events: none; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; background: radial-gradient(closest-side, rgb(255 117 0 / 0.5), transparent); }
.cta-card h2 { position: relative; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
.cta-card p { position: relative; max-width: 52ch; margin: 0 auto 22px; color: #f1dcc0; }
.cta-card .btn { position: relative; }

/* ---------- Tool pages ---------- */
.page-hero { position: relative; isolation: isolate; padding: clamp(26px, 5vw, 52px) 0 clamp(14px, 3vw, 26px); }
.page-hero::before { height: 100%; } /* stay inside the header: it must never cover the content below */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--muted); font-size: 0.88rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.breadcrumbs a { display: inline-block; padding: 6px 0; color: var(--muted); } /* comfortable tap target */
.page-hero h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.8rem, 5vw, 2.9rem); font-weight: 800; letter-spacing: -0.035em; }
.page-hero .lead { margin: 0; max-width: 62ch; text-align: left; }
.page-hero .tool-icon { width: 52px; height: 52px; border-radius: 16px; }

.card { padding: clamp(18px, 3.2vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 1.25rem; }
.page-body { padding-bottom: clamp(40px, 7vw, 80px); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.35rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.2em; }
.info-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.info-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); }
.info-list .icon { margin-top: 3px; color: var(--brand-ink); }

/* ---------- Forms ---------- */
input[type="file"].input { padding: 7px; line-height: 1.2; }
input[type="file"].input::file-selector-button { margin-right: 12px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
input[type="file"].input::file-selector-button:hover { background: var(--brand-soft); border-color: var(--brand); }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.label { font-size: 0.95rem; font-weight: 650; }
.label .opt { color: var(--muted); font-weight: 500; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: 12px;
  font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.8; }
.textarea { min-height: 130px; line-height: 1.5; resize: vertical; }
.textarea.mono { font-family: var(--mono); font-size: 0.93rem; min-height: 280px; tab-size: 4; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7e70' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.help { color: var(--muted); font-size: 0.88rem; }
.field-error { display: flex; gap: 6px; margin: 8px 4px 0; color: var(--err); font-size: 0.92rem; font-weight: 600; }
.field .field-error { margin: 0 2px; }
.grid-2 { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 .span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }

.dropzone {
  display: grid; place-items: center; gap: 6px; padding: clamp(30px, 6vw, 60px) 20px; text-align: center;
  background: var(--surface-2); border: 2px dashed var(--line-strong); border-radius: var(--r); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-drag, .dropzone:focus-within { background: var(--brand-soft); border-color: var(--brand); }
.dropzone .tool-icon { width: 68px; height: 68px; margin-bottom: 8px; border-radius: 22px; }
.dropzone strong { font-size: 1.15rem; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-file { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.dz-file .name { flex: 1; min-width: 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 10px; margin-top: 14px; overflow: hidden; background: var(--line); border-radius: 99px; }
.progress span { display: block; width: 0; height: 100%; background: var(--brand); transition: width 0.15s; }

.qr-layout { display: grid; gap: 22px; }
@media (min-width: 820px) { .qr-layout { grid-template-columns: 1fr 340px; align-items: start; } }
.qr-preview { display: grid; justify-items: center; gap: 14px; text-align: center; }
.qr-preview .qr { width: min(100%, 280px); height: auto; aspect-ratio: 1; padding: 12px; }
.qr-empty { display: grid; place-items: center; width: min(100%, 280px); aspect-ratio: 1; padding: 20px; border: 2px dashed var(--line-strong); border-radius: 18px; color: var(--muted); }

/* ---------- Created / result page ---------- */
.created-card { display: grid; gap: 24px; }
@media (min-width: 760px) { .created-card { grid-template-columns: 1fr 220px; align-items: start; } }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.facts { display: grid; gap: 0; margin: 22px 0 0; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { width: 140px; color: var(--muted); font-weight: 600; }
.facts dd { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.next-steps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Text & code ---------- */
.code-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.code-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.code-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-left: 4px; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
pre.code { max-height: 72vh; margin: 0; padding: 18px; overflow: auto; background: var(--code-bg); color: var(--code-ink); font: 0.92rem/1.65 var(--mono); tab-size: 4; }
pre.code code { font: inherit; background: none; padding: 0; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-tag, .hljs-doctag { color: var(--hl-keyword); }
.hljs-string, .hljs-attr, .hljs-regexp, .hljs-addition { color: var(--hl-string); }
.hljs-number, .hljs-variable, .hljs-template-variable, .hljs-symbol, .hljs-bullet { color: var(--hl-number); }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--hl-comment); font-style: italic; }
.hljs-title, .hljs-name, .hljs-section, .hljs-selector-id, .hljs-selector-class { color: var(--hl-title); }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title, .hljs-attribute { color: var(--hl-type); }
.hljs-deletion { color: var(--hl-keyword); }

/* ---------- Dashboard ---------- */
.link-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.link-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.link-item .tool-icon { width: 42px; height: 42px; border-radius: 12px; }
.link-main { flex: 1; min-width: 0; }
.link-main a { color: var(--ink); font-weight: 700; text-decoration: none; }
.link-main a:hover { color: var(--brand-ink); }
.link-sub { display: block; overflow: hidden; color: var(--muted); font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.link-stat { display: none; color: var(--muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
@media (min-width: 640px) { .link-stat { display: inline-flex; align-items: center; gap: 6px; } }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.pagination [aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pagination [aria-disabled="true"] { opacity: 0.45; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: start center; padding: clamp(24px, 6vw, 64px) 0 clamp(40px, 8vw, 96px); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.auth-card .lead { margin: 0 0 22px; font-size: 1rem; text-align: left; }
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.danger-zone { border-color: var(--err); }
dialog.modal { width: min(92vw, 460px); padding: 24px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); }
dialog.modal::backdrop { background: rgb(20 12 4 / 0.55); }

/* ---------- Errors ---------- */
.error-page { display: grid; place-items: center; gap: 6px; padding: clamp(48px, 12vw, 140px) 20px; text-align: center; }
.error-code { color: var(--brand-wordmark); font-size: clamp(4rem, 16vw, 8rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; }
.error-page h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.error-page p { max-width: 46ch; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; padding-top: clamp(32px, 5vw, 56px); background: var(--surface-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { max-width: 34ch; margin: 12px 0 0; color: var(--muted); }
@media (min-width: 860px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
.footer-title { margin: 0 0 12px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer nav a, .site-footer li a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); text-decoration: none; }
.site-footer li a:hover { color: var(--brand-ink); text-decoration: underline; }
.site-footer a[aria-current] { color: var(--ink); font-weight: 700; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-top: 32px; padding-block: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.footer-bottom p { margin: 0; }

/* ---------- Link in bio ---------- */
.bio-form-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.bio-form-layout > * { min-width: 0; }
@media (min-width: 960px) { .bio-form-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .bio-form-layout .sticky { position: sticky; top: 96px; } }
.theme-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-option { position: relative; }
.theme-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.theme-option span { display: block; width: 52px; height: 52px; border: 3px solid transparent; border-radius: 16px; background: var(--swatch); box-shadow: 0 0 0 1px var(--line-strong); transition: transform 0.15s; }
.theme-option input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 3px var(--brand); transform: scale(1.06); }
.theme-option input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 3px; }
.avatar-field { display: flex; align-items: center; gap: 16px; }
.avatar-field .input { flex: 1; min-width: 0; }
.avatar-thumb { display: grid; place-items: center; flex: none; width: 76px; height: 76px; overflow: hidden; background: var(--brand-soft); border: 1px solid var(--line-strong); border-radius: 50%; color: var(--brand-ink); }
.avatar-thumb img { width: 100%; height: 100%; object-fit: cover; }

.bio-body {
  --bio-ink: #2a1a08; --bio-btn: #ffffff; --bio-btn-ink: #2a1a08; --bio-btn-line: rgb(42 26 8 / 0.08); --bio-shadow: 0 8px 20px -10px rgb(90 50 0 / 0.35);
  background: linear-gradient(160deg, #fff4e6, #ffdcb4); color: var(--bio-ink);
}
.bio-body[data-bio-theme="sunset"], .bio-preview[data-bio-theme="sunset"] { --bio-ink: #fff; --bio-btn: rgb(255 255 255 / 0.18); --bio-btn-ink: #fff; --bio-btn-line: rgb(255 255 255 / 0.4); --bio-shadow: none; background: linear-gradient(160deg, #ff9a5a, #ff4d6d 55%, #7b2ff7); }
.bio-body[data-bio-theme="ocean"], .bio-preview[data-bio-theme="ocean"] { --bio-ink: #fff; --bio-btn: rgb(255 255 255 / 0.18); --bio-btn-ink: #fff; --bio-btn-line: rgb(255 255 255 / 0.4); --bio-shadow: none; background: linear-gradient(160deg, #0f4c81, #1d8fe1 60%, #5ccfff); }
.bio-body[data-bio-theme="forest"], .bio-preview[data-bio-theme="forest"] { --bio-ink: #fff; --bio-btn: rgb(255 255 255 / 0.16); --bio-btn-ink: #fff; --bio-btn-line: rgb(255 255 255 / 0.35); --bio-shadow: none; background: linear-gradient(160deg, #0b3d2e, #1f7a55 60%, #8bd35a); }
.bio-body[data-bio-theme="night"], .bio-preview[data-bio-theme="night"] { --bio-ink: #f4f0ff; --bio-btn: rgb(255 255 255 / 0.08); --bio-btn-ink: #f4f0ff; --bio-btn-line: rgb(255 255 255 / 0.18); --bio-shadow: none; background: linear-gradient(160deg, #0b0b12, #1a1a2e 55%, #302b63); }
.bio-body { min-height: 100vh; min-height: 100dvh; }
.bio { max-width: 480px; margin: 0 auto; padding: max(40px, env(safe-area-inset-top)) 20px 48px; text-align: center; }
.bio-avatar { display: grid; place-items: center; width: 116px; height: 116px; margin: 8px auto 18px; overflow: hidden; border: 4px solid rgb(255 255 255 / 0.85); border-radius: 50%; background: rgb(255 255 255 / 0.35); box-shadow: 0 14px 34px -12px rgb(0 0 0 / 0.45); font-size: 2.6rem; font-weight: 800; color: inherit; }
.bio-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio h1, .bio-preview h2 { margin: 0 0 8px; font-size: 1.7rem; font-weight: 800; }
.bio-desc { max-width: 38ch; margin: 0 auto 26px; opacity: 0.88; white-space: pre-line; }
.bio-links { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bio-link {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 20px;
  background: var(--bio-btn); color: var(--bio-btn-ink); border: 1px solid var(--bio-btn-line); border-radius: 18px; box-shadow: var(--bio-shadow);
  font-weight: 700; text-decoration: none; transition: transform 0.15s, background 0.15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bio-link:hover { color: var(--bio-btn-ink); transform: translateY(-2px); }
.bio-link span { flex: 1; margin-right: 24px; text-align: center; }
.bio-foot { margin-top: 40px; font-size: 0.85rem; opacity: 0.85; }
.bio-foot a { display: inline-block; padding: 8px 4px; color: inherit; font-weight: 700; }
.bio-preview { padding: 28px 18px; border-radius: 28px; box-shadow: var(--shadow-2); color: var(--bio-ink); --bio-ink: #2a1a08; --bio-btn: #ffffff; --bio-btn-ink: #2a1a08; --bio-btn-line: rgb(42 26 8 / 0.08); --bio-shadow: 0 8px 20px -10px rgb(90 50 0 / 0.35); background: linear-gradient(160deg, #fff4e6, #ffdcb4); }
.bio-preview .bio { padding: 0; }
.bio-preview .bio-avatar { width: 88px; height: 88px; font-size: 2rem; }
.bio-preview .bio-link { min-height: 48px; }
.bio-preview h2 { font-size: 1.35rem; }

/* ---------- Shared bits (the invitation host pages have their own file: manage.css) ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .toast, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
