/* ==========================================================
   Gulnara & Fredrik
   Palette: cream paper, deep garden green, brass.
   Type: engraved script for names and titles,
         Garamond serif for tracked caps and italic body.
   ========================================================== */

:root {
  --cream:  #F7F4ED;
  --sand:   #EDE6D9;
  --ink:    #2E2E2E;
  --green:  #1F3D2B;
  --sage:   #87998E;
  --brass:  #B6A36A;
  --tan:    #CEB79D;

  --script: 'Pinyon Script', cursive;
  --serif:  'Cormorant Garamond', Georgia, serif;
}

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

html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.site-open { overflow: auto; }

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


/* ==========================================================
   TYPE SCALE
   ========================================================== */

/* Script: names, section titles, event names. */
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.25;
  color: inherit;
}

.script-xl { font-size: clamp(3rem, 9vw, 5.2rem); }
.script-lg { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.script-md { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.script-sm { font-size: clamp(1.4rem, 4vw, 1.9rem); }

/* Label: uppercase, wide tracking. Everything structural. */
.label {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  line-height: 1.8;
  /* trailing letter-space sits inside the box, so centred text lands
     half a tracking unit left of true centre. Nudge it back. */
  text-indent: 0.12em;
}

.label-sm { font-size: 0.72rem; letter-spacing: 0.22em; }
.label-xs { font-size: 0.64rem; letter-spacing: 0.2em; }

/* Italic: all running body copy. */
.italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.italic-sm { font-size: 0.95rem; }

.prose {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* One text system: script section title, small green caps item title, plain body */
.item-title { color: var(--green); font-weight: 400; margin: 0.4rem 0 0.7rem; }
.body-text { font-family: var(--serif); font-size: 1.05rem; line-height: 1.7; }
.section-green .item-title { color: var(--cream); }

.prose p + p { margin-top: 1.2em; }

.gtk { max-width: 42rem; margin: 0 auto; text-align: center; }
.gtk-item + .gtk-item { margin-top: 2.4rem; }
.gtk-item h3 { margin: 0 0 0.7rem; }
/* pretty: the browser rebalances lines so a paragraph never ends on one lonely word */
.gtk-item p { font-size: 1.05rem; line-height: 1.7; text-wrap: pretty; }
.gtk-item p + p { margin-top: 0.5em; }


/* ==========================================================
   LANGUAGE SWITCHER
   ========================================================== */

/* Stays fixed over every section, so it carries its own chip rather than
   relying on the background behind it (cream sections and the dark hero
   both scroll under it). */
.lang-switcher {
  position: fixed;
  top: 0.9rem;
  right: 1.1rem;
  z-index: 2000;
  display: flex;
  gap: 0.15rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(31, 61, 43, 0.82);
  backdrop-filter: blur(6px);
}

.lang-switcher button {
  font-family: var(--serif);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--cream);
  opacity: 0.6;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  transition: opacity 0.25s, background 0.25s;
}

.lang-switcher button:hover { opacity: 0.85; }

.lang-switcher button.active {
  opacity: 1;
  background: var(--brass);
  color: var(--green);
}


/* ==========================================================
   ENVELOPE
   ========================================================== */

.envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.envelope-overlay.dismissed { opacity: 0; visibility: hidden; pointer-events: none; }

.envelope-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.envelope-scene > .envelope-dear { color: var(--green); margin-bottom: 1rem; }
.envelope-scene > .envelope-dear:not([hidden]) { animation: dear-in 0.6s ease-out; }
@keyframes dear-in { from { opacity: 0; } }
.envelope-scene > .label { color: var(--ink); opacity: 0.7; }
.envelope-scene > .script-xl { margin: 0.4rem 0 0.5rem; }
.envelope-scene > .italic { color: var(--ink); opacity: 0.65; margin-bottom: 2.4rem; }

.envelope {
  position: relative;
  width: clamp(280px, 74vw, 380px);
  aspect-ratio: 1.42;
  cursor: pointer;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: #16301F; /* darker than the front, reads as the envelope interior */
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(31, 61, 43, 0.22);
}

.envelope-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56%;
  background: #234630;
  clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
  transform-origin: top center;
  z-index: 4;
  /* z-index steps down once the flap is edge-on, so the folded-back flap
     ends up behind the card instead of painting over it */
  transition: transform 0.7s ease-in-out, z-index 0s 0.3s;
}

.envelope-front {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

/* Full front panel with a V notch cut out of the top, so the card is only
   ever visible through the notch. The flap covers the notch when closed. */
.envelope-front-flap {
  position: absolute;
  inset: 0;
  background: var(--green);
  clip-path: polygon(0% 0%, 50% 50%, 100% 0%, 100% 100%, 0% 100%);
}

.envelope-seal {
  position: absolute;
  top: 47%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #D6C089, var(--brass) 55%, #8E7C46);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.envelope-seal span {
  font-family: var(--script);
  font-size: 1.3rem;
  color: var(--green);
  line-height: 1;
}

.envelope-seal small { font-size: 0.7rem; }

/* Card inside */
.envelope-card {
  position: absolute;
  inset: 7%;
  z-index: 2;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}

.card-frame {
  width: 100%; height: 100%;
  background: var(--cream);
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--tan), inset 0 0 0 5px var(--cream), inset 0 0 0 6px var(--tan);
}

.card-frame .label { opacity: 0.7; }
.card-frame .script-md { margin: 0.3rem 0; }
.card-frame .italic-sm { opacity: 0.7; }
.card-date { color: var(--brass); margin-top: 0.9rem; }

.envelope-cta {
  margin-top: 2.4rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--brass);
  color: var(--ink);
  padding: 0 0 0.5rem;
  cursor: pointer;
  transition: color 0.3s;
}

