/* ── Throne stationery — tokens from the app brand board (src/theme/tokens.ts) ── */

:root {
  --surface: #fafafb;
  --surface-2: #f2f2f4;
  --surface-map: #eeeff1;
  --card: #ffffff;
  --hairline: #e5e5e8;
  --ink: #1c1c1e;
  --ink-2: #6f6f76;
  --ink-3: #8a8a90;
  --gold: #a6884c;
  --gold-deep: #8c7140;
  --gold-bright: #c9a85c;
  --cream: #e9dfc6;
  --parchment: #d9cdaa;
  --parchment-hairline: #eee7d4;
  --brown: #5a4632;
  --brown-parchment: #d8cfc6;
  --brown-parchment-hairline: #e9e2db;
  --oxblood: #7e4038;
  --sage: #5c7a58;
  --olive: #75855f;
  --brass: #948a62;
  --clay: #a26f51;
  /* charcoal panel foreground */
  --panel-ink: #ececee;
  --panel-ink-2: #a3a3aa;
  --panel-hairline: #2a2a2e;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
  color: var(--ink);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

.wrap {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.mono {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--hairline);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--ink-2);
  font-size: 14px;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.site-header nav .button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

/* ── Buttons — 4px radius, no pills, flat (app idiom) ───── */

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--cream);
  padding: 0 22px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;
}

.button:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.button--gold {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  color: var(--ink);
}

.button--gold:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--ink);
}

/* ── Hero — full-bleed charcoal band ────────────────────── */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--panel-ink);
  border-bottom: 1px solid var(--gold);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  min-height: clamp(540px, calc(100vh - 180px), 760px);
}

.hero-copy {
  padding: clamp(48px, 7vw, 96px) 0;
  align-self: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 12ch;
  color: var(--cream);
  font-size: clamp(42px, 6vw, 84px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.hero-copy > p {
  max-width: 44ch;
  margin-top: 22px;
  color: var(--panel-ink-2);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.actions .note {
  color: var(--panel-ink-2);
  font-size: 13.5px;
}

/* store badges — flat, 4px radius, paper on charcoal */

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--surface);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.store-badge:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-badge small {
  font-size: 10.5px;
  color: var(--ink-2);
}

.store-badge:hover small {
  color: var(--ink);
}

.store-badge strong {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-phone {
  position: relative;
  z-index: 1;
  min-height: clamp(380px, 42vw, 540px);
}

.hero-phone .ph {
  position: absolute;
  right: clamp(20px, 4vw, 64px);
  bottom: -72px;
}

/* ── Grading scale specimen ─────────────────────────────── */

.scale {
  border-bottom: 1px solid var(--hairline);
}

.scale ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 36px 0 30px;
  list-style: none;
}

.scale li {
  padding: 0 18px 0 0;
}

.scale li + li {
  padding-left: 18px;
  border-left: 1px solid var(--hairline);
}

.scale .bar {
  display: block;
  height: 8px;
  border-radius: 2px;
  margin-bottom: 12px;
}

.scale .num {
  margin-right: 8px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}

.scale .label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.grade-5 { background: var(--sage); }
.grade-4 { background: var(--olive); }
.grade-3 { background: var(--brass); }
.grade-2 { background: var(--clay); }
.grade-1 { background: var(--oxblood); }

/* ── Section scaffolding ────────────────────────────────── */

.section {
  padding: clamp(64px, 8vw, 96px) 0;
}

.section-head {
  max-width: 620px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.section-head p {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Proceedings ────────────────────────────────────────── */

.proceedings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
}

.proceedings h3 {
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.proceedings p {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Inside the app — phone specimens ───────────────────── */

.showcase {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}

.showcase-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(28px, 4vw, 56px);
}

.showcase figure {
  margin: 0;
  text-align: center;
}

.showcase figure.raised {
  margin-top: -28px;
}

.showcase figcaption {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-2);
}

/* ── Phone frame ────────────────────────────────────────── */

.ph {
  width: 272px;
  padding: 9px;
  border: 1px solid #333338;
  border-radius: 42px;
  background: #1c1c1e;
  text-align: left;
}

.ph-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 564px;
  border-radius: 34px;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
}

.ph-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 0;
}

.ph-status .time {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ph-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 21px;
  border-radius: 11px;
  background: #1c1c1e;
}

/* in-screen shared bits */

.app-topbar {
  padding: 16px 14px 12px;
}

.app-topbar .screen-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-topbar .screen-sub {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 11px;
}

.app-label {
  display: block;
  margin: 14px 14px 8px;
  font-size: 12px;
  font-weight: 600;
}

.app-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.app-tabbar {
  display: flex;
  margin-top: auto;
  padding: 8px 6px 18px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}

.app-tabbar span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 500;
}

.app-tabbar span.active {
  color: var(--ink);
}

/* map screen */

.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 12.5px;
}

.app-map {
  position: relative;
  flex: 1;
  background: var(--surface-map);
  overflow: hidden;
}

.app-map svg.roads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-pin {
  position: absolute;
  padding: 3px 7px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  font-size: 11px;
  font-weight: 600;
}

.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  border-bottom: 0;
}

.map-pin.selected {
  background: var(--ink);
  color: var(--cream);
}

.app-callout {
  position: absolute;
  left: 24px;
  top: 82px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
}

.app-callout::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
  border-bottom: 0;
}

.app-callout .name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-callout .meta {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 10.5px;
}

.app-score {
  text-align: right;
}

.app-score .value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.app-score .of {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 10px;
}

/* search screen */

.app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 14px;
}

