/* ============================================================
   WeST Trust Board · warm institutional theme
   Display: Fraunces (variable opsz + SOFT axis for warmth)
   Body:    Public Sans (US Web Design System sans, free)
   ============================================================ */

:root {
  --bg:           #F4EFE6;
  --bg-deep:      #EAE2D2;
  --bg-grain:     0.04;
  --surface:      #FFFFFF;
  --surface-2:    #FBF7EE;
  --ink:          #1A1D24;
  --ink-2:        #4F535F;
  --ink-3:        #847E6F;
  --border:       #E5DBC7;
  --border-soft:  #EFE7D5;
  --accent:       #0E5E6F;
  --accent-deep:  #0A4854;
  --accent-soft:  #DCEAEC;
  --copper:       #B0581C;
  --copper-soft:  #F1E1CB;
  --shadow-sm:    0 1px 0 rgba(20,22,26,.04), 0 1px 2px rgba(20,22,26,.04);
  --shadow-md:    0 1px 0 rgba(20,22,26,.04), 0 8px 24px -12px rgba(20,22,26,.18);
  --shadow-lg:    0 1px 0 rgba(20,22,26,.04), 0 24px 48px -24px rgba(20,22,26,.28);
  --radius:       14px;
  --radius-lg:    20px;
  --tile-pad:     24px;
  --container:    1100px;
  --ease:         cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Warm paper grain + soft top-right glow */
  background-image:
    radial-gradient(1100px 600px at 88% -10%, rgba(14, 94, 111, .07), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(176, 88, 28, .05), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.10  0 0 0 0 0.10  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-blend-mode: multiply, normal, multiply;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px 96px;
  flex: 1;
}
.container--narrow { max-width: 640px; }

/* ---------- Site header ---------- */
.site-header {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none !important;
}
.brand:hover .brand-name-mark { color: var(--accent); }
.brand-mark {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-name-mark {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  font-variation-settings: 'opsz' 24, 'SOFT' 40;
  letter-spacing: -0.01em;
  transition: color .25s var(--ease);
}
.brand-name-sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-nav { display: inline-flex; align-items: center; gap: 18px; }
.nav-link {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .01em;
  padding: 6px 0;
}
.nav-link--cta {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}
.nav-link--cta:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.nav-form { margin: 0; }
.link-btn {
  background: none; border: 0; padding: 6px 0;
  font: inherit; color: var(--ink-2); cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.link-btn:hover { color: var(--accent); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.status-pill--in { color: var(--accent-deep); }
.status-pill--in svg { color: #1ea66a; }

/* ---------- Hero ---------- */
.hero {
  margin: 36px 0 72px;
}
.hero-text { width: 100%; }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
  padding-left: 30px;
  position: relative;
}
.eyebrow::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 22px; height: 1px;
  background: var(--ink-3);
  transform: translateY(-50%);
}

.display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 360;
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 22px;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}
.display em {
  font-style: italic;
  font-weight: 360;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
}
.display--sm {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 14px;
}

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.lede--sm { font-size: 16px; }

.hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--copper));
  border-radius: 3px;
}
.hero-card-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 8px;
}
.hero-card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Inline notice (hero) and callout (admin) ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--copper-soft);
  border: 1px solid color-mix(in srgb, var(--copper) 18%, var(--border));
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}
.notice strong { color: var(--copper); font-weight: 700; }
.notice-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--copper);
  margin-top: 1px;
}

.callout {
  margin: 22px 0 28px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  border-left: 3px solid var(--copper);
}
.callout--warn { background: var(--copper-soft); border-color: color-mix(in srgb, var(--copper) 22%, var(--border)); }
.callout strong { color: var(--copper); }

/* ---------- Sections ---------- */
.tiles-section { margin: 0 0 80px; }
.tiles-section--trust { padding-top: 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variation-settings: 'opsz' 36, 'SOFT' 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lock-glyph {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--copper-soft);
  color: var(--copper);
}

/* ---------- Tile grid ---------- */
.tile-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tile-wrap {
  opacity: 0;
  transform: translateY(8px);
  animation: tile-in .55s var(--ease) forwards;
  animation-delay: var(--stagger, 0ms);
}
@keyframes tile-in {
  to { opacity: 1; transform: translateY(0); }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--tile-pad);
  text-decoration: none !important;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  overflow: hidden;
  isolation: isolate;
}
.tile::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .45s var(--ease);
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.tile:hover::after,
.tile:focus-visible::after {
  transform: scaleX(1);
}
.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tile--soon {
  cursor: not-allowed;
  opacity: .72;
}
.tile--soon:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.tile--soon::after { display: none; }

