/* ---------------------------------------------------------------
   KinToTable — website styles
   Design tokens copied from the app (src/lib/theme.ts) so the site
   and the app read as one product.
   --------------------------------------------------------------- */

:root {
  color-scheme: light;

  --bg: #F6EFE5;
  --surface: #FFFDF8;
  --surface-2: #FBF6EC;
  --ink: #33261C;
  --ink-soft: #8A7663;
  --ink-faint: #BBAA96;
  --accent: #BE5B34;
  --accent-deep: #A34A27;
  --accent-soft: #F6E2D4;
  --gold: #DD9A33;
  --sage: #6F7F5B;
  --sage-soft: #E8EBDD;
  --line: #EDE3D3;
  --photo: #E7D7C2;

  /* The app's --ink-soft is a UI-chrome tone; on a page of running text it
     falls under WCAG AA. This is the same warm brown, darkened to ~6:1. */
  --ink-body: #675548;

  --radius: 22px;
  --shadow: 0 4px 14px rgba(90, 62, 40, 0.08);
  --shadow-lg: 0 18px 44px rgba(90, 62, 40, 0.14);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 720px; }

/* --- typography ------------------------------------------------ */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(38px, 6vw, 60px); }
h2 { font-size: clamp(28px, 4vw, 38px); }
h3 { font-size: 20px; letter-spacing: -0.2px; }

p { margin: 0 0 18px; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.lede {
  font-size: 19px;
  color: var(--ink-body);
  line-height: 1.65;
}

.muted { color: var(--ink-soft); }
.small { font-size: 14.5px; }

/* --- buttons --------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(190, 91, 52, 0.32);
}
.btn--primary:hover { background: var(--accent-deep); box-shadow: 0 9px 22px rgba(190, 91, 52, 0.36); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { background: #fff; }

/* --- header ---------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 239, 229, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(237, 227, 211, 0.8);
}
.site-head__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 700;
  font-size: 14.5px;
}
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* --- hero ------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 78px 0 88px;
}
.hero__copy { max-width: 520px; }
.hero h1 { margin-bottom: 20px; }
.hero .lede { margin-bottom: 30px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__note { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-body); font-weight: 600; }

/* --- phone mockup ---------------------------------------------- */

.phone-stage { display: flex; justify-content: center; }

.phone {
  position: relative;
  width: 300px;
  border-radius: 46px;
  padding: 11px;
  background: linear-gradient(160deg, #3b2c21, #241a13);
  box-shadow: var(--shadow-lg);
}
.phone__screen {
  position: relative;
  border-radius: 36px;
  overflow: hidden;
  background: var(--bg);
  padding: 22px 16px 16px;
  font-size: 13px;
}
.phone__notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  border-radius: 999px;
  background: #241a13;
  z-index: 3;
}
.phone__screen > * { position: relative; z-index: 1; }

.ui-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ui-date {
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: var(--accent);
}
.ui-greeting {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.4px;
  margin-top: 2px;
}
.ui-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-hero {
  height: 152px;
  border-radius: 20px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(120% 90% at 25% 15%, rgba(255, 214, 150, 0.55), transparent 60%),
    linear-gradient(150deg, #C4703F 0%, #9E4E2C 55%, #6E3A24 100%);
  box-shadow: var(--shadow);
}
.ui-badge {
  align-self: flex-start;
  background: rgba(255, 250, 242, 0.93);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 8.5px;
  letter-spacing: 0.7px;
}
.ui-hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 8px rgba(30, 17, 8, 0.5);
}
.ui-hero__sub {
  font-weight: 600;
  font-size: 10.5px;
  color: rgba(255, 248, 240, 0.95);
  margin-top: 3px;
  text-shadow: 0 1px 6px rgba(30, 17, 8, 0.5);
}
.ui-hero__sub b { color: #FFD98C; font-weight: 800; }

.ui-card {
  background: var(--surface);
  border: 1px solid rgba(237, 227, 211, 0.7);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.ui-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  font-size: 10.5px;
  color: var(--ink-soft);
}
.ui-stack { display: flex; }
.ui-stack span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  color: #fff;
  font-weight: 800;
  font-size: 8.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ui-stack span + span { margin-left: -7px; }

.ui-section {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
  margin: 16px 0 9px;
  letter-spacing: -0.2px;
}

.ui-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ui-row--today { border-color: var(--accent); border-width: 1.5px; }
.ui-slot {
  width: 46px;
  text-align: center;
  font-weight: 800;
  font-size: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent);
}
.ui-slot i { display: block; font-style: normal; font-size: 12px; margin-bottom: 1px; }
.ui-row__name { font-weight: 700; font-size: 11.5px; }
.ui-row__status { font-weight: 600; font-size: 9.5px; color: var(--ink-faint); }
.ui-row__status.done { color: var(--sage); }
.ui-row__icon {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-soft);
}
.ui-row__icon.done { background: var(--sage-soft); color: var(--sage); }

