/* main.css — design system v2.
   Same warm invitation palette (cream, sage, forest, terracotta), rebuilt
   with a product-site discipline: one frosted sticky header, the invitation
   artwork as the hero, wide card grids over narrow prose columns, restrained
   motion, and a consistent spacing scale. Still zero JavaScript. */

:root {
  --cream: #FBF8F1;
  --cream-deep: #F1EADB;
  --paper: #FFFDF8;
  --ink: #4C4237;
  --ink-soft: #7A6E5C;
  --sage: #99A386;
  --sage-soft: #CAD0BB;
  --forest: #44573F;
  --terracotta: #B96A45;
  --blue: #9FB4C4;
  --gold: #C8A96A;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Segoe UI", Arial, sans-serif;
  --script: "Pinyon Script", cursive;

  --hairline: rgba(76, 66, 55, 0.08);
  --radius: 18px;
  --wide: 72rem;
  --prose: 46rem;
  --shadow-card: 0 1px 2px rgba(76, 66, 55, 0.05);
  --shadow-hover: 0 14px 34px rgba(76, 66, 55, 0.12);
  --shadow-hero: 0 24px 70px rgba(76, 66, 55, 0.16);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem; /* 17px floor — readable for every generation */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--sage-soft); color: var(--ink); }

a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- frosted sticky header ---------- */

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--forest);
  color: var(--cream);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

.site-head {
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-head {
    background: color-mix(in srgb, var(--cream) 80%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
  }
}

.head-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--forest);
  text-decoration: none;
  white-space: nowrap;
}
.brand .amp { font-family: var(--script); font-weight: 400; color: var(--terracotta); }

.nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.nav::-webkit-scrollbar { display: none; }
/* Centers when there's room; scrolls from the start when there isn't.
   (justify-content:center would clip the first links unreachably.) */
.nav a:first-child { margin-left: auto; }
.nav a:last-child { margin-right: auto; }

.nav a {
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  padding: 0.3rem 0.48rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--forest); }
.nav a[aria-current="page"] {
  color: var(--terracotta);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.lang {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1px solid var(--sage-soft);
  border-radius: 999px;
  padding: 0.28rem 0.9rem;
  color: var(--forest);
  background: var(--paper);
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lang:hover { border-color: var(--terracotta); }

/* Sticky only where there's room for it. */
@media (min-width: 820px) {
  .site-head { position: sticky; top: 0; z-index: 50; }
}
@media (max-width: 819.98px) {
  .head-inner { padding-bottom: 0.55rem; }
  .brand { order: 1; }
  .lang { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a:first-child { margin-left: 0; }
}

/* ---------- hero: the invitation as the front door ---------- */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem) 4rem;
}

.hero { padding-top: clamp(1.5rem, 4vw, 3rem); }

.hero-card {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 5000 / 2813;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: image-set(url("/static/img/invite-front-1400.webp") 1x, url("/static/img/invite-front-2100.webp") 2x);
  /* Text must stay inside the artwork's clear zone: x 22–78%, y 14.6–87.3%.
     Never widen this padding. */
  padding: 8.2% 22% 7%;
  border-radius: 22px;
  box-shadow: var(--shadow-hero);
}

.hero-pre {
  margin: 0 0 1.1cqw;
  font-size: 1.85cqw;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: 8.8cqw;
  line-height: 1.08;
  color: var(--forest);
}

.hero-card .orn { margin: 1.9cqw auto 1.4cqw; width: 14cqw; color: var(--sage); }

.hero-date {
  margin: 0;
  font-family: var(--serif);
  font-size: 3.3cqw;
  letter-spacing: 0.13em;
  color: var(--terracotta);
}

.hero-place {
  margin: 0.8cqw 0 0;
  font-size: 1.75cqw;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Phones get the portrait artwork, like the invitation itself. */
@media (max-width: 700px) {
  .hero-card {
    aspect-ratio: 1060 / 1484;
    background-image: image-set(url("/static/img/invite-p-front-720.webp") 1x, url("/static/img/invite-p-front-1060.webp") 2x);
    /* Portrait clear zone: x 22–78%, y 12.3–83.7%. */
    padding: 17.2% 22% 22.8%;
    border-radius: 18px;
  }
  .hero-pre { font-size: 3.3cqw; letter-spacing: 0.2em; }
  .hero-names { font-size: 13cqw; }
  .hero-card .orn { width: 27cqw; margin: 3.4cqw auto 2.8cqw; }
  .hero-date { font-size: 6.4cqw; }
  .hero-place { font-size: 3.1cqw; letter-spacing: 0.2em; }
}

/* ---------- sub-tabs (Things to Do / Ascain / Saint-Jean-de-Luz) ---------- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  margin: 0 auto clamp(1.5rem, 4vw, 2.25rem);
  padding: 0;
  background: none;
  width: fit-content;
  max-width: 100%;
}
.subnav a {
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.subnav a:hover { color: var(--forest); }
.subnav a[aria-current="page"] {
  color: var(--terracotta);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* Second level: same look, one size down, pulled close to the level above. */
.subnav-2 {
  gap: 0.15rem;
  margin-top: -0.5rem;
}
.subnav-2 a {
  font-size: 0.88rem;
  padding: 0.3rem 0.85rem;
  color: var(--ink-soft);
}
.subnav-2 a[aria-current="page"] {
  color: var(--terracotta);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* The title already introduces the page; pull the tabs up close to it. */
.page-title + .subnav { margin-top: -0.5rem; }
.subnav + .sect { margin-top: 0; }

/* Personal hello, added by script when this browser has an invitation. */
.greeting {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  text-align: center;
  color: var(--terracotta);
  max-width: var(--prose);
  margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
}

/* ---------- content rhythm ---------- */

.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--forest);
  max-width: 20ch;
  margin: clamp(2.75rem, 7vw, 4.5rem) auto clamp(1.75rem, 4vw, 2.5rem);
}
.page-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 1px;
  background: var(--gold);
  margin: clamp(1rem, 2.5vw, 1.4rem) auto 0;
}