.tile-icon-wrap {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 18px;
  transition: transform .4s var(--ease), background .3s var(--ease);
}
.tile:hover .tile-icon-wrap { transform: rotate(-4deg) scale(1.04); }

.tile-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
  font-variation-settings: 'opsz' 30, 'SOFT' 60;
}
.tile-blurb {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 18px;
  flex: 1;
}
.tile-cta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent-deep);
}
.tile-cta-arrow {
  display: inline-block;
  transition: transform .3s var(--ease);
}
.tile:hover .tile-cta-arrow { transform: translate(3px, -3px); }

/* Trust-only tile variant */
.tile--trust {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.tile--trust::after { background: var(--copper); }
.tile--trust .tile-icon-wrap {
  background: var(--copper-soft);
  color: var(--copper);
}
.tile--trust:hover { border-color: var(--copper); }
.tile-key {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--copper);
  background: var(--copper-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.tile-key--request {
  background: var(--ink);
  color: #F4EFE6;
}

/* Trust + no URL: a real artefact, just not linkable. Full opacity,
   no lift-on-hover, no top-accent rule. CTA reads "Available on request". */
.tile--request { cursor: default; opacity: 1; }
.tile--request:hover,
.tile--request:focus-visible {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}
.tile--request::after { display: none; }
.tile--request .tile-icon-wrap { transform: none !important; }
.tile--request .tile-cta {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Gated panel ---------- */
.gated-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.gated-panel p { margin: 0; color: var(--ink-2); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .15s var(--ease);
  text-decoration: none !important;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-deep); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Auth ---------- */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px 36px;
  box-shadow: var(--shadow-md);
  margin: 40px 0;
}
.auth-form { display: flex; flex-direction: column; gap: 20px; margin-top: 26px; }
.auth-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
}
.link-muted {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
.link-muted:hover { color: var(--accent); }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 8px;
  font-size: 12px;
}
.field-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea.field-input { resize: vertical; min-height: 96px; font-family: inherit; }
.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.checkbox {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-2);
}
.form-error {
  color: var(--copper);
  background: var(--copper-soft);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0;
}
.form-actions {
  display: flex; align-items: center; gap: 16px; margin-top: 8px;
}

/* ---------- Admin ---------- */
.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  margin: 30px 0 26px;
  flex-wrap: wrap;
}
.admin-head h1 { margin-bottom: 0; }
.flash {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 18px;
}
.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.admin-table th, .admin-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.col-sort { width: 80px; }
.col-actions { width: 160px; text-align: right; }
.col-url a { word-break: break-all; }
.row-blurb { color: var(--ink-3); font-size: 13px; margin-top: 4px; max-width: 46ch; }
.text-muted { color: var(--ink-3); }
.is-archived td { opacity: .55; }
.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.chip--public { background: var(--accent-soft); color: var(--accent-deep); }
.chip--trust  { background: var(--copper-soft); color: var(--copper); }
.inline-form { display: inline; margin: 0 0 0 14px; }
.link-danger {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--copper);
  cursor: pointer;
}
.link-danger:hover { text-decoration: underline; text-underline-offset: 3px; }
.admin-form { display: flex; flex-direction: column; gap: 22px; margin-top: 28px; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 28px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.footer-row { display: flex; align-items: center; gap: 8px; }
.footer-row--muted { color: var(--ink-3); font-size: 12.5px; }
.footer-mark { color: var(--ink-2); font-weight: 600; }
.footer-sep { color: var(--border); }

/* ---------- Locked / sign-in screen ---------- */
.page-locked .site-header { position: relative; z-index: 4; }
.page-locked .site-footer { position: relative; z-index: 4; }

.locked-stage {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 28px 80px;
  flex: 1;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.ghost-grid {
  position: absolute;
  inset: 28px 28px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  /* Blur the ghost layer directly so it always reads as a frosted backdrop
     regardless of contrast between the ghost cards and the parchment. */
  filter: blur(10px) saturate(115%);
  -webkit-filter: blur(10px) saturate(115%);
  transform: scale(1.02); /* avoid blur softening exposing edges */
  transform-origin: center;
}

.ghost-tile {
  /* Gradient fill (teal -> copper -> cream) so the blur picks up real
     colour, not a near-uniform off-white. */
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 18%, var(--surface)) 0%,
      var(--surface) 45%,
      color-mix(in srgb, var(--copper) 14%, var(--surface)) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--tile-pad);
  box-shadow: var(--shadow-md);
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  animation: tile-in .55s var(--ease) forwards;
  animation-delay: var(--stagger, 0ms);
}
.ghost-tile:nth-child(2n) {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--copper) 16%, var(--surface)) 0%,
    var(--surface) 55%,
    color-mix(in srgb, var(--accent) 14%, var(--surface)) 100%);
}
.ghost-tile:nth-child(3n) {
  background: linear-gradient(180deg,
    var(--surface) 0%,
    color-mix(in srgb, var(--accent) 20%, var(--surface)) 100%);
}

