/* Kodiak Cleaner website. Colors come only from the Honey tokens in theme.css. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent),
            0 12px 32px -12px color-mix(in srgb, var(--text) 18%, transparent);
  --shadow-lg: 0 2px 4px color-mix(in srgb, var(--text) 6%, transparent),
               0 40px 80px -30px color-mix(in srgb, var(--text) 35%, transparent);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-size: 17px; line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-tint); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: var(--radius); z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { display: inline-block; font-family: var(--font-display); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .6rem; }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 680px; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Wordmark */
.wordmark { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.wordmark .w1 { color: var(--brand-1); }
.wordmark .w2 { color: var(--brand-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.45rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { color: var(--text); padding: 8px 12px; border-radius: var(--radius); font-weight: 500; font-size: .98rem; }
.nav a:hover { background: var(--accent-tint); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--control-border); }
.icon-btn svg { width: 20px; height: 20px; }
.header-tools { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
@media (max-width: 1060px) {
  .menu-btn { display: inline-grid; }
  .nav { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 18px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .header-tools { margin-left: auto; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: 1.02rem; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; text-align: center; line-height: 1.2; }
.btn:hover { text-decoration: none; border-color: var(--control-border); transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.btn.primary:hover { box-shadow: var(--shadow-lg); }
.btn.lg { padding: 16px 28px; font-size: 1.1rem; border-radius: 14px; }
.btn small { display: block; font-weight: 500; font-size: .8rem; opacity: .85; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .btn-row { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

.chip { display: inline-block; padding: 3px 11px; font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.center { justify-content: center; }
.chip-link { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font-weight: 600; font-size: .92rem; }
.chip-link:hover { border-color: var(--accent); text-decoration: none; }

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 0; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 78%; background: var(--surface-alt); border-bottom: 1px solid var(--line); z-index: -1; }
.hero-logo { position: relative; width: clamp(150px, 22vw, 230px); margin: 0 auto 18px; }
.hero-logo img { width: 100%; filter: drop-shadow(0 18px 24px color-mix(in srgb, var(--text) 18%, transparent)); animation: bob 6s ease-in-out infinite; }
.hero-logo .halo { position: absolute; inset: 8% 4% 0; border-radius: 50%; background: var(--accent-tint); z-index: -1; transform: scale(1.25); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .hero-logo img { animation: none; } }
.hero h1 { font-size: clamp(3rem, 9vw, 6rem); margin-bottom: .15em; }
.slogan { font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.75rem); color: var(--accent-text); margin-bottom: .7em; line-height: 1.3; }
.hero .lead { margin-bottom: 28px; }
.hero-meta { margin-top: 18px; font-size: .92rem; color: var(--muted); }
.hero-meta span + span::before { content: "·"; margin: 0 10px; }
.hero-shot { margin: clamp(40px, 6vw, 64px) auto 0; max-width: 1100px; }

/* Window frame around screenshots */
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); }
.frame .bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.frame .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.frame .bar span { margin-left: auto; font-size: .78rem; color: var(--muted); }
.frame img { width: 100%; }
button.zoom { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: none; cursor: zoom-in; }

/* Warning */
.notice { display: flex; gap: 14px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); border-radius: var(--radius-card); padding: 16px 20px; font-size: .98rem; }
.notice svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.notice p { margin: 0; }
.notice strong { font-weight: 700; }

/* Sections */
section { padding: clamp(56px, 9vw, 104px) 0; }
section.tight { padding: clamp(36px, 5vw, 56px) 0; }
.alt { background: var(--surface-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center { text-align: center; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.card { padding: 26px; box-shadow: none; transition: border-color .15s ease, transform .15s ease; }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-tint); color: var(--accent-text); margin-bottom: 14px; }
.card .icon svg { width: 26px; height: 26px; }
.card.hover:hover { border-color: var(--control-border); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card.hover:hover { transform: none; } }

/* Steps */
.steps { counter-reset: step; }
.step { position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 24px; left: 26px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-family: var(--font-display); font-size: 1.2rem; }
.step { padding-top: 80px; }

/* Showcase rows */
.showcase { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.showcase + .showcase { margin-top: clamp(56px, 8vw, 96px); }
.showcase.flip { grid-template-columns: 1.35fr 1fr; }
.showcase.flip .text { order: 2; }
.showcase ul { padding-left: 1.2em; margin: 0 0 1em; }
.showcase li { margin: .3em 0; }
@media (max-width: 860px) { .showcase, .showcase.flip { grid-template-columns: 1fr; } .showcase.flip .text { order: 0; } }

/* Theme gallery tabs */
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 26px; }
.tabs button { border: 1.5px solid transparent; background: none; padding: 9px 16px; font: 600 .95rem var(--font); border-radius: 10px; cursor: pointer; color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-text); }
.tab-panel[hidden] { display: none; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 12px; font-weight: 600; text-align: center; }
.gallery figcaption span { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; }

/* Story quote */
.quote { position: relative; font-family: var(--font-display); font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.3; margin: 0 0 24px; color: var(--text); }
.quote::before { content: "\201C"; display: block; font-size: 4em; line-height: .6; color: var(--accent); }
.signature { display: flex; align-items: center; gap: 14px; justify-content: center; color: var(--muted); }
.signature img { width: 48px; height: 48px; }

/* Checklist */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 36px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 6px; background: var(--success); }
.ticks li::after { content: ""; position: absolute; left: 7px; top: 7px; width: 6px; height: 11px; border: solid var(--on-primary); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* CTA band */
.cta { text-align: center; }
.cta .card { padding: clamp(32px, 6vw, 64px); background: var(--surface); }
.cta img { width: 110px; margin: 0 auto 14px; }

/* Page header for inner pages */
.page-head { padding: clamp(48px, 7vw, 80px) 0 clamp(32px, 5vw, 48px); background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.page-head .wrap { display: flex; align-items: center; gap: clamp(20px, 4vw, 40px); }
.page-head img.mark { width: clamp(84px, 11vw, 128px); flex: none; filter: drop-shadow(0 10px 16px color-mix(in srgb, var(--text) 15%, transparent)); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .2em; }
.page-head .lead { margin: 0; }
@media (max-width: 600px) { .page-head .wrap { flex-direction: column; align-items: flex-start; } }

/* Prose (rendered markdown) */
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; color: var(--accent-text); }
.prose ul { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent); }
.prose.story p { font-size: 1.15rem; line-height: 1.75; }
.prose.story p:first-of-type::first-letter { font-family: var(--font-display); float: left; font-size: 3.6em; line-height: .9; padding: 6px 10px 0 0; color: var(--accent-text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--muted); background: var(--surface-alt); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: var(--surface-alt); }
td .chip { margin: 2px 4px 2px 0; }

/* Downloads */
.dl-card { display: flex; flex-direction: column; padding: 32px; position: relative; }
.dl-card .badge { position: absolute; top: 20px; right: 20px; }
.dl-card h3 { font-size: 1.6rem; }
.dl-card ul { padding-left: 1.2em; margin: 0 0 22px; }
.dl-card .btn { margin-top: auto; }
.dl-card .file { margin-top: 12px; font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }

/* Changelog */
.log-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.log-nav { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.log-nav h2 { font-size: 1rem; margin-bottom: .6em; color: var(--muted); }
.log-nav ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.log-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: .95rem; }
.log-nav a:hover { background: var(--accent-tint); text-decoration: none; }
.release { padding: 28px 30px; margin-bottom: 22px; scroll-margin-top: 96px; }
.release header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 8px; }
.release header h2 { font-size: 1.7rem; margin: 0; }
.release header time { color: var(--muted); font-size: .95rem; }
.release header .links { margin-left: auto; display: flex; gap: 14px; font-size: .95rem; }
.release h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; color: var(--accent-text); }
.release ul { padding-left: 1.2em; margin: 0; }
.release li { margin: .35em 0; }
.release li::marker { color: var(--accent); }
@media (max-width: 860px) { .log-layout { grid-template-columns: 1fr; } .log-nav { position: static; max-height: none; } .log-nav ol { display: flex; flex-wrap: wrap; gap: 6px; } }

/* Feature page */
.jump { position: sticky; top: 70px; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 12px 0; }
.feature-group { scroll-margin-top: 140px; }
.feature { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 48px); align-items: center; padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--line); }
.feature:first-of-type { border-top: 0; }
.feature.no-shot { grid-template-columns: 1fr; }
.feature h3 { font-size: 1.6rem; display: flex; align-items: center; gap: 12px; }
.feature h3 .icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-tint); color: var(--accent-text); flex: none; }
.feature h3 .icon svg { width: 22px; height: 22px; }
.feature ul { padding-left: 1.2em; margin: 0; }
.feature li { margin: .35em 0; }
.feature li::marker { color: var(--accent); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }
.tool-grid .card h3 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; }
.tool-grid .card .icon { margin: 0; width: 40px; height: 40px; flex: none; }
.tool-grid .card .icon svg { width: 22px; height: 22px; }

