:root {
  --bg: #f6f1e9;
  --bg-alt: #eee6d8;
  --card: #fbf8f3;
  --ink: #2a2420;
  --muted: #6f655b;
  --accent: #7d8a6a;
  --accent-ink: #4f5a41;
  --line: rgba(42, 36, 32, 0.14);
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(16px, 5vw, 72px);
  --max: 1180px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 clamp(16px, 0.3vw + 15px, 18px)/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; }

p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1rem;
}

.amp {
  font-style: italic;
  color: var(--accent);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 72px);
}

.section-title { font-size: clamp(2.75rem, 6vw, 4.5rem); }

.section-lead { color: var(--muted); margin-top: 1.25rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.6em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 0.8rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.button:hover { background: transparent; color: var(--ink); }

.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--bg); }

/* Nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 14px;
  color: #fff;
  transition: background 0.4s, color 0.4s, box-shadow 0.4s;
}

.nav--solid {
  background: rgba(246, 241, 233, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.nav__brand {
  font: italic 400 1.5rem/1 var(--serif);
  text-decoration: none;
}

.nav__brand span { margin: 0 0.1em; }

.nav__links {
  display: flex;
  gap: clamp(14px, 3vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.nav__links a:hover { opacity: 1; }

.nav__links { margin-left: auto; }

.lang {
  display: flex;
  margin-left: clamp(18px, 3vw, 40px);
  padding-left: clamp(14px, 2.5vw, 28px);
  border-left: 1px solid currentColor;
  border-left-color: color-mix(in srgb, currentColor 35%, transparent);
}

.lang button {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: inherit;
  font: 500 0.72rem/1 var(--sans);
  letter-spacing: 0.14em;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s;
}

.lang button:hover { opacity: 0.85; }

.lang button[aria-pressed="true"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 5px;
}

@media (max-width: 560px) {
  .nav__brand { display: none; }
  .nav__links { margin-left: 0; gap: 14px; }
  .nav__links a { font-size: 0.62rem; letter-spacing: 0.12em; }
  .lang { margin-left: 10px; padding-left: 8px; }
  .lang button { padding: 4px 4px; font-size: 0.62rem; letter-spacing: 0.08em; }
}

@media (max-width: 359px) {
  .nav__links a { letter-spacing: 0.06em; }
  .nav__links { gap: 10px; }
}

/* Hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  display: grid;
  place-items: start center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background: #4a4238;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 8% 50%;
  animation: hero-in 2.4s var(--ease) both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 16, 12, 0.55), rgba(20, 16, 12, 0.2) 45%, rgba(20, 16, 12, 0) 60%),
    linear-gradient(to top, rgba(20, 16, 12, 0.35), rgba(20, 16, 12, 0) 35%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(72px, 10vh, 120px) var(--gutter) 0;
  text-shadow: 0 2px 24px rgba(20, 16, 12, 0.35);
}

.hero__names {
  font-size: clamp(3.5rem, 11vw, 8rem);
  letter-spacing: -0.01em;
  animation: fade-up 1.4s 0.8s var(--ease) both;
}

.hero__names .amp { color: rgba(255, 255, 255, 0.85); }

.hero__date {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  animation: fade-up 1.2s 1.1s var(--ease) both;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    place-items: center;
    background: #ece4d6;
    color: var(--ink);
    isolation: isolate;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: -20% -20% -20% 30%;
    z-index: -1;
    background:
      radial-gradient(closest-side at 30% 30%, rgba(125, 138, 106, 0.6), transparent),
      radial-gradient(closest-side at 75% 25%, rgba(222, 166, 136, 0.6), transparent),
      radial-gradient(closest-side at 60% 80%, rgba(236, 196, 140, 0.65), transparent);
    background-size: 80% 70%, 75% 70%, 85% 75%;
    background-position: 0 10%, 100% 0, 60% 100%;
    background-repeat: no-repeat;
    filter: blur(24px);
    animation: blobs 26s ease-in-out infinite alternate;
  }

  .hero::after { display: none; }

  .hero__media {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    overflow: hidden;
  }

  .hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(20, 16, 12, 0.4), rgba(20, 16, 12, 0) 22%);
    pointer-events: none;
  }

  .hero__content {
    grid-column: 2;
    grid-row: 1;
    padding: 0 var(--gutter) var(--arch);
    text-shadow: none;
  }

  .hero__names { font-size: clamp(3.5rem, 6.5vw, 7rem); }

  .hero__names .amp { color: var(--accent); }

  .hero__date { color: var(--muted); }

  .nav:not(.nav--solid) .nav__links,
  .nav:not(.nav--solid) .lang { color: var(--ink); }
}


@keyframes hero-in {
  from { transform: scale(1.12); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* Tinted sections with a side photo */

