:root {
  --ink: #082a4d;
  --ink-soft: #274667;
  --sea: #14aab5;
  --sea-deep: #087d8c;
  --coral: #ff7469;
  --coral-dark: #ec5f55;
  --sand: #fff8eb;
  --foam: #effcff;
  --shell: #fffdf6;
  --line: rgba(8, 42, 77, 0.14);
  --shadow: 0 22px 60px rgba(8, 42, 77, 0.16);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--shell);
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}

img,
svg {
  display: block;
}

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

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(calc(100% - 32px), 1220px);
  margin: 34px auto 0;
  padding: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
}

.brand svg {
  width: 28px;
  height: 28px;
  fill: var(--coral);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 42px);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.58);
}

.nav-links a {
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 3px;
  border-radius: 999px;
  background: var(--coral);
  content: "";
  opacity: 0;
  transform: scaleX(0.2);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.hero {
  position: relative;
  scroll-margin-top: 110px;
  min-height: 94svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 160px max(24px, calc((100vw - var(--max)) / 2)) 130px;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -1px;
  height: 120px;
  background: var(--shell);
  clip-path: ellipse(54% 54% at 50% 100%);
  content: "";
  z-index: -1;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-content {
  width: min(640px, 100%);
}

.hero-content h1,
.section h2,
.site-footer p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-content h1 {
  max-width: 720px;
  font-size: clamp(4rem, 12vw, 9.4rem);
  line-height: 0.92;
  text-shadow: 0 2px 22px rgba(255, 255, 255, 0.52);
}

.hero-content p {
  max-width: 520px;
  margin: 28px 0 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 650;
  line-height: 1.4;
  text-shadow: 0 2px 18px rgba(255, 255, 255, 0.68);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 160px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 28px;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(8, 42, 77, 0.16);
}

.button.primary {
  border-color: var(--coral);
  color: white;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
}

.button.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 38px;
  width: 36px;
  height: 36px;
  transform: translateX(-50%);
}

.scroll-cue span,
.scroll-cue span::before,
.scroll-cue span::after {
  position: absolute;
  background: var(--coral);
  content: "";
}

.scroll-cue span {
  left: 8px;
  top: 16px;
  width: 20px;
  height: 3px;
  border-radius: 999px;
}

.scroll-cue span::before,
.scroll-cue span::after {
  top: -6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.scroll-cue span::before {
  left: 0;
}

.scroll-cue span::after {
  right: 0;
}

.section {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 96px 0;
  scroll-margin-top: 110px;
}

.section h2 {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 1.05;
}

.section p {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.section-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  color: var(--sea);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.moments {
  display: grid;
  grid-template-columns: 0.72fr 1.4fr;
  gap: clamp(32px, 6vw, 78px);
  align-items: center;
}

.section-copy {
  max-width: 340px;
}

.text-link {
  display: inline-flex;
  margin-top: 26px;
  color: var(--coral-dark);
  font-weight: 850;
}

.text-link::after {
  content: "";
  width: 56px;
  height: 9px;
  margin: 18px 0 0 12px;
  border-top: 3px solid currentColor;
  border-radius: 50%;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 155px;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.memory-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(8, 42, 77, 0.1);
}

.memory-card.large {
  grid-column: span 4;
  grid-row: span 2;
}

.memory-card.wide {
  grid-column: span 4;
}

.memory-card:not(.large):not(.wide) {
  grid-column: span 2;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card div {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: white;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.image-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.image-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-style: italic;
  line-height: 1;
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 135px;
  color: white;
  font-weight: 900;
  text-align: center;
}

.placeholder::before {
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  content: "";
}

.placeholder span {
  position: relative;
  padding: 0 18px;
}

.sea {
  background: linear-gradient(135deg, #10aebe, #68dccb);
}

.coral {
  background: linear-gradient(135deg, #ff7a6d, #f7aa70);
}

.palm {
  background: linear-gradient(135deg, #218c5a, #75c47c);
}

.lagoon {
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(255, 255, 255, 0.35),
      transparent 30%
    ),
    linear-gradient(135deg, #0c7b91, #17b8b0);
}

.beaches {
  position: relative;
  width: 100%;
  max-width: none;
  padding: 100px max(24px, calc((100vw - var(--max)) / 2));
  background: linear-gradient(180deg, #e9fbff 0%, #f5fdff 100%);
}

.centered-copy {
  max-width: 650px;
  margin: 0 auto 44px;
  text-align: center;
}

.centered-copy .section-icon {
  margin-left: auto;
  margin-right: auto;
}

.beach-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.beach-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.9);
  box-shadow: 0 16px 34px rgba(8, 42, 77, 0.08);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.beach-card:hover,
.beach-card:focus-within,
.beach-card.active {
  border-color: rgba(255, 116, 105, 0.62);
  box-shadow: 0 22px 46px rgba(8, 42, 77, 0.14);
  transform: translateY(-4px);
}

.beach-thumb {
  display: block;
  height: 150px;
  background-size: cover;
  background-position: center;
}

.beach-thumb.sunset {
  background-image: url("assets/costa-rica-sunset.png");
}

.beach-thumb.blue {
  background-image:
    linear-gradient(rgba(8, 42, 77, 0), rgba(8, 42, 77, 0.06)),
    url("assets/costa-rica-coast-hero.png");
  background-position: center right;
}

.beach-thumb.reef {
  background:
    radial-gradient(
      circle at 28% 24%,
      rgba(255, 255, 255, 0.88),
      transparent 5%
    ),
    radial-gradient(
      circle at 72% 52%,
      rgba(255, 255, 255, 0.7),
      transparent 4%
    ),
    linear-gradient(135deg, #0e8aa8, #4ee0d0 52%, #f9da9f 53%, #f9da9f);
}

.beach-thumb.palms {
  background-image:
    linear-gradient(135deg, rgba(18, 132, 95, 0.22), rgba(255, 255, 255, 0)),
    url("assets/costa-rica-coast-hero.png");
  background-position: top right;
}

.beach-card h3 {
  margin: 18px 18px 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.beach-card p {
  min-height: 70px;
  margin: 8px 18px 22px;
  font-size: 0.92rem;
}

.note {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(30px, 7vw, 84px);
  align-items: start;
}

.note-copy {
  max-width: 360px;
}

.note-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.note-form label {
  display: grid;
  gap: 7px;
}

.note-form label span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 850;
}

.note-form input,
.note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font: inherit;
}

.note-form input:focus,
.note-form textarea:focus {
  border-color: var(--sea);
  outline: 3px solid rgba(20, 170, 181, 0.18);
}

.message-field,
.form-status {
  grid-column: 1 / -1;
}

.note-form .button {
  justify-self: start;
}

.form-status {
  min-height: 28px;
  margin: 0;
  color: var(--sea-deep);
  font-weight: 800;
}

.site-footer {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  color: white;
  text-align: center;
}

.site-footer::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 42, 77, 0.18),
    rgba(8, 42, 77, 0.58)
  );
  content: "";
  z-index: 1;
}

.site-footer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer div {
  position: relative;
  z-index: 2;
  padding: 42px 20px;
}

.site-footer p {
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.35);
}

.site-footer span {
  display: block;
  margin-top: 12px;
  font-weight: 750;
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 18px;
    max-width: 260px;
    font-size: 0.86rem;
  }

  .hero {
    min-height: 90svh;
    padding-top: 150px;
  }

  .hero-content {
    max-width: 560px;
  }

  .moments,
  .note {
    grid-template-columns: 1fr;
  }

  .section-copy,
  .note-copy {
    max-width: 620px;
  }

  .beach-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    position: absolute;
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: var(--radius);
    background: rgba(255, 253, 246, 0.76);
    box-shadow: 0 14px 40px rgba(8, 42, 77, 0.12);
    backdrop-filter: blur(16px);
  }

  .brand {
    font-size: 1.42rem;
  }

  .brand svg {
    width: 22px;
    height: 22px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 86svh;
    padding: 122px 20px 96px;
  }

  .hero-image {
    object-position: 58% center;
  }

  .hero-content h1 {
    max-width: 360px;
    font-size: clamp(3.6rem, 18vw, 5.6rem);
  }

  .hero-content p {
    max-width: 330px;
    font-size: 1.08rem;
  }

  .hero-actions {
    gap: 12px;
  }

  .button {
    width: 100%;
    min-width: 0;
  }

  .section {
    width: min(calc(100% - 28px), var(--max));
    padding: 72px 0;
  }

  .memory-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 140px;
  }

  .memory-card.large,
  .memory-card.wide,
  .memory-card:not(.large):not(.wide) {
    grid-column: span 2;
  }

  .memory-card.large {
    grid-row: span 2;
  }

  .beaches {
    padding: 72px 14px;
  }

  .beach-list,
  .note-form {
    grid-template-columns: 1fr;
  }

  .message-field,
  .form-status {
    grid-column: auto;
  }

  .beach-thumb {
    height: 170px;
  }
}

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