/* pizzatime DELIVERY tracker, stage 1 — the page: tokens (primitive → semantic), the tomato nav, the hero (a sky
   gradient for now) with its title, the ETA chip and the frosted-glass order panel (the four-knob progress, the courier
   card), the order section, the footer; on a phone the panel becomes a bottom sheet. Light only: the OS colour scheme is
   never read. */
:root {
  color-scheme: light;
  /* primitives (sampled from the concept, nudged for 4.5:1 text contrast) */
  --tomato-400: #e5502f; --tomato-500: #d4432a; --tomato-600: #c2311e; --brick-700: #8a2511;
  --cream-50: #fffaf1; --cream-100: #fbf2e3; --cream-200: #f6e8d2; --cream-300: #ecdcc4; --track: #e6d8be;
  --basil-400: #739855; --basil-500: #5b8a3c; --basil-600: #4e7d32; --basil-700: #46722c;
  --ink-900: #2d211b; --ink-700: #4a3a31; --ink-500: #6f5f52; --white: #fff;
  /* semantic */
  --bg: var(--cream-100); --surface: var(--cream-50); --surface-2: var(--cream-200); --line: #e7d6bd;
  --text: var(--ink-900); --text-2: var(--ink-700); --muted: var(--ink-500);
  --brand: var(--tomato-500); --on-brand: var(--white); --title: var(--brick-700);
  --ok: var(--basil-600); --ok-text: var(--basil-700); --focus: #1c64d8;
  --radius: 14px; --radius-lg: 20px; --shadow: 0 1px 0 rgba(90, 50, 20, .05), 0 10px 30px -14px rgba(90, 50, 20, .28);
  --display: 'Outfit', ui-rounded, system-ui, sans-serif; --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--ui); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--white); color: var(--text); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }

/* ------------------------------------------------------------------ nav */
.nav { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.nav-in { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 600 22px/1 var(--display); letter-spacing: -.01em; min-height: 44px; }
.brand-mark { width: 30px; height: 30px; }
.nav-links { margin-left: auto; }
.nav-links ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 10px; opacity: .92; }
.nav-links a:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.nav-links a[aria-current=page] { opacity: 1; font-weight: 600; box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .85); border-radius: 0; }
.nav-icon { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--on-brand); cursor: pointer; place-items: center; position: relative; }
.nav-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon:hover { background: rgba(255, 255, 255, .14); }

/* ------------------------------------------------------------------ title + board */
/* v2: the scene is a full-bleed hero; the order panel floats over it as frosted glass */
.hero { --panel-w: 400px; --gut: 24px; position: relative; height: clamp(600px, calc(100svh - 64px), 980px); overflow: hidden; outline: none; isolation: isolate; }
.title { position: absolute; z-index: 3; top: 22px; left: 250px; right: calc(var(--panel-w) + var(--gut) * 2); text-align: center; line-height: .9; pointer-events: none; }
.title .t1 { display: block; font: 800 clamp(40px, 4.4vw, 66px)/.92 var(--display); color: var(--title); text-transform: uppercase; letter-spacing: .005em; text-shadow: 0 2px 18px rgba(251, 242, 227, .85); }
.title .t2 { display: block; font: 500 clamp(26px, 2.6vw, 38px)/1 var(--display); color: var(--ink-700); letter-spacing: .01em; margin-top: 2px; text-shadow: 0 2px 14px rgba(251, 242, 227, .9); }
/* glass surfaces */
.glass { background: rgba(255, 250, 241, .74); -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35); box-shadow: 0 18px 50px -24px rgba(60, 30, 10, .45), inset 0 0 0 1px rgba(255, 255, 255, .55); }
/* the scene: 3D canvas (or the SVG fallback) covering the hero */
.scene { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(120% 95% at 40% 25%, var(--sky-a, #fbf1e1), var(--sky-b, #f3e1c6)); contain: layout paint; transition: background .8s; }

/* ETA chip (outside the world layer: never scaled, always sharp) */
.eta { position: absolute; right: calc(var(--panel-w) + var(--gut) * 2); bottom: calc(var(--gut) + 74px); z-index: 3; background: var(--white); border-radius: 12px; padding: 8px 14px 9px; box-shadow: 0 6px 18px -8px rgba(40, 20, 10, .45), 0 0 0 1px rgba(0, 0, 0, .04); min-width: 112px; }
.eta-k { display: flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--ui); color: var(--text-2); }
.eta-v { display: block; font: 700 26px/1.1 var(--ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--tomato-400); flex: none; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--tomato-400); animation: ping 1.8s ease-out infinite; will-change: transform, opacity; }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* the floating order panel */
.panel { position: absolute; z-index: 4; top: var(--gut); right: var(--gut); max-height: calc(100% - var(--gut) * 2); width: var(--panel-w); display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 20px; border-radius: 24px; overflow: auto; overscroll-behavior: contain; container-type: inline-size; scrollbar-width: thin; }
.panel-more { display: flex; flex-direction: column; gap: 14px; }
.sheet-grab, .sheet-eta { display: none; }
.order-line { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); flex-wrap: wrap; }
.order-line b { color: var(--text); font-weight: 600; }
.pill-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; background: #fde3da; color: var(--tomato-600); font: 700 12px/1 var(--ui); text-transform: uppercase; letter-spacing: .06em; }
.status-h { font: 700 clamp(25px, 2.3vw, 31px)/1.12 var(--display); letter-spacing: -.01em; color: var(--ink-900); text-wrap: balance; }
.status-sub { color: var(--text-2); font-size: 15.5px; margin-top: -8px; }

