/* GO_ingALLIN - mobile first, no framework, no external requests.
   Targets in-app browsers (WhatsApp, Instagram, TikTok) on cheap Android as much
   as modern iOS Safari, so: system fonts only, no custom properties fallback
   needed beyond what those webviews support, generous tap targets. */

:root {
  /* Brand palette supplied by the owner (color.adobe.com):
       #A64B52 brick   #A66369 rose   #D9C6BF sand   #BFA9A4 taupe   #0D0D0D ink
     plus #ffe7dd blush, the ground the logo itself is drawn on.

     Sand and taupe are surfaces only - at 1.6:1 and 2.2:1 on white they can
     never carry text. Brick is the one brand colour dark enough to be ink
     (5.6:1 on white), so it does the links, buttons and the meter fill.

     Every pair below was checked, not eyed: body/muted/link text >= 4.5:1 on
     both the page and the card, UI marks >= 3:1. See docs/palette.md. */
  --brand: #A64B52;          /* brick - buttons, meter fill              */
  --brand-dark: #89353f;     /* link ink on light surfaces, 6.7:1 on bg  */
  --brand-soft: #ffd0d2;     /* current-notice tint                      */
  --bg: #ffe7dd;             /* blush - identical to the logo's panel, so
                                the lockup dissolves into the page        */
  --surface: #ffffff;
  --text: #0D0D0D;
  --muted: #564444;          /* darkened for the backdrop: the poster's
                                darkest patch composites to #c6b4ac, where
                                the old #745d5d was only 3.0:1              */
  --link: #75353a;           /* 4.5:1 on white, blush AND the poster        */
  --line: #e7c8c9;
  --track: #D9C6BF;          /* sand - unfilled part of the stage meter.
                                Deliberately recessive; what must be legible
                                is fill-vs-track, and that is 3.4:1.      */

  /* Stage chips. The statuses are funnel stages, so the fills are one hue
     stepping light -> dark (dL >= 0.07) and the order is visible in the colour.
     Each chip is outlined in its own ink: that gives the pill a >= 3:1 edge
     against the card, so the tint can stay light without the shape going
     invisible on white. Text on every fill is >= 4.8:1. */
  --stage-1: #fbdedf;  --stage-1-ink: #704547;
  --stage-2: #f1c1c3;  --stage-2-ink: #74383d;
  --stage-3: #e8a4a8;  --stage-3-ink: #772933;
  --stage-4: #db8288;  --stage-4-ink: #581119;   /* delivered - the last rung */

  --on-brand: #ffffff;       /* label ON a brand fill - 5.6:1 on brick     */
  --on-brand-soft: rgba(255, 255, 255, .88);
  --note-bg: #f6ddd6;        /* disclaimer callouts: ETA-is-an-estimate,
                                ordered-quantity-is-not-stock             */
  --note-ink: #5f3b3b;       /* 7.5:1 on the tint                         */
  --danger: #89353f;
  --danger-bg: #ffdcde;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(45, 20, 20, .07), 0 6px 20px rgba(45, 20, 20, .06);
  --max: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Not a flip of the light values: brick at 3.0:1 on a dark card is too
       weak for a link, so the brand step is lightened and re-checked. */
    --brand: #d17d82;
    --brand-dark: #b8636a;
    --brand-soft: #3c1f21;
    --bg: #171211;
    --surface: #211a19;
    --text: #f6e8e3;
    --muted: #c4b0b0;
    --link: #fe989e;
    --line: #3c2f2f;
    --track: #413435;
    --stage-1: #3e2728;  --stage-1-ink: #eecfd0;
    --stage-2: #5d3336;  --stage-2-ink: #fed1d3;
    --stage-3: #7d4045;  --stage-3-ink: #ffd4d6;
    --stage-4: #95494f;  --stage-4-ink: #ffeef0;
    --on-brand: #1a1312;     /* brand is a light rose here, so the label
                                flips to dark ink - 6.1:1                   */
    --on-brand-soft: rgba(26, 19, 18, .78);
    --note-bg: #2c2221;
    --note-ink: #e3c9c4;
    --danger: #eba0a4;
    --danger-bg: #3b1b1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

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

/* The brand backdrop: the CORTIS tour poster, composited exactly the way the
   owner's master file does it - blush ground with the poster at 22% over it.

   It lives on a fixed pseudo-element rather than on `body` so that it covers
   the viewport once instead of stretching over the whole scroll height, and so
   it does not need `background-attachment: fixed`, which janks on iOS Safari.
   The colour sits on <html> because a negative z-index would otherwise put the
   layer behind body's own background and hide it.

   Cards, chips and callouts all paint opaque fills, so the poster only shows
   in the gaps - and every token that sits in those gaps was re-checked against
   the poster's worst patch. See docs/palette.md. */
html { background: var(--bg); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("backdrop.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: .22;
  pointer-events: none;
}

body {
  margin: 0;
  padding: 0 0 3rem;
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

a { color: var(--link); }

.site-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0 1rem;
  text-align: center;
}
.site-header .logo { width: 64px; height: 64px; display: block; margin: 0 auto .5rem; }

/* Homepage wordmark. The asset is a 1.69:1 lockup, so it scales by width and
   keeps its own aspect ratio -- never force it into the square .logo box.
   `aspect-ratio` reserves the space before the SVG loads, so the buttons below
   don't jump on a slow in-app browser. */
.site-header .lockup {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1334 / 788;
  margin: 0 auto .35rem;
}
.site-header h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.site-header .tagline { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }

.back-link {
  display: inline-block;
  margin: 1rem 0 0;
  font-size: .9rem;
  text-decoration: none;
  color: var(--muted);
}
.back-link:active { color: var(--text); }

.intro { margin: 1.25rem 0 0; color: var(--muted); font-size: .95rem; }

.notice {
  margin: 1.25rem 0 0;
  padding: .9rem 1rem;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
}
.notice h2 { margin: 0 0 .25rem; font-size: .95rem; }
.notice p { margin: 0; font-size: .9rem; color: var(--muted); }
.notice[hidden] { display: none; }

.actions { display: grid; gap: .65rem; margin: 1.5rem 0 0; }

.btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 56px;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}
.btn:active { transform: translateY(1px); }
.btn .icon { font-size: 1.35rem; line-height: 1; width: 1.6rem; text-align: center; flex: none; }
.btn .sub { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
/* Centred variant. The icon and the label stay one group so they centre
   together rather than the icon pinning to the left edge. */
.btn-spaced { margin-top: 1rem; }
.btn-center { justify-content: center; }
.btn-center > span:last-child { text-align: center; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary .sub { color: var(--on-brand-soft); }

.social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: .5rem;
  margin-top: .65rem;
}
.social a {
  /* Width comes from the grid track; height is what makes the tap target. */
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: .9rem;
  color: var(--text);
}

.search { margin: 1.25rem 0 0; }
.search label { display: block; font-weight: 600; margin-bottom: .4rem; }
.search .hint { color: var(--muted); font-size: .85rem; margin: 0 0 .6rem; }
.search-row { display: flex; gap: .5rem; }
.search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: .7rem .9rem;
  font-size: 1.05rem;   /* >=16px stops iOS zooming on focus */
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.search button {
  flex: none;
  min-height: 52px;
  padding: 0 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--brand);
  color: var(--on-brand);
  border: 0;
  border-radius: var(--radius);
}

.result-head { margin: 1.5rem 0 .25rem; }
.result-head h2 { margin: 0; font-size: 1.2rem; }
.result-head p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }

