/* ==========================================================================
   Kaizen Aiki Juku — Diseño oriental minimalista
   ========================================================================== */

:root {
  --paper: #f6f3ed;
  --paper-2: #efeae0;
  --ink: #1b1917;
  --ink-soft: #5b564f;
  --aka: #c1272d;
  --aka-deep: #9e1f24;
  --line: rgba(27, 25, 23, 0.14);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", "Helvetica Neue", sans-serif;
  --font-kanji: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; list-style: none; }
::selection { background: var(--aka); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--aka);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Tipografía base ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
}
h2 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem); letter-spacing: -0.01em; }
h2 em { font-style: italic; color: var(--aka); }
h3 { font-size: 1.35rem; }
p { text-wrap: pretty; }

.kanji {
  font-family: var(--font-kanji);
  color: var(--aka);
  font-weight: 500;
}

.container {
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding-block: clamp(4.5rem, 4rem + 4vw, 8rem); }

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.section-eyebrow .kanji { font-size: 1.15rem; letter-spacing: 0; }

.section-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-lead { margin-top: 1rem; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out),
              border-color 0.25s var(--ease-out), translate 0.25s var(--ease-out);
}
.btn:hover { translate: 0 -2px; }
.btn-primary { background: var(--aka); border-color: var(--aka); color: #fff; }
.btn-primary:hover { background: var(--aka-deep); border-color: var(--aka-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  container-type: scroll-state;
  container-name: site-header;
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding-inline: max(1.25rem, calc((100vw - 72rem) / 2));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
/* El fondo con blur va en un pseudo-elemento: backdrop-filter en el propio
   header crearía un containing block y rompería el position:fixed del menú móvil */
.header-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(246, 243, 237, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@container site-header scroll-state(stuck: top) {
  .header-inner {
    border-bottom-color: var(--line);
    box-shadow: 0 10px 30px -18px rgba(27, 25, 23, 0.35);
  }
}
/* Fallback JS (navegadores sin container scroll-state) */
.site-header.is-stuck .header-inner {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -18px rgba(27, 25, 23, 0.35);
}

.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 2.75rem; width: auto; }

.nav-menu { display: flex; align-items: center; gap: 2rem; }
.nav-menu a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-block: 0.35rem;
  transition: color 0.2s;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--aka);
  scale: 0 1;
  transform-origin: left;
  transition: scale 0.3s var(--ease-out);
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a:hover::after { scale: 1 1; }
.nav-menu .nav-cta {
  color: #fff;
  background: var(--aka);
  padding: 0.55rem 1.2rem;
  transition: background-color 0.2s;
}
.nav-menu .nav-cta::after { display: none; }
.nav-menu .nav-cta:hover { background: var(--aka-deep); color: #fff; }

.nav-toggle {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: translate 0.3s var(--ease-out), rotate 0.3s var(--ease-out), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { translate: 0 8px; rotate: 45deg; }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { translate: 0 -8px; rotate: -45deg; }

@media (max-width: 47.99rem) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    background: var(--paper);
    translate: 0 -100%;
    visibility: hidden;
    transition: translate 0.45s var(--ease-out), visibility 0s 0.45s;
    z-index: 105;
  }
  .nav-menu.is-open {
    translate: 0 0;
    visibility: visible;
    transition: translate 0.45s var(--ease-out);
  }
  .nav-menu a { font-size: 1.15rem; }
  .nav-menu .nav-cta { padding: 0.8rem 2rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: center;
  overflow: clip;
  isolation: isolate;
}

.hero-circle {
  position: absolute;
  z-index: -1;
  width: clamp(20rem, 48vw, 42rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #d4383e 0%, var(--aka) 55%, var(--aka-deep) 100%);
  right: max(-10rem, -8vw);
  top: 50%;
  translate: 0 -50%;
  opacity: 0.92;
}
.hero-circle::after {
  content: "";
  position: absolute;
  inset: -1.5rem;
  border-radius: 50%;
  border: 1px solid rgba(193, 39, 45, 0.25);
}

.hero-kanji {
  position: absolute;
  z-index: -1;
  right: clamp(1rem, 12vw, 14rem);
  top: 50%;
  translate: 0 -50%;
  writing-mode: vertical-rl;
  font-family: var(--font-kanji);
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
  user-select: none;
}

.hero-content {
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
  padding-block: 4rem;
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(3.4rem, 3rem + 9vw, 8.5rem);
  font-weight: 300;
  letter-spacing: 0.01em;
}
.hero h1 span {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 0.7rem + 1.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.58em;
  margin-top: 0.9rem;
  color: var(--aka);
}
.hero-sub {
  margin-top: 1.8rem;
  max-width: 32rem;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  color: var(--ink-soft);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.6rem;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  translate: -50% 0;
  width: 1.5rem;
  height: 3.5rem;
  display: grid;
  justify-items: center;
}
.hero-scroll span {
  width: 1px;
  height: 100%;
  background: linear-gradient(var(--ink) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-content > * {
    animation: hero-rise 0.9s var(--ease-out) backwards;
  }
  .hero-content > *:nth-child(2) { animation-delay: 0.1s; }
  .hero-content > *:nth-child(3) { animation-delay: 0.2s; }
  .hero-content > *:nth-child(4) { animation-delay: 0.3s; }
  .hero-circle { animation: hero-circle-in 1.4s var(--ease-out) backwards 0.15s; }
  .hero-scroll span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--aka);
    animation: scroll-hint 2.2s ease-in-out infinite;
  }
}
@keyframes hero-rise {
  from { opacity: 0; translate: 0 2rem; }
}
@keyframes hero-circle-in {
  from { opacity: 0; scale: 0.85; }
}
@keyframes scroll-hint {
  0%   { translate: 0 -100%; }
  60%, 100% { translate: 0 100%; }
}

@media (max-width: 47.99rem) {
  .hero-circle {
    right: -38vw;
    top: 24%;
    opacity: 0.28;
  }
  .hero-kanji {
    right: 0.5rem;
    top: 22%;
    color: rgba(193, 39, 45, 0.18);
  }
  .hero-scroll { display: none; }
}

/* ==========================================================================
   Filosofía
   ========================================================================== */

.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}
.split-text p + p { margin-top: 1.1rem; color: var(--ink-soft); }
.split-text h2 { margin-bottom: 1.4rem; }
.split-text blockquote {
  margin-top: 2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--aka);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
}
.split-media { position: relative; }
.split-media::before {
  content: "";
  position: absolute;
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--aka);
  opacity: 0.14;
  left: -8%;
  bottom: -10%;
  z-index: -1;
}
.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
}

