/* ============================================================
   Lovehansa · Wedding Boarding Pass · Save the Date
   Caressa & Tobias · 17.04.2027 · CGN → HER
   ============================================================ */

:root {
  /* palette */
  --sage-deep: #5C7059;
  --sage-mid:  #6E8369;
  --sage-soft: #BFCAB2;
  --sage-mist: #E5E9D9;

  --cream:      #F4EEE1;
  --cream-warm: #ECE4D2;
  --cream-edge: #E1D7BD;

  --gold:       #A88A48;
  --gold-soft:  #C9AE74;
  --gold-faint: #D9C595;

  --ink:        #1B2418;
  --ink-soft:   #34402F;
  --ink-faint:  #5B6C56;

  /* typography */
  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-script:  'Parisienne', 'Allura', cursive;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;

  /* metrics */
  --pass-width: 440px;
  --pass-radius: 22px;
  --inner-pad: 30px;
}

/* ------------------- reset ------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, #F2EFE3 0%, #E8E5D4 45%, #D7DBC4 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* faint noise overlay on the whole page */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: 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.35  0 0 0 0 0.40  0 0 0 0 0.30  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ------------------- ambient ------------------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--gold-faint);
}
.bg-arc {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  opacity: 0.22;
  color: var(--gold-faint);
}
.bg-arc-1 { top: -10vmax; left: -10vmax; transform: rotate(-6deg); }
.bg-arc-2 { bottom: -15vmax; right: -10vmax; transform: rotate(8deg); opacity: 0.16; }

.glint {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 12px 1px rgba(201, 174, 116, 0.45);
  opacity: 0.55;
}
.glint-1 { top: 12%; left: 18%; animation: drift 14s ease-in-out infinite; }
.glint-2 { top: 32%; right: 14%; animation: drift 17s ease-in-out -3s infinite; }
.glint-3 { bottom: 22%; left: 26%; animation: drift 19s ease-in-out -7s infinite; }
.glint-4 { bottom: 14%; right: 22%; animation: drift 16s ease-in-out -11s infinite; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50%      { transform: translate(8px, -10px); opacity: 0.75; }
}

/* ------------------- stage ------------------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 60px) clamp(8px, 2vw, 30px);
}

/* ------------------- pass shell ------------------- */
.pass {
  position: relative;
  width: 100%;
  max-width: var(--pass-width);
  background: var(--cream);
  border-radius: var(--pass-radius);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 30px 60px -22px rgba(60, 80, 50, 0.32),
    0 14px 30px -14px rgba(40, 50, 30, 0.22),
    0 2px 6px rgba(40, 50, 30, 0.06);
  isolation: isolate;
  animation: pass-rise 1100ms cubic-bezier(0.18, 0.8, 0.22, 1) both;
  /* container queries: child sizes scale to pass width, not viewport */
  container-type: inline-size;
  container-name: pass;
}

.pass::after {
  /* inner gold hairline border */
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-faint);
  border-radius: calc(var(--pass-radius) - 8px);
  pointer-events: none;
  z-index: 5;
  opacity: 0.55;
}

@keyframes pass-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------- HEAD (green band) ------------------- */
.pass-head {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.05) 100%),
    var(--sage-deep);
  color: var(--cream);
  padding: 24px 28px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.05rem, 5.8vw, 2.6rem);
  letter-spacing: 0.005em;
  line-height: 1;
  color: var(--cream);
}
.brand-heart {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.55em;
  color: var(--gold-soft);
  transform: translateY(-0.5em);
  vertical-align: top;
}
.brand-sub {
  margin-top: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  white-space: nowrap;
}

.plane-loop {
  width: 125px;
  height: 72px;
  color: var(--gold-soft);
  flex-shrink: 0;
  margin-top: -4px;
  animation: plane-float 6s ease-in-out infinite;
}
.plane-loop .trail {
  opacity: 0.85;
}
@keyframes plane-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ------------------- BODY (cream) ------------------- */
.pass-body {
  padding: 28px var(--inner-pad) 22px;
  color: var(--ink);
  position: relative;
}

