/* =============================================
   GRAND PRIX WEDDING INVITATION
   Responsive desktop + mobile design
============================================= */

:root {
  --f1-red: #e10600;
  --f1-red-bright: #ff352d;
  --papaya: #ff8700;
  --electric-blue: #00a8ff;
  --race-yellow: #ffd600;

  --asphalt-black: #0b0d12;
  --carbon-grey: #171b24;
  --panel: #202634;

  --pure-white: #f7f9ff;
  --silver: #c4ccda;
  --muted: #8f9aad;

  --max-width: 1180px;
  --page-padding: clamp(20px, 4vw, 56px);
  --section-space: clamp(64px, 9vw, 112px);
  --radius: 14px;
}

/* =============================================
   BASE
============================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 6%, rgba(0, 168, 255, 0.13), transparent 25rem),
    radial-gradient(circle at 88% 20%, rgba(225, 6, 0, 0.16), transparent 26rem),
    #050609;
  color: var(--pure-white);
  font-family: "Titillium Web", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--race-yellow);
  outline-offset: 3px;
}

.app-frame {
  position: relative;
  width: min(100%, var(--max-width));
  min-height: 100vh;
  margin: 0 auto;
  overflow: clip;
  background: linear-gradient(180deg, rgba(18, 22, 31, 0.98), rgba(8, 10, 15, 0.99));
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
}

.carbon-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0 2px,
      transparent 2px 5px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.02) 0 2px,
      transparent 2px 5px
    );
}

.checkered-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
  background-size: 42px 42px;
  background-position: 0 0, 21px 21px;
}

/* =============================================
   COVER
============================================= */

.cover-screen,
.zoom-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 15%, rgba(0, 168, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 50% 78%, rgba(225, 6, 0, 0.25), transparent 25rem),
    var(--asphalt-black);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.cover-screen.hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.cover-content,
.zoom-names {
  position: relative;
  z-index: 2;
  width: min(100%, 680px);
  padding: clamp(24px, 6vw, 64px);
  text-align: center;
}

