/*
 * Sunny Toolbox design system.
 * Follows the ai-design-skills visual rules: one typeface (Manrope), Tailwind type scale,
 * fixed spacing tokens, Tailwind radii, flat backgrounds, weighted motion curve.
 */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* colour */
  --bg: #fffcf5;
  --surface: #ffffff;
  --surface-2: #faf6ec;
  --ink: #1c1a17;
  --muted: #6b665d;
  --line: #ebe4d3;
  --sun: #f5a300;
  --sun-strong: #b86f00;
  --sun-soft: #fff3d1;
  --ok-ink: #2e6b2e; --ok-bg: #eef8ec;
  --err-ink: #8a1f1f; --err-bg: #fff0f0; --err-line: #f3c0c0;
  --focus: #2266cc;
  /* spacing tokens */
  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px;
  --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;
  /* radii (Tailwind) */
  --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 24px; --r-full: 9999px;
  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 24px; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--sun-strong); text-underline-offset: 3px; transition: color 300ms var(--ease); }
a:hover { color: #7d4b00; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-md); }

/* ---------- named text styles (Tailwind scale) ---------- */
.heading-1 { font-size: 60px; line-height: 60px; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.015em; }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-1 { font-size: 20px; line-height: 28px; font-weight: 500; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.body-7 { font-size: 18px; line-height: 28px; font-weight: 400; } /* lead paragraph */
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p, li { text-wrap: pretty; }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-200); }
.narrow { max-width: 760px; }
.skip-link { position: absolute; left: var(--s-200); top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); transition: transform 300ms var(--ease); }
.skip-link:focus { transform: translateY(76px); color: #fff; }

/* floating nav */
.site-header { position: sticky; top: var(--s-100); z-index: 40; display: flex; justify-content: center; padding: 0 var(--s-200); margin-top: var(--s-100); pointer-events: none; }
.nav-bar {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200);
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(160, 130, 60, 0.18); border-radius: var(--r-full);
  box-shadow: 0 8px 24px rgba(80, 55, 0, 0.08);
}
.brand { display: flex; align-items: center; gap: var(--s-75); text-decoration: none; color: var(--ink); }
.brand svg { width: 24px; height: 24px; color: var(--sun); }
.brand span { font-size: 16px; line-height: 24px; font-weight: 600; }
.site-nav { display: flex; gap: var(--s-50); }
.site-nav a {
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: var(--s-75) var(--s-100); border-radius: var(--r-full); transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--sun-soft); }
.menu-toggle { display: none; }