.title-block {
  text-align: center;
}
.save-the-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 9.5vw, 3.6rem);
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.012em;
}
.save-the-date em {
  font-style: italic;
  font-weight: 500;
  font-size: 0.8em;
  margin: 0 0.05em;
  color: var(--ink-soft);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 14px;
  color: var(--gold);
}
.ornament .line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
.ornament .dot {
  font-size: 0.8rem;
  color: var(--gold);
}

.invite-line {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
}
.names {
  font-family: var(--font-script);
  font-weight: 400;
  /* scale to container width — always fits on one line */
  font-size: clamp(1.5rem, 8.5cqi, 3rem);
  line-height: 1.15;
  color: var(--sage-deep);
  letter-spacing: 0;
  white-space: nowrap;
  /* slight optical adjustment — script fonts sit low */
  margin-top: 2px;
}

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-faint) 20%, var(--gold-faint) 80%, transparent);
  margin: 22px 0 18px;
  opacity: 0.7;
}

/* ------------------- ROUTE (CGN → HER) ------------------- */
.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.airport { text-align: center; }
.airport-from { text-align: left; }
.airport-to { text-align: right; }

.cap {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.airport .code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 7.8vw, 2.95rem);
  line-height: 1;
  color: var(--sage-deep);
  margin: 6px 0 4px;
  letter-spacing: 0.02em;
}
.airport .city {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.route-path {
  width: 100%;
  min-width: 80px;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.route-path .dash {
  flex: 1;
  height: 1px;
  /* dashed line: 1.4px dash, 3px gap */
  background-image: linear-gradient(to right, currentColor 50%, transparent 50%);
  background-size: 4.4px 1px;
  background-repeat: repeat-x;
  opacity: 0.85;
}
.route-plane {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: block;
  transform: rotate(90deg);  /* point right */
  filter: drop-shadow(0 1px 1px rgba(60, 80, 50, 0.12));
}

/* ------------------- CELLS ROW ------------------- */
.cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  padding-top: 6px;
}
.cell {
  text-align: center;
  position: relative;
  padding: 6px 4px 4px;
  min-width: 0;
}
.cell + .cell::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 10px;
  bottom: 6px;
  width: 1px;
  border-left: 1px dotted var(--gold-faint);
  opacity: 0.85;
}

.cell .val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 4.4cqi, 1.4rem);
  color: var(--sage-deep);
  letter-spacing: 0.015em;
  margin: 8px 0 4px;
  white-space: nowrap;
}

/* ------------------- FOOTER BANNER ------------------- */
.footer-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 0 6px;
}
.footer-banner .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sage-deep);
  flex-shrink: 0;
}
.banner-text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage-deep);
  white-space: nowrap;
}

/* ------------------- PERFORATION ------------------- */
.perforation {
  position: relative;
  height: 12px;
  background:
    radial-gradient(circle at 9px 12px, transparent 5.5px, var(--cream) 6px) repeat-x,
    var(--sage-deep);
  background-size: 18px 12px, 100% 100%;
}

/* ------------------- STUB (green) — countdown ------------------- */
.pass-stub {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.08)),
    var(--sage-deep);
  color: var(--cream);
  padding: 22px 26px 30px;
  text-align: center;
}

.stub-cap {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 16px;
}

.countdown {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: end;
  gap: 4px;
  padding: 6px 0 4px;
}
.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.time-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 9.5vw, 2.8rem);
  line-height: 1;
  color: var(--cream);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  transition: opacity 240ms ease;
}
.time-num.flip {
  opacity: 0.35;
}
.time-lbl {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream);
}
.time-sep {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--gold-soft);
  opacity: 0.75;
  transform: translateY(-11px);
  user-select: none;
}

.stub-ornament {
  margin: 18px auto 14px;
  font-size: 0.9rem;
  color: var(--gold-soft);
  position: relative;
  display: inline-block;
  padding: 0 16px;
}
.stub-ornament::before,
.stub-ornament::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 32px;
  height: 1px;
  background: var(--gold-soft);
  opacity: 0.5;
}
.stub-ornament::before { right: 100%; }
.stub-ornament::after  { left: 100%; }

.stub-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cream);
  max-width: 32ch;
  margin: 0 auto;
}
.stub-text strong {
  font-weight: 600;
  color: var(--gold-faint);
}

.stub-sign {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--gold-faint);
  margin-top: 14px;
}

