/* Alex & Noelle wedding site: shared styles.
 * Palette and fonts from docs/SPEC.md. Pixel panels: hard ink borders, hard offset shadows, no rounding.
 */
:root {
  --navy: #1b2a4a;
  --navy-deep: #101a33;
  --stone: #efe6d2;
  --stone-light: #f7f1e3;
  --gold: #d4a640;
  --gold-light: #f2d27a;
  --ink: #2a1a16;
  --white: #ffffff;
  --rose: #c0182b;
  --muted: #5a4630;      /* 7.9:1 on stone */
  --ok: #1f5a2a;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
  --shadow: 4px 4px 0 var(--ink);
}

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

/* The hero stage is a 1:1 port of the approved scene and uses browser defaults. */
.hero-stage, .hero-stage * { box-sizing: content-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.35;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }

a { color: #7a2a1c; text-underline-offset: 3px; }
a:hover { color: #3a120c; }

:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--gold); color: var(--ink); border: 3px solid var(--ink);
  padding: 10px 14px; font-family: var(--font-pixel); font-size: 12px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------- header + nav ---------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 0 var(--ink);
  position: relative;
  z-index: 10;
}
.site-header :focus-visible { outline-color: var(--gold-light); }
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-pixel); font-size: 14px; color: var(--white); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
}
.brand:hover { color: var(--gold-light); }
.brand-mark {
  /* tiny pixel cross */
  width: 6px; height: 6px; background: var(--gold); flex: none; margin: 0 6px;
  box-shadow: 0 -6px 0 var(--gold), 0 -12px 0 var(--gold), 0 6px 0 var(--gold), 0 12px 0 var(--gold), -6px -6px 0 var(--gold), 6px -6px 0 var(--gold);
}
.nav-toggle {
  display: none;
  font-family: var(--font-pixel); font-size: 11px;
  background: transparent; color: var(--white); border: 3px solid var(--white);
  min-height: 44px; padding: 8px 12px; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px;
  font-family: var(--font-pixel); font-size: 10px; color: var(--white); text-decoration: none;
  border: 3px solid transparent;
}
.site-nav a:hover { color: var(--gold-light); border-color: var(--gold); }
.site-nav a[aria-current="page"] { background: var(--gold); color: var(--ink); border-color: var(--ink); }

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; padding-bottom: 8px; }
  .site-nav a { width: 100%; font-size: 11px; }
}

/* ---------- layout ---------- */
main { flex: 1; width: 100%; }
.wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap-wide { max-width: 1100px; }

.page-title {
  font-family: var(--font-pixel); font-size: 22px; line-height: 1.4; color: var(--navy);
  margin: 8px 0 8px;
}
.page-lede { font-size: 26px; color: var(--muted); margin: 0 0 24px; }
h2, h3 { font-family: var(--font-pixel); color: var(--navy); line-height: 1.5; }
.panel h2, .wrap h2 { font-size: 15px; margin: 0 0 12px; }
.panel h3, .wrap h3 { font-size: 12px; margin: 20px 0 8px; }
@media (min-width: 640px) { .page-title { font-size: 28px; } }

.panel {
  background: var(--stone-light);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 24px;
}
.panel > :last-child { margin-bottom: 0; }
.panel-navy { background: var(--navy); color: var(--white); }
.panel-navy h2, .panel-navy h3 { color: var(--gold-light); }
.panel-navy a { color: var(--gold-light); }
.panel-navy :focus-visible { outline-color: var(--gold-light); }

