/* ==========================================================================
   Tiger Tools — Design System
   Hand-authored, no build step. Light + dark themes via CSS custom properties.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* brand */
  --navy: #0e1f3a;
  --gold: #d99413;
  --gold-soft: #fbeecb;

  /* surfaces & text (light) */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --surface-3: #e7edf6;
  --text: #0e1a2b;
  --text-2: #3f4f66;
  --muted: #64748b;
  --border: #e4e9f1;
  --border-2: #d3dbe8;

  /* actions */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-contrast: #ffffff;
  --accent: #b8790a;          /* gold, AA-safe for text on light */
  --accent-bg: #fdf6e6;
  --success: #0f9d58;
  --success-bg: #e7f6ee;
  --danger: #dc2626;
  --danger-bg: #fdeaea;

  /* effects */
  --ring: 0 0 0 3px rgba(37, 99, 235, .35);
  --shadow-sm: 0 1px 2px rgba(14, 31, 58, .06), 0 1px 3px rgba(14, 31, 58, .08);
  --shadow-md: 0 4px 12px -2px rgba(14, 31, 58, .10), 0 2px 6px -2px rgba(14, 31, 58, .08);
  --shadow-lg: 0 18px 40px -12px rgba(14, 31, 58, .22);
  --shadow-gold: 0 10px 30px -10px rgba(217, 148, 19, .45);

  /* geometry */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --container: 1200px;
  --nav-h: 64px;

  /* type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step--1: clamp(.8rem, .76rem + .2vw, .875rem);
  --step-0: clamp(.95rem, .9rem + .25vw, 1rem);
  --step-1: clamp(1.1rem, 1rem + .4vw, 1.25rem);
  --step-2: clamp(1.35rem, 1.2rem + .7vw, 1.6rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.4vw, 2.25rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.6vw, 3.4rem);

  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a1220;
  --surface: #0f1b2e;
  --surface-2: #14213a;
  --surface-3: #1a2942;
  --text: #e9eef6;
  --text-2: #bccadd;
  --muted: #8695ad;
  --border: #213150;
  --border-2: #2c3f61;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-contrast: #061226;
  --accent: #f0b429;
  --accent-bg: #2a2410;
  --success: #34d399;
  --success-bg: #0f2a20;
  --danger: #f87171;
  --danger-bg: #34161a;

  --ring: 0 0 0 3px rgba(96, 165, 250, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 22px 48px -16px rgba(0, 0, 0, .6);
  --shadow-gold: 0 10px 30px -12px rgba(240, 180, 41, .35);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { color: var(--text-2); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
::selection { background: var(--accent); color: #fff; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2rem); }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.eyebrow { font-size: var(--step--1); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: var(--step-1); color: var(--text-2); }
.muted { color: var(--muted); }
.center { text-align: center; }
.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: -60px; z-index: 200; background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-md); transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--surface); --_fg: var(--text); --_bd: var(--border-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 650; font-size: var(--step-0);
  padding: .68rem 1.15rem; border-radius: var(--radius);
  background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { --_bg: var(--primary); --_fg: var(--primary-contrast); --_bd: transparent; box-shadow: 0 6px 16px -6px rgba(37,99,235,.6); }
.btn-primary:hover { --_bg: var(--primary-hover); }
.btn-gold { --_bg: var(--gold); --_fg: #2a1a02; --_bd: transparent; box-shadow: var(--shadow-gold); }
.btn-ghost { --_bg: transparent; --_bd: var(--border-2); }
.btn-lg { padding: .85rem 1.5rem; font-size: var(--step-1); border-radius: var(--radius-lg); }
.btn-sm { padding: .45rem .8rem; font-size: var(--step--1); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(1.25rem, 3vw, 2rem); }
.tool-card {
  display: flex; flex-direction: column; gap: .75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.tool-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-2); text-decoration: none; }
.tool-card:hover::after { opacity: 1; }
.tool-card .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent); flex: none;
}
.tool-card h3 { font-size: var(--step-1); }
.tool-card p { font-size: var(--step--1); color: var(--muted); flex: 1; }
.tool-card .go { font-weight: 650; color: var(--primary); font-size: var(--step--1); display: inline-flex; align-items: center; gap: .35rem; }
.tool-card:hover .go svg { transform: translateX(3px); }
.tool-card .go svg { transition: transform .2s var(--ease); }

.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step--1); font-weight: 650; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-live { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: var(--step--1); font-weight: 600; text-decoration: none; transition: background-color .2s, border-color .2s, transform .15s; }
.chip:hover { text-decoration: none; background: var(--surface-3); transform: translateY(-1px); }

/* ---------- Forms ---------- */
label { font-weight: 650; font-size: var(--step--1); color: var(--text-2); display: inline-block; margin-bottom: .35rem; }
.input, .select, textarea.input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--radius); padding: .7rem .85rem;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder { color: var(--muted); }
.field { margin-bottom: 1rem; }
.result-box { background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 1rem 1.15rem; }

