/* ============================================================
   G-Reader — "order rail" design system
   A deliberate single-world (dark kitchen-at-night) treatment —
   colors are painted explicitly so it holds regardless of the
   viewer's OS theme.

   No external font/CDN dependency by design (see server/browser-files/README.md
   for why) -- 'Fraunces' / 'Work Sans' / 'IBM Plex Mono' are named in
   the stacks below for whoever wants to self-host the .woff2 files
   later, but every stack already ends in a solid system fallback, so
   the page looks correct with zero network calls either way.
   ============================================================ */

:root {
  --board:      #1F1B17;   /* steel kitchen at night */
  --board-2:    #28221D;   /* panel / card back */
  --board-3:    #332C25;   /* rail bar */
  --paper:      #FBF6EC;   /* ticket paper / primary text on dark */
  --paper-dim:  #C9BCA2;   /* secondary text on dark */
  --ink:        #241F1A;   /* text on paper */
  --ink-dim:    #6B6255;   /* secondary text on paper */
  --copper:     #D98B4A;
  --copper-deep:#B96E33;
  --green:      #6FAE8C;
  --green-tint: #E4F3EC;
  --green-ink:  #2E6B4F;
  --blue:       #6C93B8;
  --blue-tint:  #E7EEF5;
  --blue-ink:   #355A78;
  --rose:       #C97A6B;
  --rose-tint:  #F6E8E3;
  --rose-ink:   #8C4A38;
  --line:       rgba(251,246,236,0.14);
  --line-paper: #E1D6C1;
  --shadow:     rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

body {
  background: var(--board);
  color: var(--paper);
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; text-wrap: balance; }
.mono, .ticket-amount, .ticket-time, .stamp { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace; }

a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin-inline: auto; padding-inline: 24px; }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 22px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.brand svg { flex: none; color: var(--copper); }
.nav-links { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--paper-dim); text-decoration: none; font-size: .92rem; }
.nav-links a:hover { color: var(--paper); }
.nav-links a.btn-ghost { color: var(--paper); font-size: .9rem; padding: 8px 16px; }

/* ---------- buttons ---------- */
.btn-primary {
  background: var(--copper); color: #241505; border: none; padding: 14px 22px;
  border-radius: 8px; font-weight: 600; font-size: .98rem; display: inline-flex;
  align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(217,139,74,.55);
}
.btn-primary:hover { background: var(--copper-deep); }
.btn-ghost {
  color: var(--paper); border: 1px solid var(--line); padding: 13px 20px;
  border-radius: 8px; font-size: .95rem; text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px;
}
.btn-ghost:hover { border-color: var(--paper-dim); }
.btn-back { color: var(--paper-dim); text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.btn-back:hover { color: var(--paper); }

/* ---------- hero ---------- */
.hero { padding-block: 60px 44px; display: grid; gap: 44px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--copper);
}
.hero h1 { font-size: clamp(2rem, 4.3vw, 3.1rem); font-weight: 700; margin-block: 14px 18px; color: var(--paper); }
.hero .lede { color: var(--paper-dim); font-size: 1.05rem; max-width: 46ch; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; align-items: center; }
.cta-note { color: var(--paper-dim); font-size: .85rem; margin-top: 14px; max-width: 42ch; }

