:root {
  --canvas: #fbfefa; --surface: #ffffff; --ink: #19271e; --muted: #4e5e53; --line: #dcebdd; --glow: #7fe0a4; --tavi: #038801;
  --green: #0b5d32; --on-green: #ffffff; --apple: #a13424; --leaf: #e2f6e9; --bread: #fbebc8;
  --serif: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #141712; --surface: #1f241d; --ink: #eef1e8; --muted: #a9b7ac; --line: #333a31;
    --green: #86cfa1; --glow: #2f6b45; --on-green: #0c2416; --apple: #ff9c8a; --leaf: #23382a; --bread: #43361a;
  }
}
:root[data-theme="dark"] {
    --canvas: #141712; --surface: #1f241d; --ink: #eef1e8; --muted: #a9b7ac; --line: #333a31;
    --green: #86cfa1; --glow: #2f6b45; --on-green: #0c2416; --apple: #ff9c8a; --leaf: #23382a; --bread: #43361a;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: radial-gradient(90% 55% at 85% 0%, color-mix(in srgb, var(--glow) 30%, transparent), transparent 70%) fixed, radial-gradient(120% 70% at 20% 100%, color-mix(in srgb, var(--glow) 45%, transparent), transparent 70%) fixed, var(--canvas); color: var(--ink); font: 1.0625rem/1.55 var(--sans); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0 0 .6rem; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
a { color: var(--green); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
.lead { font-size: 1.2rem; color: var(--muted); }
.fine { font-size: .85rem; color: var(--muted); margin: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border: 0; border-radius: 12px; background: var(--leaf); color: var(--green); font: 600 1rem var(--sans);
  text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--green); color: var(--on-green); }
.button.quiet { background: var(--leaf); color: var(--green); }
.button.danger { background: transparent; color: var(--apple); }
.button:disabled { opacity: .45; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font: 700 1.2rem var(--serif); color: var(--ink); text-decoration: none; }
.brand img { object-fit: contain; flex: none; }
.masthead nav { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.masthead nav a:not(.button) { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 72px; align-items: center; padding: 40px 0 88px; }
.hero h1 { padding-top: .35em; }
/* Set up by motion.js; without it, or with Reduce Motion, text is simply there. */
.words > span { display: inline-block; opacity: 0; transform: translateY(.7em) rotate(5deg); transform-origin: 0 100%;
  transition: opacity .45s ease calc(var(--i) * 90ms), transform .75s cubic-bezier(.2,1.5,.4,1) calc(var(--i) * 90ms); }
.words.in > span { opacity: 1; transform: none; }
/* Point at a headline and its letters hop one after another in Tavi’s green. */
.ch { display: inline-block; position: relative; transition: color .3s; }
.words:hover .ch { color: var(--tavi, var(--green)); animation: hop .55s cubic-bezier(.3,.7,.4,1) calc(var(--c) * 32ms); }
@keyframes hop { 40% { transform: translateY(-.22em) rotate(-4deg); } 70% { transform: translateY(.04em); } }
.hatted { display: inline-block; position: relative; }
/* Sized from the W itself: its first two tips sit at .02–.55em and reach .88em up; the third starts at .79em.
   The hat's band covers 0–.61em, and the two tips are trimmed beneath it so no black shows over or around it. */
/* It sits at an angle, turning about the middle of its band; the trim under it slopes the same way. */
.hatted svg { position: absolute; left: -.146em; bottom: .7em; width: .86em; height: auto; rotate: -10deg; transform-origin: 52% 95%; pointer-events: none; }
.crown { display: inline-block; clip-path: polygon(-.5em .466em, .68em .258em, .68em -1em, 2em -1em, 2em 2em, -.5em 2em); }
.line { opacity: 0; translate: 0 18px; transition: opacity .6s ease calc(.25s + var(--i) * 110ms), translate .7s cubic-bezier(.2,.8,.2,1) calc(.25s + var(--i) * 110ms); }
.line.in { opacity: 1; translate: 0 0; }
.stage { position: relative; padding: 0 44px; animation: rise .9s .15s cubic-bezier(.2,.8,.2,1) backwards; }
/* Tavi hovers around the phone. */
.flyer { position: absolute; left: -26px; bottom: 90px; animation: hover 7s ease-in-out infinite; }
.flyer::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -14px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgb(3 70 20 / .28), transparent); pointer-events: none; }
.flyer svg { display: block; width: 104px; height: auto; }
.flyer .eye { transition: transform .12s ease-out; }
/* Following the page: placed by script, above everything but never in the way of a click. */
.flyer.travel { position: absolute; left: 0; top: 0; bottom: auto; z-index: 5; pointer-events: none; animation: none; will-change: transform; }
.flyer .body { will-change: transform; }
.flyer.roll .body { animation: roll .95s cubic-bezier(.5,0,.25,1); }
@keyframes roll { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* A blink: the eyes close and open again. */
.shut .eye path { animation: shut .26s ease-in-out; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes shut { 50% { transform: scaleY(.08); } }
/* Only Tavi itself takes clicks; the space around stays click-through. */
.flyer svg { cursor: pointer; pointer-events: auto; overflow: visible; }
/* What's under the hat. Hidden until a click; everything runs on one short clock (1.4s). */
.cloud, .shards, .mouth, .inside, .gpu, .idea, .food { opacity: 0; }
.open .hat { animation: hat-up 1.4s linear both; transform-box: fill-box; transform-origin: 50% 80%; }
.open .inside, .open .mouth { animation: shown 1.4s linear both; }
.open .eye path { animation: wide-eyed 1.4s linear both; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes hat-up {
  0% { transform: none; animation-timing-function: cubic-bezier(.2,.7,.4,1); }
  20% { transform: translate(var(--hx), var(--hy)) rotate(var(--hr)); animation-timing-function: ease-in-out; }
  66% { transform: translate(calc(var(--hx) * 1.1), calc(var(--hy) * 1.06)) rotate(calc(var(--hr) * 1.15)); animation-timing-function: cubic-bezier(.6,0,.9,.4); }
  86% { transform: translate(0, 0) rotate(var(--home, 0deg)); animation-timing-function: ease-out; }
  92% { transform: translate(0, -40px) rotate(calc(var(--home, 0deg) - 4deg)); animation-timing-function: ease-in; }
  100% { transform: translate(0, 0) rotate(var(--home, 0deg)); }
}
/* up and over, off to the left, off to the right, straight up in a full spin */
.show-blow { --hx: 130px; --hy: -640px; --hr: 22deg; }
.show-gpu { --hx: -640px; --hy: -300px; --hr: -65deg; }
.show-idea { --hx: 480px; --hy: -300px; --hr: 80deg; }
.show-food { --hx: -40px; --hy: -760px; --hr: 320deg; --home: 360deg; }
@keyframes shown { 0% { opacity: 0; } 5%, 72% { opacity: 1; } 84%, 100% { opacity: 0; } }
@keyframes wide-eyed { 0%, 100% { transform: none; } 12%, 70% { transform: scale(.72, 1.18); } }

/* 1. Mind blown */
.show-blow { animation: jolt .4s linear; }
.show-blow .cloud { animation: cloud 1.4s linear both; transform-origin: 600px 630px; }
.show-blow .shards { animation: shown 1.1s linear both; }
.show-blow .shards polygon { animation: shard 1.1s cubic-bezier(.15,.7,.35,1) both; transform-box: fill-box; transform-origin: 50% 50%; }
.s1 { --x: -250px; --y: -150px; --r: -220deg; }
.s2 { --x: 250px; --y: -160px; --r: 240deg; }
.s3 { --x: -200px; --y: -340px; --r: 160deg; }
.s4 { --x: 210px; --y: -330px; --r: -180deg; }
.s5 { --x: -90px; --y: -460px; --r: 300deg; }
.s6 { --x: 100px; --y: -450px; --r: -280deg; }
@keyframes cloud {
  0% { opacity: 0; transform: scale(.1); }
  6% { opacity: 1; }
  22% { opacity: 1; transform: scale(1.62, 1.45); }
  36% { transform: scale(1.4, 1.26); }
  66% { opacity: 1; transform: scale(1.48, 1.34); }
  86%, 100% { opacity: 0; transform: scale(.15); }
}
@keyframes shard { from { transform: none; } to { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.7); } }
@keyframes jolt { 20% { translate: -7px 3px; } 40% { translate: 7px -3px; } 60% { translate: -5px 0; } 80% { translate: 4px 1px; } }

/* 2. A graphics card where the brain should be, 3. a bright idea */
.pop-out { transform-origin: 600px 630px; }
.show-gpu .gpu, .show-idea .idea { animation: pop-out 1.4s linear both; }
.show-gpu .spin { animation: whirl .35s linear infinite; }
.show-idea .rays { animation: blink .35s ease-in-out infinite alternate; }
@keyframes pop-out {
  0% { opacity: 0; transform: scale(.15); }
  8% { opacity: 1; }
  24% { opacity: 1; transform: scale(1.46) translateY(-24px); }
  34% { transform: scale(1.28) translateY(-8px); }
  68% { opacity: 1; transform: scale(1.32) translateY(-16px); }
  86%, 100% { opacity: 0; transform: scale(.15); }
}
@keyframes whirl { to { transform: rotate(360deg); } }
@keyframes blink { from { opacity: .35; } to { opacity: 1; } }

/* 4. Dinner flies out */
.show-food .food { animation: shown 1.4s linear both; }
.show-food .food > g { animation: toss 1.2s cubic-bezier(.3,.6,.5,1) both; transform-box: fill-box; transform-origin: 50% 50%; }
.show-food .f1 { --x: -230px; --y: -300px; --r: -200deg; }
.show-food .f2 { --x: 20px; --y: -420px; --r: 340deg; animation-delay: .07s; }
.show-food .f3 { --x: 250px; --y: -260px; --r: 220deg; animation-delay: .14s; }
@keyframes toss {
  0% { transform: scale(.2); }
  45% { transform: translate(calc(var(--x) * .8), var(--y)) rotate(calc(var(--r) * .6)) scale(1.6); }
  70% { transform: translate(var(--x), calc(var(--y) * .85)) rotate(var(--r)) scale(1.45); }
  100% { transform: translate(0, 0) rotate(var(--r)) scale(.2); }
}

/* A phone: metal rim, black glass edge, side buttons, and the screen recording inside. */
.phone { --w: 300px; position: relative; width: var(--w); max-width: 100%; padding: calc(var(--w) * .012); border-radius: calc(var(--w) * .175);
  background: linear-gradient(145deg, #d9dcde, #6e7275 18%, #3b3e40 45%, #8b8f92 72%, #45484a);
  box-shadow: 0 1px 1px rgb(255 255 255 / .6) inset, 0 0 0 1px rgb(0 0 0 / .35), 0 50px 70px -30px rgb(6 60 28 / .45), 0 20px 30px -20px rgb(0 0 0 / .35); }
.phone::before, .phone::after { content: ""; position: absolute; width: 4px; border-radius: 3px; background: linear-gradient(90deg, #4a4d4f, #a4a8ab, #4a4d4f); }
/* Left: action button and volume. Right: side button. */
.phone::before { left: -3px; top: 17%; height: 4.5%; box-shadow: 0 calc(var(--w) * .24) 0 0 #6e7275, 0 calc(var(--w) * .46) 0 0 #6e7275; }
.phone::after { right: -3px; top: 28%; height: 13%; }
.screen { position: relative; padding: calc(var(--w) * .022); background: #050505; border-radius: calc(var(--w) * .165); }
.screen video { display: block; width: 100%; height: auto; aspect-ratio: 540 / 1172; object-fit: cover; border-radius: calc(var(--w) * .142); background: #fbfefa; }
/* A faint reflection across the glass. */
.screen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, rgb(255 255 255 / .16), transparent 26%); }
.moving .shot .phone { transform: perspective(1200px) rotateY(-16deg) rotateX(4deg) translateY(34px); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.moving .shot.flip .phone { transform: perspective(1200px) rotateY(16deg) rotateX(4deg) translateY(34px); }
.moving .shot .phone.arrived, .moving .shot.flip .phone.arrived { transform: perspective(1200px) rotateY(0) rotateX(0) translateY(0); }
.shot { display: grid; grid-template-columns: auto minmax(0, 440px); gap: 80px; align-items: center; justify-content: center; padding: 56px 0; }
.shot.flip { grid-template-columns: minmax(0, 440px) auto; }
.shot.flip .phone { order: 2; }
.shot p { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes hover {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  25% { transform: translate(22px, -34px) rotate(5deg); }
  50% { transform: translate(-4px, -58px) rotate(-3deg); }
  75% { transform: translate(-22px, -26px) rotate(7deg); }
}
.release { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 48px 0 64px; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); }
footer nav { display: flex; gap: 20px; }

/* Terms and privacy */
.legal { max-width: 760px; padding: 24px 0 72px; }
.legal h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2rem; }
.legal li { margin-bottom: .4rem; max-width: 62ch; }

/* Web kitchen */
.kitchen { padding-bottom: 96px; min-height: 70vh; }
.thread { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.thread li { max-width: 88%; padding: 10px 15px; border-radius: 18px; }
.thread .from-tavi { align-self: flex-start; }
.thread .from-you { background: var(--green); color: var(--on-green); align-self: flex-end; }
.thread .proposal { align-self: stretch; max-width: none; border: 1px solid var(--line); display: grid; gap: 12px; }
.kitchen h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.kitchen-status:empty { display: none; }
.kitchen-status { background: var(--leaf); border-radius: 12px; padding: 10px 14px; max-width: none; }
.tabs { display: flex; gap: 4px; margin: 4px 0 28px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--ink); border-radius: 999px; padding: 10px 18px; min-height: 44px; font: 600 1rem var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--green); color: var(--on-green); }
.week-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card { background: var(--surface); border-radius: 20px; padding: 22px; margin-bottom: 18px; max-width: 760px; }
.kitchen-items, .grocery-items { list-style: none; margin: 0; padding: 0; }
.kitchen-items li, .grocery-items li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.kitchen-items li:last-child, .grocery-items li:last-child { border-bottom: 0; }
.grocery-items label { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; min-height: 32px; cursor: pointer; }
.grocery-items input { width: 22px; height: 22px; accent-color: var(--green); }
.grocery-items input:checked + span { text-decoration: line-through; color: var(--muted); }
label { display: block; font-weight: 600; margin-bottom: 14px; }
label span { font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
label > input, label > textarea { display: block; width: 100%; margin-top: 6px; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.auth { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 56px; align-items: center; min-height: 66vh; padding: 24px 0 40px; }
.auth-tavi { display: block; width: 120px; height: auto; margin-bottom: 18px; animation: bob 4.5s ease-in-out infinite; filter: drop-shadow(0 16px 12px rgb(3 70 20 / .22)); }
.perks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; }
.perks li::before { content: "✓"; display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--leaf); color: var(--green); font-weight: 700; }
.auth .auth-card { margin: 0; padding: 32px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid color-mix(in srgb, var(--surface) 60%, var(--line)); box-shadow: 0 40px 70px -40px rgb(6 80 36 / .4); animation: rise .8s .15s cubic-bezier(.2,.8,.2,1) backwards; }
.auth-card .actions .button { flex: 1; }
.agree { margin-top: 16px; }
.auth-sub { margin: -6px 0 18px; color: var(--muted); }
.password { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.password input { flex: 1; min-width: 0; }
button.link { border: 0; background: none; color: var(--green); font: 600 1rem var(--sans); padding: 0 6px; min-height: 44px; cursor: pointer; }
button.link[hidden] { display: none; }
button.forgot { display: block; margin: -8px 0 0 auto; }
.auth-problem { color: var(--danger, #a13424); font-weight: 600; margin: 4px 0 10px; }
.auth-problem:empty { display: none; }
.button.wide { width: 100%; }
.switch { text-align: center; margin: 14px 0 0; }
.reset-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 48px; padding-bottom: 64px; }
.reset-page h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0; }
.reset-card { text-align: left; width: 100%; max-width: 420px; }
#password-field[hidden] { display: none; }
@keyframes bob { 50% { transform: translateY(-16px) rotate(5deg); } }
.chat { max-width: 760px; }
.chat .thread { min-height: 200px; }
.chat .from-tavi { background: var(--surface); }
.chat .proposal { background: var(--surface); }
.chat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.chat-head img { width: 56px; height: auto; }
.composer { display: flex; gap: 10px; }
.composer input { flex: 1; min-width: 0; background: var(--surface); }
.toggle { display: flex; gap: 10px; align-items: center; font-weight: 400; margin-top: 12px; }
.toggle input { min-height: 0; width: 20px; height: 20px; accent-color: var(--green); }
dialog { border: 0; border-radius: 20px; padding: 26px; background: var(--surface); color: var(--ink); max-width: min(440px, 100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .45); }

@media (max-width: 820px) {
  .hero, .auth, .shot, .shot.flip { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero { padding: 24px 0 56px; }
  .phone { --w: 262px; margin-inline: auto; }
  .stage { justify-self: center; padding: 0 18px; }
  .flyer { left: -10px; }
  .flyer svg { width: 80px; }
  /* On a phone the sign-in form comes up sooner. */
  .auth { min-height: 0; gap: 20px; padding-top: 8px; }
  .auth-tavi { width: 64px; margin-bottom: 10px; }
  .auth-words .perks { display: none; }
  .shot.flip .phone { order: 0; }
  .nav-extra { display: none !important; }
  .masthead nav { gap: 12px; }
}
@media (max-width: 420px) {
  .masthead .button { padding: 8px 12px; }
  .brand { font-size: 1.05rem; }
  .tabs button { padding: 8px 9px; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
