/* heySec viewer — the heySec web look (docs/app-brief.md): system font, the Portal's tokens,
   light and dark from the system, brand yellow only for the one main action, ink text on it. */

:root {
  color-scheme: light dark;
  --accent: #f9ce19;
  --accent-hover: #ffdf58;
  --accent-pressed: #efc000;
  --on-accent: #030107;
  --ink: #030107;
  --text-2: #5d5d57;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #efefe9;
  --separator: rgba(3, 1, 7, 0.08);
  --teal: #146c79;
  --green: #18753b;
  --orange: #d85c2e;
  --red: #b92f28;
  --gold: #8a6d00;
  --quiet: rgba(3, 1, 7, 0.06);
  --quiet-hover: rgba(3, 1, 7, 0.1);

  /* Type: a Mac window's scale on a desktop, iOS's ramp on a phone (below). No letter-spacing. */
  --large-title: 28px;
  --title-2: 20px;
  --title-3: 17px;
  --body: 15px;
  --subhead: 13px;
  --footnote: 12px;

  --radius-card: 18px;
  --radius-hero: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f0;
    --text-2: #a8a79f;
    --bg: #0e0d0a;
    --surface: #1a1915;
    --surface-2: #24231e;
    --separator: rgba(255, 255, 255, 0.08);
    --teal: #3fb4c6;
    --green: #3ecf7a;
    --orange: #ff8a3d;
    --red: #f05f59;
    --gold: #f9ce19;
    --quiet: rgba(255, 255, 255, 0.08);
    --quiet-hover: rgba(255, 255, 255, 0.13);
  }
}

@media (max-width: 640px) {
  :root {
    --large-title: 34px;
    --title-2: 22px;
    --title-3: 20px;
    --body: 17px;
    --subhead: 15px;
    --footnote: 13px;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--body);
  line-height: 1.4;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--large-title); font-weight: 700; line-height: 1.15; }
h2 { font-size: var(--title-3); font-weight: 600; line-height: 1.25; }
h3 { font-size: var(--body); font-weight: 600; }
a { color: var(--teal); }
img { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: 12px; top: -48px; z-index: 10; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { top: 12px; }

/* Bar */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 880px; margin: 0 auto; padding: 18px 20px 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-2); }
.brand img { display: block; height: 30px; width: auto; }
.brand-sub { font-size: var(--subhead); font-weight: 500; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.who { color: var(--text-2); font-size: var(--subhead); }

/* Layout */
main {
  flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 8px 20px 32px;
  display: flex; flex-direction: column; gap: 18px;
}
#app { display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.page-head .back { align-self: flex-start; }
.lede { color: var(--text-2); }

/* Cards and rows */
.card {
  background: var(--surface); border-radius: var(--radius-card); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.card > h2 { margin-bottom: 2px; }
.hero-card { border-radius: var(--radius-hero); padding: 26px 24px; align-items: flex-start; gap: 14px; }
.caption { font-size: var(--footnote); text-transform: uppercase; color: var(--text-2); padding: 0 20px; margin-bottom: -10px; }
.footnote { font-size: var(--footnote); color: var(--text-2); }

.rows { display: flex; flex-direction: column; }
.rows > li + li > .row, .rows > .row + .row { box-shadow: inset 0 0.5px 0 var(--separator); }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 0;
  color: inherit; text-decoration: none;
}
.row-link { border-radius: 10px; }
.row-link:hover .row-title { text-decoration: underline; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 400; overflow-wrap: anywhere; }
.row-sub { font-size: var(--subhead); color: var(--text-2); overflow-wrap: anywhere; }
.row-end { display: flex; align-items: center; gap: 8px; color: var(--text-2); flex-wrap: wrap; justify-content: flex-end; }
.event-row { align-items: flex-start; flex-wrap: wrap; }
.event-row .media { flex-basis: 100%; }

/* Symbols: the heySec set (docs/symbols), drawn in the text colour. */
.sym {
  display: inline-block; width: 1.25em; height: 1.25em; flex: none;
  background-color: currentColor;
  -webkit-mask: var(--sym) center / contain no-repeat;
  mask: var(--sym) center / contain no-repeat;
}
.sym-house { --sym: url(/symbols/house.svg); }
.sym-lock-fill { --sym: url(/symbols/lock-fill.svg); }
.sym-link { --sym: url(/symbols/link.svg); }
.sym-link-slash { --sym: url(/symbols/link-slash.svg); }
.sym-camera { --sym: url(/symbols/camera.svg); }
.sym-bell { --sym: url(/symbols/bell.svg); }
.sym-clock { --sym: url(/symbols/clock.svg); }
.sym-exclamation-triangle { --sym: url(/symbols/exclamation-triangle.svg); }
.sym-sign-out { --sym: url(/symbols/sign-out.svg); }
.sym-arrow-clockwise { --sym: url(/symbols/arrow-clockwise.svg); }
.sym-chevron-left { --sym: url(/symbols/chevron-left.svg); }
.sym-chevron-right { --sym: url(/symbols/chevron-right.svg); }
.sym-shield-check { --sym: url(/symbols/shield-check.svg); }
.sym-waveform { --sym: url(/symbols/waveform.svg); }
.sym-iphone { --sym: url(/symbols/iphone.svg); }
.sym-laptop { --sym: url(/symbols/laptop.svg); }
.sym-info { --sym: url(/symbols/info.svg); }
.sym-play-fill { --sym: url(/symbols/play-fill.svg); }
.sym-speaker-wave { --sym: url(/symbols/speaker-wave.svg); }
.sym-x-circle-fill { --sym: url(/symbols/x-circle-fill.svg); }
.sym-check-circle-fill { --sym: url(/symbols/check-circle-fill.svg); }

.tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--ink);
}
.tile .sym { width: 18px; height: 18px; }
.tile-yellow { background: var(--accent); color: var(--on-accent); }
.hero-card .tile { width: 52px; height: 52px; border-radius: 14px; }
.hero-card .tile .sym { width: 30px; height: 30px; }