.envelope-cta:hover { color: var(--brass); }

/* Open animation. The card rises far enough to read, but stops short of the
   names above it, so nothing collides before the overlay fades. */
.envelope.opened .envelope-flap { transform: rotateX(-180deg); z-index: 1; }
.envelope.opened .envelope-seal { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
.envelope.opened .envelope-card { transform: translateY(-42%); }


/* ==========================================================
   SITE + NAV
   ========================================================== */

.site { opacity: 0; transition: opacity 0.7s ease; }
.site.visible { opacity: 1; }

.site-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  /* wide side padding keeps the links clear of the fixed language switcher */
  padding: 1.6rem 6rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.25s;
}

.site-nav a:hover { opacity: 1; }


/* ==========================================================
   HERO
   ========================================================== */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.62) brightness(0.6);
}

/* Vignette plus a top-to-bottom wash, so the script stays legible
   wherever the photo happens to be bright. */
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(18, 28, 22, 0.5), transparent 70%),
    linear-gradient(to bottom, rgba(18, 28, 22, 0.6), rgba(18, 28, 22, 0.25) 45%, rgba(18, 28, 22, 0.65));
}

.hero-content {
  position: relative;
  text-align: center;
  color: var(--cream);
  padding: 0 1.5rem;
}

.hero-content .label { opacity: 0.9; }
.hero-content .script-xl { margin: 0.5rem 0 0.9rem; }


/* ==========================================================
   SECTIONS
   ========================================================== */

.section { background: var(--cream); color: var(--ink); }
.section-sand  { background: var(--sand); }
.section-green { background: var(--green); color: var(--cream); }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 7rem 1.6rem;
  text-align: center;
}

.wrap-wide { max-width: 68rem; }

.gt-address { margin: -1rem 0 3.4rem; line-height: 1.8; }
.gt-tip { margin-bottom: 3.6rem; }
.gt-address a { color: inherit; border-bottom: 1px solid var(--tan); text-decoration: none; }

.section h2.script { margin-bottom: 2.4rem; }

.ornament {
  display: block;
  width: 180px;
  height: 28px;
  margin: 0 auto 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }


/* ==========================================================
   OUR STORY
   ========================================================== */

.sign { margin-top: 1.6rem; color: var(--ink); }

/* Photos mounted like a print in a classical passe-partout: the same cream card and fine double
   tan rule as the invitation card and the RSVP card, a hairline around the print, and a gentle
   warm grade so the colours sit in the site's cream, green and brass palette */
.photo-frame {
  max-width: 560px;
  margin: 0 auto 2.6rem;
  padding: 26px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--tan), inset 0 0 0 5px var(--cream), inset 0 0 0 6px var(--tan);
}
.photo-portrait { max-width: 380px; }
#getting-there .photo-frame { margin-top: -1.2rem; margin-bottom: 3.4rem; }
footer .photo-frame { margin-bottom: 2.4rem; }
.section-green .photo-frame,
footer .photo-frame { box-shadow: inset 0 0 0 1px var(--tan), inset 0 0 0 5px var(--cream), inset 0 0 0 6px var(--tan), 0 10px 30px rgba(0, 0, 0, 0.25); }

.photo-frame img {
  width: 100%;
  height: auto;
  outline: 1px solid var(--tan);
  outline-offset: 5px;
  filter: sepia(0.18) saturate(0.8) contrast(0.96) brightness(1.02);
}
.tl-note + .photo-frame { margin-top: 2.6rem; margin-bottom: 0; }


/* ==========================================================
   PROGRAMME
   ========================================================== */

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
}

.tl-item { display: flex; flex-direction: column; align-items: center; }

.timeline-2 { grid-template-columns: repeat(2, minmax(0, 22rem)); justify-content: center; }

.tl-icon {
  width: 60px; height: 60px;
  margin-bottom: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

.tl-when { color: var(--tan); }
.tl-when .sep { margin: 0 0.15em; opacity: 0.6; }
.tl-item .italic-sm { opacity: 0.85; }

.tl-schedule {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.45rem 1rem;
  margin: 1.4rem 0 0;
  text-align: left;
}
.tl-schedule dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--tan);
  padding-top: 0.2em;
}
.tl-schedule dd { margin: 0; font-size: 1.05rem; line-height: 1.5; }

