/* ============================================
   ATIKOO DEL PACÍFICO — Sistema visual
   ============================================ */

:root {
  /* Brand */
  --navy: #0d1f4d;
  --navy-deep: #04102b;
  --cyan: #3fb6e8;
  --cyan-soft: #8ed4f0;
  --foam: #e8f4fb;
  --pearl: #fafbfd;
  --sand: #f4ede0;
  --coral: oklch(72% 0.14 35);
  --kelp: oklch(55% 0.10 165);

  /* Day mode (default) */
  --bg: var(--pearl);
  --bg-2: #ffffff;
  --bg-deep: #eaf3fa;
  --ink: #0a1834;
  --ink-soft: #4a5878;
  --line: rgba(13, 31, 77, 0.12);
  --water-tint: rgba(63, 182, 232, 0.08);
  --creature-stroke: rgba(13, 31, 77, 0.35);
  --creature-fill: rgba(13, 31, 77, 0.08);
  --shadow: 0 18px 60px -28px rgba(13, 31, 77, 0.35);

  --accent: var(--cyan);
  --accent-deep: var(--navy);

  --header-h: 76px;

  /* Type system — matched to Atikoo logo (rounded, friendly, geometric) */
  --serif: "Caprasimo", "Lalezar", "Cormorant Garamond", Georgia, serif;
  --sans: "Quicksand", "Nunito", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  --speed: 1;
}

[data-theme="night"] {
  --bg: var(--navy-deep);
  --bg-2: #08183d;
  --bg-deep: #020817;
  --ink: #e9f1ff;
  --ink-soft: #93a8d0;
  --line: rgba(143, 200, 240, 0.18);
  --water-tint: rgba(63, 182, 232, 0.10);
  --creature-stroke: rgba(143, 200, 240, 0.45);
  --creature-fill: rgba(63, 182, 232, 0.06);
  --shadow: 0 28px 80px -28px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.6s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 8vw, 124px); font-style: normal; letter-spacing: -0.02em; }
h2 { font-size: clamp(36px, 5vw, 72px); letter-spacing: -0.02em; }
h3 { font-size: clamp(22px, 2.4vw, 32px); font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em; }
p  { line-height: 1.6; color: var(--ink-soft); text-wrap: pretty; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.hand {
  font-family: var(--hand);
  font-weight: 500;
  color: var(--cyan);
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 32px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
}
.site-header__brand img { height: 56px; width: auto; }
.site-header__brand span { display: none; }
.site-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-header__nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.site-header__nav a:hover,
.site-header__nav a.active { color: var(--ink); }
.site-header__nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--cyan);
}
.site-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 14px;
  background: var(--cyan);
  color: var(--navy-deep);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.site-header__cta::before {
  content: "";
  width: 28px; height: 28px;
  border-radius: 50%;
  background: white;
  display: grid; place-items: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1f4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/></svg>");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
.site-header__cta:hover {
  transform: translateY(-2px);
  background: var(--navy);
  color: white;
  box-shadow: 0 14px 30px -10px rgba(63,182,232,0.5);
}
.site-header__cta:hover::before { background-color: var(--cyan); }
[data-theme="night"] .site-header__cta { background: var(--cyan); color: var(--navy-deep); }

/* ===== Sections ===== */
section { position: relative; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  background: var(--navy);
  color: white;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn--cyan { background: var(--cyan); color: var(--navy-deep); }

[data-theme="night"] .btn { background: var(--cyan); color: var(--navy-deep); }
[data-theme="night"] .btn:hover { background: var(--cyan-soft); }

/* ===== Aquarium layer (criaturas SVG flotando) ===== */
.aquarium {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.aquarium__creature {
  position: absolute;
  will-change: transform;
  /* Scale subtly with scroll progress so creatures grow as we descend */
  transform-origin: center;
}
.aquarium__creature svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  /* Inner SVG inherits scale from parent var */
  transform: scale(var(--atk-scroll-scale, 1));
  transform-origin: center;
  transition: transform 120ms linear;
}
.aquarium__creature--flip svg { transform: scaleX(-1) scale(var(--atk-scroll-scale, 1)); }

/* Deeper zones get stronger scale */
.aquarium[data-zone="2"] .aquarium__creature svg { transform: scale(calc(var(--atk-scroll-scale, 1) * 1.05)); }
.aquarium[data-zone="2"] .aquarium__creature--flip svg { transform: scaleX(-1) scale(calc(var(--atk-scroll-scale, 1) * 1.05)); }
.aquarium[data-zone="3"] .aquarium__creature svg { transform: scale(calc(var(--atk-scroll-scale, 1) * 1.1)); }
.aquarium[data-zone="3"] .aquarium__creature--flip svg { transform: scaleX(-1) scale(calc(var(--atk-scroll-scale, 1) * 1.1)); }

/* Bubbles */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(143, 212, 240, 0.2) 60%, transparent 80%);
  border: 1px solid rgba(143, 212, 240, 0.3);
  pointer-events: none;
  animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(20px, -50vh) scale(1); }
  100% { transform: translate(-10px, -110vh) scale(1.1); opacity: 0; }
}

