/* ============================================================
   linajasim.duckdns.org — a love letter from afar
   ============================================================ */

:root {
  --cream: #f4ecdc;
  --cream-warm: #f7e9d2;
  --cream-deep: #e8dcc4;
  --ink: #2a1810;
  --ink-soft: #4a3328;
  --ink-faint: rgba(42, 24, 16, 0.55);
  --oxblood: #a3322a;
  --oxblood-deep: #7e2620;
  --sage: #7c8b6f;
  --sage-deep: #5d6b53;
  --gold: #c69d4a;
  --gold-pale: #e8c87d;
  --dust: #b8a698;

  --serif-display: "Playfair Display", "Italiana", "EB Garamond", serif;
  --serif-roman: "Italiana", "EB Garamond", serif;
  --serif-body: "EB Garamond", "Garamond", "Times New Roman", serif;
  --script: "Imperial Script", "Apple Chancery", cursive;
  --mono: "JetBrains Mono", "Courier New", monospace;

  --reveal-base: 220ms;
  --reveal-step: 140ms;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  background: var(--cream);
}

body {
  font-family: var(--serif-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 1100px 700px at 50% -10%, #f9f0d8 0%, transparent 60%),
    radial-gradient(ellipse 800px 600px at 90% 110%, rgba(163, 50, 42, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 10% 110%, rgba(124, 139, 111, 0.07) 0%, transparent 60%),
    var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--oxblood); color: var(--cream-warm); }

/* ---------- paper + textures ---------- */

.paper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 72px) clamp(36px, 6vw, 96px);
  min-height: 100vh;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: multiply;
  opacity: 0.22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.09  0 0 0 0 0.06  0 0 0 0.85 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(58, 30, 20, 0.18) 100%);
}

/* ---------- shared rule ---------- */

.gallery-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: clamp(40px, 8vw, 80px) 0 clamp(20px, 3vw, 36px);
  font-family: var(--serif-roman);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.gallery-rule em {
  font-family: var(--serif-body);
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink);
}
.gallery-rule-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-faint) 30%, var(--ink-faint) 70%, transparent);
}
.gallery-rule-label {
  white-space: nowrap;
  padding: 0 4px;
}

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  padding: clamp(8px, 2vw, 24px) 0 clamp(24px, 4vw, 48px);
}
.kicker {
  display: inline-block;
  font-family: var(--serif-roman);
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.signature {
  margin: 6px 0 0;
  position: relative;
  display: inline-block;
  line-height: 1;
}
.signature-script {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(4rem, 13vw, 9.5rem);
  color: var(--oxblood);
  line-height: 0.85;
  letter-spacing: -0.01em;
  display: inline-block;
  transform: rotate(-3deg);
  text-shadow: 0 2px 0 rgba(163, 50, 42, 0.06);
}
.signature-underline {
  display: block;
  width: 56%;
  height: 1px;
  margin: -2px auto 0;
  background: linear-gradient(90deg, transparent, var(--oxblood) 20%, var(--oxblood) 80%, transparent);
  opacity: 0.4;
  transform: rotate(-2deg);
}

/* ---------- hero / countdown ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(20px, 4vw, 60px);
  align-items: center;
  padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 56px);
}

.datestamp {
  font-family: var(--serif-roman);
  text-transform: uppercase;
  color: var(--ink);
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  padding: 14px 12px;
  text-align: center;
  letter-spacing: 0.28em;
  display: grid;
  gap: 12px;
  transform: rotate(-1.5deg);
  min-width: 92px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0) 30%),
    rgba(255, 245, 225, 0.6);
  box-shadow:
    0 1px 0 rgba(42, 24, 16, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.datestamp-month { font-size: 0.86rem; }
.datestamp-day {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: 0;
  color: var(--oxblood);
  line-height: 1;
}
.datestamp-year {
  font-size: 0.7rem;
  letter-spacing: 0.36em;
}

.hero-body {
  position: relative;
  min-width: 0;
}

.hero-eyebrow {
  margin: 0;
  font-family: var(--serif-roman);
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-number {
  position: relative;
  margin: -6px 0 0;
  line-height: 0.82;
}
.hero-digits {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(9rem, 28vw, 22rem);
  color: var(--ink);
  letter-spacing: -0.045em;
  display: inline-block;
  position: relative;
  background: linear-gradient(180deg, var(--ink) 0%, #3a261b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.hero-digits::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 8%;
  bottom: 12%;
  height: 6%;
  background: var(--gold-pale);
  opacity: 0.42;
  z-index: -1;
  filter: blur(2px);
  transform: skewX(-8deg);
}

.hero-sub {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-sub .dot { color: var(--oxblood); }
.hero-clock { font-variant-numeric: tabular-nums; }

.hero-postscript {
  margin: 18px 0 0;
  font-family: var(--script);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  color: var(--oxblood);
  line-height: 1;
  letter-spacing: 0.01em;
  transform: rotate(-2deg);
}

/* ---------- gallery / slideshow ---------- */

.gallery {
  position: relative;
}

.stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 60vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  position: absolute;
  width: clamp(280px, 42vw, 520px);
  height: clamp(360px, 56vw, 640px);
  background: #fefaf0;
  padding: 14px 14px 56px;
  box-shadow:
    0 1px 1px rgba(42, 24, 16, 0.08),
    0 12px 36px rgba(42, 24, 16, 0.22),
    0 26px 60px rgba(42, 24, 16, 0.12);
  border: 1px solid rgba(42, 24, 16, 0.06);
  transition:
    transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 1.2s ease;
  will-change: transform, opacity;
  overflow: hidden;
}