/* ---------- the rail ---------- */
.rail { position: relative; padding-top: 30px; }
.rail-bar {
  position: absolute; left: 14px; right: 14px; top: 0; height: 7px;
  background: linear-gradient(180deg, #55493d, var(--board-3));
  border-radius: 4px; box-shadow: 0 2px 0 rgba(0,0,0,.4) inset;
}
.ticket {
  background: var(--paper); color: var(--ink); border-radius: 5px 5px 12px 12px;
  padding: 15px 17px 17px; margin: 0 14px 18px; position: relative;
  box-shadow: 0 16px 32px -16px var(--shadow);
  animation: drop .55s ease both;
}
.ticket::before {
  content: ""; position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 20px; background: #55493d;
}
.ticket::after {
  content: ""; position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: var(--copper);
  box-shadow: 0 0 0 3px var(--board);
}
.ticket:nth-child(1) { transform: rotate(-1.4deg); animation-delay: .05s; }
.ticket:nth-child(2) { transform: rotate(1deg); animation-delay: .38s; }
.ticket:nth-child(3) { transform: rotate(-.7deg); animation-delay: .7s; }
@keyframes drop {
  from { opacity: 0; transform: translateY(-16px) rotate(var(--tilt, 0deg)); }
  to   { opacity: 1; }
}
.ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.pill {
  font-family: 'IBM Plex Mono', monospace; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap;
}
.pill-epassi  { background: var(--green-tint); color: var(--green-ink); }
.pill-edenred { background: var(--blue-tint);  color: var(--blue-ink); }
.pill-booking { background: var(--rose-tint);  color: var(--rose-ink); }
.ticket-title { font-weight: 600; font-size: .95rem; margin-top: 2px; }
.ticket-sub { font-size: .82rem; color: var(--ink-dim); margin-top: 1px; }
.ticket-amount { font-weight: 600; font-size: 1.1rem; text-align: right; flex: none; }
.ticket-rule { border: none; border-top: 1px dashed var(--line-paper); margin-block: 10px; }
.ticket-time { font-size: .72rem; color: #948a78; }

/* ---------- sections ---------- */
.section { padding-block: 52px; border-top: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: 30px; }
.section h2 { font-size: 1.6rem; margin-block: 8px 10px; color: var(--paper); }
.section .lede { color: var(--paper-dim); }

.grid3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { background: var(--board-2); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.feature svg { width: 26px; height: 26px; color: var(--copper); margin-bottom: 14px; }
.feature h3 { font-size: 1.03rem; margin-bottom: 6px; color: var(--paper); font-family: 'Fraunces', serif; font-weight: 600; }
.feature p { color: var(--paper-dim); font-size: .9rem; margin: 0; }

/* ---------- trust / stamp ---------- */
.trust {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: var(--board-2); border: 1px solid var(--line); border-radius: 16px; padding: 30px;
}
.stamp {
  width: 100px; height: 100px; border: 3px solid var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  transform: rotate(-9deg); color: var(--green); font-size: .6rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; line-height: 1.35; flex: none; opacity: .95; padding: 6px;
}
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 220px; }
.trust-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--paper-dim); font-size: .92rem; }
.trust-list svg { flex: none; margin-top: 3px; color: var(--green); }

/* ---------- pricing ticket ---------- */
.receipt {
  background: var(--paper); color: var(--ink); border-radius: 6px 6px 14px 14px;
  max-width: 380px; margin-inline: auto; padding: 30px 28px 32px;
  box-shadow: 0 24px 48px -20px var(--shadow); position: relative;
}
.receipt::after {
  content: ""; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 3px var(--board);
}
.receipt h2 { font-size: 1.1rem; text-align: center; margin: 0 0 4px; }
.receipt .sub { text-align: center; color: var(--ink-dim); font-size: .82rem; margin-bottom: 20px; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding-block: 7px; }
.receipt-row.total { font-weight: 700; font-size: 1.02rem; }
.receipt-rule { border: none; border-top: 1px dashed var(--line-paper); margin-block: 10px; }
.receipt .btn-primary { width: 100%; justify-content: center; margin-top: 20px; }
.receipt-note { text-align: center; font-size: .78rem; color: var(--ink-dim); margin-top: 14px; }

/* The acceptance tick. Sits on the paper receipt, so it's inked, not papered. */
.accept { margin-top: 22px; }
.accept-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .82rem; line-height: 1.5; color: var(--ink-dim);
  cursor: pointer; margin-bottom: 16px; text-align: left;
}
.accept-row input[type="checkbox"] {
  flex: none; width: 17px; height: 17px; margin: 2px 0 0;
  accent-color: var(--copper-deep); cursor: pointer;
}
.accept-row a { color: var(--copper-deep); text-decoration: underline; text-underline-offset: 2px; }
.accept-row a:hover { color: var(--ink); }
.accept .btn-primary { margin-top: 0; }

/* ---------- legal / prose ---------- */
.prose { max-width: 62ch; margin-inline: auto; padding-block: 20px 60px; }
.prose h1 { font-size: 1.9rem; margin-bottom: 6px; }
.prose h2 { font-size: 1.1rem; margin-block: 28px 8px; color: var(--copper); }
.prose p, .prose li { color: var(--paper-dim); font-size: .96rem; }
.prose strong { color: var(--paper); }
.prose a { color: var(--copper); }
.prose code { background: var(--board-2); padding: 2px 6px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: .85em; }
.prose em { color: var(--paper-dim); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line); padding-block: 28px; color: var(--paper-dim); font-size: .85rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--paper); }