.tl-note { margin-top: 3rem; opacity: 0.7; }

.tl-schedule dt.dress-dt { margin-top: -0.3rem; }
.tl-schedule dd.tl-dress {
  margin-top: -0.3rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--tan);
}


/* ==========================================================
   RSVP
   ========================================================== */

.rsvp-card {
  max-width: 27rem;
  margin: 0 auto;
  padding: 3rem 2.4rem;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--tan), inset 0 0 0 5px var(--cream), inset 0 0 0 6px var(--tan);
}

.rsvp-loading,
.rsvp-no-token p,
.rsvp-not-found p,
.rsvp-already-msg { opacity: 0.7; }

.rsvp-greeting { margin-bottom: 2rem; }

.rsvp-form { text-align: left; }

.form-group { margin-bottom: 1.8rem; }

.form-group > label.label {
  display: block;
  margin-bottom: 0.7rem;
  opacity: 0.75;
  text-indent: 0;
}

.radio-group { display: flex; flex-direction: column; gap: 0.7rem; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
}

.radio-option input[type="radio"] {
  accent-color: var(--green);
  width: 0.95rem; height: 0.95rem;
}

.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid var(--tan);
  border-radius: 0;
  transition: border-color 0.25s;
}

.form-select:focus,
.form-textarea:focus { outline: none; border-bottom-color: var(--green); }

.form-textarea { resize: vertical; min-height: 2.6rem; }

.btn {
  display: block;
  width: 100%;
  margin-top: 2.2rem;
  padding: 1rem 1.5rem;
  background: var(--green);
  color: var(--cream);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover { background: #2B5239; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.rsvp-success-msg { color: var(--green); }

.rsvp-note { opacity: 0.75; margin: -1.2rem 0 2rem; text-align: center; }
.rsvp-parents {
  max-width: 30rem; margin: 0.4rem auto 2rem; padding: 1rem 0;
  border-top: 1px solid var(--tan); border-bottom: 1px solid var(--tan);
  text-align: center; text-wrap: pretty;
}

.person {
  border: none;
  border-top: 1px solid var(--tan);
  padding: 1.6rem 0 0.6rem;
  margin: 0 0 1.4rem;
  min-width: 0;
}

/* float takes the legend out of the fieldset border, so the line sits above the name */
.person-name { float: left; width: 100%; padding: 0; margin-bottom: 1rem; color: var(--ink); }
.person-name ~ * { clear: both; }
.person-name-input { margin-bottom: 1.2rem; }

.choice-row { margin-bottom: 1.2rem; }
.choice-row > .label { display: block; margin-bottom: 0.55rem; opacity: 0.75; text-indent: 0; }

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choices label { position: relative; cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span {
  display: inline-block;
  min-width: 4.2rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--tan);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}
.choices input:checked + span { background: var(--green); border-color: var(--green); color: var(--cream); }
.choices input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

.person-allergies { margin-top: 0.2rem; }

.rsvp-summary {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  font-style: italic;
  line-height: 1.8;
}

.rsvp-room { border-top: 1px solid var(--tan); padding-top: 1.6rem; margin-bottom: 1.4rem; }
.rsvp-room > .script { color: var(--ink); margin-bottom: 1rem; }
.rsvp-room .choices span b { display: block; font-weight: 400; }
.rsvp-room .choices span small { display: block; font-size: 0.85rem; opacity: 0.75; }
.rsvp-room-note { opacity: 0.75; margin-top: 0.8rem; }

.rsvp-calendar { margin-top: 1.8rem; }
.rsvp-calendar > .label { display: block; margin-bottom: 0.55rem; opacity: 0.75; }
.rsvp-calendar .choices { justify-content: center; }
.rsvp-calendar a { text-decoration: none; }
.rsvp-calendar a span { color: var(--ink); }
.rsvp-calendar a:hover span { background: var(--green); border-color: var(--green); color: var(--cream); }

.rsvp-edit {
  margin-top: 1.6rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--tan);
  padding: 0.3rem 0;
  color: var(--ink);
  cursor: pointer;
}


/* ==========================================================
   FOOTER
   ========================================================== */

footer {
  background: var(--green);
  color: var(--cream);
  text-align: center;
  padding: 5rem 1.5rem;
}

footer .label-xs { opacity: 0.55; margin-top: 0.6rem; }


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 720px) {
  html { font-size: 16px; }

  .wrap { padding: 4.5rem 1.4rem; }

  /* drop the links below the language switcher instead of behind it */
  .site-nav { justify-content: flex-start; gap: 1.6rem; padding: 3.2rem 1.2rem 1.2rem; }

  .timeline { grid-template-columns: 1fr; gap: 3.2rem; }

  .rsvp-card { padding: 2.2rem 1.5rem; }

  .lang-switcher { top: 0.7rem; right: 1rem; gap: 0.7rem; }
}