/* the four-knob tracker (concept: thick rounded track, round knobs, tomato in the kitchen, basil on the road) */
.steps { --c: var(--tomato-500); list-style: none; margin: 6px 0 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); height: 64px; }
.steps .track { position: absolute; left: 11px; right: 11px; top: 11px; height: 12px; border-radius: 6px; background: var(--track); overflow: hidden; }
.steps .fill { position: absolute; inset: 0; border-radius: 6px; background: var(--c); transform-origin: 0 50%; transform: scaleX(var(--share, .6)); transition: background .5s; }
.steps li[data-step] { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.steps li[data-step]:first-child { align-items: flex-start; } .steps li[data-step]:nth-child(4) { align-items: flex-end; }
.knob { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--track); transition: background .4s, transform .4s var(--ease); }
.knob::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; background: var(--c); opacity: 0; transform: scale(.7); transition: opacity .4s, transform .4s var(--ease); }
.steps li[aria-current=step] .knob { background: var(--c); transform: scale(1.12); }
.steps li[aria-current=step] .knob::before { opacity: .22; transform: scale(1); }
.step-l { font: 500 14px/1.2 var(--ui); color: var(--muted); white-space: nowrap; }
.steps li[aria-current=step] .step-l { color: var(--ink-900); font-weight: 700; }
.steps li[data-step]:first-child .knob { margin-left: -1px; }