/* Water surface caustics */
.caustics {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(63,182,232,0.08), transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 30%, rgba(63,182,232,0.06), transparent 60%);
  mix-blend-mode: screen;
  animation: causticShift 18s ease-in-out infinite alternate;
}
@keyframes causticShift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-3%, 2%); }
}

/* ===== Floating chrome (lang + chat + theme) ===== */
.float-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.float-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 14px 40px -18px rgba(13,31,77,0.45);
  transition: transform 0.2s, background 0.2s;
  position: relative;
}
.float-btn:hover { transform: translateY(-2px) scale(1.05); }
.float-btn--cyan { background: var(--cyan); color: white; border-color: transparent; }
.float-btn__pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.35;
  animation: pulse 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes pulse {
  0%   { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ===== Lang menu ===== */
.lang-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  box-shadow: 0 24px 60px -20px rgba(13,31,77,0.4);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.lang-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lang-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: none; background: none;
  color: var(--ink); font-size: 14px;
  border-radius: 12px;
  text-align: left;
}
.lang-menu button:hover { background: color-mix(in srgb, var(--cyan) 15%, transparent); }
.lang-menu button.active { background: color-mix(in srgb, var(--cyan) 20%, transparent); color: var(--cyan); font-weight: 600; }
.flag {
  width: 24px; height: 16px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ===== Chat panel ===== */
.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: var(--bg-2);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -30px rgba(13,31,77,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 199;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.chat-panel.open {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.chat-panel__head {
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--navy), var(--cyan));
  color: white;
  display: flex; align-items: center; gap: 12px;
}
.chat-panel__head h4 { font-family: var(--serif); font-style: italic; font-size: 22px; }
.chat-panel__head p { color: rgba(255,255,255,0.8); font-size: 12px; margin: 2px 0 0; }
.chat-panel__close {
  margin-left: auto; background: rgba(255,255,255,0.15);
  border: none; color: white; width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px;
}
.chat-panel__body {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(circle at 80% 20%, var(--water-tint), transparent 50%),
    var(--bg-2);
}
.chat-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-msg--bot {
  align-self: flex-start;
  background: color-mix(in srgb, var(--cyan) 18%, transparent);
  color: var(--ink);
  border-top-left-radius: 4px;
}
.chat-msg--user {
  align-self: flex-end;
  background: var(--navy);
  color: white;
  border-top-right-radius: 4px;
}
[data-theme="night"] .chat-msg--user { background: var(--cyan); color: var(--navy-deep); }
.chat-msg--typing { display: flex; gap: 4px; padding: 14px 16px; }
.chat-msg--typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  animation: typing 1.2s infinite;
}
.chat-msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg--typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 20px 12px;
}
.chat-suggestions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.chat-suggestions button:hover { border-color: var(--cyan); color: var(--cyan); }
.chat-panel__input {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px;
}
.chat-panel__input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.chat-panel__input input:focus { border-color: var(--cyan); }
.chat-panel__input button {
  background: var(--cyan);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 18px;
}