.tbd { color: var(--muted); font-style: italic; }
.panel-navy .tbd { color: #d9d2c0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 18px;
  font-family: var(--font-pixel); font-size: 12px; line-height: 1.4; text-align: center;
  background: var(--gold); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: var(--shadow);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--gold-light); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); box-shadow: 4px 4px 0 var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-small { font-size: 10px; padding: 8px 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* ---------- hero ---------- */
.hero {
  position: relative; width: 100%; aspect-ratio: 1200 / 760; overflow: hidden;
  background: #ece2cb; border-bottom: 4px solid var(--ink);
}
@supports not (aspect-ratio: 1 / 1) {
  .hero { height: 0; padding-top: 63.3333%; }
}
.hero-btn:focus-visible { outline: 6px solid var(--gold-light); outline-offset: 6px; }
.hero-btn:hover { filter: brightness(1.08); }

/* ---------- home ---------- */
.details-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .details-grid { grid-template-columns: 1fr 1fr; } }
.detail-list { margin: 0; display: grid; gap: 10px; }
.detail-list div { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
.detail-list dt { font-family: var(--font-pixel); font-size: 10px; padding-top: 6px; color: var(--navy); }
.panel-navy .detail-list dt { color: var(--gold-light); }
.detail-list dd { margin: 0; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 0; }
.countdown-cell {
  background: var(--navy-deep); border: 3px solid var(--gold); text-align: center; padding: 10px 4px;
}
.countdown-num { display: block; font-family: var(--font-pixel); font-size: 20px; color: var(--gold-light); }
.countdown-label { display: block; font-size: 18px; color: var(--white); margin-top: 4px; }
@media (min-width: 480px) { .countdown-num { font-size: 26px; } }
.countdown-done { font-family: var(--font-pixel); font-size: 14px; color: var(--gold-light); line-height: 1.6; }

.big-nav { display: grid; gap: 14px; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
@media (min-width: 520px) { .big-nav { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .big-nav { grid-template-columns: 1fr 1fr 1fr; } }
.big-nav a {
  display: flex; flex-direction: column; gap: 6px; min-height: 96px; padding: 16px;
  background: var(--stone-light); color: var(--ink); text-decoration: none;
  border: 4px solid var(--ink); box-shadow: var(--shadow);
}
.big-nav a:hover { background: var(--gold-light); }
.big-nav a:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.big-nav .bn-title { font-family: var(--font-pixel); font-size: 13px; color: var(--navy); }
.big-nav .bn-sub { font-size: 20px; color: var(--muted); }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .field legend, .label {
  font-family: var(--font-pixel); font-size: 11px; line-height: 1.5; color: var(--navy);
}
.optional { font-family: var(--font-body); font-size: 18px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px;
  font-family: var(--font-body); font-size: 22px; color: var(--ink);
  background: var(--white); border: 3px solid var(--ink); border-radius: 0;
}
textarea { min-height: 140px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--rose) !important; background: #fff4f4; }
.field-error { color: var(--rose); font-size: 20px; min-height: 0; margin: 0; }
.field-error:empty { display: none; }
.hint { font-size: 19px; color: var(--muted); margin: 0; }

fieldset { border: 3px solid var(--ink); padding: 12px 14px 14px; margin: 0; background: var(--stone-light); }
legend { padding: 0 6px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px;
  font-family: var(--font-body); font-size: 22px; color: var(--ink);
  border: 3px solid var(--ink); background: var(--white); cursor: pointer;
}
.radio-row input { width: 20px; height: 20px; accent-color: var(--navy); margin: 0; }
.radio-row label:has(input:checked) { background: var(--gold-light); }

.guest-row {
  border: 3px dashed var(--ink); padding: 12px; display: grid; gap: 10px; background: var(--white);
}
.guest-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.guest-row-head .label { margin: 0; }
.guest-fields { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .guest-fields { grid-template-columns: 1.3fr 1fr 1.3fr; } }
.guest-list { display: grid; gap: 12px; }
.not-attending .meal-only { display: none !important; }

.honeypot { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 22px; margin: 0; }
.form-status.error { color: var(--rose); }

.success-panel {
  background: var(--navy); color: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow);
  padding: 24px; text-align: center;
}
.success-panel h2 { color: var(--gold-light); font-size: 16px; line-height: 1.6; margin: 0 0 12px; }
.success-panel p { margin: 0 0 12px; font-size: 24px; }
.success-panel :focus-visible { outline-color: var(--gold-light); }
.success-panel .btn-outline { color: var(--white); border-color: var(--white); box-shadow: 4px 4px 0 var(--ink); }
.success-panel .btn-outline:hover { background: var(--white); color: var(--navy); }
.success-sprite {
  /* little pixel heart */
  width: 6px; height: 6px; margin: 12px auto 30px; color: var(--rose);
  box-shadow:
    -12px -6px 0 currentColor, -6px -6px 0 currentColor, 6px -6px 0 currentColor, 12px -6px 0 currentColor,
    -18px 0 0 currentColor, -12px 0 0 currentColor, -6px 0 0 currentColor, 0 0 0 currentColor, 6px 0 0 currentColor, 12px 0 0 currentColor, 18px 0 0 currentColor,
    -12px 6px 0 currentColor, -6px 6px 0 currentColor, 0 6px 0 currentColor, 6px 6px 0 currentColor, 12px 6px 0 currentColor,
    -6px 12px 0 currentColor, 0 12px 0 currentColor, 6px 12px 0 currentColor,
    0 18px 0 currentColor;
}
.success-panel .success-sprite { color: #ff6b7d; }

.notice {
  border: 3px solid var(--ink); background: var(--gold-light); padding: 10px 14px; margin: 0 0 18px; font-size: 22px;
}

/* ---------- registry ---------- */
.registry-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .registry-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .registry-grid { grid-template-columns: 1fr 1fr 1fr; } }
.gift {
  display: flex; flex-direction: column; background: var(--stone-light);
  border: 4px solid var(--ink); box-shadow: var(--shadow);
}
.gift-img {
  aspect-ratio: 4 / 3; background: var(--white); border-bottom: 4px solid var(--ink);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gift-img img { width: 100%; height: 100%; object-fit: contain; }
.gift-img-empty {
  font-family: var(--font-pixel); font-size: 10px; color: var(--muted);
  background-image: repeating-linear-gradient(45deg, #f2eadb 0 8px, #ffffff 8px 16px);
}
.gift-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gift-name { font-family: var(--font-pixel); font-size: 12px; line-height: 1.6; color: var(--navy); margin: 0; }
.gift-price { font-size: 26px; margin: 0; }
.gift-note { font-size: 20px; color: var(--muted); margin: 0; }
.gift-left { font-size: 20px; margin: 0; }
.gift-left.none { color: var(--rose); }
.gift-mine { font-size: 20px; margin: 0; color: var(--ok); font-weight: bold; }
.gift-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.gift.is-gone { opacity: 0.75; }

.empty-state { text-align: center; padding: 32px 20px; }
.empty-state p { margin: 8px 0; }

dialog.pixel-dialog {
  border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 0;
  background: var(--stone-light); color: var(--ink); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
dialog.pixel-dialog::backdrop { background: rgba(16, 26, 51, 0.7); }
.dialog-head { background: var(--navy); color: var(--white); padding: 14px 18px; }
.dialog-head h2 { margin: 0; color: var(--gold-light); font-size: 13px; line-height: 1.6; }
.dialog-body { padding: 18px; }
.dialog-body p { margin: 0 0 14px; }

/* ---------- content pages ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  border-bottom: 2px dashed #c9b994; padding: 8px 0;
}
.steps li:last-child { border-bottom: 0; }
.pose {
  font-family: var(--font-pixel); font-size: 10px; padding: 6px 8px; border: 3px solid var(--ink);
  min-width: 6.5em; text-align: center; white-space: nowrap;
}
.pose-stand { background: var(--gold-light); }
.pose-sit { background: var(--white); }
.pose-kneel { background: var(--navy); color: var(--white); }
.pose-any { background: var(--stone); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }

.faq dt { font-family: var(--font-pixel); font-size: 12px; line-height: 1.6; color: var(--navy); margin: 18px 0 6px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 0; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-deep); color: var(--white); border-top: 4px solid var(--gold);
  text-align: center; padding: 22px 16px 26px;
}
.site-footer .f-names { font-family: var(--font-pixel); font-size: 13px; color: var(--gold-light); margin: 0 0 8px; }
.site-footer p { margin: 4px 0; font-size: 20px; }
.site-footer a { color: var(--gold-light); }
.site-footer :focus-visible { outline-color: var(--gold-light); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:active, .big-nav a:active { transform: none; }
}

[hidden]{display:none !important}
