/* styles.css — Estilos generales, secciones del sitio, cabecera y tema claro/oscuro.
 * Estilo visual inspirado en la plantilla «Sushi Delivery» (TokyoDash) de Weblium:
 * fondos carbón con textura, crema cálida, acento naranja y títulos en mayúsculas gruesas. */

:root {
  /* paleta base */
  --ink: #181818;
  --ink-2: #222222;
  --ink-3: #2c2c2c;
  --cream: #fff9f0;
  --cream-2: #fcf3e2;
  --orange: #e14411;
  --navy: #113e65;

  /* tokens de interfaz (tema claro) */
  --bg: var(--cream);
  --bg-alt: var(--cream-2);
  --bg-elev: #fffdf8;
  --surface: #ffffff;
  --surface-2: #f6ead6;
  --border: #ead9bf;
  --text: var(--ink);
  --text-muted: #6b6b6b;
  --accent: var(--orange);
  --accent-strong: #b8350b;
  --accent-soft: #fde4d8;
  --accent-contrast: #fff9f0;
  --olive: #3f6b2a;
  --olive-soft: #e6eedb;
  --mode-quiz: #113e65;
  --mode-quiz-soft: #e1ebf5;
  --ok: #2f7a45;
  --ok-soft: #e1f2e6;
  --warn: #9a6a00;
  --warn-soft: #fbf0d3;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --focus: #1f6feb;
  --shadow: 0 1px 2px rgb(24 24 24 / 0.06), 0 6px 20px rgb(24 24 24 / 0.07);
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Geologica", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --font-deco: "Reggae One", "Segoe UI", system-ui, sans-serif;
  --font-serif: Georgia, "Palatino Linotype", serif;
  --maxw: 1180px;
  --chatw: 920px;
  color-scheme: light;
}