.ui-meals { display: flex; gap: 10px; }
.ui-meal { width: 88px; flex: none; }
.ui-meal__photo {
  height: 68px;
  border-radius: 13px;
  background: var(--photo);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.ui-meal__photo.a { background: linear-gradient(150deg, #E8C79B, #C98C57); }
.ui-meal__photo.b { background: linear-gradient(150deg, #DCC9A6, #A88A63); }
.ui-meal__photo.c { background: linear-gradient(150deg, #E3B39A, #B96E4C); }
.ui-meal__name { font-weight: 700; font-size: 10.5px; margin-top: 6px; }
.ui-stars { color: var(--gold); font-size: 9px; letter-spacing: 0.5px; }

/* --- sections -------------------------------------------------- */

.section { padding: 76px 0; }
.section--tint { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 620px; margin-bottom: 42px; }
.section__head p { margin-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(237, 227, 211, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 15px; color: var(--ink-body); line-height: 1.6; }

.card__icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.card__icon.sage { background: var(--sage-soft); }

/* steps */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step__num {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(190, 91, 52, 0.28);
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-body); font-size: 15px; }

/* privacy strip */

.pledge {
  background: var(--surface);
  border: 1px solid rgba(237, 227, 211, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}
.pledge ul {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
}
.pledge li {
  position: relative;
  padding-left: 30px;
  font-size: 15.5px;
  color: var(--ink-body);
  line-height: 1.55;
}
.pledge li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pledge li b { color: var(--ink); font-weight: 800; }

/* --- article pages --------------------------------------------- */

.page { padding: 60px 0 20px; }
.page h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 10px; }
.page__meta { font-size: 14px; color: var(--ink-body); font-weight: 700; letter-spacing: 0.3px; margin-bottom: 34px; }

.prose h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 28px; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; }
.prose p, .prose li { color: #4a3a2d; }
.prose ul { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }

.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 26px 0;
}
.callout p:last-child { margin-bottom: 0; }

.contact-card {
  background: var(--surface);
  border: 1px solid rgba(237, 227, 211, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin: 30px 0 10px;
  scroll-margin-top: 88px; /* clears the sticky header when linked to by #contact */
}
.contact-card > h2 { margin-bottom: 10px; }
.contact-card > p { color: var(--ink-body); }

/* --- contact form ---------------------------------------------- */
/* Fields mirror the app's Input component in src/components/ui.tsx:
   uppercase micro-label, 1.5px line border, 14px radius. */

.form { display: grid; gap: 18px; margin-top: 26px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { display: grid; gap: 7px; }
.field > label {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field > label .req { color: var(--accent); }

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 150px; }
.field select {
  appearance: none;
  cursor: pointer;
  /* caret drawn inline so nothing is fetched from another host */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238A7663' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); font-weight: 600; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(190, 91, 52, 0.16);
}

.field[data-invalid] input,
.field[data-invalid] select,
.field[data-invalid] textarea { border-color: #C2452B; }

.field__error {
  font-size: 13px;
  font-weight: 700;
  color: #A8351E;
  display: none;
}
.field[data-invalid] .field__error { display: block; }

/* keeps bots out; never shown to people */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form__foot .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.form__fine { margin: 0; font-size: 13px; color: var(--ink-body); flex: 1 1 220px; }

.form__status {
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  display: none;
}
.form__status[data-state] { display: block; }
.form__status[data-state='sending'] { background: var(--surface-2); color: var(--ink-body); }
.form__status[data-state='ok'] { background: var(--sage-soft); color: #3F4B32; }
.form__status[data-state='error'] { background: #F8E0D8; color: #8E2F1A; }

@media (max-width: 620px) {
  .contact-card { padding: 24px 20px; }
  .form__row { grid-template-columns: 1fr; }
}

/* --- footer ---------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 44px 0 52px;
  margin-top: 20px;
}
.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
}
.site-foot .brand { font-size: 17px; }
.site-foot nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-weight: 700;
  font-size: 14.5px;
}
.site-foot nav a { color: var(--ink-soft); }
.site-foot__legal {
  width: 100%;
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-top: 6px;
}

/* --- responsive ------------------------------------------------ */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 52px 0 64px; }
  .hero__copy { max-width: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .pledge { padding: 26px 22px; }
  .pledge ul { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .site-head__inner { gap: 12px; }
  .site-nav { gap: 16px; font-size: 13.5px; }
  .site-nav .hide-sm { display: none; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .site-foot nav { margin-left: 0; width: 100%; }
}

/* Small phones: the brand + nav and the 300px mockup are both wider than the
   viewport allows, so tighten the gutters, drop the least important nav link,
   and shrink the mockup. Support and Privacy stay — Apple's reviewers use them. */
@media (max-width: 430px) {
  .wrap { padding: 0 18px; }
  .site-head__inner { gap: 10px; }
  .brand { font-size: 17.5px; }
  .brand img { width: 30px; height: 30px; }
  .site-nav { gap: 14px; font-size: 13px; }
  .site-nav .hide-xs { display: none; }
  .phone { zoom: 0.92; }
}

@media (max-width: 360px) {
  .phone { zoom: 0.82; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
