/* ============================================================
   Kanaloa Surf Co — site stylesheet
   Look recreated from the original Wix site: one continuous
   ocean-wave background behind every section under a stormy
   gray tint, content floating over it in white — monochrome
   gray/white theme throughout (white buttons, white K logo).
   ============================================================ */

:root {
  --char: #1c1f23;          /* charcoal (darkest) */
  --char-2: #2b3036;        /* panel charcoal */
  --char-3: #3a4046;        /* lighter panel */
  --white: #ffffff;
  --foam: #f4f4f2;          /* soft off-white */
  --gray-1: #d7dade;        /* light gray text */
  --gray-2: #aab0b6;        /* mid gray text */
  --text-light: rgba(244, 244, 242, 0.92);
  --text-dim: rgba(244, 244, 242, 0.66);
  --glass: rgba(24, 27, 31, 0.62);           /* card panels over the wave */
  --glass-border: rgba(244, 244, 242, 0.16);
  --max: 1120px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-light);
  background: var(--char);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The wave behind everything — fixed so the page scrolls over it,
   under a stormy gray tint so text stays readable.
   --wave-p (0 → 1, set from scroll position in main.js) zooms the
   wave in and lifts it so it appears to roll forward as you scroll.
   The layer is oversized (inset -12%) so the zoom never shows edges. */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(90, 96, 102, 0.68), rgba(26, 29, 33, 0.82)),
    url("../assets/images/wave-dark.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(0.55);
  transform: scale(calc(1 + var(--wave-p, 0) * 0.3))
             translateY(calc(var(--wave-p, 0) * -3.5%));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  body::before { transform: none; }
}

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

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--white);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: 0.04em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: 0.03em; }
h3 { font-size: 1.35rem; }

p { margin-bottom: 1rem; }

a { color: var(--white); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); }
a:hover { text-decoration-color: var(--white); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

section { padding: 72px 0; }

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-2);
  margin-bottom: 0.6rem;
}

.center { text-align: center; }

.lead { font-size: 1.15rem; color: var(--gray-1); max-width: 46rem; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

/* White pill, dark text — like the old Wix "Book Now" buttons */
.btn-primary {
  background: var(--white);
  color: var(--char);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover { background: var(--gray-1); color: var(--char); }

.btn-ghost {
  background: transparent;
  color: var(--foam);
  border: 2px solid rgba(244, 244, 242, 0.85);
}
.btn-ghost:hover { background: rgba(244, 244, 242, 0.14); }

/* Secondary button floating on the wave */
.btn-dark {
  background: rgba(244, 244, 242, 0.1);
  color: var(--foam);
  border: 1.5px solid rgba(244, 244, 242, 0.55);
}
.btn-dark:hover { background: rgba(244, 244, 242, 0.22); }

/* ---------- Header / Nav ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  padding: 14px 0;
}
.site-header.solid,
.site-header.always-solid {
  background: rgba(24, 27, 31, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foam);
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { height: 36px; width: auto; }
.brand:hover { color: var(--white); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  flex-wrap: nowrap;
}
.nav-links a {
  color: rgba(244, 244, 242, 0.82);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links .nav-cta {
  background: var(--white);
  color: var(--char);
  padding: 8px 18px;
  border-radius: 999px;
}
.nav-links .nav-cta:hover { background: var(--gray-1); color: var(--char); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 42px; height: 42px;
  position: relative;
  z-index: 120;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  position: absolute;
  left: 8px; right: 8px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--foam);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span { top: 20px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(8px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--char);
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  body.nav-open .nav-links { transform: translateX(0); }
  .nav-links a { font-size: 1.2rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--foam);
  padding: 120px 20px 80px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(32, 36, 40, 0.4), rgba(24, 27, 31, 0.6)), var(--hero-img);
  background-size: cover;
  background-position: center;
  filter: saturate(0.6);
}
.hero > .container { position: relative; }

.hero .logo-text {
  max-width: 300px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.45));
}

.hero h1 { color: var(--white); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }

.hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-style: italic;
  color: var(--gray-1);
  margin: 14px auto 30px;
  max-width: 38rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.hero .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Page hero (interior pages) */
.page-hero {
  position: relative;
  padding: 160px 20px 80px;
  text-align: center;
  color: var(--foam);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(32, 36, 40, 0.6), rgba(24, 27, 31, 0.75)), var(--hero-img);
  background-size: cover;
  background-position: center;
  filter: saturate(0.6);
}
.page-hero > * { position: relative; }
.page-hero h1 { color: var(--white); }
.page-hero p {
  color: var(--gray-1);
  font-size: 1.15rem;
  max-width: 42rem;
  margin: 12px auto 0;
}

/* ---------- Feature rows / cards ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* Cards float on the wave as dark glass panels */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { width: 100%; height: 230px; object-fit: cover; }
.card .card-body { padding: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .card-body .btn { align-self: flex-start; margin-top: auto; }
.card .card-body p { color: var(--text-dim); }

.feature-list { list-style: none; display: grid; gap: 14px; margin: 20px 0; }
.feature-list li {
  padding-left: 34px;
  position: relative;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--foam);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center / contain no-repeat;
}

.rounded-img { border-radius: var(--radius); box-shadow: var(--shadow); filter: saturate(0.85); }

/* Legacy class from the light theme — sections all float on the wave now */
.band-dark { background: none; }

.quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-style: italic;
  color: var(--gray-1);
  max-width: 44rem;
  margin: 0 auto;
}
.quote-attr {
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--gray-2);
}

