/* KinDee landing — "Calorie Ledger" brand (see KinDee/brand-theme.md) */
:root {
  --paper: #f8f7f2;
  --sheet: #fffdf8;
  --ink: #24322d;
  --ink-soft: #5d6862;
  --rule: #e1dbcd;
  --rule-faint: #ece6da;
  --pandan: #3f7d68;
  --pandan-deep: #285c50;
  --pandan-line: #72a493;
  --pandan-tint: #ddece6;
  --pandan-soft: #f0f7f3;
  --brick: #9a6234;
  --turmeric: #c58a2d;
  --danger: #b4534c;
  --on-accent: #ffffff;
  --shadow: 0 18px 40px rgba(37, 50, 46, 0.12);

  --sans: 'LINE Seed Sans TH', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --maxw: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #141a18;
    --sheet: #1b2320;
    --ink: #e6ece8;
    --ink-soft: #a2aea8;
    --rule: #33403b;
    --rule-faint: #27312d;
    --pandan: #7cc2a6;
    --pandan-deep: #a6dcc6;
    --pandan-line: #5c9c85;
    --pandan-tint: #1f3a31;
    --pandan-soft: #18261f;
    --brick: #d59a6a;
    --turmeric: #e0b35e;
    --danger: #e38a82;
    --on-accent: #0f1a16;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; line-height: 1.2; font-weight: 700; }
h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 700; line-height: 1.4; }
p { text-wrap: pretty; }
img { max-width: 100%; }
a { color: var(--pandan-deep); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--pandan); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 16px; top: -48px; background: var(--pandan); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--pandan); display: inline-flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  background: var(--pandan); color: var(--on-accent);
  font: inherit; font-weight: 700; text-decoration: none; border: 2px solid var(--pandan);
  cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--pandan-deep); border-color: var(--pandan-deep); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--pandan-deep); }
.btn-ghost:hover { background: var(--pandan-soft); color: var(--pandan-deep); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-faint);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { max-width: var(--maxw); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; }
.brand img { border-radius: 9px; }
.nav-links { list-style: none; display: flex; gap: 22px; margin: 0 0 0 auto; padding: 0; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}

main > section { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }
main > section + section { margin-top: clamp(72px, 10vw, 120px); }
.section-head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 62ch; }
.section-head p:not(.eyebrow) { color: var(--ink-soft); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 72px); align-items: center;
  padding-block: clamp(40px, 7vw, 88px) 0;
}
.hero-copy { display: grid; gap: 20px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -0.02em; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-soft); max-width: 36em; }
.lede b { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: 14px; color: var(--ink-soft); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--pandan); box-shadow: 0 0 0 0 var(--pandan-line); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pandan) 45%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* The ledger slip */
.slip {
  margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px;
  padding: 22px 24px 18px; box-shadow: var(--shadow); transform: rotate(1.2deg);
}
.slip-head { display: flex; justify-content: space-between; font-weight: 700; padding-bottom: 12px; border-bottom: 1px solid var(--rule); color: var(--ink-soft); font-size: 14px; }
.slip-rows { list-style: none; margin: 0; padding: 0; }
.slip-rows li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule-faint); }
.slip-rows li span:first-child { font-weight: 700; }
.slip-rows small { font-weight: 400; color: var(--ink-soft); margin-left: 6px; font-size: 14px; }
.slip-rows .mono { color: var(--brick); font-size: 17px; }
.slip-rows .credit .mono { color: var(--pandan); }
.slip-rows li { opacity: 1; animation: ink-in .5s ease-out both; }
.slip-rows li:nth-child(2) { animation-delay: .15s; }
.slip-rows li:nth-child(3) { animation-delay: .3s; }
.slip-rows li:nth-child(4) { animation-delay: .45s; }
.slip-rows li:nth-child(5) { animation-delay: .6s; }
@keyframes ink-in { from { opacity: .35; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.slip-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding-top: 12px; border-top: 3px double var(--ink);
  font-weight: 700; font-size: 18px;
}
.slip-total .mono { font-size: 30px; color: var(--pandan-deep); }
.slip-total small { font-size: 14px; color: var(--ink-soft); }
.meter { margin-top: 14px; height: 8px; background: var(--pandan-tint); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--pandan); border-radius: 4px; }
.slip figcaption { margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .slip { transform: none; max-width: 460px; }
}

/* Why */
.why { display: grid; gap: 28px; }
.why h2 { max-width: 22ch; }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.why-grid article { padding: 24px 24px 8px 0; display: grid; gap: 8px; align-content: start; }
.why-grid article + article { padding-left: 24px; border-left: 1px solid var(--rule); }
.why-grid p { color: var(--ink-soft); }
@media (max-width: 760px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-grid article, .why-grid article + article { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 22px; display: grid; gap: 8px; align-content: start; }
.feature svg { width: 36px; height: 36px; padding: 6px; border-radius: 10px; background: var(--pandan-tint); fill: none; stroke: var(--pandan-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--ink-soft); font-size: 15px; }

/* How — a real sequence, so numbered */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; padding-top: 20px; border-top: 3px solid var(--pandan); }
.steps li::before { content: counter(step); font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--pandan); }
.steps p { color: var(--ink-soft); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Plans */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--sheet); }
.plan-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.plan-table th, .plan-table td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--rule-faint); }
.plan-table thead th { font-size: 16px; padding-block: 18px; }
.plan-table tbody th { text-align: left; font-weight: 400; color: var(--ink-soft); }
.plan-table tbody tr:last-child > * { border-bottom: 0; }
.plan-table .pick { background: var(--pandan-soft); }
.plan-table thead .pick { color: var(--pandan-deep); box-shadow: inset 0 3px 0 var(--pandan); }

/* Privacy */
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.privacy-list li { background: var(--pandan-soft); border-radius: 14px; padding: 20px 22px; color: var(--ink-soft); }
.privacy-list b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
@media (max-width: 700px) { .privacy-list { grid-template-columns: 1fr; } }

/* FAQ */
.faq-list { display: grid; border-top: 1px solid var(--rule); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 700; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 6px; top: 14px; font-family: var(--mono); font-size: 22px; color: var(--pandan); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding-bottom: 18px; color: var(--ink-soft); max-width: 68ch; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact-copy { display: grid; gap: 12px; }
.contact-copy p:not(.eyebrow) { color: var(--ink-soft); }
.select { user-select: all; color: var(--ink); }
.contact-form { background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; padding: 24px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--rule); border-radius: 10px; padding: 11px 14px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--pandan); box-shadow: 0 0 0 3px var(--pandan-tint); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; color: var(--ink-soft); align-items: start; }
.consent input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--pandan); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.7em; font-size: 15px; }
.form-status.ok { color: var(--pandan-deep); font-weight: 700; }
.form-status.err { color: var(--danger); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* Footer */
.site-footer {
  max-width: var(--maxw); margin: clamp(72px, 10vw, 120px) auto 0; padding: 28px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule); display: grid; gap: 8px; font-size: 14px; color: var(--ink-soft);
}
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.foot-brand img { border-radius: 7px; }