/* Buttons: the one main action is the yellow capsule; the rest are quiet. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 16px; border-radius: 999px; border: 0;
  font: inherit; font-size: var(--subhead); font-weight: 600; line-height: 1.2;
  background: var(--quiet); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--quiet-hover); }
.btn .sym { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-size: var(--body); min-height: 44px; padding: 10px 22px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-pressed); }
.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { background: var(--quiet); }
.btn-plain { background: transparent; color: var(--teal); padding-left: 4px; padding-right: 8px; }
.btn-plain:hover { background: var(--quiet); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: var(--footnote); font-weight: 600; background: var(--quiet); color: var(--text-2); white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-red { color: var(--red); }
.pill-orange { color: var(--orange); }
.pill-teal { color: var(--teal); }
.pill-green { color: var(--green); }

/* Segmented navigation */
.segments { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); align-self: flex-start; }
.segments a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: var(--subhead); font-weight: 500; }
.segments a[aria-current="page"] { background: var(--surface); font-weight: 600; }

/* Notices */
.notice { gap: 8px; }
.message { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.message .sym { margin-top: 1px; }
.message-error { color: var(--red); }
.message-error p { color: var(--ink); }
.message-warn { color: var(--orange); }
.message-warn p { color: var(--ink); }
.message-info { color: var(--teal); }
.message-info p { color: var(--ink); }
.message p { flex: 1; }

/* Media */
.media { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.media img, .media video { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #000; }
.media audio { width: 100%; }
.media-note { font-size: var(--footnote); color: var(--text-2); }
.clip-list { display: flex; flex-direction: column; gap: 14px; }

/* Linking */
.qr-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.qr { width: 232px; height: 232px; padding: 0; background: #fff; border-radius: 14px; flex: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.steps { list-style: decimal; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }

/* Footer */
.foot { width: 100%; max-width: 880px; margin: 0 auto; padding: 8px 20px 28px; }
.privacy { font-size: var(--footnote); color: var(--text-2); max-width: 70ch; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 120ms ease; }
}
