/* Nobita, la web. Colores y formas tomados de Nobita/Theme/NobitaTheme.swift.
   Solo modo claro, como la app. Sin JavaScript, sin fuentes ni recursos de terceros. */

@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #1e2a5a;
  --navy-soft: #2b3a7a;
  --yellow: #ffd43b;
  --yellow-deep: #f5b800;
  --paper: #fbf8f1;
  --paper-2: #f5f1e6;
  --white: #fff;
  --line: #e8e2d4;
  --red: #d63b3b;
  --rule: #c5d6ee; /* el azul del papel rayado */
  --ink-2: #444f7d; /* texto secundario sobre papel: contraste 7:1 */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  --radius: 18px;
  --shadow: 0 1px 0 var(--line), 0 14px 30px -18px rgba(30, 42, 90, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure, pre { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--yellow-deep); }
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 7px var(--yellow);
}

.wrap { width: min(100% - 40px, 1120px); margin-inline: auto; }
.sprite, .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 10;
  background: var(--yellow); color: var(--navy); padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; }

.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

/* ---------- Cabecera ---------- */

.top { position: relative; z-index: 2; }
.top .wrap { display: flex; align-items: center; gap: 20px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.02em; }
.brand svg { width: 58px; height: auto; display: block; }
.nav { margin-left: auto; display: none; gap: 26px; font-weight: 600; font-size: 0.97rem; }
.nav a { text-decoration: none; padding-block: 4px; }
.nav a:hover { text-decoration: underline; text-decoration-color: var(--yellow-deep); text-decoration-thickness: 3px; }
.lang {
  margin-left: auto; text-decoration: none; font-weight: 700; font-size: 0.9rem;
  border: 1.5px solid var(--navy); border-radius: 999px; padding: 5px 14px;
}
.lang:hover { background: var(--yellow); }
@media (min-width: 820px) {
  .nav { display: flex; }
  .lang { margin-left: 0; }
}

/* ---------- Portada: una hoja de cuaderno ---------- */

