/* =============================================================
   Periodo Corto — styles.css
   Arquetipo: Liquid Wave (adaptado a la marca: azul noche + azul ola)
   Layout: una página que baja como una sesión de surf. Bandas claras
   separadas por olas SVG; una banda profunda para "Quién soy".
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #EAF4FB;   /* espuma */
  --bg-soft:   #F6FAFD;   /* agua clara */
  --bg-deep:   #13294B;   /* azul noche (marca) */
  --ink:       #0F2140;
  --ink-soft:  #44597A;
  --accent:    #1E7BD8;   /* azul ola (marca) */
  --accent-2:  #F2B544;   /* sol */
  --wa:        #1C9A52;
  --on-deep:   #FFFFFF;
  --on-deep-soft: #C4D8F1;
  --line:      rgba(15, 33, 64, 0.12);
  --card:      #FFFFFF;

  --display: "Outfit", "Trebuchet MS", system-ui, sans-serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand:    "Caveat", "Comic Sans MS", cursive;

  --gutter: max(18px, env(safe-area-inset-left, 0px));
  --gutter-r: max(18px, env(safe-area-inset-right, 0px));
  --radius: 28px;
  --nav-h: 72px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; }
ul, ol { padding: 0; list-style: none; }
figure { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--bg-deep); color: #fff;
  border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.icon { width: 20px; height: 20px; flex: none; }

