/* Hana Pho — dark/light theme (Dev's exception, Dec 3 2026).
   The ONLY piece of the Dec 2 a11y pass Dev chose to keep: the theme
   toggle. Loaded AFTER the app bundle CSS. Contains NO light-mode
   overrides — in light appearance the site is the locked design,
   untouched. Dark palette applies only when the visitor's system is
   dark (and they have not chosen light) or they pick dark on the
   toggle (.theme-toggle, assets/theme-toggle.js; choice persists in
   localStorage "hana-theme" on <html data-theme>).

   GRAY-BLOCK FIX (Dev's order): the bundle paints .dish-card,
   .sig-card and the menu search field in translucent white
   (#ffffff59 / #ffffff8c) tuned for the cream linen ground. Over a
   dark ground those composite into flat gray slabs. In dark mode
   they are given solid deep-slate backgrounds instead — dark panels,
   never gray blocks. */
:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}

/* ---------- dark palette ---------- */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --linen:#1b232e;
    --linen-dim:#232d38;
    --ink:#f0ead9;
    --ink-soft:#b9c2cc;
    --clay:#e08a6d;
    --clay-dark:#eda183;
    --amber:#dfb36a;
    --basil:#8fbc94;
    --indigo:#0d141c;
    --indigo-deep:#090f16;
  }
  :root:not([data-theme="light"]) .btn-clay,
  :root:not([data-theme="light"]) .rv-submit{
    background:#bc5837;color:#f7f3ea;
  }
  :root:not([data-theme="light"]) .dish-modal,
  :root:not([data-theme="light"]) .menu-rail{
    background-color:#1b232e;
  }
  /* gray-block fix: solid panels, not translucent white */
  :root:not([data-theme="light"]) .dish-card,
  :root:not([data-theme="light"]) .sig-card{
    background:#232d38;
  }
  :root:not([data-theme="light"]) .dish-card:hover{
    background:#2a3542;
  }
  :root:not([data-theme="light"]) .menu-search input{
    background:#232d38;color:#f0ead9;
  }
}
:root[data-theme="dark"]{
  --linen:#1b232e;
  --linen-dim:#232d38;
  --ink:#f0ead9;
  --ink-soft:#b9c2cc;
  --clay:#e08a6d;
  --clay-dark:#eda183;
  --amber:#dfb36a;
  --basil:#8fbc94;
  --indigo:#0d141c;
  --indigo-deep:#090f16;
}
:root[data-theme="dark"] .btn-clay,
:root[data-theme="dark"] .rv-submit{
  background:#bc5837;color:#f7f3ea;
}
:root[data-theme="dark"] .dish-modal,
:root[data-theme="dark"] .menu-rail{
  background-color:#1b232e;
}
/* gray-block fix: solid panels, not translucent white */
:root[data-theme="dark"] .dish-card,
:root[data-theme="dark"] .sig-card{
  background:#232d38;
}
:root[data-theme="dark"] .dish-card:hover{
  background:#2a3542;
}
:root[data-theme="dark"] .menu-search input{
  background:#232d38;color:#f0ead9;
}

/* ---------- the toggle: a small dot in the top bar ----------
   Dev's placement (Dec 3 2026): in the header nav row, after
   "Order Online" — directly below the EN/VI options, never
   floating, never over the Call/Order bar. Static flex item; the
   script inserts it after .nav-order.
   CENTERING (Dev's fix, Dec 3 evening): the dot must sit CENTERED
   under the EN/VI block. On phones the nav spans the header's full
   content width and EN/VI is right-aligned to that same right edge,
   so margin-left:auto seats the dot flush at the nav's right end,
   and a translateX(-18px) — (62px EN/VI block − 26px dot) / 2 —
   shifts it onto the EN/VI center at ANY phone width. The shift is
   a transform, not a margin, on purpose: a real 18px right margin
   takes layout space, and at 390px the row then overflows and the
   flex items shrink and wrap their labels (worse squinching).
   (Glued right after Order Online the dot stayed at x344 while
   EN/VI moved right with the viewport — 47px too far left on a
   440px phone.) The nav gap is back to the bundle's natural 20px —
   the old 12px tightening squinched the links — and only narrows
   to 12px at <=419px, where four 20px gaps + the dot cannot fit
   the row (production text metrics run ~7px wider across the nav
   than a local render — at 14px the labels still shrank and
   wrapped on the live site; 12px is the production-proven fit,
   the same value §7 shipped at these widths). Desktop (>900px)
   is untouched: the dot keeps its seat after Order Online in the
   single header row. */