.courier { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px rgba(231, 214, 189, .8); }
.avatar svg { width: 48px; height: 48px; }
.courier-n { font-weight: 600; } .rating { color: #b7741c; font-weight: 600; font-size: 13.5px; margin-left: 4px; }
.courier-s { font-size: 14px; color: var(--muted); }
.courier-a { display: flex; gap: 8px; }
@container (max-width: 470px) {
  .courier { grid-template-columns: 48px 1fr; row-gap: 10px; }
  .courier-a { grid-column: 1 / -1; } .courier-a > * { flex: 1; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .2s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--white); color: var(--ink-900); box-shadow: 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: 0 0 0 1px #d6c0a0, 0 4px 10px -6px rgba(0, 0, 0, .25); }

/* ------------------------------------------------------------------ stage tiles */
/* below-the-fold sections skip style/layout/paint until they are near the viewport */
.order, .foot { content-visibility: auto; contain-intrinsic-size: auto 560px; }
.eta, .status-sub { contain: layout paint; }
/* small layers of their own: their per-frame repaints (slider, ETA text, knob colour fades) stay small */
.steps, .eta { will-change: transform; }
.order { max-width: 1240px; margin: 0 auto; padding: 36px 24px 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { font: 700 26px/1.1 var(--display); color: var(--ink-900); }
.sec-head p { color: var(--muted); font-size: 15px; }

/* ------------------------------------------------------------------ order details */
.order-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: 0 0 0 1px var(--line); display: grid; gap: 6px; align-content: start; }
.card h3 { font: 600 13px/1.2 var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.card h3.mt { margin-top: 12px; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.items li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: baseline; }
.items .q { font-weight: 700; color: var(--tomato-600); }
.items .n { font-weight: 600; } .items .d { display: block; font-size: 13.5px; color: var(--muted); font-weight: 400; }
.items .p { font-variant-numeric: tabular-nums; }
.totals { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14.5px; color: var(--text-2); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; color: var(--ink-900); font-size: 16px; }
.addr { font-weight: 600; }
.link { color: var(--tomato-600); font-weight: 600; text-underline-offset: 3px; display: inline-flex; min-height: 44px; align-items: center; }

.foot { max-width: 1240px; margin: 28px auto 0; padding: 22px 24px 40px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .hero { --panel-w: 360px; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-icon { display: grid; }
  .nav-in { height: 58px; padding: 0 10px; justify-content: space-between; }
  .brand { font-size: 20px; }
  .nav-links.is-open { display: block; position: absolute; left: 0; right: 0; top: 58px; background: var(--brand); padding: 6px 12px 14px; box-shadow: 0 12px 20px -12px rgba(0, 0, 0, .35); }
  .nav-links.is-open ul { flex-direction: column; }
  .nav-links.is-open a { width: 100%; font-size: 17px; }
  .nav-links.is-open a[aria-current=page] { box-shadow: inset 3px 0 0 #fff; }
  html { scroll-padding-top: 62px; }
  /* phone / small tablet: the scene fills the hero, the panel becomes a bottom sheet over it */
  .hero { --gut: 12px; height: calc(100svh - 58px); min-height: 0; max-height: none; }
  .title { left: 0; right: 0; top: 14px; }
  .title .t1 { font-size: clamp(38px, 11vw, 56px); } .title .t2 { font-size: clamp(23px, 6.6vw, 34px); }
  .eta { right: var(--gut); bottom: calc(var(--sheet-h, 300px) + 12px); padding: 6px 11px 7px; min-width: 96px; }
  .eta-v { font-size: 22px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86%; padding: 6px 16px 14px; gap: 12px; border-radius: 22px 22px 0 0; overflow: hidden; transition: max-height .35s var(--ease); }
  .panel.is-open { overflow: auto; }
  .sheet-grab { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-height: 44px; margin: 0 0 -6px; padding: 6px 0 4px; border: 0; background: none; cursor: pointer; color: var(--muted); font: 600 12.5px/1 var(--ui); }
  .grab-bar { width: 44px; height: 5px; border-radius: 3px; background: rgba(74, 58, 49, .3); }
  .sheet-eta { display: inline; margin-left: auto; font: 700 20px/1 var(--ui); color: var(--ink-900); font-variant-numeric: tabular-nums; }
  .eta { display: none; }
  .order-line { flex-wrap: nowrap; font-size: 14px; }
  .status-h, .status-sub { display: none; }
  .panel.is-open .status-h, .panel.is-open .status-sub { display: block; }
  .panel-more { display: none; }
  .panel.is-open .panel-more { display: flex; }
  .panel .status-h { order: 4; font-size: 23px; } .panel .status-sub { order: 5; margin-top: -6px; } .panel .panel-more { order: 6; }
  .order-grid { grid-template-columns: 1fr 1fr; }
  .order-grid .items-card { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .knob { width: 28px; height: 28px; }
  .steps { height: 54px; margin-top: 0; }
  .steps .track { top: 9px; height: 10px; left: 10px; right: 10px; }
  .step-l { font-size: 13px; }
  .order { padding: 28px 16px 4px; }
  .order-grid { grid-template-columns: 1fr; }
  .foot { padding: 20px 16px 36px; }
  .courier { grid-template-columns: 44px 1fr; }
  .courier-a { grid-column: 1 / -1; } .courier-a > * { flex: 1; }
  .avatar svg { width: 44px; height: 44px; }
}
@media (max-width: 360px) { .step-l { font-size: 12px; } }
/* short phones (SE): a tighter sheet so the scene keeps some room */
@media (max-width: 900px) and (max-height: 700px) and (orientation: portrait) {
  .title { top: 8px; } .title .t1 { font-size: 34px; } .title .t2 { font-size: 21px; }
  .panel { gap: 8px; padding-bottom: 10px; } .steps { height: 50px; } .sheet-grab { min-height: 44px; padding-top: 2px; margin-bottom: -10px; }
}
/* phones on their side and short laptop screens: panel stays on the right, compact */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { --panel-w: 330px; --gut: 10px; height: calc(100svh - 58px); min-height: 330px; }
  .title { top: 10px; left: 200px; } .title .t1, .title .t2 { display: inline; font-size: 22px; } .title .t2 { font-size: 18px; margin-left: 5px; }
  .panel { top: var(--gut); bottom: auto; left: auto; right: var(--gut); width: var(--panel-w); max-height: calc(100% - var(--gut) * 2); border-radius: 18px; padding: 12px 14px; overflow: auto; }
  .sheet-grab { display: none; } .panel-more, .status-h, .status-sub { display: flex; } .status-h, .status-sub { display: block; } .panel-more { flex-direction: column; }
  .sheet-eta { display: none; } .eta { display: block; right: calc(var(--panel-w) + var(--gut) * 2); bottom: calc(var(--gut) + 62px); }
  .panel { gap: 10px; } .status-h { font-size: 21px; } .steps { height: 52px; } .knob { width: 28px; height: 28px; } .steps .track { top: 9px; height: 10px; }
  .courier { grid-template-columns: 40px 1fr auto; padding: 8px 10px; } .avatar svg { width: 40px; height: 40px; }
  .courier-a { grid-column: auto; } .courier-a .btn { padding: 0 10px; } .courier-a .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .live-dot::after { display: none; }
}