:root[data-theme="dark"] {
  --bg: #1b1b1b;
  --bg-alt: #202020;
  --bg-elev: #242424;
  --surface: #2a2a2a;
  --surface-2: #333333;
  --border: #3d3d3d;
  --text: #fff9f0;
  --text-muted: #b9b0a4;
  --accent: #f05a2a;
  --accent-strong: #ff7f55;
  --accent-soft: #3a2018;
  --accent-contrast: #fff9f0;
  --olive: #a9cf8a;
  --olive-soft: #26301f;
  --mode-quiz: #8fb8e0;
  --mode-quiz-soft: #1d2b3a;
  --ok: #7fd394;
  --ok-soft: #1c3324;
  --warn: #e9c46a;
  --warn-soft: #3a2f14;
  --bad: #f28b82;
  --bad-soft: #3d1f1d;
  --focus: #79b8ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.3);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; }

a { color: var(--accent-strong); }
img { max-width: 100%; display: block; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-contrast);
  text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.accent { color: var(--orange); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* textura carbón, como el fondo de la plantilla */
.topbar, .app-header, .hero, .section--dark, .site-footer {
  background-color: var(--ink);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 20% 0%, #2a2a2a 0%, transparent 60%);
  color: var(--cream);
}

/* ------------------------------ barra superior ------------------------------ */

.topbar { font-size: 0.85rem; border-bottom: 1px solid #2b2b2b; }
.topbar__inner { display: flex; justify-content: space-around; gap: 8px 24px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; }
.topbar span { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(255 249 240 / 0.45); }

/* ------------------------------ cabecera ------------------------------ */

.app-header {
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 0 #2b2b2b;
}
.app-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; min-height: 68px; }

.logo {
  font: 800 1.4rem/1 var(--font-display); letter-spacing: 0.01em;
  color: var(--cream); text-decoration: none; text-transform: uppercase; white-space: nowrap;
}
.logo span { color: var(--orange); }

.nav { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.nav a {
  color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--orange); }

.controls { display: flex; align-items: center; gap: 8px; }

.lang { display: inline-flex; align-items: center; gap: 6px; color: var(--cream); }

.select {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.select--compact { padding: 6px 8px; font-size: 0.875rem; }
.app-header .select { background: var(--orange); border-color: var(--orange); color: var(--cream); font-weight: 600; }
.app-header .select option { background: var(--ink); color: var(--cream); }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 4px;
  border: 0; background: var(--orange); color: var(--cream);
  cursor: pointer;
}
.icon-btn:hover { background: #c4390c; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* ------------------------------ portada ------------------------------ */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: min(640px, calc(100vh - 100px));
}
.hero__text {
  align-self: center;
  padding: 56px 48px 56px max(24px, calc((100vw - var(--maxw)) / 2 + 24px));
  max-width: 640px; justify-self: end; width: 100%;
}
.eyebrow { font: 400 0.9rem/1.4 var(--font-deco); margin: 0 0 10px; color: var(--cream); }
.eyebrow--muted { color: var(--text-muted); }
.hero__title {
  margin: 0 0 18px; font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.005em; line-height: 1.02;
}
.hero__title span { display: inline-block; margin-right: 0.25em; }
.hero__lead { margin: 0 0 14px; font-size: 1.15rem; font-weight: 500; }
.hero__body { margin: 0 0 28px; color: rgb(255 249 240 / 0.86); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__media {
  position: relative; overflow: hidden;
  background-color: var(--navy);
  /* olas tipo seigaiha */
  background-image:
    radial-gradient(circle at 50% 100%, transparent 0 7px, rgb(255 255 255 / 0.13) 8px 9px, transparent 10px 15px, rgb(255 255 255 / 0.13) 16px 17px, transparent 18px 23px, rgb(255 255 255 / 0.13) 24px 25px, #164b78 26px 28px, transparent 29px),
    radial-gradient(circle at 50% 100%, transparent 0 7px, rgb(255 255 255 / 0.13) 8px 9px, transparent 10px 15px, rgb(255 255 255 / 0.13) 16px 17px, transparent 18px 23px, rgb(255 255 255 / 0.13) 24px 25px, #164b78 26px 28px, transparent 29px);
  background-size: 56px 28px;
  background-position: 0 0, 28px 14px;
}
.hero__media img {
  position: absolute; height: 90%; width: auto; aspect-ratio: 1; object-fit: cover;
  right: -10%; top: 50%; transform: translateY(-50%);
  border-radius: 50%;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.45), 0 0 0 10px rgb(24 24 24 / 0.55);
}

/* ------------------------------ secciones ------------------------------ */

.section { padding: 84px 0; }
.section--cream { background: var(--bg-alt); }
.section--light { background: var(--bg); }
.section__intro { max-width: 60ch; margin: 0 auto 40px; }

.display {
  margin: 0 0 18px; font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 900;
  text-transform: uppercase; color: var(--text);
}
.display--light { color: var(--cream); }
.rule { width: 64px; margin: 0 0 22px; border: 0; border-top: 2px solid var(--navy); }
.rule--short { width: 58px; margin: 12px auto; }
:root[data-theme="dark"] .rule { border-top-color: var(--mode-quiz); }
.lead { font-size: 1.12rem; font-weight: 500; color: var(--text-muted); }
.section .wrap p { color: var(--text-muted); }
.section--dark .wrap p { color: rgb(255 249 240 / 0.8); }

/* sobre el tutor */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about__col--offset { padding-top: 6px; }
.photo { margin: 28px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo img { width: 100%; height: auto; }
.photo--navy { background: var(--navy); }
.callout {
  display: flex; align-items: flex-start; gap: 12px; text-decoration: none;
  color: var(--text); margin-top: 20px;
}
.callout svg { color: var(--orange); flex: none; margin-top: 2px; }
.callout strong { display: block; }
.callout__sub { color: var(--orange); font-weight: 600; }
.callout:hover strong { text-decoration: underline; }

/* cuatro principios */
.features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  margin-top: 72px; text-align: center;
}
.feature__icon {
  display: inline-grid; place-items: center; width: 78px; height: 78px; border-radius: 50%;
  background: var(--bg); color: var(--orange);
}
.feature h3 { margin: 14px 0 0; font-size: 1.3rem; text-transform: uppercase; }
.feature p { margin: 0; font-size: 0.97rem; }

/* temas */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px;
}
.topic-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s;
}
.topic-card:hover { transform: translateY(-3px); }
.topic-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.topic-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 18px; flex: 1; }
.topic-card__id {
  align-self: flex-start; padding: 1px 8px; border-radius: 4px;
  font: 800 0.8rem/1.6 var(--font-display); background: var(--orange); color: var(--cream);
}
.topic-card h3 { margin: 4px 0 0; font-size: 1.05rem; text-transform: uppercase; }
.topic-card p { margin: 0 0 10px; font-size: 0.9rem; flex: 1; }
.topic-card .btn { align-self: flex-start; }

/* tutor */
.tutor-section { padding-bottom: 64px; }

/* ------------------------------ pie ------------------------------ */

.site-footer { padding: 64px 0 28px; }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; justify-content: space-between; }
.footer__slogan { margin: 0; font: 800 1.35rem/1.35 var(--font-display); text-transform: uppercase; }
.footer__info { display: flex; gap: 14px; align-items: flex-start; }
.footer__info svg { color: var(--orange); flex: none; }
.footer__info h3 { margin: 0; font-size: 1.15rem; text-transform: uppercase; }
.footer__info p { margin: 2px 0 0; font-size: 0.92rem; }
.footer__rule { border: 0; border-top: 1px solid #3a3a3a; margin: 40px 0; }
.footer__cols { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr; gap: 28px; }
.footer__cols h4 { margin: 0 0 12px; font-size: 1.05rem; text-transform: uppercase; }
.footer__cols a:not(.logo) { display: block; color: var(--cream); text-decoration: none; font-size: 0.92rem; margin: 4px 0; opacity: 0.85; }
.footer__cols a:not(.logo):hover { color: var(--orange); opacity: 1; }
.footer__small { font-size: 0.88rem; margin: 10px 0 0; color: rgb(255 249 240 / 0.75); }
.footer__legal { margin: 0; text-align: center; font-size: 0.82rem; color: rgb(255 249 240 / 0.6); }

/* ------------------------------ botones ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  font: inherit; font-weight: 600; font-size: 0.925rem; text-decoration: none;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: var(--cream); }
.btn--primary:hover { background: #c4390c; border-color: #c4390c; }
.btn--outline { background: transparent; border: 1.5px solid var(--cream); color: var(--cream); }
.btn--outline:hover { background: var(--cream); color: var(--ink); }
.btn--square { border-radius: 4px; min-height: 48px; padding: 10px 28px; font-size: 0.97rem; }
.btn--sm { min-height: 36px; padding: 6px 16px; font-size: 0.88rem; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--teacher { background: var(--warn-soft); border-color: var(--warn); color: var(--text); }
.btn--teacher::before { content: "✉"; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ------------------------------ cargador (file://) ------------------------------ */

.loader {
  margin: 16px 0; padding: 20px;
  background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius);
}
.loader h2 { margin: 0 0 8px; font-size: 1.15rem; }
.loader ol { padding-left: 20px; }
.loader li { margin: 8px 0; }
.file-btn { position: relative; margin-left: 8px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------ diálogo ------------------------------ */

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgb(12 12 12 / 0.55); }
.dialog h2 { margin-top: 0; font-size: 1.2rem; text-transform: uppercase; }

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 980px) {
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero__text { justify-self: stretch; max-width: none; padding: 48px 24px; }
  .hero__media { min-height: 340px; }
  .hero__media img { height: 92%; right: 50%; transform: translate(50%, -50%); }
  .about { grid-template-columns: 1fr; gap: 0; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .topbar__inner span:nth-child(3) { display: none; }
  .logo { font-size: 1.2rem; }
  .hero__text { padding: 40px 16px; }
  .hero__media { min-height: 280px; }

  .section { padding: 60px 0; }
  .features { grid-template-columns: 1fr; margin-top: 48px; }
  .footer__cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
