/* ==========================================================================
   K4Converter — Design System
   Warm orange theme · soft shadows · playful borders · smooth animations
   ========================================================================== */

:root {
  color-scheme: light;
  --orange: #ff6b1a;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-100: #ffe8d6;
  --orange-50: #fff4ea;
  --amber: #ffb020;
  --amber-100: #fff1cc;
  --teal: #14b8a6;

  --bg: #fff8f1;
  --bg-alt: #fff1e4;
  --card: #ffffff;
  --ink: #1f1712;
  --ink-2: #3b2f27;
  --muted: #6f625a;
  --border: #f2dcc8;
  --border-strong: #e9c4a3;

  --shadow-sm: 0 2px 8px rgba(124, 45, 18, 0.06);
  --shadow: 0 12px 30px -12px rgba(234, 88, 12, 0.28);
  --shadow-lg: 0 28px 60px -18px rgba(234, 88, 12, 0.38);
  --shadow-pop: 6px 6px 0 var(--ink);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --pill: 999px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1200px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17110d;
  --bg-alt: #1f1712;
  --card: #251c16;
  --ink: #fff4ea;
  --ink-2: #f1dfd0;
  --muted: #bba79a;
  --border: #3a2c22;
  --border-strong: #523d2f;
  --orange-100: #3d2414;
  --orange-50: #2a1b11;
  --amber-100: #3a2c10;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 60px -18px rgba(0, 0, 0, 0.7);
  --shadow-pop: 6px 6px 0 var(--orange);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: calc(var(--header-h) + 20px); }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--orange-600); text-decoration: none; }
a:hover { color: var(--orange-700); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(64px, 9vw, 110px) 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--pill);
  background: var(--orange-100); color: var(--orange-700);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 16px;
}
[data-theme="dark"] .eyebrow { color: var(--amber); }
.text-orange { color: var(--orange); }
.highlight { position: relative; white-space: nowrap; color: var(--orange); }
.highlight svg { position: absolute; left: 0; bottom: -0.18em; width: 100%; height: 0.35em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: var(--pill);
  font-weight: 700; font-size: 1rem; cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-600) 100%);
  color: #fff; box-shadow: 0 10px 22px -8px rgba(234, 88, 12, 0.6);
}
.btn-primary:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 16px 30px -10px rgba(234, 88, 12, 0.7); }
.btn-outline { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
[data-theme="dark"] .btn-outline { box-shadow: 4px 4px 0 var(--orange); border-color: var(--orange); }
.btn-outline:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
[data-theme="dark"] .btn-outline:hover { box-shadow: 6px 6px 0 var(--orange); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-600); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled { border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.03em; }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #fff; box-shadow: 0 8px 16px -6px rgba(234, 88, 12, 0.55);
  transition: transform 0.4s var(--ease);
}
.logo:hover .logo-mark { transform: rotate(-12deg) scale(1.06); }
.logo-mark svg { width: 22px; height: 22px; }
.logo b { color: var(--orange); }

.nav-menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--pill);
  color: var(--ink-2); font-weight: 600; font-size: 0.95rem;
  background: none; border: 0; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--orange-600); background: var(--orange-50); }
.nav-link svg { width: 14px; height: 14px; transition: transform 0.25s; }
.has-dropdown:hover .nav-link svg, .has-dropdown.open .nav-link svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%;
  min-width: 260px; padding: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  list-style: none; margin: 0;
}
.dropdown::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.has-dropdown:hover .dropdown, .has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.dropdown a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 0.92rem;
}
.dropdown a:hover { background: var(--orange-50); color: var(--orange-600); }
.dropdown .dd-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-600); flex-shrink: 0; }
.dropdown .dd-icon svg { width: 18px; height: 18px; }
.dropdown .soon { margin-left: auto; font-size: 0.68rem; font-weight: 700; color: var(--muted); background: var(--bg-alt); padding: 2px 8px; border-radius: var(--pill); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.icon-btn:hover { transform: rotate(-15deg); border-color: var(--orange); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle svg { display: none; }
.theme-toggle .ic-auto, [data-theme-pref="light"] .theme-toggle .ic-light, [data-theme-pref="dark"] .theme-toggle .ic-dark { display: block; }
[data-theme-pref="light"] .theme-toggle .ic-auto, [data-theme-pref="dark"] .theme-toggle .ic-auto { display: none; }
.hamburger { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 90px) 0 clamp(70px, 9vw, 120px); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero::after {
  content: ""; position: absolute; right: -10%; top: -20%; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.22), transparent 65%); z-index: 0; pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero-lead { font-size: 1.12rem; color: var(--muted); max-width: 520px; margin-bottom: 30px; }
.hero-features { display: flex; gap: 26px; margin-bottom: 36px; flex-wrap: wrap; }
.hero-feature { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-weight: 700; font-size: 0.92rem; }
.hero-feature .circle {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: var(--ink);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08), 0 10px 20px -10px rgba(255, 176, 32, 0.9);
  transition: transform 0.35s var(--ease);
}
.hero-feature:nth-child(2) .circle { background: var(--orange); color: #fff; }
.hero-feature:hover .circle { transform: translateY(-6px) rotate(-8deg); }
.hero-feature .circle svg { width: 32px; height: 32px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-trust { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: var(--muted); font-size: 0.9rem; }
.hero-trust .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); animation: pulse 2s infinite; }