/* =============================================================
   4. Typography
   ============================================================= */
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
}
.hand { font-family: var(--hand); font-weight: 700; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 800; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem;
  transition: transform .35s var(--ease-bounce), box-shadow .35s var(--ease-out), background-color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.btn:hover { transform: translateY(-3px); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 24px -12px rgba(28,154,82,.7); }
.btn-wa:hover { box-shadow: 0 16px 30px -12px rgba(28,154,82,.8); }
.btn-ghost { border: 2px solid var(--line); color: var(--ink); background: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { min-height: 44px; padding: 10px 16px; font-size: .92rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(234, 244, 251, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
@supports (backdrop-filter: blur(10px)) {
  .nav { background: rgba(234, 244, 251, 0.72); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); }
}
.nav.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px -18px rgba(15,33,64,.5); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--nav-h); padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 6px; }
.brand-emblem { width: 40px; height: auto; }
.brand-word { width: 104px; height: auto; }
.nav-links { display: none; gap: 26px; }
.nav-links a { font-size: .95rem; font-weight: 500; color: var(--ink); position: relative; padding-block: 6px; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
.nav .btn-sm span { display: none; }

/* Blobs (liquid shapes) */
.blob {
  position: absolute; z-index: 0; pointer-events: none;
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  animation: blobMorph 14s ease-in-out infinite alternate;
}
.blob-a { inset: 6% -6% -8% 8%; background: linear-gradient(140deg, #9CC7F2 0%, #1E7BD8 100%); opacity: .55; }
.blob-b { inset: -6% 6% 4% -6%; background: linear-gradient(140deg, #1E7BD8 0%, #4FA3F0 100%); opacity: .45; }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Hero --- */
.hero { position: relative; padding-block: 36px 150px; overflow: clip; }
.hero-waves {
  position: absolute; left: 0; bottom: 0; width: 200%; height: 220px; z-index: 0;
  max-width: none;
  animation: waveDrift 26s linear infinite;
}
.hero-waves .wave-back  { fill: #CFE4F7; }
.hero-waves .wave-mid   { fill: #A9CFF2; animation: waveBob 9s ease-in-out infinite; }
.hero-waves .wave-front { fill: var(--bg-soft); }
.hero-grid { position: relative; z-index: 1; display: grid; gap: 40px; align-items: center; }
.hero-title {
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  font-weight: 800; line-height: .98; max-width: 14ch; margin-top: 14px;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 40ch; margin-top: 18px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-facts li {
  font-size: .88rem; font-weight: 500; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.75); border: 1px solid var(--line);
}
.hero-figure { position: relative; padding: 18px; }
.hero-photo {
  position: relative; z-index: 1; overflow: hidden;
  border-radius: 46% 54% 42% 58% / 52% 40% 60% 48%;
  box-shadow: 0 30px 60px -30px rgba(15,33,64,.55);
  animation: floatBob 7s ease-in-out infinite;
}
.hero-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: saturate(.92); }
.hero-tag {
  position: absolute; z-index: 2; left: 0; bottom: 12%;
  background: var(--card); color: var(--ink); font-size: 1.7rem;
  padding: 4px 16px; border-radius: 14px; transform: rotate(-5deg);
  box-shadow: 0 10px 24px -14px rgba(15,33,64,.6);
}

/* --- Sections generic --- */
.section { position: relative; padding-block: 72px; }
.section-story { background: var(--bg-soft); }
.section-foam { background: var(--bg-soft); padding-top: 110px; }
.divider { display: block; width: 100%; height: 70px; }
.divider-to-deep { fill: var(--bg-deep); background: var(--bg-soft); margin-bottom: -1px; }
.divider-from-deep { fill: var(--bg-deep); background: var(--bg); margin-top: -1px; }
.divider-top-foam { position: absolute; top: -1px; left: 0; fill: var(--bg); height: 60px; }

/* --- Story --- */
.story-panels { display: grid; gap: 22px; }
.story {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 24px 50px -36px rgba(15,33,64,.45);
}
.story-num { font-size: 1.6rem; color: var(--accent); }
.story-graph { width: 100%; height: 56px; }
.story-graph path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.story h3 { font-size: 1.7rem; font-weight: 700; }
.story p { color: var(--ink-soft); }

/* --- About (deep band) --- */
.section-deep { background: var(--bg-deep); color: var(--on-deep); padding-block: 48px 72px; }
.section-deep .eyebrow { color: var(--on-deep-soft); }
.about { display: grid; gap: 40px; align-items: center; }
.about-portrait { position: relative; padding: 16px; }
.about-photo { position: relative; z-index: 1; overflow: hidden; border-radius: 58% 42% 50% 50% / 46% 54% 46% 54%; }
.about-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 55% 50%; }
.about-copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.about-copy h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; }
.about-copy p { color: var(--on-deep-soft); max-width: 60ch; }
.creds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.creds li {
  display: flex; flex-direction: column; padding: 14px 16px; border-radius: 18px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
}
.creds strong { font-family: var(--display); font-size: 1.5rem; color: var(--on-deep); }
.creds span { font-size: .86rem; color: var(--on-deep-soft); line-height: 1.4; }
.about-strip { display: grid; gap: 16px; margin-top: 44px; }
.about-strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 22px; }

/* --- Levels --- */
.levels { display: grid; gap: 18px; }
.level {
  position: relative; background: var(--card); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.level:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -30px rgba(15,33,64,.5); }
.level-feature { border: 2px solid var(--accent); }
.level-tag {
  align-self: flex-start; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: var(--bg); padding: 5px 12px; border-radius: 999px;
}
.level h3 { font-size: 1.9rem; font-weight: 800; }
.level p { color: var(--ink-soft); }

/* --- Prices --- */
.prices { display: grid; gap: 20px; align-items: start; }
.price-side { display: grid; gap: 20px; }
.price-card {
  position: relative; background: var(--card); border-radius: var(--radius); padding: 26px 26px 22px;
  box-shadow: 0 24px 50px -38px rgba(15,33,64,.5);
}
.price-card h3 { font-size: 1.45rem; font-weight: 700; margin-bottom: 6px; }
.price-list { display: flex; flex-direction: column; }
.price-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.price-row:last-child { border-bottom: 0; }
.price-row dt { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.price-row dt span { font-weight: 400; font-size: .86rem; color: var(--ink-soft); }
.price-row dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-note { font-size: .85rem; color: var(--ink-soft); margin-top: 12px; }
.price-morning {
  background: linear-gradient(150deg, #1E7BD8 0%, #13294B 100%); color: #fff;
  display: flex; flex-direction: column; gap: 8px; overflow: visible;
}
.price-morning .eyebrow { color: #CFE4F7; }
.price-morning p { color: #E3EEFA; }
.price-big { font-family: var(--display); font-weight: 800; font-size: 3.4rem; line-height: 1; color: #fff !important; }
.price-big small { font-size: 1rem; font-weight: 500; color: #CFE4F7; }
.sticker {
  position: absolute; top: -18px; right: 18px; background: var(--accent-2); color: var(--ink);
  font-size: 1.5rem; padding: 2px 14px; border-radius: 12px; transform: rotate(4deg);
}

/* --- When / gallery --- */
.when { display: grid; gap: 16px; }
.when-item { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px; }
.when-item h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 6px; }
.when-item p { color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; }

/* --- CTA --- */
.cta { background: var(--bg-soft); text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta h2 { font-size: clamp(2.6rem, 9vw, 5rem); font-weight: 800; }
.cta p { color: var(--ink-soft); max-width: 46ch; }
.cta-phone { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 7vw, 3rem); color: var(--ink) !important; user-select: all; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.wave-underline { position: relative; color: var(--accent); white-space: nowrap; }
.wave-underline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M0 7 Q 15 0 30 7 T 60 7 T 90 7 T 120 7' fill='none' stroke='%231E7BD8' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 0 / 60px 14px;
  animation: underlineFlow 3.5s linear infinite;
}

/* --- Footer --- */
.footer { background: var(--bg-soft); }
.divider-footer { fill: var(--bg-deep); height: 60px; margin-bottom: -1px; }
.footer-body { background: var(--bg-deep); color: var(--on-deep-soft); padding-block: 28px 96px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: .92rem; }
.footer-emblem { width: 48px; height: auto; margin-bottom: 6px; }
.footer a { color: var(--on-deep); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { font-size: .8rem; opacity: .85; }

/* --- Floating WhatsApp --- */
.float-wa {
  position: fixed; z-index: 60;
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--wa); color: #fff;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.45);
  transition: transform .35s var(--ease-bounce);
}
.float-wa svg { width: 30px; height: 30px; }
.float-wa:hover { transform: scale(1.08) translateY(-2px); }

/* --- Legal pages --- */
.legal-page { background: var(--bg-soft); }
.legal-top { border-bottom: 1px solid var(--line); background: var(--bg); }
.legal-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--nav-h); padding-block: 8px; }
.legal { max-width: 760px; padding-block: 48px 80px; }
.legal h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800; }
.legal h2 { font-size: 1.3rem; font-weight: 700; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { list-style: disc; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.legal strong { color: var(--ink); }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-date { font-size: .9rem; margin-top: 8px; }
.legal-links { margin-top: 40px; }

/* =============================================================
   7. Effects
   ============================================================= */
@keyframes waveDrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes waveBob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes floatBob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes blobMorph {
  0%   { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
  50%  { border-radius: 55% 45% 40% 60% / 55% 38% 62% 45%; }
  100% { border-radius: 44% 56% 58% 42% / 36% 58% 42% 64%; }
}
@keyframes underlineFlow { from { background-position: 0 0; } to { background-position: 60px 0; } }

/* Reveal on scroll — only when JS is running (html.js). Without JS all content shows. */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }   /* defensive rule (gotcha A.4.5) */

/* Wave reveal: image emerges from below */
.js .wave-reveal img { clip-path: inset(100% 0 0 0 round 20px); transition: clip-path 1.1s var(--ease-soft) .1s; }
.js .wave-reveal.is-visible img { clip-path: inset(0 0 0 0 round 20px); }

/* =============================================================
   8. Responsive (mobile-first)
   ============================================================= */
@media (min-width: 540px) {
  .nav .btn-sm span { display: inline; }
  .brand-word { width: 118px; }
  .hero-tag { font-size: 1.9rem; }
}
@media (min-width: 720px) {
  .story-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-alt { transform: translateY(40px); }
  .js .story-alt.reveal.is-visible { transform: translateY(40px); }
  .about-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .when { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section { padding-block: 96px; }
  .section-foam { padding-top: 130px; }
  .divider { height: 90px; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .hero { padding-block: 56px 190px; }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; }
  .about { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; }
  .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .levels .level:nth-child(2) { transform: translateY(28px); }
  .js .levels .level:nth-child(2).reveal.is-visible { transform: translateY(28px); }
  .levels .level:nth-child(2):hover { transform: translateY(24px); }
  .prices { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .hero-waves { height: 260px; }
}
@media (min-width: 1280px) {
  .hero-title { font-size: 5.8rem; }
}

/* =============================================================
   9. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-waves { animation-duration: 60s; }
}