.theme-toggle{
  flex:none;
  align-self:center;
  width:26px;height:26px;min-width:26px;min-height:26px;
  border-radius:50%;
  border:1.5px solid var(--amber,#c99a4a);
  background:var(--indigo,#16222e);
  color:var(--amber,#c99a4a);
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
  padding:0;
}
.theme-toggle svg{width:14px;height:14px;flex:none}
@media (max-width:900px){
  .site-nav{gap:20px}
  .theme-toggle{margin-left:auto;transform:translateX(-18px)}
}
@media (max-width:419px){
  .site-nav{gap:12px}
}

/* MOTION FIX (Dec 4 2026): a theme flip restyles the whole page at
   once. With transitions live, every button and card cross-fades its
   colors on its own clock — on a phone that reads as a glitchy
   shimmer (measured: 90ms long task, gaps to 83ms). While the toggle
   script holds .theme-switching on <html>, transitions are off and
   the flip lands as one clean step. */
html.theme-switching *,html.theme-switching *::before,html.theme-switching *::after{transition:none!important}

/* MOTION FIX (Dec 4 2026) — gold button animation states, dark side:
   the dark pins above hold .btn-clay's RESTING background at #bc5837,
   which would also swallow its hover (higher specificity than the
   bundle's hover rule). Dev's order: button ANIMATIONS go to her
   gold — the same var(--amber) the toggle sun wears. Resting colors
   are untouched. */
:root[data-theme="dark"] .btn-clay:hover{background:var(--amber);color:var(--indigo-deep)}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .btn-clay:hover{background:var(--amber);color:var(--indigo-deep)}
}

/* DARK-DEFAULT INVITE (Dec 4 2026, Dev's direct named order): the
   site now OPENS in dark (boot script defaults data-theme="dark"
   when the visitor has no saved choice; a saved choice still wins).
   In dark the toggle wears the SUN — the way out to light — and
   Dev's journey is: dark pops first, the bright little sun catches
   the eye mid-scroll ("I wonder what that sun does"), the tap
   lands the light in one clean step (the .theme-switching flip
   above). So the sun gets a gentle draw: a soft static gold halo
   plus a slow breathe on the halo only — opacity + transform on a
   pseudo-element (compositor-friendly; no layout, no paint churn,
   nothing on the button itself pulses). The gold is the same
   var(--amber) the sun already wears. Reduced-motion visitors get
   the static halo with no animation. Light mode is untouched —
   the moon needs no advertisement. */
:root[data-theme="dark"] .theme-toggle{
  position:relative;
  box-shadow:0 0 10px 1px rgba(223,179,106,.38),0 0 3px 0 rgba(223,179,106,.45);
}
:root[data-theme="dark"] .theme-toggle::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(223,179,106,.40) 0%,rgba(223,179,106,0) 70%);
  opacity:.55;
  pointer-events:none;
  animation:hana-sun-breathe 3.6s ease-in-out infinite alternate;
}
@keyframes hana-sun-breathe{
  from{opacity:.32;transform:scale(.94)}
  to{opacity:.78;transform:scale(1.09)}
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .theme-toggle{
    position:relative;
    box-shadow:0 0 10px 1px rgba(223,179,106,.38),0 0 3px 0 rgba(223,179,106,.45);
  }
  :root:not([data-theme="light"]) .theme-toggle::after{
    content:"";
    position:absolute;
    inset:-6px;
    border-radius:50%;
    background:radial-gradient(circle,rgba(223,179,106,.40) 0%,rgba(223,179,106,0) 70%);
    opacity:.55;
    pointer-events:none;
    animation:hana-sun-breathe 3.6s ease-in-out infinite alternate;
  }
}
@media (prefers-reduced-motion:reduce){
  :root[data-theme="dark"] .theme-toggle::after,
  :root:not([data-theme="light"]) .theme-toggle::after{animation:none;opacity:.55;transform:none}
}