/* Hero visual */
.hero-visual { position: relative; height: 480px; }
.fcard {
  position: absolute; width: 56%; height: 78%;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 3px solid var(--card);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
  color: #fff; transition: transform 0.6s var(--ease);
}
.fcard-1 {
  left: 2%; top: 14%; transform: rotate(-6deg);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #f3e6da 25%, transparent 25%), linear-gradient(-45deg, #f3e6da 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3e6da 75%), linear-gradient(-45deg, transparent 75%, #f3e6da 75%);
  background-size: 26px 26px; background-position: 0 0, 0 13px, 13px -13px, -13px 0;
  animation: floatA 7s ease-in-out infinite;
}
.fcard-2 {
  right: 0; top: 0; transform: rotate(5deg);
  background: linear-gradient(160deg, #ffb020 0%, #ff6b1a 55%, #c2410c 100%);
  animation: floatB 8s ease-in-out infinite;
}
.fcard .shape { position: absolute; inset: 0; display: grid; place-items: center; }
.fcard-1 .shape svg { width: 62%; filter: drop-shadow(0 12px 18px rgba(234, 88, 12, 0.35)); }
.fcard-2 .shape svg { width: 66%; opacity: 0.95; }
.fcard .label {
  position: relative; z-index: 1; align-self: flex-start;
  padding: 8px 16px; border-radius: var(--pill);
  background: var(--ink); color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.04em;
}
.fcard-2 .label { background: #fff; color: var(--orange-700); }
.convert-btn {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: 96px; height: 96px; border-radius: 50%; z-index: 3;
  background: var(--card); display: grid; place-items: center;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.35), 0 0 0 10px rgba(255, 255, 255, 0.35);
  color: var(--orange);
}
.convert-btn svg { width: 40px; height: 40px; animation: spinSlow 6s linear infinite; }
.convert-btn::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px dashed var(--amber); animation: spinSlow 14s linear infinite reverse;
}
.squiggle { position: absolute; z-index: 2; color: var(--amber); pointer-events: none; }
.squiggle-1 { left: -4%; top: 0; width: 120px; animation: wiggle 5s ease-in-out infinite; }
.squiggle-2 { right: 6%; bottom: -6%; width: 170px; animation: wiggle 6s ease-in-out infinite reverse; }
.float-badge {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 0.85rem;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.float-badge .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-600); }
.float-badge .ico svg { width: 16px; height: 16px; }
.float-badge-1 { left: -2%; bottom: 6%; animation: floatA 6s ease-in-out infinite; }
.float-badge-2 { right: -2%; top: 46%; animation: floatB 7s ease-in-out infinite; }

/* ---------- Tools grid ---------- */
.tools-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 10px 18px; border-radius: var(--pill); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--border);
  font-weight: 700; font-size: 0.9rem; color: var(--ink-2);
  transition: all 0.25s var(--ease);
}
.tab:hover { border-color: var(--orange); color: var(--orange-600); }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 3px 3px 0 var(--orange); }
.search {
  position: relative; flex: 0 1 340px;
}
.search input {
  width: 100%; padding: 13px 18px 13px 46px; border-radius: var(--pill);
  border: 1.5px solid var(--border); background: var(--card);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 107, 26, 0.15); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }

