:root {
  --ink: #1b1c3d;
  --muted: #5e6187;
  --bg: #ffffff;
  --soft: #f5f3ff;
  --line: #e8e6f4;
  --brand: #6c47ff;
  --brand-dark: #5530e6;
  --sun: #ffd23f;
  --pink: #ff8fa8;
  --ok: #138a52;
  --err: #d93654;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 10px;
  --r: 18px;
  --r-lg: 28px;
  --shadow: 0 1px 2px rgba(27, 28, 61, .06), 0 8px 24px -8px rgba(27, 28, 61, .12);
  --shadow-lift: 0 2px 4px rgba(27, 28, 61, .06), 0 18px 40px -12px rgba(27, 28, 61, .22);
  --measure: 66ch;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 1.0625rem/1.65 var(--body); color: var(--ink); background: var(--bg); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sun); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .45em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 52ch; }
.section-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }

/* ---------- Mascot ---------- */
.mascot { display: block; overflow: visible; }
.mascot .m-page { fill: #fff; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.mascot .m-fold { fill: var(--soft); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.mascot .m-grid { stroke: #cfcbea; stroke-width: 3; stroke-linecap: round; fill: none; }
.mascot .m-eye { fill: var(--ink); }
.mascot .m-brow, .mascot .m-mouth { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; }
.mascot .m-cheek { fill: var(--pink); opacity: .55; }
.mascot .m-shadow { fill: rgba(27, 28, 61, .1); }
.mascot .m-happy { opacity: 0; }
.mascot .m-brow { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: center; }
.mascot.happy .m-sad, .done .mascot-drop .m-sad { opacity: 0; }
.mascot.happy .m-happy, .done .mascot-drop .m-happy { opacity: 1; }
.mascot.happy .m-brow-l, .done .mascot-drop .m-brow-l { transform: translateY(-5px) rotate(-38deg); }
.mascot.happy .m-brow-r, .done .mascot-drop .m-brow-r { transform: translateY(-5px) rotate(38deg); }

/* ---------- Wordmark ---------- */
.home-link { text-decoration: none; display: inline-block; }
.mark { display: inline-flex; align-items: center; gap: .45rem; }
.mascot-mini { width: 30px; height: 34px; }
.mascot-mini .m-shadow, .mascot-mini .m-grid, .mascot-mini .m-cheek { display: none; }
.mascot-mini .m-page, .mascot-mini .m-fold { stroke-width: 7; }
.mascot-mini .m-brow, .mascot-mini .m-mouth { stroke-width: 7; }
.mark-text { font: 700 1.5rem/1 var(--display); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: .15rem; }
.mark-tag { background: var(--brand); color: #fff; border-radius: 8px; padding: .12em .32em .16em; margin-left: .12em; transform: rotate(-4deg); display: inline-block; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; }
.site-header nav { display: flex; align-items: center; gap: .25rem; }
.site-header nav a { font-weight: 600; font-size: .98rem; text-decoration: none; padding: .5rem .8rem; border-radius: 999px; }
.site-header nav a:hover { background: var(--soft); }
.site-header nav .nav-cta { background: var(--ink); color: #fff; margin-left: .35rem; }
.site-header nav .nav-cta:hover { background: var(--brand); }
@media (max-width: 640px) { .site-header nav a:not(.nav-cta) { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1rem/1 var(--body); color: #fff; background: var(--brand);
  border: 0; border-radius: 999px; padding: .85rem 1.4rem; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(108, 71, 255, .65), inset 0 -3px 0 rgba(0, 0, 0, .14);
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(108, 71, 255, .7), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: progress; transform: none; }
.btn-lg { font-size: 1.1rem; padding: 1.05rem 1.8rem; }
.btn-link { font: 600 1rem var(--body); color: var(--brand-dark); background: none; border: 0; padding: .5rem .25rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: rgba(108, 71, 255, .35); }
.btn-link:hover { text-decoration-color: currentColor; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 500px at 85% 0%, #efeaff 0%, rgba(239, 234, 255, 0) 60%), radial-gradient(800px 400px at 0% 100%, #fff6d6 0%, rgba(255, 246, 214, 0) 60%); overflow: hidden; }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 4.5rem); }
.hero h1 { max-width: 14ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin: 1.8rem 0 2rem; }
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pills li { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .4rem .85rem .4rem .65rem; box-shadow: 0 1px 2px rgba(27, 28, 61, .05); }
.pills svg, .privacy-note svg { width: 17px; height: 17px; fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.hero-art { position: relative; justify-self: center; width: min(360px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.blob { position: absolute; inset: 6%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: linear-gradient(140deg, var(--sun), #ffb547 55%, var(--pink)); }
.mascot-hero { position: relative; width: 62%; }
.float { position: absolute; font: 700 1rem var(--mono); background: #fff; color: var(--err); padding: .35rem .6rem; border-radius: 10px; box-shadow: var(--shadow); white-space: nowrap; }
.f1 { top: 8%; left: 2%; transform: rotate(-10deg); }
.f2 { top: 18%; right: -2%; transform: rotate(8deg); color: var(--muted); }
.f3 { bottom: 16%; left: -3%; transform: rotate(6deg); color: var(--brand); }
.f4 { bottom: 6%; right: 6%; transform: rotate(-6deg); }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.15fr .85fr; }
  .hero-art { justify-self: end; }
}
@media (prefers-reduced-motion: no-preference) {
  .mascot-hero .m-body { animation: bob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
  @keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
  .hero-art:hover .mascot-hero .m-sad { opacity: 0; }
  .hero-art:hover .mascot-hero .m-happy { opacity: 1; }
}

/* ---------- Tool cards ---------- */
.tools-section { padding-top: clamp(3rem, 6vw, 4.5rem); }
.tool-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tool-card {
  --c: var(--brand);
  position: relative; display: flex; flex-direction: column; gap: .35rem;
  padding: 1.4rem 1.4rem 1.5rem; border-radius: var(--r); background: #fff; border: 1px solid var(--line);
  text-decoration: none; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.tool-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); margin-bottom: .7rem; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tool-card:hover .tool-ico { transform: rotate(-8deg) scale(1.06); }
.ico { width: 26px; height: 26px; }
.tool-name { font: 600 1.3rem/1.2 var(--display); }
.tool-desc { color: var(--muted); font-size: .97rem; line-height: 1.5; }

/* ---------- Why ---------- */
.why { padding-top: clamp(4rem, 8vw, 6rem); }
.why-panel { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3.5rem); }
.why-panel .section-sub { color: #c4c5e6; }
.why-grid { display: grid; gap: 1.75rem; }
.why-grid p { color: #c4c5e6; margin: 0; }
.why-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .1); color: var(--sun); margin-bottom: .9rem; }
@media (min-width: 760px) { .why-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Tool page ---------- */
.tool-hero { --c: var(--brand); text-align: center; padding-block: clamp(2.5rem, 6vw, 4rem) clamp(4.5rem, 8vw, 6rem); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, #fff), #fff); }
.tool-hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
.tool-hero .lede { margin-inline: auto; }
.tool-ico-lg { width: 64px; height: 64px; border-radius: 19px; margin: 0 auto 1.1rem; background: var(--c); color: #fff; box-shadow: 0 10px 24px -10px var(--c); }
.tool-ico-lg .ico { width: 32px; height: 32px; }

.bench-wrap { --c: var(--brand); margin-top: clamp(-4rem, -6vw, -3rem); max-width: 860px; }
.workbench { background: #fff; border-radius: var(--r-lg); padding: clamp(1rem, 3vw, 1.6rem); box-shadow: var(--shadow-lift); border: 1px solid var(--line); }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .8rem;
  min-height: 19rem; padding: 2rem 1rem; cursor: pointer; border-radius: var(--r);
  border: 2.5px dashed color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 5%, #fff);
  transition: background .2s, border-color .2s, min-height .25s;
}
.drop:hover, .drop.over { background: color-mix(in srgb, var(--c) 11%, #fff); border-color: var(--c); }
.drop.over .mascot-drop { transform: scale(1.08) rotate(-4deg); }
.drop:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mascot-drop { width: 92px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.drop-title { pointer-events: none; background: var(--c); box-shadow: 0 8px 18px -8px var(--c), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.drop:hover .drop-title { transform: translateY(-2px); }
.drop-hint { color: var(--muted); font-size: .93rem; }
.has-files .drop { min-height: 0; flex-direction: row; flex-wrap: wrap; padding: .9rem 1rem; }
.has-files .mascot-drop { width: 44px; }
.has-files .drop-title { font-size: 1rem; padding: .7rem 1.2rem; }

.file-list { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .45rem; }
.file-list li { display: flex; gap: .9rem; align-items: center; padding: .6rem .9rem; background: var(--soft); border-radius: var(--r-sm); font-size: .95rem; }
.file-list li::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.file-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.file-remove { background: none; border: 0; color: var(--err); font: 600 .85rem var(--body); cursor: pointer; padding: .3rem .4rem; border-radius: 6px; }
.file-remove:hover { background: #fff; }

.options { display: grid; gap: .85rem; margin-top: 1.4rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--r); }
.check { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .22rem; accent-color: var(--c); flex: none; }
.field { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; font-weight: 600; }
.field input, .field select { font: 500 1rem var(--body); color: var(--ink); padding: .6rem .85rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; min-width: 10rem; }
.field input:focus, .field select:focus { border-color: var(--c); outline: 3px solid color-mix(in srgb, var(--c) 25%, #fff); outline-offset: 0; }
.columns-pick { border: 0; padding: 0; margin: 0; }
.columns-pick legend { font-weight: 700; margin-bottom: .6rem; padding: 0; }
.columns-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { align-items: center; border: 1.5px solid var(--line); border-radius: 999px; padding: .35rem .85rem .35rem .6rem; font-size: .92rem; font-weight: 600; background: #fff; transition: background .15s, border-color .15s; }
.chip:has(input:checked) { background: color-mix(in srgb, var(--c) 10%, #fff); border-color: var(--c); }
.chip input { margin-top: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.4rem; }
.run-btn { background: var(--c); box-shadow: 0 8px 18px -8px var(--c), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.run-btn:hover { background: color-mix(in srgb, var(--c) 85%, #000); }
.status { margin: 1rem 0 0; min-height: 1.6em; font-weight: 600; }
.status:empty { margin: 0; min-height: 0; }
.status[data-kind=error] { color: var(--err); }
.status[data-kind=busy] { color: var(--muted); }

.result { margin-top: 1.4rem; }
.result-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: var(--r); background: #e9f8f0; margin-bottom: 1rem; }
.mascot-result { width: 48px; flex: none; }
.mascot-result .m-shadow { display: none; }
.result-summary { margin: 0; font-weight: 700; color: var(--ok); flex: 1; min-width: 12rem; }
.download-btn { background: var(--ok); box-shadow: 0 8px 18px -8px var(--ok), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.download-btn:hover { background: #0f7444; }
@media (prefers-reduced-motion: no-preference) {
  .result:not([hidden]) .mascot-result { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
}

.preview { overflow: auto; max-height: 26rem; border: 1px solid var(--line); border-radius: var(--r-sm); }
.preview table { border-collapse: collapse; font: 400 .86rem/1.4 var(--body); width: max-content; min-width: 100%; }
.preview th, .preview td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: .45rem .7rem; text-align: left; white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.preview thead th { position: sticky; top: 0; background: var(--soft); font-weight: 700; z-index: 1; }
.preview .rownum { background: var(--soft); color: var(--muted); text-align: right; font-weight: 500; position: sticky; left: 0; font-size: .8rem; }
.preview thead .rownum { z-index: 2; }
.preview-more { font-size: .85rem; color: var(--muted); padding: .6rem .8rem; margin: 0; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: .45rem; font-size: .92rem; color: var(--muted); margin: 1.2rem auto 0; text-align: center; }

.how, .faq, .related { padding-top: clamp(3.5rem, 7vw, 5rem); }
.how, .faq { max-width: 860px; }
.steps { padding: 0; margin: 1.2rem 0 0; list-style: none; counter-reset: step; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: var(--r); background: var(--soft); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; font: 700 1.15rem var(--display); background: var(--c, var(--brand)); color: #fff; }

.faq details { border-radius: var(--r); background: #fff; border: 1px solid var(--line); margin-bottom: .6rem; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 1.1rem 3rem 1.1rem 1.3rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 1.3rem; top: 50%; width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding: 0 1.3rem 1.1rem; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(4rem, 8vw, 6rem); background: var(--soft); padding-block: 3rem 1.5rem; }
.footer-inner { display: grid; gap: 2rem; }
.footer-inner p { color: var(--muted); margin-top: .9rem; max-width: 38ch; }
.footer-h { font-size: 1rem; font-family: var(--body); font-weight: 700; margin-bottom: .8rem; }
.footer-tools { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.footer-tools li { margin-bottom: .55rem; break-inside: avoid; }
.footer-tools a { text-decoration: none; color: var(--muted); font-weight: 500; }
.footer-tools a:hover { color: var(--brand-dark); }
.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1.3fr 1fr; } }

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