@media (max-width: 47.99rem) {
  .split { grid-template-columns: 1fr; }
  .split-media { order: -1; }
}

/* ==========================================================================
   Actividades
   ========================================================================== */

.actividades { background: var(--paper-2); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19.5rem), 1fr));
  gap: 1.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: translate 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.card:hover {
  translate: 0 -5px;
  box-shadow: 0 24px 45px -28px rgba(27, 25, 23, 0.4);
}
.card figure {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.6s var(--ease-out);
}
.card:hover figure img { scale: 1.05; }

.card-body { padding: 1.6rem 1.6rem 1.9rem; }
.card-body h3 { margin-bottom: 0.65rem; }
.card-body h3::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 2px;
  background: var(--aka);
  margin-top: 0.6rem;
}
.card-body p { font-size: 0.95rem; color: var(--ink-soft); }

/* Tarjetas tipográficas con kanji */
.card-kanji {
  background: var(--ink);
  border-color: var(--ink);
  position: relative;
  min-height: 22rem;
  justify-content: flex-end;
}
.card-kanji-char {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-family: var(--font-kanji);
  font-size: clamp(6rem, 10vw, 9rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(246, 243, 237, 0.08);
  user-select: none;
}
.card-kanji .card-body { position: relative; }
.card-kanji .card-body h3 { color: var(--paper); }
.card-kanji .card-body p { color: rgba(246, 243, 237, 0.72); }

/* ==========================================================================
   Galería
   ========================================================================== */

.galeria { padding-block: clamp(3rem, 3rem + 2vw, 5rem); }
.gallery-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.gallery-strip figure { overflow: hidden; }
.gallery-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: scale 0.6s var(--ease-out), filter 0.6s var(--ease-out);
  filter: saturate(0.85);
}
.gallery-strip figure:hover img { scale: 1.04; filter: saturate(1); }