/* ---------- Founders ---------- */

.founder { text-align: center; }
.founder img {
  width: 240px; height: 240px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 18px;
  box-shadow: var(--shadow);
}
.founder .role {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-2);
  margin-bottom: 10px;
}
.founder p { color: var(--text-dim); max-width: 30rem; margin: 0 auto; }

/* ---------- Booking ---------- */

.service-card { cursor: pointer; border: 3px solid transparent; transition: border-color 0.15s ease, transform 0.15s ease; }
.service-card:hover { transform: translateY(-4px); }
.service-card.selected { border-color: var(--white); }
.service-card .price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--white);
  font-weight: 700;
}
.service-card .duration { color: var(--text-dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }

.booking-form {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  max-width: 640px;
  margin: 40px auto 0;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--foam);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(244, 244, 242, 0.28);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: rgba(18, 21, 24, 0.6);
  color: var(--foam);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.form-note { font-size: 0.9rem; color: var(--text-dim); }

.alert {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 auto 26px;
  max-width: 640px;
  font-weight: 600;
  display: none;
}
.alert.show { display: block; }
.alert-success { background: #e5f3e6; color: #276221; border: 1.5px solid #46923c; }
.alert-error { background: #fdeceb; color: #a3271d; border: 1.5px solid #e05c52; }

/* ---------- Shop ---------- */

.product-card .card-body h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; color: var(--foam); }
.product-card .price { font-size: 1.25rem; font-weight: 700; color: var(--white); }
.product-card .badge {
  align-self: flex-start;
  background: rgba(244, 244, 242, 0.16);
  border: 1px solid rgba(244, 244, 242, 0.35);
  color: var(--foam);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
}
.product-card select { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: rgba(18, 21, 24, 0.6); color: var(--foam); border: 1.5px solid rgba(244, 244, 242, 0.28); }
.product-card img { height: 300px; object-fit: cover; background: #eee; }

/* ---------- Turtle game ---------- */

.game-frame-wrap {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #12151a;
  border: 1px solid var(--glass-border);
}
.game-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: none;
}

/* ---------- CTA band — floats straight on the wave ---------- */

.cta-band {
  position: relative;
  text-align: center;
  color: var(--foam);
  padding: 110px 20px;
}
.cta-band h2 { color: var(--white); margin-bottom: 8px; }
.cta-band p { color: var(--gray-1); font-size: 1.15rem; margin-bottom: 28px; }

/* ---------- Motion: hero intro, scroll reveal, ocean details ---------- */

@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Cinematic entrance: K logo, then title, tagline, buttons — after the
   intro the logo keeps a gentle bob, like it's floating on the water. */
.hero .logo-text { animation: hero-in 0.9s ease 0.1s both, logo-bob 6s ease-in-out 1.4s infinite; }
.hero h1 { animation: hero-in 0.9s ease 0.3s both; }
.hero .tagline { animation: hero-in 0.9s ease 0.5s both; }
.hero .btn-row { animation: hero-in 0.9s ease 0.7s both; }

/* Scroll reveal — elements get .reveal from main.js and fade/rise in
   when they enter the viewport; grids stagger via --reveal-delay. */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* Wave squiggle under section headings — a nod to the old Wix site */
section h2::after,
.cta-band h2::after {
  content: "";
  display: block;
  width: 86px;
  height: 10px;
  margin-top: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 12'%3E%3Cpath d='M1 8 C8 2 15 2 22 8 C29 14 36 14 43 8 C50 2 57 2 64 8 C71 14 78 14 85 8' stroke='%23f4f4f2' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.55;
}
.center h2::after,
.cta-band h2::after { margin-left: auto; margin-right: auto; }

/* Foam bubbles drifting up over the wave (behind the content panels) */
.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bubbles span {
  position: absolute;
  bottom: -4vh;
  border-radius: 50%;
  background: rgba(244, 244, 242, 0.35);
  box-shadow: 0 0 6px rgba(244, 244, 242, 0.25);
  animation: bubble-rise linear infinite;
}
@keyframes bubble-rise {
  from { transform: translate3d(0, 0, 0); opacity: 0; }
  8% { opacity: var(--bub-o, 0.3); }
  85% { opacity: var(--bub-o, 0.3); }
  to { transform: translate3d(var(--bub-x, 0px), -112vh, 0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .logo-text, .hero h1, .hero .tagline, .hero .btn-row { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bubbles { display: none; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: rgba(18, 21, 24, 0.72);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--glass-border);
  color: rgba(244, 244, 242, 0.8);
  padding: 56px 0 28px;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: rgba(244, 244, 242, 0.8); text-decoration: none; }
.site-footer a:hover { color: var(--white); }

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img { height: 34px; width: auto; }

.footer-bottom {
  border-top: 1px solid rgba(244, 244, 242, 0.15);
  padding-top: 22px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(244, 244, 242, 0.55);
}