.tinted {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f1e8da;
}

.tinted::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(closest-side at 18% 28%, var(--blob-1), transparent),
    radial-gradient(closest-side at 82% 22%, var(--blob-2), transparent),
    radial-gradient(closest-side at 70% 82%, var(--blob-3), transparent),
    radial-gradient(closest-side at 22% 85%, var(--blob-4), transparent);
  background-size: 95% 80%, 85% 75%, 95% 85%, 80% 70%;
  background-repeat: no-repeat;
  background-position: 0 10%, 100% 0, 100% 100%, 0 95%;
  filter: blur(24px);
  animation: blobs 26s ease-in-out infinite alternate;
}

.tinted--sage {
  background: #e4e3d2;
  --blob-1: rgba(125, 138, 106, 0.85);
  --blob-2: rgba(222, 166, 136, 0.8);
  --blob-3: rgba(150, 165, 132, 0.85);
  --blob-4: rgba(236, 196, 140, 0.85);
}

.tinted--blush {
  background: #efdcd0;
  --blob-1: rgba(214, 150, 126, 0.8);
  --blob-2: rgba(150, 165, 132, 0.75);
  --blob-3: rgba(232, 180, 130, 0.85);
  --blob-4: rgba(190, 136, 150, 0.7);
}

@keyframes blobs {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); }
  100% { transform: translate3d(-4%, 3%, 0) rotate(-6deg) scale(1); }
}

.split {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.split--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.split--flip > .photo { order: 2; }

.photo {
  position: relative;
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 440px;
}

.photo::after {
  content: "";
  position: absolute;
  inset: -12px 12px 12px -12px;
  z-index: -1;
  border: 1px solid var(--accent);
  border-radius: 999px 999px 22px 22px;
}

.split--flip > .photo::after { inset: -12px -12px 12px 12px; }

.photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 30px 60px -30px rgba(42, 36, 32, 0.45);
}

.split__body .section-head { margin-bottom: clamp(32px, 4vw, 48px); }

@media (max-width: 860px) {
  .split,
  .split--flip { grid-template-columns: minmax(0, 1fr); }
  .split--flip > .photo { order: 0; }
  .photo { max-width: min(320px, 78vw); }
}

/* Details */

.details {
  padding: clamp(96px, 14vw, 180px) var(--gutter);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 64px);
  margin: 0 auto clamp(56px, 8vw, 96px);
  text-align: center;
}

.countdown span {
  display: block;
  font: 400 clamp(2.5rem, 7vw, 4.5rem)/1 var(--serif);
  font-variant-numeric: tabular-nums;
}