.chip {
  padding: 6px 9px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
}

.chip.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.app-segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 14px;
}

.app-segments b {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.app-segments b.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.app-results {
  margin: 0 14px 20px;
}

.app-results > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.app-results .name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-results .meta {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
}

.app-results b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* grade screen */

.app-scorepicker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 14px;
}

.app-scorepicker b {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
}

.app-scorepicker b.picked {
  border-color: var(--sage);
  background: var(--sage);
  color: #fff;
}

.app-picked-label {
  margin: 8px 14px 0;
  color: var(--sage);
  font-size: 11.5px;
  font-weight: 500;
  text-align: right;
}

.app-rows {
  margin: 0 14px;
}

.app-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}

.app-rows .k {
  color: var(--ink-2);
}

.app-rows .v {
  font-weight: 500;
}

.app-merit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 14px 0;
  font-size: 11px;
  color: var(--ink-2);
}

.app-merit .amount {
  color: var(--gold-deep);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.app-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 46px;
  margin: auto 14px 16px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
}

/* honours screen */

.app-cert {
  margin: 10px 14px 0;
  border: 1px solid var(--parchment);
  border-radius: 6px;
  background: var(--card);
}

.app-cert.brown-cert {
  border-color: var(--brown-parchment);
}

.app-cert .cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--parchment-hairline);
}

.app-cert.brown-cert .cert-head {
  border-bottom-color: var(--brown-parchment-hairline);
}

.app-cert .cert-head .no {
  color: var(--gold-deep);
}

.app-cert.brown-cert .cert-head .no {
  color: var(--brown);
}

.app-cert .cert-head .date {
  color: var(--ink-3);
}

.app-cert .cert-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
}

.app-cert .kind {
  color: var(--gold-deep);
  font-size: 10.5px;
  font-weight: 500;
}

.app-cert.brown-cert .kind {
  color: var(--brown);
}

.app-cert .venue {
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-cert .place {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
}

.app-cert .figures {
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--ink-2);
}

.app-cert .figures b {
  margin-right: 5px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-cert .citation {
  padding: 8px 12px;
  border-top: 1px solid var(--parchment-hairline);
  color: var(--ink-2);
  font-size: 10.5px;
}

.app-cert.brown-cert .citation {
  border-top-color: var(--brown-parchment-hairline);
}

.app-listrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 14px 0;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--card);
  font-size: 12.5px;
  font-weight: 600;
}

.text-sage { color: var(--sage); }
.text-olive { color: var(--olive); }
.text-brass { color: var(--brass); }
.text-clay { color: var(--clay); }
.text-oxblood { color: var(--oxblood); }

/* ── The honours (page section) ─────────────────────────── */

.honours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
}

.honour {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 3vw, 32px);
}

.honour .medal {
  flex: none;
  width: clamp(104px, 12vw, 136px);
  height: auto;
}

.honour h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.honour p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}

.stamps {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 36px;
  border-top: 1px solid var(--hairline);
}

.stamps .stamp-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px;
}

.stamps svg {
  width: clamp(72px, 10vw, 104px);
  height: auto;
}

.stamps p {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 13px;
}

/* ── Closing CTA — full-bleed charcoal band ─────────────── */

.cta {
  background: var(--ink);
  color: var(--panel-ink);
  border-top: 1px solid var(--gold);
  padding: clamp(72px, 9vw, 120px) 0;
  text-align: center;
}

.cta .crest {
  display: block;
  margin: 0 auto 22px;
}

.cta h2 {
  color: var(--cream);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.cta p {
  max-width: 46ch;
  margin: 18px auto 0;
  color: var(--panel-ink-2);
  font-size: 16.5px;
  line-height: 1.55;
}

.cta .actions {
  justify-content: center;
}

/* ── Footer ─────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--hairline);
}

footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 34px;
  color: var(--ink-2);
  font-size: 13.5px;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  gap: 20px;
}

footer a {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ── Documents (privacy) ────────────────────────────────── */

.plain-label {
  margin: 0 0 18px;
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 600;
}

.document {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 84px) 0 72px;
  width: min(1104px, calc(100% - 40px));
}

.document h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 22px;
}

.document h2 {
  margin: 40px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 20px;
  font-weight: 600;
}

.document p {
  margin-bottom: 14px;
  color: var(--ink-2);
  line-height: 1.62;
}

.document a {
  color: var(--gold-deep);
}

/* ── Motion ─────────────────────────────────────────────── */

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-inner {
  animation: settle 420ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-inner {
    animation: none;
  }
  .button,
  .store-badge {
    transition: none;
  }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    padding: clamp(44px, 7vw, 64px) 0 0;
  }

  .hero-phone {
    min-height: 380px;
    margin-top: 36px;
  }

  .hero-phone .ph {
    position: absolute;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: -190px;
  }

  .proceedings {
    grid-template-columns: 1fr;
  }

  .proceedings .index {
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .honours-grid {
    grid-template-columns: 1fr;
  }

  .showcase figure.raised {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .site-header .wrap {
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 12px 0;
  }

  .site-header nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 14px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 52px);
  }

  .actions {
    gap: 10px;
  }

  .store-badge {
    padding: 0 14px;
  }

  .scale ol {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 24px 0 22px;
  }

  .scale li {
    display: flex;
    align-items: center;
    padding: 10px 0;
  }

  .scale li + li {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  .scale .bar {
    width: 44px;
    height: 10px;
    margin: 0 14px 0 0;
  }

  .stamps .stamp-row {
    justify-content: center;
    gap: 8px;
  }

  footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
