@font-face {
  font-family: Inter;
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: Inter;
  src: url("../fonts/Inter-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: block;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --ink: #1b1e23;
  --muted: #5c636d;
  --line: #e1e4e9;
  --accent: #0c6d86;
  --accent-hover: #09586c;
  --accent-soft: #e6f3f6;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 8px;
  --header-h: 4.25rem;
  /* House colors appear only on small cards, never as the page theme */
  --h666-bg: #070707;
  --h666-bone: #e8e4dc;
  --h666-muted: #8a857c;
  --h666-crimson: #9b1b2e;
  --hsaint-bg: #f4efe6;
  --hsaint-ink: #1c1814;
  --hsaint-muted: #8a8073;
  --hsaint-gold: #a67c32;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body {
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100svh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

/* ---------- Header / footer (Bit frame) ---------- */

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  padding: 1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
  outline: none;
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem 2rem 2rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.site-footer p {
  font-size: 0.8rem;
  font-weight: 500;
}

/* ---------- Buttons / links ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
}

.cta:hover,
.cta:focus-visible {
  color: var(--accent-hover);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-hover);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Landing hero ---------- */

.hero {
  padding: 5.5rem 1.5rem 4.5rem;
  text-align: center;
}

.hero .inner { max-width: 38rem; margin: 0 auto; }

.hero h1 {
  font-size: clamp(3.25rem, 8vw, 4.75rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--ink);
}

.standfirst {
  margin: 1.35rem auto 0;
  max-width: 32rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted);
}

.standfirst + .standfirst { margin-top: 0.85rem; }

.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ---------- Interior pages ---------- */

.page-body {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem 4rem;
}

.panel {
  width: min(36rem, 100%);
  text-align: center;
}

.panel h1 {
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.lede {
  margin: 0.9rem 0 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

form.verify-form {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  text-align: left;
}

.verify-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.verify-form textarea {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  min-height: 3.4rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.verify-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.verify-form .btn {
  align-self: flex-start;
  margin-top: 0.35rem;
  min-width: 7.5rem;
}

.panel .verify-form { }
.panel { text-align: left; }
.panel h1, .panel .lede { text-align: left; }

/* Result */

.result {
  display: none;
  margin: 1.75rem auto 0;
  width: min(36rem, 100%);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.3rem;
}

.result.is-visible { display: block; }

.result.is-ok { border-color: #b7d5dc; }
.result.is-fail { border-color: var(--line); }

.result-status {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.result.is-ok .result-status { color: var(--accent); }
.result.is-fail .result-status { color: var(--muted); }

.result h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.dl { display: grid; gap: 0.95rem; }

.dl dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.28rem;
}

.dl dd {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  word-break: break-all;
}

.dl dd.plain {
  font-family: var(--sans);
  font-size: 1rem;
  word-break: normal;
}

.dl a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.dl a:hover { text-decoration: underline; text-underline-offset: 0.15em; }

.result-note {
  margin-top: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.result-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Save to Wallet ---------- */

.page-wide { max-width: 56rem; margin: 0 auto; }

.save-head { text-align: center; margin-bottom: 2rem; }
.save-head h1 { font-size: clamp(1.8rem, 4vw, 2.25rem); font-weight: 650; letter-spacing: -0.04em; line-height: 1.15; }
.save-head .lede { margin-top: 0.6rem; }
.save-head .code-chip {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.wallet-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.wallet-col { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }

.wallet-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Shared pass look: off-white, graphite, teal accent */
.pass {
  width: min(20rem, 100%);
  background: var(--bg);
  color: var(--ink);
  border: 1px solid #d3d8de;
  box-shadow: 0 10px 28px rgba(27, 30, 35, 0.1), 0 1px 2px rgba(27, 30, 35, 0.06);
  font-family: var(--sans);
  text-align: left;
}

.pass .p-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.pass .p-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.pass .p-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; font-size: 1.05rem; letter-spacing: -0.03em; }
.pass .p-mark { width: 1.55rem; height: 1.55rem; border-radius: 5px; background: var(--accent); flex-shrink: 0; }
.pass .p-code { font-family: var(--mono); font-size: 0.78rem; margin-top: 0.15rem; text-align: right; }
.pass .p-house { font-size: 2.3rem; font-weight: 650; letter-spacing: -0.045em; line-height: 1.05; margin-top: 0.2rem; }
.pass .p-row { display: flex; gap: 1.75rem; margin-top: 1.1rem; }
.pass .p-val { font-size: 0.92rem; margin-top: 0.15rem; }
.pass .p-qr { background: #fff; border-radius: 6px; padding: 0.75rem; width: 10.5rem; margin: 1.35rem auto 0; }
.pass .p-qr svg { width: 100%; height: auto; display: block; }
.pass .p-alt { text-align: center; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.45rem; }

.pass-apple { border-radius: 14px; padding: 1.15rem 1.2rem 1.2rem; }

.pass-google { border-radius: 20px; padding: 1.2rem 1.25rem 1.25rem; }
.pass-google .p-title { font-size: 0.95rem; font-weight: 600; }
.pass-google .p-sub { font-size: 0.78rem; color: var(--muted); margin-top: 1.1rem; }
.pass-google .p-house { font-size: 1.9rem; margin-top: 0.1rem; }
.pass-google .p-qr { width: 12rem; border: 1px solid var(--line); }
.pass-google .p-details { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 0.85rem; display: grid; gap: 0.7rem; }
.pass-google .p-details .p-val { font-size: 0.85rem; }
.pass-google .p-details .mono { font-family: var(--mono); font-size: 0.7rem; word-break: break-all; line-height: 1.5; }

.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(20rem, 100%);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.wallet-btn:hover,
.wallet-btn:focus-visible { background: var(--accent-hover); outline: none; }

.wallet-btn[aria-expanded="true"] { background: var(--ink); }

.wallet-btn:disabled,
.wallet-btn:disabled:hover,
.wallet-btn:disabled:focus-visible {
  background: #8a9098;
  cursor: not-allowed;
}


.wallet-hint { font-size: 0.82rem; color: var(--muted); text-align: center; max-width: 20rem; line-height: 1.5; }

.google-payload {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: 2rem;
}

.google-payload[hidden] { display: none; }
.google-payload h2 { font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.google-payload p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.7rem; line-height: 1.5; }
.google-payload pre {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}
.google-payload a { color: var(--accent); font-weight: 500; font-size: 0.88rem; }

.save-note {
  margin: 2.25rem auto 0;
  max-width: 36rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.save-note a { color: var(--accent); font-weight: 500; }
.save-missing { text-align: center; margin-top: 2rem; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .site-header { padding: 0.9rem 1.15rem; }
  .site-footer { padding: 1.25rem 1.15rem 1.6rem; }
  .hero { padding: 3.5rem 1.15rem 3.25rem; }
  .page-body { padding: 1.75rem 1.15rem 3rem; }
  .verify-form .btn { width: 100%; }
  .wallet-previews { grid-template-columns: 1fr; gap: 2.25rem; }
  .save-head { margin-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