.cat-block { margin-bottom: 48px; }
.cat-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 1.25rem; }
.cat-title .count { font-size: 0.8rem; font-weight: 700; color: var(--orange-700); background: var(--orange-100); padding: 3px 10px; border-radius: var(--pill); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 24px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--border);
  color: var(--ink); overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.tool-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 107, 26, 0.10), transparent 45%);
  opacity: 0; transition: opacity 0.35s; pointer-events: none;
}
.tool-card:hover::before { opacity: 1; }
a.tool-card:hover { color: var(--ink); transform: translate(-4px, -4px); border-color: var(--ink); box-shadow: var(--shadow-pop); }
.tool-icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange-100), var(--amber-100)); color: var(--orange-600);
  transition: transform 0.4s var(--ease), background 0.3s, color 0.3s;
}
a.tool-card:hover .tool-icon { transform: rotate(-10deg) scale(1.08); background: linear-gradient(135deg, var(--orange), var(--amber)); color: #fff; }
.tool-icon svg { width: 26px; height: 26px; }
.tool-card h3 { margin: 6px 0 0; font-size: 1.1rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.tool-card .go { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9rem; color: var(--orange-600); }
.tool-card .go svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
a.tool-card:hover .go svg { transform: translateX(5px); }
.tool-badge { position: absolute; top: 18px; right: 18px; font-size: 0.7rem; font-weight: 800; padding: 4px 10px; border-radius: var(--pill); background: var(--amber); color: var(--ink); text-transform: uppercase; letter-spacing: 0.05em; }
.tool-card.is-soon { opacity: 0.75; border-style: dashed; cursor: default; }
.tool-card.is-soon .tool-badge { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.tool-card.is-soon .go { color: var(--muted); }
.empty-state { text-align: center; padding: 40px; color: var(--muted); display: none; }

/* ---------- Popular conversions ---------- */
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; margin: 0 auto; }
.popular a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: var(--pill);
  background: var(--card); border: 2px solid var(--border); color: var(--ink); font-weight: 700; font-size: 0.95rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.popular a::after { content: "→"; color: var(--orange); transition: transform 0.25s var(--ease); }
.popular a:hover { color: var(--ink); border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--orange); }
.popular a:hover::after { transform: translateX(4px); }

/* ---------- Features / steps ---------- */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature {
  padding: 30px 26px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.feature:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.feature .f-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--amber); color: var(--ink); }
