/* Tata's Kitchen. Big letters, big buttons, words on every button.
   His colours: navy and brown, with Cardinals red for the main action. */

@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --navy: #1B2A4A;
  --navy-dark: #0F1830;
  --brown: #7A5230;
  --tan: #F3E9DC;
  --tan-line: #D9C3A5;
  --red: #97233F;
  --red-dark: #7E1D33;
  --gold: #F5B82E;
  --ground: #FAF6F0;
  --white: #FFFFFF;
  --muted: #545866;
  --k: 1;
  color-scheme: light;
}
html[data-size="1"] { --k: 1.12; }
html[data-size="2"] { --k: 1.26; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--k)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--navy);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.375rem;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 2.25rem; line-height: 1.08; }
h2 { font-size: 1.6rem; line-height: 1.15; }
a { color: var(--navy); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 4.25rem; padding: .4rem 1.2rem;
  border-radius: 16px; border: 3px solid var(--navy);
  background: var(--white); color: var(--navy);
  font-size: 1.35rem; font-weight: 700; text-decoration: none; text-align: center; line-height: 1.15;
  cursor: pointer;
}
.btn svg { flex: none; width: 1.4em; height: 1.4em; }
.btn:active { transform: translateY(1px); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-tan { background: var(--tan); }
.btn-big { min-height: 5.25rem; font-size: 1.6rem; border-radius: 18px; }
.btn-icon { min-width: 4.25rem; padding: 0; }
.btn[aria-pressed="true"].btn-toggle { background: var(--tan); }
.btn-wide { width: 100%; }
.back { align-self: flex-start; padding-left: .7rem; }

.tile {
  flex: none; width: 3.9rem; height: 3.9rem; border-radius: 14px; background: var(--tan);
  display: inline-flex; align-items: center; justify-content: center;
}
.tile img { width: 78%; height: 78%; }

.eyebrow { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.sub { color: var(--brown); font-size: 1.3rem; }
.muted { color: var(--muted); }
.small { font-size: 1rem; line-height: 1.4; }
.box { background: var(--white); border: 2px solid var(--tan-line); border-radius: 20px; }

/* ---------- home ---------- */
.home-head { display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark { width: 4.2rem; height: 4.2rem; flex: none; }
.brand h1 { font-size: 2.3rem; }

.find { display: flex; flex-direction: column; gap: 8px; }
.find label { font-size: 1.25rem; font-weight: 700; }
.find-row { display: flex; gap: 10px; }
.find input {
  flex: 1; min-width: 0; height: 4.25rem; border-radius: 16px; border: 3px solid var(--navy);
  padding: 0 1rem; background: var(--white); font-size: 1.35rem;
}
.find input::placeholder { color: #6B6F7C; }
.hint { font-size: 1.1rem; color: var(--muted); }

.size { display: flex; align-items: center; gap: 10px; }
.size > span { font-size: 1.2rem; font-weight: 700; flex: 1; }
.size button {
  width: 4rem; height: 4rem; border-radius: 14px; border: 3px solid var(--navy);
  background: var(--white); color: var(--navy); font-weight: 700; cursor: pointer;
}
.size button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.size button:nth-of-type(1) { font-size: 20px; }
.size button:nth-of-type(2) { font-size: 26px; }
.size button:nth-of-type(3) { font-size: 32px; }

.home-main { display: flex; flex-direction: column; gap: 26px; }
.pick { overflow: hidden; display: flex; flex-direction: column; }
.pick-pic { position: relative; background: var(--tan); }
.pick-pic img.photo { display: block; width: 100%; height: 14rem; object-fit: cover; }
.pick-pic img.card { display: block; width: 100%; height: 14rem; object-fit: cover; object-position: top; background: #fff; }
.pick-pic .tile { position: absolute; left: 14px; bottom: -1.4rem; width: 4.4rem; height: 4.4rem; border: 3px solid var(--white); }
.pick-body { padding: 1.9rem 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pick-body h2 { font-size: 2rem; }
.pick-body .btn { margin-top: auto; }
.pick-body .credit { font-size: .85rem; color: var(--muted); }

.kinds h2 { margin-bottom: 12px; }
.kind-list { display: flex; flex-direction: column; gap: 10px; }
.kind {
  display: flex; align-items: center; gap: 14px; min-height: 5.2rem; padding: 10px 14px 10px 10px;
  border-radius: 18px; border: 2px solid var(--navy); background: var(--white); text-decoration: none;
}
.kind-text { flex: 1; display: flex; flex-direction: column; }
.kind-label { font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.kind-count { font-size: 1.05rem; color: var(--brown); }
.chev { flex: none; width: 1.6rem; height: 1.6rem; }

.saved-box { background: var(--tan); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.foot { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 8px; border-top: 2px solid var(--tan-line); }

/* ---------- lists ---------- */
.list-head { display: flex; flex-direction: column; gap: 12px; }
.list-title { display: flex; align-items: center; gap: 14px; }
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rrow {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; min-height: 5.6rem;
  border-radius: 18px; border: 2px solid var(--navy); background: var(--white); text-decoration: none;
}
.rrow .thumb { flex: none; width: 5.4rem; height: 5.4rem; border-radius: 12px; overflow: hidden; background: var(--tan); display: flex; align-items: center; justify-content: center; position: relative; }
.rrow .thumb img.card { width: 100%; height: 100%; object-fit: cover; object-position: top left; background: #fff; }
.rrow .thumb img.draw { width: 78%; height: 78%; }
.rrow .thumb .badge { position: absolute; right: 3px; bottom: 3px; width: 2.1rem; height: 2.1rem; border-radius: 9px; background: var(--tan); display: flex; align-items: center; justify-content: center; }
.rrow .thumb .badge img { width: 80%; height: 80%; }
.rrow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rrow-title { font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.rrow-prev { font-size: 1.02rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { font-size: 1.3rem; }

/* ---------- recipe ---------- */
/* On a phone it's one column in cooking order: title, buttons, his lines, then his card. */
.recipe-grid { display: flex; flex-direction: column; gap: 18px; }
.recipe-side, .recipe-main { display: contents; }
.recipe-grid .photo-fig { order: 1; }
.recipe-grid .recipe-head { order: 2; }
.recipe-grid .actions { order: 3; }
.recipe-grid .lines-head { order: 4; margin-top: 8px; }
.recipe-grid .lines { order: 5; }
.recipe-grid .lines-note { order: 6; }
.recipe-grid .hiscard, .recipe-grid .no-card { order: 7; }
.recipe-grid .switch { order: 8; }
.recipe-grid .size { order: 9; }
.recipe-grid .more { order: 10; }
.recipe-head { display: flex; flex-direction: column; gap: 6px; }
.recipe-head h1 { font-size: 2.6rem; }
.photo-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-fig img { display: block; width: 100%; max-height: 22rem; object-fit: cover; border-radius: 20px; }
.photo-fig figcaption { font-size: .9rem; color: var(--muted); }
.actions { display: flex; flex-direction: column; gap: 12px; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hiscard { margin: 0; background: var(--tan); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.hiscard img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; }
.hiscard figcaption { font-weight: 700; color: var(--brown); font-size: 1.2rem; }
.no-card { background: var(--tan); border-radius: 20px; padding: 18px; display: flex; align-items: center; gap: 14px; font-size: 1.1rem; }

.lines-head { display: flex; flex-direction: column; gap: 4px; }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.line {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 5rem; padding: 8px 12px 8px 8px;
  border-radius: 18px; border: 2px solid var(--navy); background: var(--white); text-align: left; cursor: pointer;
}
.line .tile { width: 3.7rem; height: 3.7rem; }
.line .tile.empty-tile { background: transparent; }
.line-text { flex: 1; min-width: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.line .check {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 9px; border: 3px solid var(--navy); background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.line .check svg { width: 1.6rem; height: 1.6rem; opacity: 0; }
.line.done { background: var(--tan); }
.line.done .line-said { text-decoration: line-through; text-decoration-thickness: 3px; }
.line.done .check { background: var(--navy); }
.line.done .check svg { opacity: 1; }
.struck { color: #7C7F89; text-decoration-thickness: 2px; font-weight: 400; }
.helper { font-weight: 400; color: var(--brown); }
.aside { display: block; font-size: 1rem; font-weight: 400; font-style: italic; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--tan); color: var(--navy); }
.chip svg { width: 1.1em; height: 1.1em; }
.lines-note { font-size: 1.05rem; color: var(--muted); }

.switch {
  display: flex; align-items: center; gap: 14px; min-height: 4.6rem; padding: 10px 16px; width: 100%;
  border-radius: 18px; border: 3px solid var(--navy); background: var(--white); text-align: left; cursor: pointer;
}
.switch .label { flex: 1; font-size: 1.3rem; font-weight: 700; }
.switch .track { flex: none; width: 4.2rem; height: 2.4rem; border-radius: 1.2rem; background: #E4E1DC; border: 3px solid var(--navy); position: relative; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--navy); transition: left .15s; }
.switch[aria-checked="true"] .track { background: var(--red); }
.switch[aria-checked="true"] .knob { left: calc(100% - 1.6rem - 3px); background: var(--white); }

.more { display: flex; flex-direction: column; gap: 10px; }

/* ---------- zoom ---------- */
.zoom { position: fixed; inset: 0; z-index: 50; background: var(--navy); display: flex; flex-direction: column; }
.zoom-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--white); flex-wrap: wrap; }
.zoom-bar .title { flex: 1; font-size: 1.3rem; font-weight: 700; min-width: 8rem; }
.zoom-bar .btn { min-height: 3.8rem; }
.zoom-pane { flex: 1; overflow: auto; padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }
.zoom-pane img { display: block; margin: 0 auto; border-radius: 8px; background: #fff; max-width: none; }

/* ---------- cooking ---------- */
.cook { max-width: 1180px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.cook-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cook-top .name { flex: 1; text-align: right; font-size: 1.3rem; font-weight: 700; min-width: 0; }
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress .count { font-size: 1.35rem; font-weight: 700; }
.bar { height: 14px; border-radius: 7px; border: 2px solid var(--navy); background: var(--white); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--navy); }
.cook-body { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.cook-pics { display: flex; gap: 14px; justify-content: center; align-items: center; padding: 14px; border-radius: 22px; background: var(--tan); min-height: 9rem; }
.cook-pics img { width: 7rem; height: 7rem; }
.cook-step { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 22px 20px; border-radius: 22px; background: var(--white); border: 3px solid var(--navy); }
.cook-step .said { font-size: 2.5rem; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.cook-step .helper { font-size: 1.6rem; }
.cook-step .aside { font-size: 1.15rem; }
.cook-step .chips .chip { font-size: 1.2rem; padding: 6px 14px; }
.timer-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.timer-btns .btn { flex: 1 1 10rem; }
.cook-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.cook-nav .btn { min-height: 5.8rem; font-size: 1.65rem; }
.cook-done { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.cook-done .box { padding: 28px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; border: 3px solid var(--navy); }
.cook-done img { width: 6rem; height: 6rem; }
.cook-done h1 { font-size: 2.6rem; }

/* ---------- timer bar ---------- */
#timerbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--navy); color: var(--white); box-shadow: 0 10px 30px rgba(15, 24, 48, .35); max-width: calc(100vw - 20px);
}
#timerbar .t { font-size: 1.35rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#timerbar button { min-height: 3.4rem; padding: 0 16px; border-radius: 999px; border: none; background: var(--white); color: var(--navy); font-weight: 700; font-size: 1.1rem; cursor: pointer; }
#timerbar.ring { background: var(--red); animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { transform: translateX(-50%) scale(1.04); } }
body.has-timer .wrap, body.has-timer .cook { padding-top: 5.2rem; }

/* ---------- about ---------- */
.prose { display: flex; flex-direction: column; gap: 14px; max-width: 46rem; }
.prose p { line-height: 1.5; }
.gloss { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gloss li { background: var(--tan); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gloss b { color: var(--navy); }
.credits-list { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; line-height: 1.4; color: var(--muted); }
.credits-list a, .photo-fig figcaption a, .pick-body .credit a { color: inherit; }

/* ---------- an iPad held upright: lists two to a row ---------- */
@media (min-width: 640px) and (max-width: 899px) {
  .wrap { padding: 24px 28px 48px; }
  .kind-list, .rlist { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .pick-pic img.photo, .pick-pic img.card { height: 16rem; }
}

/* ---------- tablet and computer ---------- */
@media (min-width: 900px) {
  .wrap { padding: 28px 40px 56px; gap: 28px; }
  .home-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand size" "find find"; align-items: end; gap: 20px 28px; }
  .brand { grid-area: brand; }
  .size { grid-area: size; }
  .find { grid-area: find; }
  .home-main { display: grid; grid-template-columns: 26rem 1fr; gap: 28px; align-items: start; }
  .pick { position: sticky; top: 20px; }
  .pick-pic img.photo, .pick-pic img.card { height: 17rem; }
  .kind-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 14px; }
  .kind { flex-direction: column; justify-content: center; text-align: center; padding: 16px 10px; min-height: 12rem; gap: 10px; }
  .kind .tile { width: 5.6rem; height: 5.6rem; border-radius: 20px; }
  .kind-text { align-items: center; }
  .kind .chev { display: none; }
  .rlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 16px; }
  .rrow { flex-direction: column; align-items: stretch; padding: 10px; gap: 10px; }
  .rrow .thumb { width: 100%; height: 11rem; }
  .rrow .thumb .badge { width: 3.2rem; height: 3.2rem; right: 8px; bottom: 8px; }
  .rrow .chev { display: none; }
  .rrow-text { padding: 0 6px 6px; }
  .rrow-prev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .recipe-grid { display: grid; grid-template-columns: 26rem 1fr; gap: 32px; align-items: start; }
  .recipe-side, .recipe-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .recipe-side { position: sticky; top: 20px; }
  .recipe-head h1 { font-size: 2.9rem; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions > .btn-red { grid-column: 1 / -1; }
  .cook { padding: 24px 40px 28px; gap: 18px; }
  .cook-body { display: grid; grid-template-columns: minmax(18rem, 30rem) 1fr; gap: 24px; }
  .cook-pics { flex-direction: row; min-height: 0; }
  .cook-pics img { width: 11rem; height: 11rem; }
  .cook-step .said { font-size: 3.2rem; }
  .cook-nav { grid-template-columns: 1fr 2fr; }
  .cook-done { flex-direction: row; align-items: stretch; }
  .cook-done .box { flex: 1; justify-content: center; }
  .cook-done .after { width: 25rem; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .cook-pics img { width: 8rem; height: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .btn, .find, .size, .switch, #timerbar, .actions, .back, .foot, .more { display: none !important; }
  body { background: #fff; font-size: 14pt; }
  .recipe-grid { display: block; }
  .line { border: none; min-height: 0; padding: 2px 0; }
  .line .check { display: none; }
  .hiscard { break-inside: avoid; }
}