.slide::before {
  /* tape on top */
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: linear-gradient(180deg, rgba(232, 200, 125, 0.55), rgba(232, 200, 125, 0.25));
  border: 1px solid rgba(180, 140, 60, 0.18);
  box-shadow: 0 2px 6px rgba(42, 24, 16, 0.08);
}

.slide-current {
  z-index: 3;
  transform: rotate(-1.4deg) translateY(0);
}
.slide-back-1 {
  z-index: 2;
  transform: rotate(4deg) translate(34px, 14px) scale(0.94);
  filter: brightness(0.96) saturate(0.94);
}
.slide-back-2 {
  z-index: 1;
  transform: rotate(-6deg) translate(-44px, 22px) scale(0.88);
  filter: brightness(0.92) saturate(0.88);
  opacity: 0.85;
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--cream-deep);
}
.slide-current img {
  animation: kenburns 9s ease-in-out forwards;
}
@keyframes kenburns {
  0%   { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.4%, -1.6%); }
}

.slide-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  font-family: var(--serif-roman);
  color: var(--ink-soft);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, rgba(42, 24, 16, 0.04) 0 1px, transparent 1px 14px),
    var(--cream-warm);
}
.slide-empty p { margin: 0; font-size: 1rem; }
.slide-empty small {
  font-family: var(--serif-body);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-size: 0.84rem;
}
.slide-empty-marker {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 900;
  font-size: 3rem;
  color: var(--oxblood);
  line-height: 1;
}

.caption {
  margin: clamp(20px, 3vw, 36px) 0 0;
  text-align: center;
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

/* ---------- flights / arrival board ---------- */

.flights-list {
  display: grid;
  gap: 18px;
}

.flights-locked {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 30%),
    rgba(124, 139, 111, 0.07);
  border: 1px solid rgba(124, 139, 111, 0.28);
  border-radius: 2px;
  padding: 28px 24px;
  text-align: center;
  font-family: var(--serif-body);
  color: var(--sage-deep);
  font-style: italic;
  letter-spacing: 0.02em;
  font-size: 1.06rem;
  position: relative;
}
.flights-locked strong {
  font-style: normal;
  font-family: var(--serif-roman);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--sage-deep);
}
.flights-locked small {
  display: block;
  margin-top: 8px;
  font-family: var(--serif-roman);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-style: normal;
  font-size: 0.7rem;
  color: rgba(93, 107, 83, 0.7);
}
.flights-locked-glyph {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.8rem;
  margin: 0 0 6px;
  color: var(--sage);
}