/* ---------- misc ---------- */
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ticket { animation: none !important; opacity: 1 !important; }
}

/* ---------- "working…" overlay (see loading.js) ---------- */
.loading-veil {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: rgba(19,16,13,.82);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.loading-veil.is-on { opacity: 1; pointer-events: auto; }
.loading-card {
  text-align: center; padding: 34px 30px; max-width: 360px;
  background: var(--board-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px -20px var(--shadow);
}
.loading-spinner {
  width: 30px; height: 30px; margin: 0 auto 18px;
  border: 2.5px solid var(--line); border-top-color: var(--copper);
  border-radius: 50%; animation: loading-spin .8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-message { margin: 0; font-size: 1rem; color: var(--paper); }
.loading-detail { margin: 8px 0 0; font-size: .86rem; color: var(--paper-dim); }
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 2.4s; }
  .loading-veil { transition: none; }
}

/* ============================================================
   Hero demo -- inbox -> G-Reader -> board, played by hero.js.
   The board half copies the real dashboard (server/browser-files/
   app.css): takings rail on top, tickets with a coloured stripe
   that IS the type. If the dashboard's look changes, change this.
   ============================================================ */
.demo { margin: 0; display: flex; flex-direction: column; min-width: 0; }

.step-tag {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--paper-dim);
  transition: color .3s ease;
}
.step-tag .n {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding-inline: 5px;
  border: 1px solid var(--line); border-radius: 999px; font-size: .64rem; color: var(--paper-dim);
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.demo [data-step].is-active > .step-tag,
.demo-link.is-active .step-tag { color: var(--paper); }
.demo [data-step].is-active > .step-tag .n,
.demo-link.is-active .step-tag .n { background: var(--copper); border-color: var(--copper); color: #241505; }

/* ---- 01 the inbox: a light mail client, the way Gmail looks ---- */
.inbox {
  background: #F4F1EA; color: var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 36px -22px var(--shadow); border: 1px solid rgba(0,0,0,.2);
}
.inbox-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #E9E4DA; border-bottom: 1px solid #DDD5C6; font-size: .74rem;
}
.inbox-bar .dots { display: flex; gap: 5px; }
.inbox-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: #CFC6B5; }
.inbox-title { font-weight: 600; }
.inbox-acct { margin-left: auto; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mails { list-style: none; margin: 0; padding: 0; }
.mail {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 10px;
  padding: 0 12px; font-size: .78rem; border-bottom: 1px solid #E6DFD1; position: relative;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .45s ease, opacity .45s ease, background .5s ease, padding .45s ease;
}
.mail.is-in, .mail.is-old { max-height: 40px; opacity: 1; padding-block: 8px; }
.mail:last-child { border-bottom: 0; }
.mail .from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .subj { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail .t { font-family: 'IBM Plex Mono', monospace; font-size: .7rem; font-weight: 700; color: var(--ink); }
.mail.is-old .from, .mail.is-old .subj, .mail.is-old .t { font-weight: 400; color: var(--ink-dim); }
/* A new mail arrives unread -- and stays unread. G-Reader's Gmail
   permission is read-only, so it can't mark anything as read. */
.mail.is-new { background: #FFF6E6; }
.mail.is-new::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--copper);
}
/* 02 -- being read: a sweep of light across the row */
.mail.is-reading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(217,139,74,.28), transparent);
  animation: demo-sweep .9s ease-in-out;
}
@keyframes demo-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.mail .flag {
  display: none; position: absolute; right: 52px; top: 50%; transform: translateY(-50%);
  font-family: 'IBM Plex Mono', monospace; font-size: .6rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--green-tint); color: var(--green-ink); padding: 2px 7px; border-radius: 999px; font-weight: 600;
}
.mail.is-done .flag { display: inline-block; animation: demo-pop .35s ease both; }
.mail.is-done .subj { padding-right: 70px; }
@keyframes demo-pop { from { opacity: 0; transform: translateY(-50%) scale(.85); } }