/* footer */
.site-footer { margin-top: var(--s-900); border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.site-footer .wrap { padding-top: var(--s-400); padding-bottom: var(--s-400); display: flex; flex-wrap: wrap; gap: var(--s-100) var(--s-400); justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* ---------- page header / hero ---------- */
.crumbs { margin: var(--s-400) 0 0; color: var(--muted); }
.crumbs a { color: var(--muted); }
.hero { padding: var(--s-400) 0 var(--s-300); }
.hero h1 {
  max-width: 680px;
  background: linear-gradient(90deg, #000000, #666666); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { max-width: 680px; color: var(--muted); margin: var(--s-200) 0 0; }
.hero-home { padding: var(--s-700) 0 var(--s-400); text-align: left; }

.content h2 { margin: var(--s-700) 0 var(--s-200); }
.content h3 { margin: var(--s-400) 0 var(--s-75); }
.content p, .content li { max-width: 720px; }
.content ol, .content ul { padding-left: var(--s-300); }
.content li { margin: var(--s-75) 0; }
.content code { background: var(--surface-2); padding: var(--s-25) var(--s-50); border-radius: var(--r-md); font-size: 14px; }
.note { color: var(--muted); }

/* ---------- buttons & inputs ---------- */
button, .btn, select, input[type="number"] {
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  border-radius: var(--r-lg); border: 1px solid #ddd2b9; background: var(--surface); color: var(--ink);
  padding: var(--s-75) var(--s-100);
}
select, input[type="number"] { font-weight: 500; }
button, .btn {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75);
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease);
}
button:hover, .btn:hover { background: #fff7e3; border-color: #d4b56a; }
button:active, .btn:active { transform: scale(0.98); }
button.primary { background: var(--sun); border-color: var(--sun); color: #1f1400; }
button.primary:hover { background: #ffb81f; border-color: #ffb81f; }
button.small, select.small { font-size: 14px; line-height: 20px; padding: var(--s-50) var(--s-75); border-radius: var(--r-md); }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
.icon { width: 20px; height: 20px; flex: none; }
button.small .icon { width: 16px; height: 16px; }

/* ---------- tool ---------- */
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl);
  padding: var(--s-300); margin: var(--s-200) 0 var(--s-400); box-shadow: 0 1px 2px rgba(60, 40, 0, 0.04), 0 12px 32px rgba(80, 55, 0, 0.05);
}
.pt-start { display: flex; gap: var(--s-200); flex-wrap: wrap; align-items: stretch; }
.drop {
  position: relative; flex: 1 1 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-75); text-align: center;
  border: 2px dashed #e2c779; border-radius: var(--r-2xl); background: var(--sun-soft); padding: var(--s-500) var(--s-200); cursor: pointer; min-height: 176px;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease);
}
.drop:hover, .drop.over { border-color: var(--sun-strong); background: #ffecb8; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .drop-icon { width: 40px; height: 40px; color: var(--sun-strong); }
.privacy-badge { display: inline-flex; align-items: center; gap: var(--s-50); color: var(--ok-ink); background: var(--ok-bg); border-radius: var(--r-full); padding: var(--s-25) var(--s-100); }
.privacy-badge .icon { width: 16px; height: 16px; }
.pt-sample-box { flex: 0 1 280px; display: flex; flex-direction: column; justify-content: center; gap: var(--s-75); }
.pt-error { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-ink); border-radius: var(--r-lg); padding: var(--s-100) var(--s-200); margin-top: var(--s-100); }

.pt-body {
  display: grid; gap: var(--s-300) var(--s-400); margin-top: var(--s-300);
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-areas: "controls chart" "controls details";
  align-items: start;
}
.pt-controls { grid-area: controls; display: flex; flex-direction: column; gap: var(--s-300); }
.pt-chartarea { grid-area: chart; min-width: 0; scroll-margin-top: 88px; }
#tools { scroll-margin-top: 88px; }
.pt-details { grid-area: details; min-width: 0; }
.pt-controls label { display: flex; flex-direction: column; gap: var(--s-75); font-size: 14px; line-height: 20px; font-weight: 600; }
.pt-controls label.check { flex-direction: row; align-items: center; gap: var(--s-75); font-weight: 500; }
.pt-controls .row { display: flex; gap: var(--s-100); align-items: center; }
.pt-controls input[type="range"] { flex: 1; accent-color: var(--sun-strong); }
.pt-controls input[type="number"] { width: 88px; padding: var(--s-50) var(--s-75); }
.pt-controls .hint { font-weight: 400; color: var(--muted); font-size: 12px; line-height: 16px; }
.pt-stats { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s-100); font-size: 14px; line-height: 20px; font-weight: 500; }
.pt-export { display: flex; flex-direction: column; gap: var(--s-75); }
.pt-brushbar { display: flex; gap: var(--s-100); align-items: center; justify-content: space-between; color: var(--muted); margin-bottom: var(--s-75); flex-wrap: wrap; }
.pt-chart-scroll { overflow: auto; max-height: 78vh; border: 1px solid var(--line); border-radius: var(--r-xl); background: #fff; }
#pt-chart { display: block; touch-action: none; }
.pt-details h3 { margin: var(--s-300) 0 var(--s-75); }
.pt-details h3:first-child { margin-top: 0; }
.palette { list-style: none; padding: 0; margin: var(--s-100) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-75); }
.palette li { display: flex; align-items: center; gap: var(--s-100); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s-75); transition: border-color 300ms var(--ease); }
.palette li.active { border-color: var(--sun-strong); box-shadow: 0 0 0 2px var(--sun-soft); }
.palette .swatch { width: 32px; height: 32px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.2); cursor: pointer; position: relative; flex: none; }
.palette .swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.palette .info { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; }
.palette code { font-size: 12px; color: var(--muted); }
.palette .count { color: var(--muted); font-size: 12px; }
.instr-actions { display: flex; gap: var(--s-75); flex-wrap: wrap; margin: var(--s-75) 0; }
.instructions { font-size: 14px; line-height: 20px; padding-left: 0; list-style: none; margin: 0; max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-xl); }
.instructions li { padding: var(--s-75) var(--s-100); border-bottom: 1px solid #f3eee2; margin: 0; max-width: none; }
.instructions .lbl { color: var(--muted); }
.instructions .run { white-space: nowrap; }
.instructions .run::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); border: 1px solid rgba(0, 0, 0, 0.25); margin-right: var(--s-50); vertical-align: -1px; }