.countdown small {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.details__grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.card {
  padding: clamp(32px, 4vw, 48px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}

.card__title {
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  margin-bottom: 1rem;
}

.card p:not(.eyebrow) { color: var(--muted); }

.card .button { margin-top: 0.5rem; }

/* Travel */

.travel {
  padding: clamp(96px, 14vw, 180px) var(--gutter);
}

.route {
  display: flex;
  align-items: flex-start;
  max-width: 720px;
  margin: 0 auto clamp(48px, 7vw, 80px);
  text-align: center;
}

.route__stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: 120px;
}

.route__stop strong { font: 500 1.5rem/1 var(--serif); }

.route__stop small {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.route__dot {
  width: 14px;
  height: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.route__dot--end { background: var(--accent); }

.route__line {
  position: relative;
  flex: 1;
  margin: 7px -46px 0;
  border-top: 1px dashed var(--accent);
}

.route__line span {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: italic 400 1.1rem/1 var(--serif);
  color: var(--accent-ink);
}

@media (max-width: 520px) {
  .route__stop { width: 96px; }
  .route__stop strong { font-size: 1.25rem; }
  .route__line { margin-inline: -34px; }
  .route__line span { top: auto; bottom: 10px; font-size: 0.95rem; }
}

.travel__grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.travel-card {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.travel-card .card__title { font-size: clamp(1.9rem, 3vw, 2.25rem); }

.travel-card > p:not(.eyebrow):not(.travel-card__meta) { flex: 1; }

.travel-card__meta {
  margin: 0.5rem 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font: italic 500 1.15rem/1.2 var(--serif);
  color: var(--accent-ink) !important;
}

.steps {
  flex: 1;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--muted);
}

.steps li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 0.75em;
  counter-increment: step;
  line-height: 1.55;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  font: 500 0.95rem/20px var(--serif);
  text-align: center;
  color: var(--accent-ink);
}

.tips {
  position: relative;
  max-width: 760px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding: clamp(28px, 4vw, 44px);
  border: 1px dashed var(--accent);
  border-radius: 18px;
  text-align: center;
}

.tips__title {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  margin-bottom: 1.25rem;
}

.tips ul {
  display: inline-block;
  margin: 0 auto 1.75rem;
  padding: 0;
  list-style: none;
  text-align: left;
  color: var(--muted);
}

.tips li {
  position: relative;
  margin-bottom: 0.5em;
  padding-left: 1.6em;
}

.tips li::before {
  content: "◇";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Gifts */

.gifts {
  padding: clamp(96px, 14vw, 180px) var(--gutter);
}

.gifts__grid {
  max-width: var(--max);
  margin: clamp(48px, 7vw, 88px) auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.gift {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.gift:hover,
.gift:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(42, 36, 32, 0.35);
}

.gift__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
}

.gift__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.gift:hover .gift__media img { transform: scale(1.05); }

.gift__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.gift__name {
  font: 500 1.6rem/1.15 var(--serif);
  margin-bottom: 0.5rem;
}

.gift__desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}

.gift__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.gift__amount { font: 500 1.25rem/1 var(--serif); }

.gift__cta {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Gift dialog */

.gift-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(20, 16, 12, 0.5);
}

.gift-dialog::backdrop {
  background: rgba(30, 25, 20, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.gift-dialog[open] { animation: dialog-in 0.4s var(--ease); }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.gift-dialog__inner {
  position: relative;
  padding: 40px 28px 28px;
  text-align: center;
}

.gift-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.gift-dialog__title { font-size: 2.25rem; }

.gift-dialog__amount {
  margin: 0.4rem 0 1.25rem;
  font: 500 1.4rem/1.2 var(--serif);
  color: var(--accent-ink);
}

.gift-dialog__qr {
  width: min(240px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 1.25rem;
  padding: 10px;
  background: #fff;
  border-radius: 6px;
}

.gift-dialog__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gift-dialog__hint {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.copy {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.copy__input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copy .button { white-space: nowrap; }

.gift-dialog__key {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

@media (max-width: 420px) {
  .copy { flex-direction: column; }
  .copy__input { height: 44px; }
}

/* Footer */

.footer {
  padding: clamp(72px, 10vw, 120px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 48px);
  text-align: center;
}

.footer__names { font: 400 clamp(2.5rem, 6vw, 3.5rem)/1 var(--serif); margin-bottom: 0.75rem; }

.footer__date {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--muted);
}

/* Shapes & ornaments */

:root { --arch: clamp(56px, 9vw, 150px); }

.hero + main > .details { margin-top: calc(var(--arch) * -1); }

.tinted {
  clip-path: inset(0 round 50% 50% 50% 50% / var(--arch) var(--arch) var(--arch) var(--arch));
  padding-top: calc(clamp(96px, 14vw, 180px) + var(--arch) * 0.4);
  padding-bottom: calc(clamp(96px, 14vw, 180px) + var(--arch) * 0.6);
}

.ornament {
  display: flex;
  justify-content: center;
  color: var(--accent);
  margin: 0 auto 2.25rem;
}

.ornament svg { display: block; overflow: visible; }


.footer .ornament { margin-bottom: 1.75rem; }

.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.section-head .eyebrow::before,
.section-head .eyebrow::after {
  content: "";
  width: clamp(20px, 5vw, 40px);
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.card,
.gift {
  position: relative;
  border-radius: 18px;
}

.card::before,
.gift::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 1;
  border: 1px solid rgba(125, 138, 106, 0.4);
  border-radius: 12px;
  pointer-events: none;
}

.details__grid { max-width: 860px; }

.details__grid .card {
  border-radius: 999px 999px 18px 18px / 140px 140px 18px 18px;
  padding-top: clamp(56px, 6vw, 72px);
}

.details__grid .card::before {
  border-radius: 999px 999px 12px 12px / 134px 134px 12px 12px;
}

.tinted .card,
.tinted .gift {
  background: rgba(251, 248, 243, 0.82);
  border-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 50px -30px rgba(42, 36, 32, 0.4);
}

/* Scroll reveal */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.js .reveal-img img {
  clip-path: inset(100% 0 0 0);
  transform: scale(1.15);
  transition: clip-path 1.4s var(--ease), transform 1.8s var(--ease);
}

.js .reveal.is-in { opacity: 1; transform: none; }

.js .reveal-img.is-in img { clip-path: inset(0 0 0 0); transform: none; }

.details__grid .reveal:nth-child(2),
.gifts__grid .reveal:nth-child(3n + 2) { transition-delay: 0.12s; }

.details__grid .reveal:nth-child(3),
.gifts__grid .reveal:nth-child(3n + 3) { transition-delay: 0.24s; }

/* Scroll-driven parallax (progressive enhancement) */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero__content,
    .hero__media {
      animation: hero-exit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }

    @keyframes hero-exit {
      to { transform: translateY(30%); opacity: 0.2; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* Turtle game */

.turtle-btn {
  position: fixed;
  left: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  z-index: 40;
  width: 54px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translate3d(calc(100vw - 70px), 0, 0);
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.turtle-btn__sprite {
  display: block;
  width: 100%;
  height: 100%;
  background: url("../images/turtle_walk.gif") center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 1px rgba(20, 16, 12, 0.3));
  transition: transform 0.15s;
}

.turtle-btn.is-idle .turtle-btn__sprite { background-image: url("../images/turtle_stand.gif"); }

.turtle-btn.is-right .turtle-btn__sprite { transform: scaleX(-1); }

.turtle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.game {
  width: min(calc(100vw - 24px), min(88vh, 720px) * 3 / 5);
  width: min(calc(100vw - 24px), min(88svh, 720px) * 3 / 5);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.game::backdrop { background: rgba(20, 16, 12, 0.88); }

.game-open .tinted::before,
.game-open .hero::before { animation-play-state: paused; }

.game[open] { animation: dialog-in 0.4s var(--ease); }

.game__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 5;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.game__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.game__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(251, 248, 243, 0.85);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.game__hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  text-align: center;
  container-type: inline-size;
}

.game__hud :where(p) { margin: 0; }

.game__hud [hidden] { display: none; }

.game__score {
  position: absolute;
  top: 6%;
  left: 0;
  right: 0;
  font: 500 15cqw/1 var(--serif);
  color: #fff;
  text-shadow: 0 2px 0 rgba(42, 36, 32, 0.55), 0 0 12px rgba(42, 36, 32, 0.35);
}

.game__intro {
  position: absolute;
  inset: 18% 6% auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game__title {
  font: 500 12.5cqw/1.05 var(--serif);
  color: var(--ink);
  text-shadow: 0 0 2px rgba(251, 248, 243, 0.9), 0 0 14px rgba(251, 248, 243, 0.8);
}

.game__tap {
  margin-top: 62cqw;
  font: 500 5.4cqw/1.2 var(--sans);
  color: var(--ink);
  text-shadow: 0 0 2px rgba(251, 248, 243, 0.95), 0 0 10px rgba(251, 248, 243, 0.8);
  animation: tap-pulse 1.6s ease-in-out infinite;
}

.game__best {
  margin-top: 2.5cqw;
  font: 500 4.4cqw/1.2 var(--sans);
  color: var(--accent-ink);
  text-shadow: 0 0 2px rgba(251, 248, 243, 0.95), 0 0 10px rgba(251, 248, 243, 0.8);
}

@keyframes tap-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.game__over {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  padding: 7cqw 5cqw 6cqw;
  transform: translate(-50%, -55%);
  border-radius: 14px;
  background: rgba(251, 248, 243, 0.95);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  color: var(--ink);
}

.game__over::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(125, 138, 106, 0.5);
  border-radius: 10px;
}

.game__over-title { font: 500 11cqw/1 var(--serif); }

.game__stats {
  display: flex;
  justify-content: space-around;
  margin: 5cqw 0 4cqw;
}

.game__stats small {
  display: block;
  font: 500 3.6cqw/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.game__stats span {
  display: block;
  margin-top: 1.5cqw;
  font: 500 12cqw/1 var(--serif);
}

.game__retry {
  font: 500 4.2cqw/1.2 var(--sans);
  color: var(--accent-ink);
  opacity: 0;
  transition: opacity 0.3s;
}

.game__retry.is-visible { opacity: 1; }