/* ---- 02 the link between them ---- */
.demo-link { display: flex; align-items: center; gap: 12px; padding: 6px 0 6px 20px; }
.demo-link .step-tag { margin: 0; }
.wire {
  position: relative; width: 2px; height: 46px; flex: none;
  background: repeating-linear-gradient(180deg, var(--board-3) 0 5px, transparent 5px 9px);
}
.spark {
  position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--copper); opacity: 0;
  box-shadow: 0 0 0 4px rgba(217,139,74,.18), 0 0 14px rgba(217,139,74,.8);
}
.demo-link.is-active .spark { animation: demo-travel .8s ease-in both; }
@keyframes demo-travel { 0% { top: -4px; opacity: 0; } 15% { opacity: 1; } 90% { opacity: 1; } 100% { top: 40px; opacity: 0; } }

/* ---- 03 the board: a small copy of the real dashboard ---- */
.board {
  background: var(--board); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; box-shadow: 0 24px 48px -24px #000;
}
.board-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.board-place { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: .95rem; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--paper-dim); font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(111,174,140,.6); animation: demo-live 2s ease-out infinite; }
@keyframes demo-live { 70% { box-shadow: 0 0 0 7px rgba(111,174,140,0); } 100% { box-shadow: 0 0 0 0 rgba(111,174,140,0); } }
.board-takings {
  display: grid; grid-template-columns: 1fr 1fr; background: var(--board-2);
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden;
}
.tk { padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.tk + .tk { border-left: 1px solid var(--line); }
.tk-label { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-dim); display: flex; align-items: center; gap: 6px; }
.tk-label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.tk.is-epassi .tk-label::before { background: var(--green); }
.tk.is-edenred .tk-label::before { background: var(--blue); }
.tk-fig { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; font-size: 1.35rem; line-height: 1.2; transition: color .4s ease; }
.tk-fig small { font-size: .55em; color: var(--paper-dim); margin-left: 3px; }
.tk.is-bump .tk-fig { color: var(--copper); }

.btickets { display: flex; flex-direction: column; gap: 7px; min-height: 196px; }
.bt {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 9px;
  padding: 10px 12px 10px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 10px 22px -16px var(--shadow);
  opacity: 0; transform: translateY(-14px) scale(.98);
  transition: opacity .45s ease, transform .5s cubic-bezier(.2,.9,.3,1.2), box-shadow .6s ease;
}
.bt.is-in { opacity: 1; transform: none; }
.bt.is-fresh { box-shadow: 0 0 0 2px var(--copper), 0 12px 28px -12px rgba(217,139,74,.6); }
.bt.is-out { opacity: 0; transform: translateY(8px); }
.bt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 9px 0 0 9px; }
.bt.is-epassi::before  { background: var(--green); }
.bt.is-edenred::before { background: var(--blue); }
.bt.is-booking::before { background: var(--rose); }
.bt-main { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.bt .kind {
  font-size: .58rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}
.bt.is-epassi  .kind { color: #2E6B4F; background: rgba(111,174,140,.18); }
.bt.is-edenred .kind { color: #355A78; background: rgba(108,147,184,.18); }
.bt.is-booking .kind { color: #8C4A38; background: rgba(201,122,107,.18); }
.bt .who { font-weight: 600; font-size: .9rem; }
.bt .detail { font-size: .78rem; color: var(--ink-dim); }
.bt .detail b { color: var(--ink); font-weight: 600; }
.bt .amount { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: .98rem; white-space: nowrap; }
.bt .amount small { font-size: .7em; color: var(--ink-dim); margin-left: 2px; }

@media (max-width: 480px) {
  .mail { grid-template-columns: 74px 1fr auto; gap: 8px; }
  .mail .flag { display: none !important; }
  .mail.is-done .subj { padding-right: 0; }
  .mail.is-done .t::before { content: "✓ "; color: var(--green-ink); }
  .tk-fig { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mail, .bt, .step-tag, .step-tag .n, .tk-fig { transition: none !important; }
  .mail.is-reading::after, .spark, .live i, .mail.is-done .flag { animation: none !important; }
}

/* Nav on a phone: keep the name on one line, let the links wrap beside it. */
.brand { flex: none; white-space: nowrap; }
@media (max-width: 480px) {
  .nav-links { gap: 14px; justify-content: flex-end; }
}