/* ---------- home ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-300); margin: var(--s-300) 0; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); overflow: hidden;
  text-decoration: none; color: var(--ink); transition: transform 500ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: #e2c779; box-shadow: 0 12px 32px rgba(120, 80, 0, 0.1); color: var(--ink); }
.card:active { transform: translateY(-1px) scale(0.99); }
.card .thumb { aspect-ratio: 4 / 3; height: auto; background: var(--surface-2); display: block; width: 100%; object-fit: cover; image-rendering: pixelated; border-bottom: 1px solid var(--line); }
.card .card-body { padding: var(--s-300); display: flex; flex-direction: column; gap: var(--s-75); }
.card .tag { align-self: flex-start; background: var(--sun-soft); color: #7a4c00; border-radius: var(--r-full); padding: var(--s-25) var(--s-75); }
.card p { margin: 0; color: var(--muted); }
.benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-300); margin: var(--s-300) 0 0; padding: 0; list-style: none; }
.benefits li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-300); margin: 0; max-width: none; }
.benefits li b { display: block; margin-bottom: var(--s-75); }
.benefits li .icon { width: 24px; height: 24px; color: var(--sun-strong); margin-bottom: var(--s-100); }

.faq details { border-bottom: 1px solid var(--line); padding: var(--s-200) 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: var(--s-75) 0 0; color: var(--ink); }

/* ---------- hero layouts ---------- */
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-600); align-items: center; }
.hero-home { padding: var(--s-800) 0 var(--s-600); }
.eyebrow { margin: 0 0 var(--s-200); color: var(--sun-strong); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-cta { margin-top: var(--s-400); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-100); }
.hero-cta .proof { margin: 0; }
a.btn.primary-link {
  text-decoration: none; background: var(--sun); border-color: var(--sun); color: #1f1400; font-size: 18px; line-height: 28px;
  padding: var(--s-100) var(--s-300); border-radius: var(--r-full); box-shadow: 0 8px 24px rgba(245, 163, 0, 0.28);
}
a.btn.primary-link:hover { background: #ffb81f; border-color: #ffb81f; color: #1f1400; transform: translateY(-2px); }
a.btn.primary-link:active { transform: scale(0.98); }
.hero-art { margin: 0; }
.hero-art img { display: block; width: 100%; height: auto; border-radius: var(--r-3xl); box-shadow: 0 24px 64px rgba(120, 80, 0, 0.18); }
.hero-tool { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-400); }
.tool-art { margin: 0; }
.tool-art img { display: block; width: 100%; height: auto; border-radius: var(--r-2xl); box-shadow: 0 12px 32px rgba(120, 80, 0, 0.14); }

/* ---------- home sections ---------- */
.content h2 { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.content h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
.before-after .ba-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s-300); align-items: center; margin-top: var(--s-300); }
.before-after figure { margin: 0; display: flex; flex-direction: column; gap: var(--s-75); }
.ba-img { display: block; width: 100%; height: auto; border-radius: var(--r-2xl); border: 1px solid var(--line); background: #fff; }
.ba-img.chart { image-rendering: auto; }
.ba-arrow { font-size: 36px; line-height: 40px; color: var(--sun-strong); font-weight: 600; }
.steps { list-style: none; padding: 0; margin: var(--s-300) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-300); counter-reset: none; }
.steps li { display: flex; flex-direction: column; gap: var(--s-75); margin: 0; max-width: none; }
.step-n { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: var(--r-full); background: var(--ink); color: #fff; }
.benefits li { display: flex; flex-direction: column; }
.card .title-1 { color: var(--ink); }
.content .benefits, .content .steps { padding-left: 0; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity 400ms linear; }
  .card, .card:hover, button:active { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-home h1.heading-1 { font-size: 48px; line-height: 48px; }
}
@media (max-width: 860px) {
  .pt-body { grid-template-columns: 1fr; grid-template-areas: "chart" "controls" "details"; }
  .hero-split, .hero-tool { grid-template-columns: 1fr; gap: var(--s-400); }
  .hero-home { padding: var(--s-400) 0 var(--s-300); }
  .hero h1.heading-2, .hero-home h1.heading-1 { font-size: 36px; line-height: 40px; }
  .tool-art { display: none; }
  .content h2 { font-size: 24px; line-height: 32px; }
  .tool { padding: var(--s-200); border-radius: var(--r-2xl); }
  .before-after .ba-grid { grid-template-columns: 1fr; }
  .ba-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (max-width: 720px) {
  .nav-bar { width: 100%; justify-content: space-between; }
  .menu-toggle {
    display: inline-flex; width: 40px; height: 40px; padding: 0; border-radius: var(--r-full); border: 0; background: transparent; position: relative;
  }
  .menu-toggle span { position: absolute; left: 11px; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 500ms var(--ease), opacity 300ms var(--ease); }
  .menu-toggle span:nth-child(1) { transform: translateY(-5px); }
  .menu-toggle span:nth-child(3) { transform: translateY(5px); }
  .menu-open .menu-toggle span:nth-child(1) { transform: rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: rotate(-45deg); }
  .site-nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--s-200);
    padding: var(--s-900) var(--s-400); background: rgba(255, 252, 245, 0.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    opacity: 0; pointer-events: none; transition: opacity 500ms var(--ease);
  }
  .site-nav a { font-size: 30px; line-height: 36px; font-weight: 600; color: var(--ink); opacity: 0; transform: translateY(24px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
  /* backdrop-filter makes the bar a containing block for fixed children, so drop it while the full-screen menu is open */
  .menu-open .nav-bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; border-color: transparent; box-shadow: none; }
  .menu-open .site-nav { opacity: 1; pointer-events: auto; }
  .menu-open .site-nav a { opacity: 1; transform: none; }
  .menu-open .site-nav a:nth-child(2) { transition-delay: 60ms; }
  .menu-open .site-nav a:nth-child(3) { transition-delay: 120ms; }
  .menu-open .site-nav a:nth-child(4) { transition-delay: 180ms; }
  .menu-open .site-nav a:nth-child(5) { transition-delay: 240ms; }
}
@media print {
  .site-header, .site-footer, .pt-controls, .pt-start { display: none; }
}