/* ===== Wave divider ===== */
.wave-divider {
  display: block;
  width: 100%;
  height: 80px;
}
.wave-divider path { fill: var(--bg-2); }

/* ===== Card ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* ===== Striped placeholder ===== */
.placeholder-img {
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--cyan) 12%, transparent) 0 12px,
      transparent 12px 24px),
    var(--bg-deep);
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== Hide on small ===== */
@media (max-width: 720px) {
  .site-header { padding: 0 14px; height: 64px; }
  .site-header__nav { display: none; }
  .site-header__burger { display: flex !important; }
  .site-header__logo img { height: 36px !important; }
  .wrap { padding: 0 16px; }
  .float-stack { right: 12px; bottom: 12px; gap: 10px; }
  .float-stack .float-btn { width: 44px; height: 44px; font-size: 18px; }
  .chat-window {
    right: 12px; bottom: 76px;
    width: calc(100vw - 24px);
    max-width: 100vw;
    height: 70vh;
    max-height: calc(100vh - 100px);
  }
  /* Typography scale-down */
  h1 { font-size: clamp(40px, 11vw, 56px); line-height: 1.05; }
  h2 { font-size: clamp(28px, 7vw, 40px); }
  h3 { font-size: clamp(20px, 5vw, 28px); }
  body { font-size: 15px; }
}

/* ===== Burger button ===== */
.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  margin-left: auto;
  cursor: pointer;
  transition: background 0.2s;
}
.site-header__burger:hover { background: rgba(13,31,77,0.05); }
.site-header__burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.2s;
  transform-origin: center;
}
.site-header__burger span:nth-child(1) { width: 22px; }
.site-header__burger span:nth-child(2) { width: 16px; align-self: flex-end; }
.site-header__burger span:nth-child(3) { width: 22px; }
.site-header__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 22px; }
.site-header__burger.is-open span:nth-child(2) { opacity: 0; }
.site-header__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 22px; }

/* ===== Mobile menu sheet ===== */
.mobile-menu {
  position: fixed; inset: 0;
  background: rgba(4,16,43,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu__sheet {
  position: absolute; top: 0; right: 0;
  width: min(380px, 88vw);
  height: 100%;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: 24px 28px 32px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px -10px rgba(0,0,0,0.3);
}
.mobile-menu.is-open .mobile-menu__sheet { transform: translateX(0); }
.mobile-menu__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.mobile-menu__head img { height: 44px; }
.mobile-menu__close {
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 24px;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}
.mobile-menu__nav {
  display: flex; flex-direction: column;
  gap: 4px;
  flex: 1;
}
.mobile-menu__nav a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  padding: 12px 0;
  color: var(--ink);
  letter-spacing: -0.01em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-menu__nav a:hover,
.mobile-menu__nav a.active {
  color: var(--cyan);
  padding-left: 8px;
}
.mobile-menu__cta {
  display: block;
  margin-top: 24px;
  padding: 18px 24px;
  background: var(--navy);
  color: white;
  text-align: center;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-menu__foot {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.mobile-menu__foot a { color: var(--ink-soft); }
.mobile-menu__foot a:hover { color: var(--cyan); }

/* ===== Tweaks panel hooks ===== */
.tweaks-panel {
  position: fixed;
  left: 24px; bottom: 24px;
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  z-index: 250;
  box-shadow: 0 30px 80px -30px rgba(13,31,77,0.5);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h5 {
  font-family: var(--serif); font-style: italic; font-size: 22px;
  margin: 0 0 12px;
}
.tweaks-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-soft);
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.tweaks-row:first-of-type { border-top: none; }
.tweaks-row input[type="range"] { width: 140px; }

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