/* Contact form */
.contact-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
form.card { padding: clamp(24px, 4vw, 40px); }
.field { display: grid; gap: 6px; margin-bottom: 20px; }
.field label, .field legend { font-weight: 600; font-size: .98rem; }
.field .hint { font-size: .88rem; color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select { font: inherit; font-size: 1rem; padding: 12px 14px; width: 100%; }
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; }
.topic { border: 0; padding: 0; margin: 0 0 20px; }
.topic legend { margin-bottom: 8px; }
.topic-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.topic-options label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .95rem; }
.topic-options label:hover { border-color: var(--control-border); }
.topic-options input { accent-color: var(--success); width: 18px; height: 18px; margin: 0; }
.topic-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.topic-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; padding: 14px 18px; border-radius: var(--radius); display: none; }
.form-status.show { display: block; }
.form-status.ok { background: var(--accent-tint); border: 1px solid var(--accent); color: var(--text); }
.turnstile-box { min-height: 70px; margin-bottom: 18px; }
.counter { text-align: right; font-size: .85rem; color: var(--muted); }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: none; max-width: min(96vw, 1600px); max-height: 94vh; }
dialog.lightbox::backdrop { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
dialog.lightbox img { max-height: 88vh; width: auto; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }
dialog.lightbox p { text-align: center; color: var(--text); font-weight: 600; margin: 10px 0 0; }
dialog.lightbox .close { position: fixed; top: 16px; right: 16px; }

/* Footer */
.site-footer { margin-top: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 56px 0 32px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.site-footer h2 { font-size: 1rem; color: var(--muted); margin-bottom: .8em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--text); }
.footer-brand { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; margin-bottom: 10px; }
.footer-brand img { width: 56px; height: 56px; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.more-apps { display: flex; align-items: center; gap: 18px; padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-alt); margin-bottom: 40px; }
.more-apps p { margin: 0; flex: 1; }
@media (max-width: 640px) { .more-apps { flex-direction: column; align-items: flex-start; } }

/* 404 */
.lost { text-align: center; padding: 96px 0; }
.lost img { width: 160px; margin: 0 auto 20px; }

/* Reveal on scroll (only when scripts run and motion is allowed) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Small helpers */
.mt { margin-top: 18px; }
.mt-xl { margin-top: clamp(28px, 4vw, 44px); }
.pad { padding: clamp(24px, 4vw, 48px); }
.centered { justify-content: center; }
.cta-lead { margin: 0 auto 26px; }
.link-card { display: flex; flex-direction: column; justify-content: center; color: var(--text); }
.link-card:hover { text-decoration: none; }
.form-row { gap: 0 20px; }
.prose .card > :first-child, .card.pad > :first-child { margin-top: 0; }
.icon-btn svg[hidden] { display: none; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero .btn-row { justify-content: center; }
.showcase.even { grid-template-columns: 1.1fr 1fr; align-items: start; }
@media (max-width: 860px) { .showcase.even { grid-template-columns: 1fr; } }
td.nowrap { white-space: nowrap; }
.topic-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.topic-options .hint { display: block; font-weight: 400; color: var(--muted); font-size: .86rem; }
.field input, .field textarea { background: var(--surface-alt); border: 1px solid var(--line); }
.field input:hover, .field textarea:hover { border-color: var(--control-border); }
.form-status:focus { outline: none; }