@media (max-width: 47.99rem) {
  .gallery-strip { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Horarios (sección oscura)
   ========================================================================== */

.horarios {
  background: var(--ink);
  color: var(--paper);
}
.horarios .section-eyebrow { color: rgba(246, 243, 237, 0.6); }
.horarios .section-eyebrow .kanji { color: var(--aka); }

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: 1.5rem;
}
.schedule-card {
  border: 1px solid rgba(246, 243, 237, 0.16);
  padding: 1.75rem 1.6rem;
  transition: border-color 0.3s, background-color 0.3s;
}
.schedule-card:hover {
  border-color: rgba(193, 39, 45, 0.65);
  background: rgba(246, 243, 237, 0.03);
}
.schedule-card h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.15rem;
  margin-bottom: 1.35rem;
}
.schedule-card h3 .kanji { font-size: 1rem; }
.schedule-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px dashed rgba(246, 243, 237, 0.18);
}
.schedule-list > div:last-child { border-bottom: 0; }
.schedule-list > div.stack { flex-direction: column; gap: 0.15rem; }
.schedule-list > div.stack dd { text-align: left; white-space: normal; }
.schedule-list dt {
  font-size: 0.88rem;
  color: rgba(246, 243, 237, 0.65);
}
.schedule-list dd {
  font-family: var(--font-display);
  font-size: 1rem;
  text-align: right;
  white-space: nowrap;
}
.schedule-cta {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--aka);
  transition: color 0.2s;
}
.schedule-cta:hover { color: #e2575c; }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq { background: var(--paper-2); }
.faq-list { max-width: 46rem; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0.25rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  transition: color 0.2s;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--aka);
  transition: rotate 0.3s var(--ease-out);
}
.faq-list details[open] summary::after { rotate: 45deg; }
.faq-list summary:hover { color: var(--aka); }
.faq-list details p {
  padding: 0 2.5rem 1.3rem 0.25rem;
  color: var(--ink-soft);
}
.faq-list details a {
  color: var(--aka);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Contacto
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: stretch;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-item {
  display: block;
  padding-block: 1.3rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease-out);
}
.contact-item:first-child { border-top: 1px solid var(--line); }
.contact-item:hover { padding-left: 0.75rem; }
.contact-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--aka);
  margin-bottom: 0.35rem;
}
.contact-value {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 0.8vw, 1.45rem);
  line-height: 1.35;
}

.contact-map {
  min-height: 22rem;
  border: 1px solid var(--line);
}
.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  border: 0;
  filter: grayscale(0.85) contrast(1.02);
}

@media (max-width: 47.99rem) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: rgba(246, 243, 237, 0.75);
  padding-block: 3rem;
  border-top: 3px solid var(--aka);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-logo { height: 3.25rem; width: auto; align-self: flex-start; }
.footer-tag {
  font-family: var(--font-kanji);
  font-size: 0.8rem;
  color: rgba(246, 243, 237, 0.5);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--paper); }
.footer-copy { font-size: 0.8rem; color: rgba(246, 243, 237, 0.45); }

/* ==========================================================================
   Animaciones de entrada al hacer scroll
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-rise {
      from { opacity: 0; translate: 0 2.5rem; }
    }
    .reveal {
      animation: reveal-rise auto linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

/* Fallback con IntersectionObserver (js/main.js) */
.reveal-js {
  opacity: 0;
  translate: 0 2.5rem;
  transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out);
}
.reveal-js.in-view {
  opacity: 1;
  translate: 0 0;
}
