/* ==========================================================================
   Base / reset / typography / utilities
   ========================================================================== */

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

/* Several components (e.g. .modal-overlay, .order-summary-empty) set their
   own `display` value at the same specificity as the browser's built-in
   [hidden] rule, which — since component styles load after the browser's
   defaults — silently wins the tie and keeps the element (and its click
   handling) present even while "hidden". This is the actual bug behind
   "no button works, only scrolling" reports: the hidden success-modal
   overlay stayed laid out full-screen and absorbed every click site-wide.
   This rule makes [hidden] always win, permanently, for every element. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  overflow-x: hidden;
}

body {
  margin: 0;
  position: relative;
  font-family: var(--font-body);
  background-color: var(--color-bg);
  background-repeat: no-repeat;
  background-image:
    radial-gradient(ellipse 1300px 900px at 4% 2%, rgba(47, 198, 193, 0.3), transparent 60%),
    radial-gradient(ellipse 1300px 950px at 98% 6%, rgba(193, 127, 69, 0.26), transparent 62%),
    radial-gradient(ellipse 1200px 900px at 96% 22%, rgba(111, 168, 92, 0.2), transparent 58%),
    radial-gradient(ellipse 1300px 950px at 2% 30%, rgba(23, 168, 158, 0.24), transparent 60%),
    radial-gradient(ellipse 1200px 900px at 100% 44%, rgba(193, 127, 69, 0.22), transparent 60%),
    radial-gradient(ellipse 1300px 950px at 0% 54%, rgba(111, 168, 92, 0.2), transparent 60%),
    radial-gradient(ellipse 1200px 900px at 96% 68%, rgba(47, 198, 193, 0.26), transparent 60%),
    radial-gradient(ellipse 1300px 950px at 4% 80%, rgba(193, 127, 69, 0.22), transparent 62%),
    radial-gradient(ellipse 1200px 900px at 100% 92%, rgba(23, 168, 158, 0.26), transparent 60%);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle repeating wave-line texture, tying the whole page back to the
   ocean-inspired brand without competing with photography or text. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='90' viewBox='0 0 220 90'%3E%3Cpath d='M0 45 Q 27.5 15 55 45 T 110 45 T 165 45 T 220 45' fill='none' stroke='%23146767' stroke-width='2'/%3E%3Cpath d='M0 75 Q 27.5 45 55 75 T 110 75 T 165 75 T 220 75' fill='none' stroke='%23c17f45' stroke-width='1.4'/%3E%3C/svg%3E");
  background-size: 220px 90px;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  line-height: 1.12;
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

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

::selection {
  background: var(--turquoise-300);
  color: var(--ink-900);
}

body.no-scroll { overflow: hidden; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary-dark);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 10px 0;
  z-index: 999;
}
.skip-link:focus {
  left: 0;
}

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section-mesh {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.section-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: -1;
}

.section-dark {
  background: var(--gradient-ocean);
  color: var(--sand-100);
}
.section-dark h2,
.section-dark h3 {
  color: var(--sand-50);
}

/* --- Type utilities --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--copper-700);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--copper-600);
  display: inline-block;
}
.section-dark .eyebrow {
  color: var(--turquoise-300);
}
.section-dark .eyebrow::before {
  background: var(--turquoise-400);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head h2 {
  font-size: var(--fs-h2);
  margin-top: 0.6rem;
}
.section-head h2 em,
h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--copper-600);
}
.section-dark .section-head h2 em {
  color: var(--turquoise-300);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--color-text-soft);
  margin-top: 1rem;
  max-width: 60ch;
}
.section-head.center .lead {
  margin-inline: auto;
}

.text-gradient {
  background: linear-gradient(120deg, var(--copper-600), var(--turquoise-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Buttons --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-copper);
  color: var(--white);
  box-shadow: 0 10px 25px rgba(163, 101, 47, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(163, 101, 47, 0.42);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover {
  border-color: var(--copper-600);
  color: var(--copper-700);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 1.05rem 2rem;
  font-size: 1rem;
}

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  animation: ripple 650ms var(--ease-out);
  pointer-events: none;
}
@keyframes ripple {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

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

.stack {
  display: flex;
  flex-direction: column;
}

.cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }

/* --- Reveal-on-scroll --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="scale"] {
  transform: translateY(20px) scale(0.94);
}
[data-reveal="scale"].is-visible {
  transform: translateY(0) scale(1);
}
[data-reveal="left"] {
  transform: translateX(-36px);
}
[data-reveal="left"].is-visible {
  transform: translateX(0);
}
[data-reveal="right"] {
  transform: translateX(36px);
}
[data-reveal="right"].is-visible {
  transform: translateX(0);
}
[data-reveal="clip"] {
  clip-path: inset(0 0 100% 0);
  opacity: 1;
  transform: none;
  transition: clip-path 1.1s var(--ease-out);
}
[data-reveal="clip"].is-visible {
  clip-path: inset(0 0 0% 0);
}

/* stagger children via inline --d custom property set in JS/HTML */
[data-reveal] {
  transition-delay: var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Loader
   ========================================================================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at 50% 42%, #123f3f 0%, var(--teal-900) 62%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s var(--ease-out);
}
#loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 198, 193, 0.32) 0%, rgba(193, 127, 69, 0.14) 45%, transparent 72%);
  filter: blur(10px);
  animation: loaderGlowPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes loaderGlowPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}
.loader-icon {
  position: relative;
  width: clamp(84px, 14vw, 128px);
  height: clamp(84px, 14vw, 128px);
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(47, 198, 193, 0.5);
  box-shadow: 0 0 50px rgba(47, 198, 193, 0.4);
  animation: loaderIconPop 0.7s var(--ease-out) both;
}
.loader-icon img { width: 100%; height: 100%; object-fit: cover; }
@keyframes loaderIconPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.loader-mark {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--sand-100);
  display: flex;
  gap: 1px;
  overflow: hidden;
  text-transform: uppercase;
}
.loader-mark span { display: inline-block; animation: loaderUp 0.8s var(--ease-out) both; }
@keyframes loaderUp {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.loader-bar {
  position: relative;
  width: 180px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--copper-500), var(--turquoise-400));
  box-shadow: 0 0 12px rgba(47, 198, 193, 0.6);
  animation: loaderFill 1.6s var(--ease-out) forwards 0.3s;
}
@keyframes loaderFill { to { width: 100%; } }

/* ==========================================================================
   Scroll progress bar
   ========================================================================== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--copper-600), var(--turquoise-500));
  z-index: 9500;
  transition: width 0.08s linear;
}

/* ==========================================================================
   Grain texture overlay
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Custom scrollbar
   ========================================================================== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--sand-100); }
::-webkit-scrollbar-thumb { background: var(--copper-500); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--copper-700); }

/* --- Floating decorative blobs --- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: -1;
  animation: float 12s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -26px) scale(1.06); }
}

/* --- Wave divider --- */
.wave-divider {
  display: block;
  width: 100%;
  line-height: 0;
  position: relative;
  z-index: 2;
  margin-top: -1px;
}
.wave-divider svg {
  width: 100%;
  height: 64px;
  display: block;
}
@media (max-width: 640px) {
  .wave-divider svg { height: 36px; }
}
.wave-divider--flip svg {
  transform: scaleY(-1);
}