/* The first section after the title shouldn't add its own big gap. */
.page-title + .sect { margin-top: 0; }

.sect {
  max-width: var(--prose);
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
}
.sect:has(.cards) { max-width: none; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-align: center;
  color: var(--forest);
  margin: 0 0 1.6rem;
}
h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--gold);
  margin: 0.7rem auto 0;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--forest);
  margin: 0 0 0.4rem;
}

p { margin: 0 0 1.05rem; }
.sect > p { max-width: var(--prose); margin-left: auto; margin-right: auto; }

.orn { display: block; margin: 0 auto; width: 8.5rem; color: var(--sage); }
.divide { text-align: center; margin: clamp(3rem, 7vw, 4.5rem) 0 0; }

.notice {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  text-align: center;
  background: var(--cream-deep);
  border-radius: var(--radius);
  padding: 1.2rem 1.6rem;
  margin: 0;
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.timeline li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
}
.timeline li + li { border-top: 1px solid var(--hairline); }

.tl-time {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--terracotta);
  padding-top: 0.05rem;
  text-align: right;
}
.tl-body h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.tl-body p { margin: 0; color: var(--ink-soft); }

@media (max-width: 540px) {
  .timeline li { grid-template-columns: 1fr; gap: 0.2rem; padding: 1.2rem 1.25rem; }
  .tl-time { text-align: left; }
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card p { color: var(--ink-soft); margin: 0 0 0.65rem; }
.card p:last-child { margin-bottom: 0; }

.badge {
  font-size: 0.76rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 0.4rem;
}

.card-addr {
  font-size: 0.82rem;
  color: var(--ink-soft);
  opacity: 0.85;
  margin: -0.2rem 0 0.65rem;
}

.card-link {
  display: inline-block;
  font-weight: 500;
  text-decoration: none;
  margin-top: 0.15rem;
}
.card-link::after { content: " →"; }
.card-link:hover { text-decoration: underline; }

/* ---------- FAQ ---------- */

.faq-list {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.25rem 1.5rem;
  max-width: var(--prose);
}

.faq + .faq { border-top: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--forest);
  list-style: none;
  transition: color 0.2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--terracotta);
  flex: none;
  transition: transform 0.25s ease;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--terracotta); }
.faq p { margin: 0 0 1.2rem; color: var(--ink-soft); }

/* ---------- Basque words ---------- */

.words {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.1rem 1.5rem;
  margin: 0;
}
.words > div {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-card);
}
.words dt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--forest);
}
.words dd { margin: 0.1rem 0 0; color: var(--ink-soft); font-size: 0.97rem; }

/* Added by script on the RSVP page when this browser has an invitation. */
.rsvp-jump {
  display: block;
  width: fit-content;
  margin: 2rem auto 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.8rem 2.2rem;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 6px 18px rgba(68, 87, 63, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.rsvp-jump::after { content: " →"; }
.rsvp-jump:hover { background: var(--terracotta); color: var(--cream); transform: translateY(-1px); }

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

.foot {
  text-align: center;
  border-top: 1px solid var(--hairline);
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-bottom: 3rem;
}

.rhune {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  margin: 3rem auto 1.5rem;
  color: var(--sage-soft);
}

.foot p { margin: 0.2rem 0; font-size: 0.95rem; color: var(--ink-soft); }
.foot-basque { font-family: var(--serif); font-style: italic; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .card,
    .sect > h2,
    .timeline li,
    .words > div {
      animation: rise 0.8s both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes rise {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .nav a, .faq summary::after { transition: none; }
}

/* ---------- larger screens ---------- */

@media (min-width: 640px) {
  body { font-size: 1.125rem; }
}