.flight-card {
  background:
    linear-gradient(180deg, #21241d 0%, #181b14 100%);
  color: var(--cream-warm);
  border: 1px solid #0d0f0a;
  border-radius: 3px;
  padding: 22px clamp(18px, 3vw, 32px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 12px 40px rgba(20, 24, 16, 0.4),
    0 2px 0 rgba(124, 139, 111, 0.18);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  font-family: var(--mono);
}

.flight-card-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(232, 220, 196, 0.6);
  border-bottom: 1px dashed rgba(232, 220, 196, 0.18);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.flight-card-head .flight-number {
  color: var(--gold-pale);
  letter-spacing: 0.22em;
  font-weight: 500;
}

.flight-endpoint {
  text-align: center;
}
.flight-code {
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  font-weight: 700;
  color: var(--cream-warm);
  letter-spacing: 0.08em;
  line-height: 1;
}
.flight-city {
  margin-top: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 220, 196, 0.55);
}
.flight-time {
  margin-top: 8px;
  font-size: 0.86rem;
  color: rgba(232, 220, 196, 0.85);
  letter-spacing: 0.1em;
}
.flight-time .delay {
  color: var(--oxblood);
  margin-left: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.flight-arrow {
  font-family: var(--serif-roman);
  font-size: 1.4rem;
  color: rgba(232, 220, 196, 0.4);
  letter-spacing: 0.06em;
}
.flight-arrow::before { content: "✈"; font-size: 1.1rem; }

.flight-status {
  text-align: center;
  padding: 8px 12px;
  border: 1px solid rgba(232, 220, 196, 0.22);
  border-radius: 1px;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-pale);
  background: rgba(232, 200, 125, 0.05);
  min-width: 96px;
  white-space: nowrap;
}
.flight-status.is-landed { color: var(--sage); border-color: rgba(124, 139, 111, 0.5); background: rgba(124, 139, 111, 0.08); }
.flight-status.is-active { color: var(--gold-pale); border-color: rgba(232, 200, 125, 0.4); }
.flight-status.is-scheduled { color: rgba(232, 220, 196, 0.7); }
.flight-status.is-delayed { color: var(--oxblood); border-color: rgba(163, 50, 42, 0.55); background: rgba(163, 50, 42, 0.08); }

.flight-note {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  border-top: 1px dashed rgba(232, 220, 196, 0.18);
  padding-top: 10px;
  font-family: var(--serif-body);
  font-style: italic;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
  color: rgba(232, 220, 196, 0.7);
  text-align: center;
}

@media (max-width: 720px) {
  .flight-card {
    grid-template-columns: 1fr auto 1fr;
  }
  .flight-status { grid-column: 1 / -1; justify-self: center; }
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: clamp(60px, 9vw, 110px);
  font-family: var(--serif-body);
  font-size: 0.92rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.footer-mark { color: var(--oxblood); }

/* ---------- reveal animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 1.4s cubic-bezier(0.16, 0.84, 0.3, 1) forwards;
}
[data-reveal="1"]  { animation-delay: calc(var(--reveal-base) + 0  * var(--reveal-step)); }
[data-reveal="2"]  { animation-delay: calc(var(--reveal-base) + 1  * var(--reveal-step)); }
[data-reveal="3"]  { animation-delay: calc(var(--reveal-base) + 2  * var(--reveal-step)); }
[data-reveal="4"]  { animation-delay: calc(var(--reveal-base) + 3  * var(--reveal-step)); }
[data-reveal="5"]  { animation-delay: calc(var(--reveal-base) + 4  * var(--reveal-step)); }
[data-reveal="6"]  { animation-delay: calc(var(--reveal-base) + 5  * var(--reveal-step)); }
[data-reveal="7"]  { animation-delay: calc(var(--reveal-base) + 6  * var(--reveal-step)); }
[data-reveal="8"]  { animation-delay: calc(var(--reveal-base) + 7  * var(--reveal-step)); }
[data-reveal="9"]  { animation-delay: calc(var(--reveal-base) + 8  * var(--reveal-step)); }
[data-reveal="10"] { animation-delay: calc(var(--reveal-base) + 9  * var(--reveal-step)); }

@keyframes reveal {
  to { opacity: 1; transform: none; }
}

/* ---------- swap animation for slides ---------- */
.slide.is-entering {
  animation: slide-enter 1.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes slide-enter {
  0%   { opacity: 0; transform: rotate(-8deg) translateY(-30px) scale(0.92); }
  100% { opacity: 1; transform: rotate(-1.4deg) translateY(0) scale(1); }
}

/* ---------- responsive nudges ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .datestamp { justify-self: start; transform: rotate(-1.5deg) translateX(4px); }
  .hero-digits { font-size: clamp(7rem, 36vw, 14rem); }
  .slide { width: 86vw; height: 110vw; max-width: 480px; max-height: 600px; }
}

/* ---------- a11y / motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .slide, .slide-current img, .slide.is-entering {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