.card {
  margin: .75rem 0 0;
  padding: .95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.card .variant { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; }
.card .batch { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }

.badge {
  display: inline-block;
  margin: .55rem 0 0;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.badge { border: 1px solid currentColor; }
.badge.pending  { background: var(--stage-1); color: var(--stage-1-ink); }
.badge.moving   { background: var(--stage-2); color: var(--stage-2-ink); }
.badge.arriving { background: var(--stage-3); color: var(--stage-3-ink); }
.badge.done     { background: var(--stage-4); color: var(--stage-4-ink); }
.badge.unknown  { background: var(--danger-bg); color: var(--danger); }

.status-desc { margin: .4rem 0 0; font-size: .9rem; }

.track { display: flex; gap: 4px; margin: .7rem 0 .3rem; }
.track span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--track);
}
.track span.done { background: var(--brand); }
.track-label { margin: 0; font-size: .75rem; color: var(--muted); }

.eta {
  margin: .65rem 0 0;
  padding: .5rem .65rem;
  background: var(--bg);
  border-radius: 10px;
  font-size: .85rem;
}
.eta strong { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* After a lookup the JS moves focus to #results so a screen reader announces
   them. That focus is programmatic - the container is not a tab stop - so it
   must not paint the browser's default (blue, off-brand) ring. Keyboard users
   still get a brand-coloured one through :focus-visible. */
#results:focus { outline: none; }
#results:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.empty {
  margin: 1.25rem 0 0;
  padding: 1.1rem 1rem;
  background: var(--danger-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty h2 { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--danger); }
.empty p { margin: 0 0 .75rem; font-size: .9rem; }

.legend { display: grid; gap: .4rem; margin: 1rem 0 0; }
.legend div {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  font-size: .85rem;
  color: var(--muted);
}

.group { margin: 1.5rem 0 0; }
.group > h2 { margin: 0 0 .1rem; font-size: 1.05rem; }
.group > p { margin: 0; font-size: .85rem; color: var(--muted); }

.rows { margin: .6rem 0 0; }
.row {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
}
.rows .row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.rows .row:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.rows .row:only-child { border-radius: var(--radius); }
.row .name { flex: 1 1 auto; font-size: .95rem; min-width: 0; overflow-wrap: break-word; }
.row .qty { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.row .qty small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); text-align: right; }

.callout {
  margin: 1.25rem 0 0;
  padding: .85rem 1rem;
  background: var(--note-bg);
  color: var(--note-ink);
  border-radius: var(--radius);
  font-size: .87rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.site-footer p { margin: 0 0 .5rem; }

.stamp { margin: 1.25rem 0 0; color: var(--muted); font-size: .8rem; text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (min-width: 560px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .btn-primary { grid-column: 1 / -1; }
  /* The primary spans both columns, so an even total leaves the final button
     stranded alone in a half-width cell. Let it span instead. */
  .actions .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
}
