/* The who page: the card's own world, the same deep sea as the minute lookup. The card sits on it as a white card
   sits on a table, corners rounded as the real one's (CR80, 3.18 mm). Everything a stranger needs is on the first
   screen: the card, its date, its times. The rest waits in drawers. Rows have fixed seats, so nothing reflows when
   who.js fills in the viewer's own time. No outside fonts: the date face is the card's own, subset and served here. */
@font-face {
  font-family: "Card Date"; src: url("card-date.woff2") format("woff2"); font-weight: 900; font-display: swap;
}
:root {
  --sea-0: #070A1F;
  --sea-1: #11164A;
  --text: #EEF0FF;
  --muted: #A6ACD8;
  --line: rgba(238, 240, 255, .16);
  --orange: #FF9A3C;
  --green: #7FD95A;
  --alarm: #FF5A4E;
  --f-num: "Card Date", "Arial Narrow", system-ui, sans-serif;
  --f-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 70% at 50% 18%, var(--sea-1) 0%, var(--sea-0) 62%) fixed, var(--sea-0);
  color: var(--text); font: 15px/1.5 var(--f-body);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--text); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.stage {
  max-width: 460px; margin: 0 auto; min-height: 100svh;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 8px 24px;
  display: grid; gap: 10px; align-content: start; grid-template-columns: minmax(0, 1fr);
}
.top { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; height: 34px; }
.kmark { font: 600 26px/1 var(--f-serif); display: inline-block; transform: rotate(180deg); }   /* upside down, as on the card */
.brand { text-align: center; font: 600 12px/1 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.tapmark { width: 22px; height: 22px; justify-self: end; color: var(--text); }

.chip { margin: 0; justify-self: center; text-align: center; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.chip b { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 4px; font: 700 11px/1.5 var(--f-mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--sea-0); background: var(--orange); }
.alarm { margin: 0; padding: 10px 12px; border-radius: 8px; background: rgba(255, 90, 78, .16); border: 1px solid var(--alarm);
  font-size: 14px; line-height: 1.4; }
.alarm b { color: var(--alarm); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }

/* the card: 53.98 x 85.6 mm, corners 3.18 mm = 5.89% of its width, 3.71% of its height */
.card { margin: 0; display: grid; justify-items: center; }
.card img {
  display: block; height: min(60svh, 600px); width: auto; max-width: 100%; aspect-ratio: 638 / 1011; object-fit: contain;
  border-radius: 5.89% / 3.71%; background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
}

.readout { display: grid; gap: 4px; justify-items: center; text-align: center; }
.date { font: 900 clamp(34px, 11vw, 46px)/1 var(--f-num); letter-spacing: .02em; height: 1em; }
.date .dm { color: var(--orange); }
.date .yy { color: var(--green); }
.date .dot.orange { color: var(--orange); }
.date .dot.green { color: var(--green); }
.when { font-size: 14px; color: var(--text); min-height: 1.5em; }
.times { margin: 6px 0 0; width: 100%; display: grid; gap: 0; border-top: 1px solid var(--line); }
.times div { display: grid; grid-template-columns: minmax(0, 7.4em) minmax(0, 1fr); gap: 8px; align-items: baseline;
  padding: 5px 2px; border-bottom: 1px solid var(--line); text-align: left; min-height: 2.2em; }
.times dt { font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.times dd { margin: 0; font: 500 clamp(12px, 3.3vw, 13px)/1.3 var(--f-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 439px) {   /* a phone: the label sits over its time, so a long zone (GMT+5:30) never cuts the seconds */
  .times div { grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 4px 2px; }
  .times dd { font-size: 13px; }
}
.note { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-align: left; width: 100%; }
.count { display: flex; gap: 10px; align-items: baseline; justify-content: center; margin-top: 6px; }
.count .lbl { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.count .digits { font: 900 22px/1 var(--f-num); letter-spacing: .08em; }

.claim { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.claim h2 { margin: 0 0 4px; font-size: 15px; }
.claim p { margin: 0; font-size: 14px; color: var(--muted); }

.drawer { border-top: 1px solid var(--line); }
.drawer:last-of-type { border-bottom: 1px solid var(--line); }
.drawer summary { cursor: pointer; padding: 12px 2px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after { content: "+"; color: var(--muted); font: 500 18px/1 var(--f-mono); }
.drawer[open] summary::after { content: "–"; }
.drawer p { margin: 0 0 12px; color: var(--muted); }
.parts { margin: 0 0 12px; display: grid; gap: 8px; }
.parts dt { font-weight: 600; }
.parts dt.o { color: var(--orange); }
.parts dt.g { color: var(--green); }
.parts dd { margin: 0; color: var(--muted); font-size: 14px; }

.empty { padding-top: 12px; }
.empty h1 { margin: 0 0 8px; font: 900 30px/1.05 var(--f-num); text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.empty h2 { margin: 18px 0 6px; font-size: 13px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.empty p { color: var(--muted); }
.list { margin: 0; padding-left: 18px; font-family: var(--f-mono); }

.foot { margin-top: 8px; text-align: center; font: 500 11px/1.4 var(--f-mono); color: var(--muted); opacity: .8; }

/* a wide screen: the card on the left, what it says on the right */
@media (min-width: 860px) and (min-height: 560px) {
  .stage { max-width: 980px; grid-template-columns: minmax(0, auto) minmax(0, 1fr); column-gap: 40px; align-content: center; }
  .top, .chip, .alarm, .foot { grid-column: 1 / -1; }
  .card { grid-column: 1; grid-row: span 6; align-self: start; }
  .readout, .claim, .drawer { grid-column: 2; }
  .card img { height: min(78svh, 680px); }
  .readout { justify-items: start; text-align: left; }
  .count { justify-content: flex-start; }
}