.cover-label,
.section-tag,
.zoom-tag {
  color: var(--race-yellow);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.cover-label {
  margin-bottom: clamp(24px, 5vw, 40px);
}

.grid-lights {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  margin-bottom: clamp(28px, 5vw, 44px);
}

.light {
  width: clamp(18px, 4vw, 30px);
  aspect-ratio: 1;
  border: 2px solid #72201e;
  border-radius: 50%;
  background: #341112;
  transition: background 0.2s, box-shadow 0.2s;
}

.light.on {
  background: var(--f1-red-bright);
  box-shadow: 0 0 22px 5px rgba(255, 53, 45, 0.8);
}

.cover-names,
.zoom-couple {
  font-size: clamp(32px, 7vw, 72px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.cover-date {
  margin: 16px 0 clamp(30px, 5vw, 44px);
  color: var(--silver);
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.guest-box {
  margin-bottom: clamp(28px, 5vw, 42px);
}

.guest-label {
  margin-bottom: 4px;
  color: var(--silver);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.guest-name {
  overflow-wrap: anywhere;
  color: var(--pure-white);
  font-size: clamp(20px, 3vw, 29px);
  font-weight: 800;
}

.btn-primary {
  width: 100%;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--f1-red-bright), var(--f1-red) 58%, #aa0000);
  box-shadow: 0 10px 24px rgba(225, 6, 0, 0.28);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(225, 6, 0, 0.4);
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.enter-btn {
  width: min(100%, 370px);
}

.cover-hint {
  margin-top: 14px;
  color: var(--silver);
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* =============================================
   MAIN CONTENT
============================================= */

.main-content {
  opacity: 0;
  transition: opacity 1.1s ease;
}

.main-content.visible {
  opacity: 1;
}

.section {
  position: relative;
  padding: var(--section-space) var(--page-padding);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.section > * {
  position: relative;
  z-index: 1;
}

.section-tag {
  margin-bottom: 10px;
}

.section-title {
  max-width: 760px;
  margin-bottom: clamp(24px, 3vw, 34px);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}

.speed-lines {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: 26%;
  pointer-events: none;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 12px,
    rgba(0, 168, 255, 0.1) 12px 15px
  );
}

.quote-card,
.event-card,
.info-card,
.gift-item,
.feed-item,
.countdown-grid > div {
  border: 1px solid rgba(196, 204, 218, 0.17);
  background: linear-gradient(135deg, rgba(40, 47, 63, 0.97), rgba(22, 27, 37, 0.97));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.quote-card {
  max-width: 760px;
  padding: clamp(20px, 3vw, 30px);
  border-left: 4px solid var(--race-yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-text {
  color: var(--silver);
  font-size: clamp(16px, 2vw, 20px);
  font-style: italic;
  line-height: 1.65;
}

.quote-source {
  margin-top: 12px;
  color: var(--race-yellow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* =============================================
   DRIVERS
============================================= */

#drivers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

#drivers > .section-tag,
#drivers > .section-title {
  grid-column: 1 / -1;
}

.driver-card {
  text-align: center;
}

.driver-photo-wrap {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 4 / 5;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 2px solid rgba(0, 168, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.driver-photo {
  height: 100%;
}

.driver-number {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 5px;
  color: white;
  background: var(--f1-red);
  font-size: 15px;
  font-weight: 900;
}

.driver-name {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
}

.driver-team {
  margin: 5px 0 8px;
  color: var(--electric-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.driver-parents {
  max-width: 360px;
  margin: 0 auto;
  color: var(--silver);
  font-size: 14px;
  line-height: 1.5;
}

.vs-divider {
  display: grid;
  margin: 28px 0;
  place-items: center;
}

.vs-divider span {
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--asphalt-black);
  background: var(--race-yellow);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

/* =============================================
   EVENT CALENDAR
============================================= */

.event-card {
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 16px;
  border-radius: var(--radius);
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.event-session {
  color: var(--race-yellow);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.event-name {
  text-align: right;
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.event-detail {
  margin-bottom: 4px;
  color: var(--pure-white);
  font-size: 15px;
}

.event-venue {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 900;
}

.event-address {
  margin: 3px 0 18px;
  color: var(--silver);
  font-size: 14px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--electric-blue);
  border-radius: 7px;
  color: #8cd7ff;
  background: rgba(0, 168, 255, 0.07);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  color: #041018;
  background: var(--electric-blue);
}

.countdown-box {
  margin-top: 30px;
  text-align: center;
}

.countdown-label {
  margin-bottom: 14px;
  color: var(--silver);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 2vw, 14px);
  max-width: 620px;
  margin: 0 auto;
}

.countdown-grid > div {
  padding: 14px 8px;
  border-radius: 10px;
}

.countdown-grid span {
  display: block;
  color: var(--race-yellow);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1;
}

.countdown-grid small {
  color: var(--silver);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =============================================
   FORMS
============================================= */

.form-card {
  display: grid;
  gap: 8px;
  max-width: 680px;
}

.form-label {
  margin-top: 12px;
  color: var(--silver);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.form-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(196, 204, 218, 0.22);
  border-radius: 8px;
  outline: none;
  color: var(--pure-white);
  background: rgba(16, 20, 28, 0.94);
  font-size: 16px;
}

textarea.form-input {
  min-height: 112px;
  resize: vertical;
}

.form-input:focus {
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.16);
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 7px 0;
}

.radio-pill {
  position: relative;
  display: grid;
  min-height: 48px;
  padding: 10px;
  border: 1px solid rgba(196, 204, 218, 0.2);
  border-radius: 8px;
  color: var(--silver);
  background: rgba(22, 27, 37, 0.96);
  font-size: 14px;
  text-align: center;
  place-items: center;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
}

.radio-pill:has(input:checked) {
  border-color: var(--race-yellow);
  color: var(--race-yellow);
  background: rgba(255, 214, 0, 0.12);
  font-weight: 900;
}

.form-card .btn-primary {
  margin-top: 16px;
}

.form-status {
  min-height: 20px;
  color: var(--silver);
  font-size: 14px;
  text-align: center;
}

/* =============================================
   GIFTS
============================================= */

.gift-desc,
.closing-text {
  max-width: 700px;
  color: var(--silver);
  font-size: 16px;
  line-height: 1.65;
}

.gift-desc {
  margin-bottom: 22px;
}

.gift-list {
  display: grid;
  gap: 14px;
  max-width: 700px;
}

.gift-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius);
}

.gift-bank,
.gift-owner {
  color: var(--silver);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.gift-number {
  margin: 3px 0;
  font-size: 19px;
  font-weight: 900;
}

.copy-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 7px;
  color: #06131b;
  background: var(--electric-blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* =============================================
   GALLERY
============================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 16px);
  margin-bottom: 22px;
}

.gallery-grid img {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(196, 204, 218, 0.2);
  border-radius: 10px;
  transition: transform 0.25s, border-color 0.25s;
}

.gallery-grid img:hover {
  border-color: var(--race-yellow);
  transform: scale(1.025);
}

.video-wrap {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(196, 204, 218, 0.2);
  border-radius: var(--radius);
  background: #000;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
}

/* =============================================
   GUESTBOOK
============================================= */

.radio-feed {
  display: grid;
  gap: 10px;
  max-height: 380px;
  margin-top: 24px;
  overflow-y: auto;
}

.feed-item {
  padding: 14px 16px;
  border-radius: 10px;
}

.feed-name {
  color: var(--electric-blue);
  font-size: 14px;
  font-weight: 900;
}

.feed-message {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--pure-white);
  font-size: 14px;
  line-height: 1.55;
}

.feed-time,
.feed-empty {
  color: var(--silver);
  font-size: 11px;
}

.feed-time {
  margin-top: 7px;
}

.feed-empty {
  padding: 24px 0;
  text-align: center;
}

/* =============================================
   ADDITIONAL INFO
============================================= */

.info-card {
  max-width: 780px;
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 16px;
  border-radius: var(--radius);
}

.info-title {
  margin-bottom: 9px;
  color: var(--race-yellow);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.info-text {
  color: var(--silver);
  font-size: 15px;
  line-height: 1.65;
}

.color-swatches {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.color-swatches span {
  width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  padding-left: 15px;
  border-left: 3px solid var(--electric-blue);
}

.timeline-year {
  color: var(--race-yellow);
  font-size: 13px;
  font-weight: 900;
}

.timeline-text {
  margin-top: 3px;
  color: var(--silver);
  font-size: 14px;
  line-height: 1.55;
}

/* =============================================
   CLOSING
============================================= */

.closing-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #121927, #0a0c11);
  text-align: center;
}

.closing-section .section-title,
.closing-section .closing-text {
  margin-right: auto;
  margin-left: auto;
}

.closing-signature {
  margin-top: 24px;
  color: var(--race-yellow);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  text-transform: uppercase;
}

/* =============================================
   AUDIO CONTROL
============================================= */

.audio-fab {
  position: fixed;
  right: clamp(16px, 3vw, 36px);
  bottom: clamp(16px, 3vw, 36px);
  z-index: 500;
  display: grid;
  width: 52px;
  aspect-ratio: 1;
  border: 2px solid var(--race-yellow);
  border-radius: 50%;
  color: #fff;
  background: var(--f1-red);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  place-items: center;
}

/* =============================================
   LIGHTS-OUT TRANSITION
============================================= */

.zoom-transition {
  z-index: 900;
  visibility: hidden;
  opacity: 0;
}

.zoom-transition.active {
  visibility: visible;
  opacity: 1;
}

.zoom-transition.done {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.cars-stage {
  position: absolute;
  inset: 0;
}

.f1-car {
  position: absolute;
  left: -260px;
  opacity: 0;
  transform: scaleX(-1);
  will-change: transform;
}

.car-1 {
  top: 22%;
}

.car-2 {
  top: 48%;
}

.car-3 {
  top: 72%;
}

.zoom-transition.active .car-1 {
  animation: carZoom 0.9s cubic-bezier(0.7, 0, 0.9, 0.4) 0.15s forwards;
}

.zoom-transition.active .car-2 {
  animation: carZoom 0.85s cubic-bezier(0.7, 0, 0.9, 0.4) 0.55s forwards;
}

.zoom-transition.active .car-3 {
  animation: carZoom 0.8s cubic-bezier(0.7, 0, 0.9, 0.4) 0.95s forwards;
}

@keyframes carZoom {
  0% {
    opacity: 0;
    transform: translateX(0) skewX(-8deg) scaleX(-1);
  }

  8%,
  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(calc(100vw + 320px)) skewX(-8deg) scaleX(-1);
  }
}

.speed-trail {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 140px;
  height: 3px;
  background: linear-gradient(to right, rgba(0, 168, 255, 0.9), transparent);
  transform: translateY(-50%);
}

.zoom-names {
  opacity: 0;
}

.zoom-transition.active .zoom-names {
  animation: namesIn 0.8s ease 1.7s forwards;
}

@keyframes namesIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zoom-tag {
  margin-bottom: 14px;
}

.zoom-initials {
  margin-top: 12px;
  color: var(--silver);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.35em;
}

/* =============================================
   TABLET AND DESKTOP
============================================= */

@media (min-width: 720px) {
  .app-frame {
    margin: 22px auto;
    border: 1px solid rgba(196, 204, 218, 0.12);
    border-radius: 20px;
  }

  #drivers {
    grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(20px, 5vw, 70px);
  }

  #drivers .driver-card {
    align-self: start;
  }

  #drivers .vs-divider {
    margin: 0;
  }

  #calendar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }

  #calendar > .section-tag,
  #calendar > .section-title,
  #calendar > .countdown-box {
    grid-column: 1 / -1;
  }

  .countdown-box {
    width: min(100%, 620px);
    justify-self: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #rsvp,
  #guestbook {
    display: grid;
    grid-template-columns: minmax(230px, 0.55fr) minmax(0, 1.45fr);
    align-items: start;
    column-gap: clamp(32px, 7vw, 90px);
  }

  #rsvp > .section-tag,
  #rsvp > .section-title,
  #guestbook > .section-tag,
  #guestbook > .section-title {
    grid-column: 1;
  }

  #rsvp > .form-card,
  #guestbook > .form-card,
  #guestbook > .radio-feed {
    grid-column: 2;
  }

  #guestbook > .form-card {
    grid-row: 1 / span 2;
  }

  #guestbook > .radio-feed {
    grid-row: 3;
  }
}

/* =============================================
   SMALL PHONES
============================================= */

@media (max-width: 479px) {
  .section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .event-name {
    text-align: left;
  }

  .countdown-grid {
    gap: 6px;
  }

  .countdown-grid > div {
    padding: 12px 4px;
  }

  .gift-item {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    width: 100%;
  }
}

/* =============================================
   REDUCED MOTION
============================================= */

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

/* =============================================
EVENT ACTION BUTTONS (Maps + Add to Calendar)
============================================= */

.event-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .event-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
