/* ============================================================
   fukudamiyasato — base tokens & shared shell
   ============================================================ */

:root {
  --bg:          #08080a;
  --bg-2:        #0e0e11;
  --panel:       #141418;
  --panel-2:     #1b1b21;
  --line:        #26262e;
  --line-soft:   #1d1d24;

  --red:         #e0102b;
  --red-hot:     #ff1f3d;
  --red-deep:    #8c0518;
  --red-glow:    rgba(224, 16, 43, .35);

  --text:        #f2f2f4;
  --text-dim:    #9a9aa6;
  --text-faint:  #5c5c68;

  --radius:      14px;
  --radius-sm:   10px;
  --ease:        cubic-bezier(.22, 1, .36, 1);

  --shell:       min(1180px, 100% - 48px);
}

/* ============================================================
   Transiciones entre páginas — la nebulosa como efecto de warp
   ------------------------------------------------------------
   Cada página se difumina, se satura de rojo y gira levemente al
   salir, y un resplandor rojo tipo nebulosa (el mismo tono que la
   de IA) asoma un instante detrás, justo cuando ambas capas están
   semitransparentes — como si se atravesara la nebulosa para llegar
   a la otra página.
   ============================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-group(root) {
  animation-duration: .8s;
  animation-timing-function: var(--ease);
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 31, 61, .55), rgba(140, 5, 24, .28) 42%, transparent 72%);
}

@keyframes fm-warp-out {
  0%   { opacity: 1; filter: blur(0) saturate(1) brightness(1) hue-rotate(0deg); transform: scale(1) rotate(0deg); }
  55%  { opacity: .16; filter: blur(22px) saturate(2.4) brightness(1.35) hue-rotate(-10deg); transform: scale(1.08) rotate(-2deg); }
  100% { opacity: 0; filter: blur(34px) saturate(2.8) brightness(.6) hue-rotate(-14deg); transform: scale(1.16) rotate(-3deg); }
}
@keyframes fm-warp-in {
  0%   { opacity: 0; filter: blur(34px) saturate(2.8) brightness(1.4) hue-rotate(12deg); transform: scale(.88) rotate(3deg); }
  45%  { opacity: .28; filter: blur(18px) saturate(2.1) brightness(1.2) hue-rotate(6deg); transform: scale(.95) rotate(1.5deg); }
  100% { opacity: 1; filter: blur(0) saturate(1) brightness(1) hue-rotate(0deg); transform: scale(1) rotate(0deg); }
}
::view-transition-old(root) {
  animation: fm-warp-out .55s var(--ease) both;
}
::view-transition-new(root) {
  animation: fm-warp-in .62s var(--ease) .12s both;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root) { background: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow-x: hidden;
  /* que se sienta como app: sin el rebote elástico de Safari al tope/fondo.
     Va en <html> (el que hace scroll), no en <body>: ver abajo */
  overscroll-behavior-y: none;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  /* clip y no hidden: con hidden el <body> pasa a ser su propio contenedor de
     scroll (sin nada que desplazar) y, con overscroll-behavior: none, la rueda
     y el dedo nunca llegaban a la página → las páginas internas no bajaban */
  overflow-x: clip;
}

/* subtle red vignette on every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(224, 16, 43, .16), transparent 70%),
    radial-gradient(700px 500px at 100% 100%, rgba(140, 5, 24, .12), transparent 70%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }

::selection { background: var(--red); color: #fff; }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--red-deep); }

/* ============================================================
   Botón fijo de volver — arriba a la izquierda, en cada sub página
   ============================================================ */
.back-btn {
  position: fixed;
  /* viewport-fit=cover hace que el contenido llegue hasta el notch/Dynamic
     Island; sin este margen el botón queda debajo o pegado al borde y no
     se puede tocar en iOS. env() da 0 en dispositivos sin muesca. */
  top: calc(22px + env(safe-area-inset-top, 0px));
  left: calc(22px + env(safe-area-inset-left, 0px));
  z-index: 200;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 20, 24, .72);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-dim);
  transition: transform .28s var(--ease), background .28s var(--ease),
              border-color .28s var(--ease), color .28s var(--ease);
}
.back-btn svg { width: 19px; height: 19px; }
.back-btn:hover {
  background: var(--red);
  border-color: var(--red-hot);
  color: #fff;
  transform: translateX(-3px);
  box-shadow: 0 0 0 6px var(--red-glow);
}
.back-btn:active { transform: translateX(-1px) scale(.95); }

/* ============================================================
   Page shell
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: 0 auto;
  padding: 84px 0 96px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 30px;
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}
.page-title em {
  font-style: normal;
  color: var(--red-hot);
}
.page-sub {
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.brand-mini {
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.brand-mini b { color: var(--text-dim); font-weight: 600; }

@media (max-width: 720px) {
  :root { --shell: calc(100% - 32px); }
  .page { padding: 76px 0 72px; }
  .back-btn {
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
    width: 42px;
    height: 42px;
  }
}