/* pulse live dot */
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.7);} }
.pulse { animation: pulse 1.8s var(--ease) infinite; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand-logo { height: 38px; width: auto; }
.brand-mark { display: inline-flex; align-items: center; gap: .6rem; }
.brand-logo + .brand-mark { display: none; }
.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: .5rem; }
.nav-links a { color: var(--text-2); font-weight: 600; font-size: var(--step-0); padding: .5rem .75rem; border-radius: var(--radius-sm); text-decoration: none; transition: background-color .2s, color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search input { width: 230px; padding-left: 2.2rem; padding-right: 3rem; cursor: pointer; }
.nav-search svg { position: absolute; left: .65rem; color: var(--muted); pointer-events: none; }
.hamburger { display: none; }
.nav-search-mobile { display: none; }
@media (max-width: 860px) { .nav-search-mobile { display: grid; } }

/* search results dropdown */
.search-pop { position: absolute; top: calc(100% + 8px); right: 0; width: min(360px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; max-height: 60vh; overflow: auto; display: none; }
.search-pop.open { display: block; }
.search-pop a { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--step-0); }
.search-pop a:hover, .search-pop a.active { background: var(--surface-2); }
.search-pop .hint { padding: .6rem; color: var(--muted); font-size: var(--step--1); }

/* mobile drawer */
.drawer { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 90; background: var(--bg); transform: translateX(100%); transition: transform .28s var(--ease); overflow-y: auto; display: flex; flex-direction: column; padding: 1.2rem; gap: .4rem; }
.drawer.open { transform: translateX(0); }
.drawer a { color: var(--text); font-weight: 650; font-size: var(--step-1); padding: .8rem .6rem; border-radius: var(--radius); text-decoration: none; }
.drawer a:hover { background: var(--surface-2); }

@media (max-width: 860px) {
  .nav-links, .nav-search { display: none; }
  .hamburger { display: grid; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6.5rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    radial-gradient(50% 45% at 100% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%);
}
.hero h1 .hl { background: linear-gradient(100deg, var(--accent), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.4rem; color: var(--muted); font-size: var(--step--1); font-weight: 600; }
.trust-row span { display: inline-flex; align-items: center; gap: .4rem; }
.trust-row svg { color: var(--success); }

/* ---------- Feature (why choose) ---------- */
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex: none; }
.feature h3 { font-size: var(--step-0); font-weight: 700; }
.feature p { font-size: var(--step--1); color: var(--muted); }

/* ---------- FAQ ---------- */
details.faq { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: .7rem; overflow: hidden; }
details.faq > summary { cursor: pointer; list-style: none; padding: 1rem 1.15rem; font-weight: 700; display: flex; justify-content: space-between; gap: 1rem; align-items: center; color: var(--text); }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary .chev { transition: transform .2s var(--ease); color: var(--muted); flex: none; }
details.faq[open] > summary .chev { transform: rotate(180deg); }
details.faq > div { padding: 0 1.15rem 1.1rem; color: var(--text-2); }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: var(--step--1); color: var(--muted); padding-block: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }

/* ---------- Tool page layout ---------- */
.tool-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.tool-head .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); flex: none; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.tool-aside { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
@media (max-width: 960px) { .tool-grid { grid-template-columns: 1fr; } .tool-aside { position: static; } }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; color: var(--text-2); }
.prose li { margin-top: .4rem; }
.prose code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .9em; }

/* data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
table.data th, table.data td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data thead th { background: var(--surface-2); color: var(--muted); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:last-child td, table.data tr:last-child td { border-bottom: 0; }

/* ---------- Ad slot ---------- */
.ad { margin-block: 1.5rem; }
.ad .label { text-align: center; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.footer h4 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .9rem; font-weight: 700; }
.footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer a { color: var(--text-2); font-size: var(--step-0); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer-brand p { font-size: var(--step--1); color: var(--muted); margin-top: .7rem; max-width: 32ch; }
.newsletter { display: flex; gap: .5rem; margin-top: .9rem; }
.newsletter input { flex: 1; }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 1.2rem; display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; align-items: center; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-weight: 600; font-size: var(--step--1); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Favorite (star) button ---------- */
.fav-btn { position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; z-index: 2; transition: color .2s, background-color .2s, border-color .2s, transform .15s; }
.fav-btn:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.fav-btn[aria-pressed="true"] { color: var(--accent); border-color: transparent; background: var(--accent-bg); }
.fav-btn svg { pointer-events: none; }
.tool-card { position: relative; }

/* ---------- Command palette (Cmd/Ctrl-K) ---------- */
.kbd { display: inline-flex; align-items: center; gap: .1rem; padding: .12rem .4rem; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); font-size: .72rem; font-weight: 700; color: var(--muted); font-family: inherit; }
.cmdk-btn { display: inline-flex; align-items: center; gap: .5rem; }
.cmdk-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(6, 12, 24, .55); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; }
.cmdk-overlay.open { display: flex; }
.cmdk { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: cmdk-in .18s var(--ease); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-input-row { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.cmdk-input-row svg { color: var(--muted); flex: none; }
.cmdk-input-row input { flex: 1; border: 0; background: transparent; font: inherit; font-size: var(--step-1); color: var(--text); outline: none; }
.cmdk-list { max-height: 52vh; overflow: auto; padding: .4rem; }
.cmdk-group { font-size: var(--step--1); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: .6rem .7rem .3rem; }
.cmdk-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; }
.cmdk-item .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.cmdk-item small { color: var(--muted); font-weight: 500; }
.cmdk-item.active, .cmdk-item:hover { background: var(--surface-2); text-decoration: none; }
.cmdk-empty { padding: 1.4rem; text-align: center; color: var(--muted); }
@media (max-width: 860px) { .cmdk-hint { display: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .cmdk { animation: none; }
}