.ghost-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--copper));
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.ghost-line {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border-soft), var(--bg-deep), var(--border-soft));
  background-size: 200% 100%;
  animation: shimmer 2.6s linear infinite;
}
.ghost-line--title { height: 18px; width: 70%; margin-bottom: 6px; background: linear-gradient(90deg, var(--ink-3), var(--ink-2), var(--ink-3)); background-size: 200% 100%; animation: shimmer 2.6s linear infinite; opacity: .35; }
.ghost-line--short { width: 55%; }
.ghost-cta {
  display: block;
  height: 12px;
  width: 30%;
  border-radius: 6px;
  background: var(--accent);
  opacity: .6;
  margin-top: auto;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Very light wash on top of the blurred grid to keep the warm tone
   consistent and ensure the sign-in card sits on a calm field. */
.locked-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(640px 460px at 50% 52%, rgba(244, 239, 230, .12), rgba(244, 239, 230, .32) 70%, rgba(244, 239, 230, .48) 100%);
}

.locked-card {
  position: relative;
  z-index: 3;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-lg);
  text-align: left;
  animation: card-in .55s var(--ease) both;
  animation-delay: 120ms;
}
.locked-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 32px; right: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--copper));
  border-radius: 3px;
}
.locked-card .eyebrow {
  color: var(--copper);
  margin-bottom: 14px;
}
.locked-card .eyebrow::before { background: var(--copper); }
.locked-card .auth-form { margin-top: 20px; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@media (max-width: 640px) {
  .locked-card { padding: 32px 24px 26px; }
}

/* ---------- Phone-width refinements (iPhone SE upward) ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .container { padding: 0 20px 64px; }
  .site-header { padding: 18px 20px 16px; gap: 10px; }
  .site-footer { padding: 22px 20px 28px; }

  .brand-mark { width: 32px; height: 32px; }
  .brand-name-mark { font-size: 17px; }
  .brand-name-sub { font-size: 10px; letter-spacing: .14em; }

  .site-nav { gap: 12px; }
  .nav-link, .link-btn { font-size: 13px; }
  .status-pill { font-size: 11px; padding: 3px 8px 3px 7px; }

  .hero { margin: 24px 0 44px; gap: 22px; }
  .display {
    font-size: clamp(34px, 9.6vw, 52px);
    letter-spacing: -0.02em;
  }
  .display--sm { font-size: clamp(26px, 7.8vw, 36px); }
  .lede { font-size: 16px; }

  .notice { font-size: 13px; padding: 10px 12px; gap: 8px; }

  .tile-grid { gap: 14px; }
  .tile { padding: 20px; }
  .tile-title { font-size: 20px; }
  .tile-blurb { font-size: 14px; }
  .tile-icon-wrap { width: 40px; height: 40px; margin-bottom: 14px; }

  .section-head { margin-bottom: 18px; padding-bottom: 10px; }
  .section-title { font-size: 22px; }

  .auth-card { padding: 28px 22px 24px; margin: 28px 0; }

  .locked-stage { padding: 20px 20px 64px; min-height: 60vh; }
  .ghost-grid { inset: 20px 20px 64px; gap: 14px; }
  .ghost-tile { min-height: 190px; padding: 20px; }
  .locked-card { padding: 30px 22px 24px; }
  .locked-card::before { left: 22px; right: 22px; }

  .gated-panel { padding: 22px 20px; }

  .admin-head { margin: 22px 0 18px; gap: 10px; }
  .admin-table th, .admin-table td { padding: 12px 12px; }
  .col-actions { width: auto; text-align: left; }
  .col-actions .inline-form { margin-left: 10px; }

  .callout { padding: 12px 14px; font-size: 14px; }

  .footer-row { flex-wrap: wrap; }
}

/* Very narrow (iPhone SE 1st gen, 320px) — keep the header from wrapping awkwardly. */
@media (max-width: 380px) {
  .site-header { padding: 16px 16px 14px; }
  .container { padding: 0 16px 56px; }
  .brand-name-sub { display: none; }
  .status-pill { padding: 3px 6px; }
  .status-pill svg { display: none; }
}

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tile-wrap { opacity: 1; transform: none; animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