.feature:nth-child(even) .f-ico { background: var(--orange); color: #fff; }
.feature .f-ico svg { width: 26px; height: 26px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; position: relative; }
.step { position: relative; padding: 36px 28px 28px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow-pop); }
[data-theme="dark"] .step { border-color: var(--orange); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -22px; left: 24px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
  background: var(--orange); color: #fff; border: 3px solid var(--bg);
}
.step p { color: var(--muted); margin: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.faq details { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0 24px; transition: border-color 0.25s, box-shadow 0.25s; }
.faq details[open] { border-color: var(--orange); box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-700); font-size: 1.2rem; transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); background: var(--orange); color: #fff; }
.faq details p { color: var(--muted); padding-bottom: 20px; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 64px); text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-600) 60%, var(--orange-700) 100%);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; }
.cta-band p { opacity: 0.92; max-width: 560px; margin: 0 auto 28px; }
.cta-band .btn { background: #fff; color: var(--orange-700); box-shadow: 5px 5px 0 var(--ink); }
.cta-band .btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.cta-band .blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.cta-band .blob-1 { width: 260px; height: 260px; left: -80px; top: -80px; }
.cta-band .blob-2 { width: 200px; height: 200px; right: -50px; bottom: -70px; background: rgba(255, 176, 32, 0.35); }

/* ---------- Footer ---------- */
.site-footer { background: #1a120d; color: #d9c8bb; padding: 72px 0 28px; margin-top: 0; position: relative; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--amber), var(--orange), var(--orange-700)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 36px; margin-bottom: 48px; }
.site-footer .logo { color: #fff; margin-bottom: 16px; }
.site-footer p { font-size: 0.93rem; color: #b8a597; max-width: 320px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: #b8a597; font-size: 0.93rem; transition: color 0.2s, padding 0.2s; }
.footer-links a:hover { color: var(--amber); padding-left: 4px; }
.footer-bottom { border-top: 1px solid #33251c; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; color: #9c897b; }

.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.social {
  --brand: var(--orange);
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: #2a1d15; color: #d9c8bb; border: 1px solid #3a2a20; font-size: 1.05rem;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.social:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-4px); box-shadow: 0 10px 20px -8px var(--brand); }
.social svg { width: 18px; height: 18px; }
.social.linkedin { --brand: #0a66c2; }
.social.instagram { --brand: #e4405f; }
.social.instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social.email { --brand: #ea4335; }
.social.portfolio { --brand: #ff6b1a; }

/* ---------- Side social (floating arrow) ---------- */
.side-social { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 90; display: flex; align-items: center; }
.side-toggle {
  width: 34px; height: 64px; border-radius: 14px 0 0 14px;
  background: rgba(31, 23, 18, 0.3); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; opacity: 0.3;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s, background 0.3s, width 0.3s;
}
.side-toggle:hover, .side-toggle:focus-visible, .side-social.open .side-toggle { opacity: 1; background: var(--orange); }
.side-toggle svg { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
.side-social.open .side-toggle svg { transform: rotate(180deg); }
.side-panel {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 10px;
  background: var(--card); border: 1px solid var(--border); border-right: 0;
  border-radius: 16px 0 0 16px; box-shadow: var(--shadow-lg);
  max-width: 0; padding-left: 0; padding-right: 0; overflow: hidden; opacity: 0;
  transition: max-width 0.45s var(--ease), opacity 0.3s, padding 0.45s var(--ease);
}
.side-social.open .side-panel { max-width: 80px; opacity: 1; padding-left: 10px; padding-right: 10px; }
.side-panel .social { background: var(--bg-alt); color: var(--ink-2); border-color: var(--border); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: clamp(36px, 6vw, 64px) 0 clamp(28px, 4vw, 40px); overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: 14px; }
.page-hero .lead { color: var(--muted); font-size: 1.1rem; max-width: 680px; }
.page-hero.center { text-align: center; }
.page-hero.center .lead { margin: 0 auto; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; font-size: 0.88rem; color: var(--muted); }
.page-hero.center .breadcrumb { justify-content: center; }
.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--orange-600); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.page-hero.center .chips { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.chip svg { width: 15px; height: 15px; color: var(--orange); }

/* ---------- Converter tool UI ---------- */
.tool-wrap { position: relative; z-index: 1; }
.tool-box {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: 10px 10px 0 var(--orange); padding: clamp(18px, 3vw, 32px);
}
[data-theme="dark"] .tool-box { border-color: var(--orange); box-shadow: 10px 10px 0 var(--amber); }
.dropzone {
  position: relative; border: 2.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--orange-50); padding: clamp(28px, 6vw, 56px) 20px; text-align: center; cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.dropzone:hover, .dropzone.drag { border-color: var(--orange); background: var(--orange-100); }
.dropzone.drag { transform: scale(1.01); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz-icon { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), var(--orange)); color: #fff; box-shadow: 0 14px 28px -12px rgba(234, 88, 12, 0.7); animation: bob 3s ease-in-out infinite; }
.dz-icon svg { width: 34px; height: 34px; }
.dropzone h2 { font-size: 1.35rem; margin-bottom: 6px; }
.dropzone p { color: var(--muted); margin-bottom: 18px; font-size: 0.95rem; }
.dropzone .btn { pointer-events: none; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 26px 0 8px; align-items: end; }
.field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; color: var(--ink-2); }
.field select, .field input[type="color"], .field input[type="number"] {
  width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--border);
}
.field select:focus, .field input:focus { outline: none; border-color: var(--orange); }
.field input[type="color"] { height: 46px; padding: 4px; cursor: pointer; }
.field input[type="range"] { width: 100%; accent-color: var(--orange); }
.field .val { float: right; color: var(--orange-600); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.92rem; cursor: pointer; padding: 11px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.format-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.format-pills button {
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg);
  font-weight: 800; cursor: pointer; transition: all 0.2s;
}
.format-pills button:hover { border-color: var(--orange); }
.format-pills button.active { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 8px 16px -8px rgba(234, 88, 12, 0.8); }

/* Background picker (rounded bar + reset to transparent) */
.tool-box { --k4-bg: #ffffff; }
.bg-row { display: flex; gap: 10px; align-items: stretch; }
.bg-bar {
  position: relative; flex: 1; height: 46px; border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 2px solid #000; box-shadow: 3px 3px 0 #000;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.bg-bar:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; }
.bg-bar:focus-within { outline: 3px solid var(--amber); outline-offset: 3px; }
.bg-fill { position: absolute; inset: 0; background: var(--k4-bg); transition: background-color 0.2s; }
.bg-bar input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.bg-reset {
  width: 46px; flex-shrink: 0; border-radius: 16px; border: 2px solid #000; box-shadow: 3px 3px 0 #000;
  background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, color 0.2s;
}
.bg-reset:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; background: var(--orange); color: #fff; }
.bg-reset svg { width: 18px; height: 18px; }
.bg-reset[disabled] { opacity: 0.45; cursor: default; transform: none; box-shadow: 3px 3px 0 #000; background: var(--card); color: var(--ink); }
.is-transparent .bg-fill, .file-thumb.thumb-transparent {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e9e2dc 25%, transparent 25%), linear-gradient(-45deg, #e9e2dc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e2dc 75%), linear-gradient(-45deg, transparent 75%, #e9e2dc 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.file-thumb { transition: background-color 0.2s; }
.file-thumb.thumb-filled { background-image: none; }
.bg-note { display: block; margin-top: 10px; font-size: 0.78rem; color: var(--muted); min-height: 1em; }

/* Result preview modal */
.pv-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: opacity 0.25s, visibility 0.25s; }
.pv-modal.open { visibility: visible; opacity: 1; }
.pv-backdrop { position: absolute; inset: 0; background: rgba(20, 12, 8, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pv-card {
  position: relative; width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--card); border: 2px solid #000; border-radius: var(--radius-lg); box-shadow: 8px 8px 0 var(--orange);
  overflow: hidden; transform: translateY(16px) scale(0.98); transition: transform 0.35s var(--ease);
}
.pv-modal.open .pv-card { transform: none; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pv-title { min-width: 0; }
.pv-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-meta { font-size: 0.82rem; color: var(--muted); }
.pv-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.pv-tabs button { padding: 7px 14px; border-radius: var(--pill); border: 1.5px solid var(--border); background: var(--bg); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.pv-tabs button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pv-body { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 16px 20px; }
.pv-body img { max-width: 100%; max-height: 62vh; border-radius: 10px; box-shadow: var(--shadow); }
.pv-checker {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e9e2dc 25%, transparent 25%), linear-gradient(-45deg, #e9e2dc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e2dc 75%), linear-gradient(-45deg, transparent 75%, #e9e2dc 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.pv-body.is-pdf { padding: 0; place-items: stretch; }
.pv-body iframe { width: 100%; height: 65vh; border: 0; background: #525659; }
.pv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pv-open { font-size: 0.86rem; font-weight: 700; }
.pv-btns { display: flex; gap: 10px; }
body.pv-lock { overflow: hidden; }
.file-thumb { cursor: zoom-in; }
@media (max-width: 640px) {
  .pv-modal { padding: 10px; }
  .pv-card { box-shadow: 5px 5px 0 var(--orange); }
  .pv-body iframe { height: 60vh; }
  .pv-btns { width: 100%; }
  .pv-btns .btn { flex: 1; }
}

/* Reorder buttons & ICO size chips */
.order-btns { display: inline-flex; gap: 4px; }
.order-btns .remove-btn { width: 32px; height: 32px; }
.order-btns .remove-btn:hover { color: var(--orange-600); border-color: var(--orange); }
.order-btns .remove-btn[disabled] { opacity: 0.35; cursor: default; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); font-weight: 800; font-size: 0.88rem; transition: all 0.2s; }
.chip-check input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Calculator tools ---------- */
.calc { display: grid; gap: 22px; }
.calc-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end; }
.calc-field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; color: var(--ink-2); }
.calc-input {
  width: 100%; padding: 16px 18px; border-radius: 16px; border: 2px solid #000; background: var(--bg);
  font-size: 1.6rem; font-weight: 800; color: var(--ink); box-shadow: 3px 3px 0 #000; transition: box-shadow 0.2s, transform 0.2s;
}
.calc-input:focus { outline: none; box-shadow: 4px 4px 0 var(--orange); transform: translate(-1px, -1px); }
.calc-input.invalid { border-color: #dc2626; box-shadow: 3px 3px 0 #dc2626; }
.calc-swap {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid #000; background: var(--orange); color: #fff;
  display: grid; place-items: center; cursor: pointer; margin-bottom: 6px; box-shadow: 3px 3px 0 #000; transition: transform 0.35s var(--ease);
}
.calc-swap:hover { transform: rotate(180deg); }
.calc-swap svg { width: 22px; height: 22px; }
.calc-result {
  padding: 18px 22px; border-radius: var(--radius); background: var(--orange-50); border: 1.5px dashed var(--border-strong);
  font-size: 1rem; color: var(--ink-2); min-height: 60px;
}
.calc-result strong { color: var(--orange-700); font-size: 1.15rem; }
[data-theme="dark"] .calc-result strong { color: var(--amber); }
.calc-result .err { color: #dc2626; font-weight: 700; }
.calc-steps { margin: 10px 0 0; padding-left: 1.2em; font-size: 0.92rem; color: var(--muted); }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { padding: 8px 14px; border-radius: var(--pill); border: 1.5px solid var(--border); background: var(--bg); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.quick button:hover { border-color: var(--orange); color: var(--orange-600); }
.live-clock { font-size: 0.95rem; color: var(--muted); }
.live-clock b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .calc-row { grid-template-columns: 1fr; }
  .calc-swap { margin: 0 auto; transform: rotate(90deg); }
  .calc-swap:hover { transform: rotate(270deg); }
  .calc-input { font-size: 1.35rem; }
}

.only-each { display: none; }
.mode-each .only-each { display: block; }
.file-format {
  padding: 8px 30px 8px 12px; border-radius: 10px; font-weight: 800; font-size: 0.85rem; cursor: pointer;
  border: 1.5px solid var(--orange); background: var(--orange-50); color: var(--orange-700);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ea580c' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.file-format:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 107, 26, 0.2); }
[data-theme="dark"] .file-format { color: var(--amber); }
.file-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.file-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border);
  animation: slideIn 0.4s var(--ease);
}
.file-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: contain;
  background-color: #fff;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  border: 1px solid var(--border);
}
.file-meta { min-width: 0; }
.file-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info { font-size: 0.84rem; color: var(--muted); }
.file-info .saved { color: #16a34a; font-weight: 700; }
.file-info .bigger { color: var(--orange-700); font-weight: 700; }
.file-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.remove-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: all 0.2s; }
.remove-btn:hover { color: #dc2626; border-color: #dc2626; }
.remove-btn svg { width: 16px; height: 16px; }
.status { font-size: 0.78rem; font-weight: 800; padding: 4px 10px; border-radius: var(--pill); background: var(--bg-alt); color: var(--muted); }
.status.done { background: #dcfce7; color: #15803d; }
.status.error { background: #fee2e2; color: #b91c1c; }
.status.working { background: var(--amber-100); color: var(--orange-700); }
.tool-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.tool-actions .left, .tool-actions .right { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.privacy-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; margin-top: 18px; justify-content: center; text-align: center; }
.privacy-note svg { width: 16px; height: 16px; color: #16a34a; flex-shrink: 0; }
.hidden { display: none !important; }

/* Ad slots — reserve space only once AdSense is added */
.ad-slot { margin: 32px auto; text-align: center; min-height: 0; }
.ad-slot:empty { display: none; }

/* ---------- Article / content ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.prose { font-size: 1.04rem; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--orange); font-weight: 800; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.95rem; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--orange); color: #fff; }
.prose td { background: var(--card); }
.table-wrap { overflow-x: auto; }
.callout { padding: 18px 22px; border-radius: var(--radius); background: var(--amber-100); border-left: 5px solid var(--amber); margin: 1.4em 0; }
.callout p { margin: 0; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 20px; }
.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.side-card h3 { font-size: 1.05rem; }
.side-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.side-card a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 0.93rem; }
.side-card a:hover { background: var(--orange-50); color: var(--orange-600); }
.side-card a svg { width: 18px; height: 18px; color: var(--orange); }

.legal { max-width: 820px; margin: 0 auto; }
.legal .updated { color: var(--muted); font-size: 0.92rem; }

/* Contact form */
.form-card { max-width: 640px; margin: 0 auto; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: clamp(22px, 4vw, 40px); }
[data-theme="dark"] .form-card { border-color: var(--orange); }
.form-grid { display: grid; gap: 18px; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid input, .form-grid textarea { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); }
.form-grid input:focus, .form-grid textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 107, 26, 0.15); }
.form-grid textarea { min-height: 150px; resize: vertical; }

/* Cookie banner */
.cookie {
  position: fixed; left: 20px; bottom: 20px; z-index: 120; max-width: 380px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; font-size: 0.9rem;
  transform: translateY(150%); transition: transform 0.5s var(--ease);
}
.cookie.show { transform: none; }
.cookie p { color: var(--muted); margin-bottom: 14px; }
.cookie .row { display: flex; gap: 10px; }

/* Back to top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange)); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.35s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px); }
.to-top svg { width: 20px; height: 20px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 200%); opacity: 0; visibility: hidden; z-index: 130; background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: var(--pill); font-weight: 600; font-size: 0.92rem; box-shadow: var(--shadow-lg); transition: transform 0.4s var(--ease), opacity 0.3s, visibility 0.3s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* Above-the-fold hero animates with pure CSS (no JS wait → better LCP for SEO) */
.hero .reveal { opacity: 1; transform: none; transition: none; animation: heroIn 0.8s var(--ease) both; }
.hero .reveal-d1 { animation-delay: 0.08s; } .hero .reveal-d2 { animation-delay: 0.16s; } .hero .reveal-d3 { animation-delay: 0.24s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; } .reveal-d3 { transition-delay: 0.24s; }

/* ---------- Keyframes ---------- */
@keyframes floatA { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes floatB { 0%, 100% { translate: 0 0; } 50% { translate: 0 12px; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); } 50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.05); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}

@media (max-width: 920px) {
  :root { --header-h: 68px; }
  .hamburger { display: grid; }
  /* backdrop-filter would make the header the containing block for the fixed menu, so use a solid bar on mobile */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-menu {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 20px; background: var(--bg); overflow-y: auto;
    /* stays inside the viewport while hidden (sliding it off-screen widened the page on phones) */
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s linear 0.25s;
  }
  .nav-menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s; }
  .nav-link { width: 100%; justify-content: space-between; padding: 14px 16px; font-size: 1.05rem; }
  .dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; border: 0; padding: 0 0 0 10px; min-width: 0;
    max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease);
    background: transparent;
  }
  .has-dropdown:hover .dropdown { transform: none; }
  .has-dropdown.open .dropdown { max-height: 800px; transform: none; }
  .nav-cta { display: none; }
  body.menu-open { overflow: hidden; }

  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-features, .hero-cta, .hero-trust { justify-content: center; }
  .hero-visual { height: 400px; max-width: 520px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: 1fr; gap: 40px; max-width: 520px; margin: 0 auto; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .hero-visual { height: 330px; }
  .convert-btn { width: 74px; height: 74px; }
  .convert-btn svg { width: 30px; height: 30px; }
  .float-badge { font-size: 0.75rem; padding: 8px 12px; }
  .float-badge .ico { width: 24px; height: 24px; }
  .squiggle-2 { width: 120px; }
  .hero-features { gap: 18px; }
  .hero-feature .circle { width: 62px; height: 62px; }
  .hero-feature .circle svg { width: 26px; height: 26px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .tools-toolbar { flex-direction: column; align-items: stretch; }
  .search { flex-basis: auto; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .tab { flex-shrink: 0; }
  .file-item { grid-template-columns: 52px 1fr; }
  .file-thumb { width: 52px; height: 52px; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .tool-actions, .tool-actions .left, .tool-actions .right { flex-direction: column; align-items: stretch; }
  .tool-actions .btn { width: 100%; }
  .tool-box { box-shadow: 6px 6px 0 var(--orange); }
  .form-grid .two { grid-template-columns: 1fr; }
  .cookie { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .side-toggle { width: 28px; height: 54px; }
}

@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; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Dark-mode polish for the bold black-outlined controls ---------- */
[data-theme="dark"] .bg-bar, [data-theme="dark"] .bg-reset, [data-theme="dark"] .calc-input, [data-theme="dark"] .calc-swap { border-color: var(--orange); box-shadow: 3px 3px 0 var(--orange-700); }
[data-theme="dark"] .bg-bar:hover, [data-theme="dark"] .bg-reset:hover { box-shadow: 4px 4px 0 var(--orange-700); }
[data-theme="dark"] .bg-reset[disabled] { box-shadow: 3px 3px 0 var(--orange-700); }
[data-theme="dark"] .calc-input:focus { box-shadow: 4px 4px 0 var(--amber); }
[data-theme="dark"] .pv-card { border-color: var(--orange); box-shadow: 8px 8px 0 var(--orange-700); }
[data-theme="dark"] .checker, [data-theme="dark"] .pv-checker { background-color: #2a201a; }
html { transition: background-color 0.3s; }

/* ---------- PDF tools ---------- */
.order-no { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 8px; border-radius: 6px; background: var(--orange); color: #fff; font-size: 0.75rem; font-weight: 800; vertical-align: 1px; }
.field input[type="text"] { width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--border); }
.field input[type="text"]:focus { outline: none; border-color: var(--orange); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 22px; }
.page-card { margin: 0; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); display: grid; gap: 8px; animation: slideIn 0.4s var(--ease); }
.page-thumb { display: block; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; aspect-ratio: 3 / 4; }
.page-thumb img { width: 100%; height: 100%; object-fit: contain; }
.page-card figcaption { display: flex; justify-content: space-between; gap: 6px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.page-card figcaption b { color: var(--ink); }
.page-actions { display: flex; gap: 6px; }
.page-actions .btn { flex: 1; padding: 8px 10px; font-size: 0.82rem; gap: 6px; }
.page-actions .btn svg { width: 15px; height: 15px; }

/* Sign PDF */
.sign-work { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.sign-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.sign-panel { padding: 16px; border-radius: var(--radius); background: var(--bg); border: 1.5px solid var(--border); display: grid; gap: 12px; }
.sign-panel h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.sign-panel h3 .sp-step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font-size: 0.8rem; }
.sig-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sig-tabs button { padding: 8px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.sig-tabs button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#sig-pad { width: 100%; height: 150px; border-radius: 12px; border: 2px dashed var(--border-strong); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sig-colors { display: flex; gap: 6px; }
.sig-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; background: var(--c); }
.sig-color.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--orange); }
.sig-typed-preview { min-height: 80px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 2px dashed var(--border-strong); font-size: 2.2rem; color: #111; overflow: hidden; white-space: nowrap; padding: 0 10px; }
.sig-upload-preview { min-height: 60px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 2px dashed var(--border-strong); padding: 8px; }
.sig-upload-preview img { max-height: 70px; }
.sig-current { min-height: 50px; display: grid; place-items: center; background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 6px; }
.sig-current img { max-height: 54px; }
.sig-current:empty::before { content: "No signature yet"; color: #9c897b; font-size: 0.85rem; }
.place-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.place-btns .btn { padding: 10px 12px; font-size: 0.88rem; }
.place-btns .btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.sign-main { min-width: 0; display: grid; gap: 12px; }
.sign-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--orange-50); border: 1px solid var(--border); }
.sign-file { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.sign-hint { font-size: 0.88rem; color: var(--muted); margin: 0; }
.sign-viewer { display: grid; gap: 18px; justify-items: center; max-height: 78vh; overflow: auto; padding: 14px; border-radius: 16px; background: var(--bg-alt); border: 1px solid var(--border); }
.sign-page { position: relative; background: #fff; box-shadow: var(--shadow); max-width: 100%; }
.sign-page canvas { display: block; }
.placing .sign-page { cursor: copy; outline: 3px dashed var(--orange); outline-offset: 2px; }
.sign-page-no { position: absolute; top: -2px; right: 0; transform: translateY(-100%); font-size: 0.72rem; color: var(--muted); padding-bottom: 2px; }
.sign-loading { padding: 40px; color: var(--muted); text-align: center; }
.sign-item { position: absolute; border: 1.5px dashed var(--orange); border-radius: 4px; cursor: move; touch-action: none; user-select: none; }
.sign-item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sign-item span:not(.sign-resize) { display: block; white-space: nowrap; line-height: 1.3; color: #111; font-family: Helvetica, Arial, sans-serif; padding-left: 1px; pointer-events: none; }
.sign-del { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #dc2626; color: #fff; font-weight: 800; cursor: pointer; line-height: 1; }
.sign-resize { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 4px; background: var(--orange); border: 2px solid #fff; cursor: nwse-resize; }
.sign-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 920px) {
  .sign-work { grid-template-columns: 1fr; }
  .sign-side { position: static; }
  .sign-viewer { max-height: none; padding: 8px; }
}

/* ---------- Responsive hardening ---------- */
.prose, .sidebar, .tool-box, .options, .file-meta, .sign-main, .page-card { min-width: 0; }
.tools-toolbar > *, .tabs { min-width: 0; max-width: 100%; }
.prose { overflow-wrap: break-word; }
.prose code { word-break: break-all; }
.prose img, .prose svg { max-width: 100%; height: auto; }
.table-wrap { max-width: 100%; }
@media (max-width: 400px) {
  .container { padding: 0 14px; }
  .nav { gap: 10px; }
  .logo { font-size: 1.1rem; gap: 8px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .logo-mark svg { width: 19px; height: 19px; }
  .icon-btn { width: 38px; height: 38px; }
  .nav-actions { gap: 6px; }
  .tool-box { padding: 14px; box-shadow: 4px 4px 0 var(--orange); }
  .dropzone { padding: 26px 12px; }
  .format-pills button { padding: 9px 13px; }
  .hero-features { gap: 12px; }
  .hero-feature { font-size: 0.82rem; }
}

/* ---------- Nav: labels on one line; switch to the ☰ menu below 1100px ---------- */
.nav-link { white-space: nowrap; }
@media (min-width: 1101px) and (max-width: 1280px) {
  .nav-link { padding: 10px 10px; font-size: 0.9rem; }
  .nav { gap: 14px; }
}
@media (min-width: 921px) and (max-width: 1100px) {
  .hamburger { display: grid; }
  .nav-cta { display: none; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-menu {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 20px; background: var(--bg); overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s linear 0.25s;
  }
  .nav-menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s; }
  .nav-link { width: 100%; justify-content: space-between; padding: 14px 16px; font-size: 1.05rem; }
  .dropdown { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: 0; padding: 0 0 0 10px; min-width: 0; max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); background: transparent; }
  .has-dropdown:hover .dropdown { transform: none; }
  .has-dropdown.open .dropdown { max-height: 800px; transform: none; }
  body.menu-open { overflow: hidden; }
}