.hero { position: relative; isolation: isolate; padding-block: 28px 84px; overflow: hidden; }
.hero::before { /* renglones, que se desvanecen hacia abajo */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(30, 42, 90, 0.075) 31px 32px);
  background-position: 0 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero::after { /* el margen rojo */
  content: ""; position: absolute; top: 0; bottom: 0; z-index: -1; width: 2px;
  left: max(10px, calc((100% - min(100% - 40px, 1120px)) / 2 - 26px));
  background: rgba(214, 59, 59, 0.45);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.hero .wrap { display: grid; gap: 52px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.08fr 0.92fr; gap: 40px; } }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--yellow); border: 1.5px solid var(--navy); border-radius: 999px;
  padding: 6px 16px 6px 12px; font-weight: 700; font-size: 0.95rem;
}
h1 {
  margin-top: 22px; font-size: clamp(2.35rem, 1.2rem + 4.6vw, 4.1rem); line-height: 1.04;
  font-weight: 800; letter-spacing: -0.035em; text-wrap: balance;
}
.mark {
  background: linear-gradient(transparent 58%, rgba(255, 212, 59, 0.85) 58% 94%, transparent 94%);
  padding-inline: 0.08em; margin-inline: -0.08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lead { margin-top: 24px; font-size: 1.2rem; line-height: 1.55; max-width: 34rem; color: var(--ink-2); }
.lead strong { color: var(--navy); font-weight: 700; }
.cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700;
  background: var(--yellow); border: 2px solid var(--navy); border-radius: 999px; padding: 12px 24px;
  box-shadow: 0 4px 0 var(--navy); transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { background: #ffdc5c; transform: translateY(2px); box-shadow: 0 2px 0 var(--navy); }
.link-quiet { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Marco de iPad hecho con CSS (no es un dispositivo de Apple: solo un marco sencillo) */
.ipad {
  position: relative; background: var(--navy); padding: 3.3%; border-radius: 6.2% / 4.3%;
  box-shadow: 0 34px 50px -26px rgba(30, 42, 90, 0.55), 0 2px 6px rgba(30, 42, 90, 0.18);
}
.ipad::before {
  content: ""; position: absolute; top: 1.15%; left: 50%; width: 1.3%; aspect-ratio: 1; translate: -50% 0;
  background: #3c4a85; border-radius: 50%;
}
.ipad img { display: block; width: 100%; height: auto; border-radius: 3.4% / 2.4%; background: var(--white); }

.devices { position: relative; aspect-ratio: 1 / 1.06; width: min(100%, 520px); margin-inline: auto; }
.devices .ipad { position: absolute; margin: 0; }
.devices .back { left: 0; top: 0; width: 57%; rotate: -3.5deg; }
.devices .front { right: 0; bottom: 0; width: 63%; rotate: 2.5deg; }
.note {
  position: absolute; left: -2%; bottom: 2%; width: 37%; z-index: 2;
  font: 600 1.4rem/1.05 var(--hand); color: var(--navy); rotate: -4deg;
}
.note svg { display: block; width: 54px; height: auto; margin: 2px 0 0 auto; fill: none; stroke: var(--navy); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .note { font-size: 1.1rem; } .note svg { width: 38px; } }

/* ---------- Datos rápidos ---------- */

.facts { background: var(--white); border-block: 1px solid var(--line); }
.facts ul { display: grid; gap: 22px 28px; padding-block: 30px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.facts li { display: flex; gap: 14px; align-items: flex-start; }
.facts .dot {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--yellow); font-size: 1.35rem; color: var(--navy);
}
.facts b { display: block; line-height: 1.25; }
.facts span { color: var(--ink-2); font-size: 0.97rem; line-height: 1.4; display: block; }

/* ---------- Secciones ---------- */

section { padding-block: clamp(64px, 9vw, 116px); }
.kicker { font: 600 1.55rem/1 var(--hand); color: var(--navy); display: block; margin-bottom: 10px; rotate: -1.5deg; transform-origin: left; }
h2 { font-size: clamp(1.9rem, 1.1rem + 2.8vw, 3rem); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.squiggle {
  padding-bottom: 0.2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4Q6 0 12 4T24 4' fill='none' stroke='%23F5B800' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left bottom / 24px 8px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sec-head { max-width: 46rem; }
.sec-head p { margin-top: 20px; font-size: 1.15rem; color: var(--ink-2); max-width: 40rem; }
h3 { font-size: 1.25rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.015em; }

/* ---------- Tu IA ve tus apuntes ---------- */

.flow { margin-top: 56px; display: grid; gap: 40px 28px; counter-reset: paso; }
@media (min-width: 960px) { .flow { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.step { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step > p { display: flex; gap: 12px; align-items: center; font-weight: 700; line-height: 1.25; }
.step > p::before {
  counter-increment: paso; content: counter(paso);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--yellow); border: 1.5px solid var(--navy); font-weight: 800; font-size: 0.95rem;
}
.sheet {
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line);
  rotate: -1deg; padding: 6px;
}
.sheet svg { display: block; width: 100%; height: auto; }
.sheet .rules { stroke: var(--rule); stroke-width: 1.5; }
.sheet .margin { stroke: #e98a8a; stroke-width: 1.8; }
.sheet .sel { fill: rgba(255, 212, 59, 0.14); stroke: var(--navy); stroke-width: 1.6; stroke-dasharray: 7 6; }
.sheet .ink { fill: none; stroke: #232748; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sheet text { font-family: var(--hand); font-weight: 600; fill: #232748; }

.seen {
  background: var(--navy); color: var(--paper); border-radius: var(--radius); padding: 22px 24px 26px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.seen::before { /* renglones, como una hoja */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(251, 248, 241, 0.06) 31px 32px);
}
.seen .t { position: relative; display: block; font: 600 1.5rem/1 var(--hand); color: var(--yellow); margin-bottom: 12px; }
.seen p { position: relative; font-size: 1.15rem; line-height: 2rem; }

.chat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.msg { max-width: 92%; padding: 11px 15px; border-radius: 16px; line-height: 1.45; font-size: 1rem; }
.msg small { display: block; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.02em; margin-bottom: 3px; color: var(--ink-2); }
.msg.me { justify-self: end; background: var(--paper-2); border-bottom-right-radius: 4px; }
.msg.ia { background: var(--yellow); border-bottom-left-radius: 4px; }
.msg.ia small { color: var(--navy); }
.flow-note { margin-top: 30px; color: var(--ink-2); font-size: 0.97rem; max-width: 46rem; }

.how { margin-top: 72px; }
.how h3 { margin-bottom: 22px; }
.points { display: grid; gap: 22px; }
.points li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.points .ic { margin-top: 3px; width: 26px; height: 26px; }
.points b { display: block; }
.points span { color: var(--ink-2); }
@media (min-width: 760px) { .how .points { grid-template-columns: 1fr 1fr; gap: 26px 56px; } }
@media (min-width: 1100px) { .how .points { grid-template-columns: repeat(4, 1fr); gap: 26px 36px; } }

/* ---------- Funciones ---------- */

.features { background: var(--white); border-block: 1px solid var(--line); }
.cards { margin-top: 52px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 28px; }
.card .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--yellow); font-size: 1.5rem; margin-bottom: 18px; }
.card h3 { margin-bottom: 12px; }
.card li { position: relative; padding-left: 20px; color: var(--ink-2); line-height: 1.45; margin-top: 8px; font-size: 1rem; }
.card li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 9px; height: 3px; border-radius: 2px; background: var(--yellow-deep); }

.show { margin-top: 84px; display: grid; gap: 36px 64px; align-items: center; }
.show + .show { margin-top: 72px; }
@media (min-width: 860px) {
  .show { grid-template-columns: 1fr minmax(280px, 340px); }
  .show.flip { grid-template-columns: minmax(280px, 340px) 1fr; }
  .show.flip .show-pic { order: -1; }
}
.show-pic { width: min(100%, 340px); margin-inline: auto; position: relative; }
.show-pic::before { content: ""; position: absolute; inset: 7% -6% -5% -6%; background: var(--paper-2); border-radius: 36px; z-index: 0; rotate: 2deg; }
.show-pic .ipad { z-index: 1; rotate: -1.5deg; }
.show.flip .show-pic .ipad { rotate: 1.5deg; }
.show-text p { margin-top: 14px; color: var(--ink-2); font-size: 1.1rem; max-width: 34rem; }
.show-text .kicker { font-size: 1.4rem; }

/* ---------- Tus archivos son tuyos ---------- */

.files { background: var(--navy); color: var(--paper); position: relative; overflow: hidden; }
.files::before { /* renglones sutiles, como en la portada */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(251, 248, 241, 0.045) 31px 32px);
}
.files .wrap { position: relative; display: grid; gap: 52px; align-items: center; }
@media (min-width: 900px) { .files .wrap { grid-template-columns: 1.05fr 0.95fr; gap: 72px; } }
.files .kicker { color: var(--yellow); }
.files .squiggle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4Q6 0 12 4T24 4' fill='none' stroke='%23FFD43B' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.files .points { margin-top: 36px; }
.files .points span { color: #c9d0ec; }
.files .points .ic { color: var(--yellow); }
.files a { color: var(--yellow); }
.filecard {
  background: #151f47; border: 1px solid rgba(251, 248, 241, 0.16); border-radius: var(--radius); padding: 22px 24px 26px;
}
.filecard .t { display: block; font: 600 1.6rem/1 var(--hand); color: var(--yellow); margin-bottom: 14px; }
.filecard li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(251, 248, 241, 0.14); font-size: 1.1rem; }
.filecard li:first-child { border-top: 0; }
.filecard .ic { width: 26px; height: 26px; color: var(--yellow); flex: none; }

/* ---------- Estado ---------- */

.status-card {
  margin-top: 44px; max-width: 46rem; background: var(--white); border: 2px dashed var(--navy); border-radius: var(--radius);
  padding: 8px 28px;
}
.status-card li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.status-card li:first-child { border-top: 0; }
.status-card .ic { width: 26px; height: 26px; margin-top: 1px; }
.status-card .ok .ic { color: #1f8a4c; }
.status-card .todo .ic { color: var(--yellow-deep); }
.status-card b { font-weight: 700; }
.status-card span { color: var(--ink-2); display: block; font-size: 0.97rem; }

.status { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .status { grid-template-columns: 1.1fr 0.9fr; gap: 64px; } }
.status-art { display: none; text-align: center; rotate: 4deg; }
@media (min-width: 960px) { .status-art { display: block; } }
.status-art svg { width: min(100%, 360px); height: auto; opacity: 0.95; }
.status-art p { font: 600 1.7rem/1 var(--hand); margin-top: 8px; color: var(--ink-2); }

/* ---------- Pie ---------- */

.foot { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: 44px 52px; font-size: 0.97rem; }
.foot .wrap { display: grid; gap: 28px; }
@media (min-width: 820px) { .foot .wrap { grid-template-columns: 1fr auto; align-items: end; } }
.foot .brand { font-size: 1.2rem; }
.foot .brand svg { width: 42px; }
.foot .brand + .small { margin-top: 14px; }
.foot p + p { margin-top: 6px; }
.foot .small { color: var(--ink-2); font-size: 0.88rem; max-width: 44rem; margin-top: 14px; line-height: 1.5; }
.foot .foot-r { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.foot .foot-r .lang { margin-left: 0; }

/* ---------- Página 404 ---------- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 60px; }
.lost p { margin-top: 18px; color: var(--ink-2); }
.lost .btn { margin-top: 28px; }

/* ---------- Animación: el trazo del lápiz (solo si no se pide reducir el movimiento) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .note svg path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: trazo 0.9s 0.5s ease-out forwards; }
  @keyframes trazo { to { stroke-dashoffset: 0; } }
}

@media (max-width: 520px) {
  body { font-size: 1.02rem; }
  .card { padding: 22px 20px 24px; }
  .status-card { padding-inline: 18px; }
  .hero { padding-bottom: 64px; }
  .brand { font-size: 1.3rem; }
  .brand svg { width: 46px; }
}
