/* CalculatorPK - shared styles */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --text: #16202e;
  --muted: #5b6778;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-soft: #e8efff;
  --ok: #0f766e;
  --bad: #b91c1c;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141f;
    --surface: #151d2b;
    --surface-2: #1a2436;
    --text: #e8edf5;
    --muted: #9aa7ba;
    --line: #26324a;
    --brand: #6b9bff;
    --brand-ink: #0b1220;
    --brand-soft: #1a2745;
    --ok: #2dd4bf;
    --bad: #f87171;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141f;
  --surface: #151d2b;
  --surface-2: #1a2436;
  --text: #e8edf5;
  --muted: #9aa7ba;
  --line: #26324a;
  --brand: #6b9bff;
  --brand-ink: #0b1220;
  --brand-soft: #1a2745;
  --ok: #2dd4bf;
  --bad: #f87171;
  --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--brand); }
a:hover { text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin-top: 1.8em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav > a, .menu > summary { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; list-style: none; display: block; }
.nav > a:hover, .menu > summary:hover, .menu[open] > summary { background: var(--brand-soft); color: var(--brand); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " \25BE"; font-size: .8em; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.menu-panel a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.menu-panel a:hover { background: var(--brand-soft); color: var(--brand); }

/* Hero (home) */
.hero { padding: 44px 0 20px; }
.hero p.lead { max-width: 680px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--brand-soft); color: var(--brand); padding: 6px 12px; border-radius: 999px; font-size: .9rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.08rem; }

/* Cards and grids */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.tool-card strong { display: block; font-size: 1.02rem; margin-bottom: 4px; color: var(--brand); }
.tool-card span { color: var(--muted); font-size: .92rem; line-height: 1.5; display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.calc { margin: 22px 0 10px; }
.crumbs { font-size: .9rem; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); }

/* Forms */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field[hidden] { display: none; }
label, .label { font-weight: 600; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
input[type="number"], input[type="text"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; min-height: 46px;
}
input[type="color"] { width: 100%; height: 46px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { appearance: none; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 10px; cursor: pointer; min-height: 46px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-choice label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.inline-choice input { accent-color: var(--brand); }

/* Result */
.result { margin-top: 20px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.result.ready { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.result.error { border-color: var(--bad); color: var(--bad); background: transparent; }
.result .ph { margin: 0; color: var(--muted); }
.rows { display: grid; gap: 0; margin: 0; }
.rows .row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rows .row:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); font-weight: 600; margin: 0; }
.rows dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rows .hi dd { font-size: 1.35rem; color: var(--brand); }
.rows .hi dt { color: var(--text); }
.tag-ok { color: var(--ok); }
.tag-bad { color: var(--bad); }
.tag-warn { color: var(--warn); }
.result-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.bar-split { height: 14px; border-radius: 999px; overflow: hidden; display: flex; background: var(--line); margin: 12px 0 6px; }
.bar-split i { display: block; height: 100%; }
.bar-split .p { background: var(--brand); }
.bar-split .i { background: var(--warn); }
.legend { display: flex; gap: 16px; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { background: var(--surface-2); font-weight: 700; position: sticky; top: 0; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.scroll-y { max-height: 420px; overflow: auto; }

/* Content */
.prose { max-width: 780px; }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.formula { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; overflow-x: auto; }
.example { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.example p:last-child { margin-bottom: 0; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: .95rem; color: var(--muted); margin: 16px 0; }
.note.warn { border-color: var(--warn); }
.note strong { color: var(--text); }
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
details.faq p { margin: 0 0 12px; color: var(--muted); }
details.more { margin-top: 18px; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--brand); }

/* Tool specific */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--surface-2); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone p { margin: 0 0 6px; }
.canvas-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 50% / 16px 16px; text-align: center; }
.canvas-wrap canvas { cursor: crosshair; display: inline-block; max-width: 100%; height: auto; touch-action: none; }
.swatch { width: 100%; height: 90px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; }
.history { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.history button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.qr-out { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.qr-out canvas { border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; height: auto; }
.preview-img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; margin: 0 auto 12px; }
.quote { font-size: 1.15rem; line-height: 1.6; margin: 0; }
.output-box { word-break: break-all; font-weight: 700; margin: 0 0 10px; }

/* Footer */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0 20px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.foot-grid h2 { font-size: 1rem; margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot-grid a { color: var(--muted); text-decoration: none; font-size: .94rem; }
.foot-grid a:hover { color: var(--brand); text-decoration: underline; }
.foot-grid p { color: var(--muted); font-size: .94rem; }
.copy { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: .9rem; }
.related h2 { margin-top: 2em; }

@media (max-width: 560px) {
  .card { padding: 16px; }
  .hero { padding-top: 28px; }
  .rows dd { text-align: left; }
}
@media print {
  .site-header, .site-footer, .actions, .result-actions { display: none; }
}

.rows dd { overflow-wrap: anywhere; min-width: 0; }
.prose, .card, .result { min-width: 0; }
@media (max-width: 700px) {
  .menu { position: static; }
  .menu-panel { left: 16px; right: 16px; width: auto; max-width: none; top: 100%; }
}

.wheel-wrap { position: relative; display: flex; justify-content: center; }
.wheel-wrap::before { content: ""; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--text); z-index: 2; }
.fancy-list { display: grid; gap: 10px; margin-top: 16px; }
.fancy-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.fancy-out { font-size: 1.15rem; overflow-wrap: anywhere; min-height: 1.6em; }
textarea { resize: vertical; line-height: 1.5; }

/* ---------- Motion (transform/opacity only, so no layout shift) ---------- */
@keyframes cpk-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cpk-pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cpk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cpk-pulse { 0% { box-shadow: 0 0 0 0 var(--brand-soft); } 100% { box-shadow: 0 0 0 12px transparent; } }

.lead, .prose > h1, main h1 { animation: cpk-rise .5s ease both; }
.tool-card { animation: cpk-rise .5s ease both; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.tool-card:active { transform: translateY(-1px) scale(.99); }
.cards .tool-card:nth-child(1) { animation-delay: .04s; } .cards .tool-card:nth-child(2) { animation-delay: .08s; }
.cards .tool-card:nth-child(3) { animation-delay: .12s; } .cards .tool-card:nth-child(4) { animation-delay: .16s; }
.cards .tool-card:nth-child(5) { animation-delay: .20s; } .cards .tool-card:nth-child(n+6) { animation-delay: .24s; }
.card { animation: cpk-fade .5s ease both; }
.btn { transition: transform .15s ease, filter .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible { animation: cpk-pulse .8s ease-out; }
.result.ready, .result.error { animation: cpk-pop .35s ease both; }
.fancy-row, .wheel-wrap { animation: cpk-fade .4s ease both; }
.logo { transition: transform .4s ease; }
.brand:hover .logo { transform: rotate(-8deg) scale(1.08); }
.nav a, .menu-panel a { transition: color .15s ease, background-color .15s ease; }
details.faq summary { transition: color .15s ease; }
details.faq[open] > :not(summary) { animation: cpk-fade .3s ease both; }

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

/* Grouped tools menu and footer */
.menu-panel { max-height: min(75vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.menu-cat { display: block; padding: 10px 10px 4px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-cat:first-child { padding-top: 4px; }
.foot-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 24px; }
.foot-tools h3 { font-size: .8rem; margin: 0 0 8px; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.2fr 3.4fr 1fr 1fr; } }

/* Compact wide Tools menu: groups sit side by side, no long scroll */
.menu-panel { width: min(760px, calc(100vw - 32px)); max-height: none; overflow: visible; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; padding: 12px; }
.menu-group { display: grid; gap: 1px; align-content: start; }
.menu-group a { padding: 6px 10px; font-size: .92rem; }
.menu-cat, .menu-cat:first-child { padding: 4px 10px 6px; }
@media (max-width: 700px) { .menu-panel { grid-template-columns: 1fr 1fr; max-height: 70vh; overflow-y: auto; } }
@media (max-width: 440px) { .menu-panel { grid-template-columns: 1fr; } }
/* Footer: tighter */
.site-footer { padding: 24px 0 16px; margin-top: 40px; }
.foot-tools ul { gap: 2px; }
.foot-tools a { font-size: .9rem; }

/* Tools menu anchored to the right corner of the header */
.site-header .bar { position: relative; }
.menu { position: static; }
.menu-panel { right: 16px; left: auto; top: calc(100% + 4px); }
@media (max-width: 700px) { .menu-panel { left: 16px; right: 16px; width: auto; } }

/* Compact footer */
.foot-grid { grid-template-columns: 2fr 1fr 1fr !important; gap: 16px 24px; }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr 1fr !important; } .foot-grid > div:first-child { grid-column: 1 / -1; } }
.foot-h { font-size: 1rem; margin: 18px 0 8px; }
.foot-tools { display: block; }
.foot-row { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; color: var(--muted); font-size: .9rem; }
.foot-row strong { color: var(--text); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; min-width: 150px; }
.foot-row a { color: var(--muted); text-decoration: none; }
.foot-row a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 560px) { .foot-row strong { min-width: 100%; } }
.site-footer .copy { margin-top: 12px; }

/* Hero split with animated tool previews */
.hero-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; } }
.hero-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; }
.demo-tile:nth-child(1) { animation: cpk-float 5s ease-in-out infinite; }
.demo-tile:nth-child(2) { animation: cpk-float 6s ease-in-out -2s infinite; }
.demo-tile:nth-child(3) { animation: cpk-float 5.5s ease-in-out -1s infinite; }
.demo-tile:nth-child(4) { animation: cpk-float 6.5s ease-in-out -3s infinite; }
.demo-label { position: absolute; top: 8px; left: 10px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@keyframes cpk-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.demo-pct { text-align: center; font-size: .9rem; color: var(--muted); display: grid; gap: 6px; width: 100%; margin-top: 14px; }
.demo-pct b { color: var(--brand); font-size: 1.6rem; animation: cpk-fade-loop 4s ease-in-out infinite; }
.demo-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.demo-track i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transform-origin: left; animation: cpk-fill 4s ease-in-out infinite; }
@keyframes cpk-fill { 0% { transform: scaleX(0); } 55%, 100% { transform: scaleX(.15); } }
@keyframes cpk-fade-loop { 0%, 40% { opacity: 0; transform: scale(.8); } 60%, 100% { opacity: 1; transform: none; } }
.demo-wheel { width: 84px; height: 84px; margin-top: 12px; animation: cpk-spin 6s cubic-bezier(.3,.1,.2,1) infinite; }
@keyframes cpk-spin { 0% { transform: rotate(0); } 60%, 100% { transform: rotate(900deg); } }
.demo-pointer { position: absolute; top: 24px; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top: 9px solid var(--text); }
.demo-qr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 80px; margin-top: 14px; }
.demo-qr i { aspect-ratio: 1; background: var(--text); border-radius: 2px; animation: cpk-blink 2.4s ease-in-out infinite; }
.demo-qr i:nth-child(3n) { animation-delay: .3s; } .demo-qr i:nth-child(4n) { animation-delay: .7s; }
.demo-qr i:nth-child(5n+2) { animation-delay: 1.1s; } .demo-qr i:nth-child(7n) { animation-delay: 1.5s; background: var(--brand); }
@keyframes cpk-blink { 0%, 100% { opacity: 1; } 50% { opacity: .12; } }
.demo-gauge { width: 112px; margin-top: 14px; color: var(--text); }
.demo-needle { transform-origin: 50px 52px; animation: cpk-needle 5s ease-in-out infinite; }
@keyframes cpk-needle { 0%, 100% { transform: rotate(-55deg); } 50% { transform: rotate(40deg); } }

/* Dark hero banner with floating, tilted tool tiles */
.hero-split { position: relative; margin-top: 18px; padding: 40px 36px; border-radius: 22px; color: #fff; overflow: hidden;
  background: radial-gradient(ellipse at 20% 30%, #12296b 0%, rgba(18,41,107,0) 55%), linear-gradient(120deg, #0a1a4a 0%, #070c26 60%, #03050f 100%); }
.hero-split h1 { color: #fff; }
.hero-split .accent { color: #22d3ee; }
.hero-split .lead { color: #b6c2e2; }
.hero-split .chips li { background: rgba(255,255,255,.1); color: #dbe6ff; }
.hero-stage { position: relative; min-height: 270px; perspective: 900px; }
.stage-glow { position: absolute; width: 220px; height: 220px; left: 50%; top: 50%; margin: -110px 0 0 -110px; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.28), rgba(34,211,238,0) 70%); animation: cpk-glow 5s ease-in-out infinite; }
@keyframes cpk-glow { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
.ftile { position: absolute; width: 104px; padding: 14px 8px 10px; border-radius: 22px; background: linear-gradient(160deg, #101a3f, #0a1030); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 36px rgba(0,0,0,.45); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ftile svg { width: 48px; height: 48px; }
.ftile b { font-size: .66rem; letter-spacing: .08em; }
.ftile .spin { transform-origin: 24px 24px; animation: cpk-spin2 5s linear infinite; }
@keyframes cpk-spin2 { to { transform: rotate(360deg); } }
.t1 { left: 4%;  top: 6%;  --r: -8deg;  animation: cpk-drift 6s ease-in-out infinite; }
.t2 { left: 44%; top: 0;   --r: 7deg;   animation: cpk-drift 7s ease-in-out -2s infinite; width: 96px; }
.t3 { right: 2%; top: 14%; --r: -12deg; animation: cpk-drift 6.5s ease-in-out -1s infinite; }
.t4 { left: 14%; bottom: 0; --r: 10deg; animation: cpk-drift 7.5s ease-in-out -3s infinite; }
.t5 { right: 12%; bottom: 2%; --r: -6deg; animation: cpk-drift 6.8s ease-in-out -4s infinite; }
@keyframes cpk-drift { 0%, 100% { transform: rotate(var(--r)) translateY(0) rotateY(0); } 50% { transform: rotate(calc(var(--r) * -.4)) translateY(-12px) rotateY(14deg); } }
@media (max-width: 860px) { .hero-split { padding: 28px 20px; } .hero-stage { min-height: 250px; } }
@media (max-width: 520px) { .ftile, .t2 { width: 88px; padding: 10px 6px 8px; } .ftile svg { width: 40px; height: 40px; } .t2 { left: 38%; } .t3 { right: 0; top: 24%; } .hero-stage { min-height: 270px; } }

/* Search */
.search { margin: 22px 0 6px; }
.search label { display: block; font-weight: 700; margin-bottom: 8px; }
.search input { width: 100%; font: inherit; padding: 14px 16px; min-height: 52px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
[hidden] { display: none !important; }
.hsearch { display: flex; align-items: center; margin-left: 12px; }
.hsearch input { font: inherit; font-size: .92rem; width: 150px; padding: 7px 10px; min-height: 38px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--text); }
.hsearch button { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 0 10px 10px 0; background: var(--surface); cursor: pointer; font-size: .95rem; }
@media (max-width: 700px) { .hsearch { order: 3; flex-basis: 100%; margin: 0; } .hsearch input { flex: 1; width: auto; min-height: 44px; } .hsearch button { min-height: 44px; padding: 0 14px; } }

/* Footer search */
.fsearch { margin: 18px 0 0; }
.fsearch label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.fsearch div { display: flex; max-width: 520px; }
.fsearch input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; min-height: 46px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--text); }
.fsearch button { font: inherit; font-weight: 700; padding: 0 18px; min-height: 46px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); border-radius: 0 10px 10px 0; cursor: pointer; }

/* Phones: shorter hero so the tools show sooner; tiles become one compact row */
@media (max-width: 700px) {
  .hero-split { margin-top: 10px; padding: 18px 16px; gap: 12px; border-radius: 16px; }
  .hero-split h1 { font-size: 1.6rem; margin: 0 0 6px; }
  .hero-split .lead { font-size: .98rem; margin: 0 0 8px; }
  .hero-split .chips { display: none; }
  .hero-stage { min-height: 0; height: 92px; display: flex; gap: 8px; justify-content: space-between; perspective: none; }
  .stage-glow { display: none; }
  .ftile, .t2 { position: static; flex: 1; width: auto; min-width: 0; padding: 8px 2px 6px; gap: 6px; border-radius: 14px; --r: 0deg; }
  .ftile svg { width: 34px; height: 34px; }
  .ftile b { font-size: .52rem; letter-spacing: .02em; }
}
@media (max-width: 700px) { .ftile { justify-content: center; } .hero-stage { height: 84px; } }