/* ------------------- wallet & calendar buttons ------------------- */
.wallet-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px auto 0;
  max-width: 280px;
}
.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-faint);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.wallet-btn:hover,
.wallet-btn:focus-visible {
  background: var(--gold-soft);
  color: var(--sage-deep);
  border-color: var(--gold-soft);
  outline: none;
}
.wallet-btn:active {
  transform: scale(0.98);
}
.wallet-btn .wallet-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
/* placeholder state: dim until the real Pass2U URL is wired in */
.wallet-btn[data-pending] {
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------- reveal animation ------------------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
}
@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------- responsive: scale to pass width ------------------- */

/* medium pass (≤ 400px wide) */
@container pass (max-width: 400px) {
  .pass-body { padding-left: 24px; padding-right: 24px; }
  .pass-stub { padding-left: 22px; padding-right: 22px; }
  .pass-head { padding-left: 24px; padding-right: 24px; }
  .plane-loop { width: 110px; height: 64px; }

  .brand-name { font-size: 2.2rem; }
  .save-the-date { font-size: 2.8rem; }
  .airport .code { font-size: 2.45rem; }
  .airport .city { font-size: 0.76rem; letter-spacing: 0.16em; }
  .cell .val { font-size: 1.15rem; letter-spacing: 0.01em; }
  .cap { font-size: 0.7rem; letter-spacing: 0.18em; }
  .time-num { font-size: 2.3rem; }
  .time-sep { font-size: 1.4rem; transform: translateY(-9px); }
  .time-lbl { font-size: 0.66rem; letter-spacing: 0.22em; }
  .banner-text { font-size: 0.76rem; letter-spacing: 0.24em; }
  .footer-banner .bar { width: 16px; }
  .footer-banner { gap: 10px; }
  .stub-cap { font-size: 0.8rem; letter-spacing: 0.26em; }
  .stub-text { font-size: 0.88rem; }
}

/* narrow pass (≤ 340px wide) */
@container pass (max-width: 340px) {
  .pass-body { padding-left: 18px; padding-right: 18px; }
  .pass-stub { padding-left: 16px; padding-right: 16px; }
  .pass-head { padding-left: 20px; padding-right: 20px; }
  .plane-loop { width: 92px; height: 54px; }

  .brand-name { font-size: 1.8rem; }
  .brand-sub { font-size: 0.64rem; letter-spacing: 0.18em; }
  .save-the-date { font-size: 2.35rem; }
  .ornament .line { width: 40px; }
  .invite-line { font-size: 0.74rem; letter-spacing: 0.22em; }
  .airport .code { font-size: 2.05rem; }
  .airport .city { font-size: 0.68rem; letter-spacing: 0.14em; }
  .cell .val { font-size: 1rem; }
  .cap { font-size: 0.64rem; letter-spacing: 0.14em; }
  .time-num { font-size: 1.95rem; }
  .time-sep { font-size: 1.15rem; transform: translateY(-7px); }
  .time-lbl { font-size: 0.6rem; letter-spacing: 0.18em; }
  .banner-text { font-size: 0.68rem; letter-spacing: 0.2em; }
  .footer-banner .bar { width: 12px; }
  .footer-banner { gap: 8px; }
  .stub-cap { font-size: 0.74rem; letter-spacing: 0.24em; }
  .stub-text { font-size: 0.84rem; max-width: 28ch; }
  .stub-sign { font-size: 1.05rem; }
  .wallet-buttons { max-width: 220px; gap: 8px; }
  .wallet-btn { font-size: 0.7rem; padding: 9px 14px; letter-spacing: 0.1em; }
  .wallet-btn .wallet-icon { width: 16px; height: 16px; }
}

/* ------------------- larger screens — hover tilt ------------------- */
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  .pass {
    transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1),
                box-shadow 600ms ease;
    will-change: transform;
  }
  .pass:hover {
    transform: translateY(-4px) rotateX(2deg);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.6) inset,
      0 40px 80px -22px rgba(60, 80, 50, 0.38),
      0 20px 40px -14px rgba(40, 50, 30, 0.26),
      0 4px 10px rgba(40, 50, 30, 0.08);
  }
}

/* ------------------- reduced motion ------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .plane-loop .plane,
  .route-plane,
  .glint { animation: none; }
}
