/* =========================================================
   RAY—B · Sistema compartido
   Hormigón y papel de día, tinta sumi de noche, sello hanko.
   ========================================================= */

:root {
  --hormigon: #DAD7D0;
  --papel: #ECEAE5;
  --washi: #F4F2EE;
  --tinta: #1C1D1A;
  --grafito: #4E5049;
  --linea: rgba(28, 29, 26, 0.14);
  --hanko: #B5122C;
  --hanko-oscuro: #8F0E22;
  --sumi: #121311;
  --sumi-2: #1A1B18;
  --sumi-texto: #E6E4DE;
  --sumi-tenue: #A09F98;
  --sumi-linea: rgba(230, 228, 222, 0.14);

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --jp: "Noto Serif JP", serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --header: 72px;
  --radius-s: 4px;
  --radius-m: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header); }
body {
  margin: 0;
  background: var(--hormigon);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--hanko); color: #fff; }
:focus-visible { outline: 2px solid var(--hanko); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--tinta); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); }
.skip-link:focus { top: 12px; }

/* ---------- Sello 光美 ---------- */
.seal {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 30px; height: 40px; border-radius: 3px;
  background: var(--hanko); color: #fff;
  font-family: var(--jp); font-weight: 900; font-size: 13px; line-height: 1.15;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18);
  text-decoration: none;
}
.seal span + span { margin-top: 1px; }

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform 160ms var(--ease-out);
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--hanko); color: #fff; }
.btn-light { background: rgba(244, 242, 238, .94); color: var(--tinta); }
.btn-ghost { border-color: var(--linea); background: transparent; }
.btn-ghost-dark { border-color: var(--sumi-linea); color: var(--sumi-texto); background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--hanko-oscuro); }
  .btn-light:hover { background: #fff; }
  .btn-ghost:hover { border-color: var(--tinta); }
  .btn-ghost-dark:hover { border-color: var(--sumi-texto); }
}

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(218, 215, 208, .86);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--linea);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: var(--header); }
.wordmark { font-weight: 800; font-size: 20px; letter-spacing: .06em; text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--hanko); }
.main-nav { display: flex; gap: 2px; margin-right: auto; }
.main-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; font-weight: 500; font-size: 15px; color: var(--grafito);
}
.main-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 1px; background: var(--tinta);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out);
}
.main-nav a[aria-current="page"] { color: var(--tinta); }
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .main-nav a:hover { color: var(--tinta); }
  .main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
}
.header-cta { display: flex; align-items: center; gap: 14px; }
.header-seal { transition: transform 200ms var(--ease-out); }
.header-seal:active { transform: scale(0.94); }
.menu-btn { display: none; }
.main-nav .nav-mobile-only { display: none; }

@media (max-width: 960px) {
  .site-header .wrap { justify-content: space-between; }
  .main-nav, .header-cta .btn { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--linea); border-radius: var(--radius-s);
    background: transparent; cursor: pointer;
  }
  .menu-btn svg { width: 22px; height: 22px; }
  .site-header.open .main-nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--header); left: 0; right: 0;
    background: var(--washi); border-bottom: 1px solid var(--linea);
    padding: 8px var(--gutter) 20px;
    max-height: calc(100svh - var(--header)); overflow: auto;
  }
  .site-header.open .main-nav a { min-height: 54px; font-size: 19px; color: var(--tinta); border-bottom: 1px solid var(--linea); padding: 0; }
  .site-header.open .main-nav a::after { display: none; }
  .site-header.open .main-nav .nav-mobile-only { display: inline-flex; color: var(--hanko); font-weight: 600; border-bottom: 0; }
}

/* ---------- Secciones y marcas verticales ---------- */
section { scroll-margin-top: var(--header); }
.section { position: relative; padding: clamp(80px, 11vw, 160px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px 64px; align-items: end; margin-bottom: clamp(44px, 5vw, 72px); }
.section-title { font-weight: 700; font-size: clamp(36px, 4.8vw, 68px); line-height: 1; letter-spacing: -.032em; text-wrap: balance; }
.section-lead { font-family: var(--serif); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--grafito); max-width: 52ch; }
.dark .section-lead { color: var(--sumi-tenue); }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } }

.mark {
  position: absolute; top: clamp(80px, 11vw, 160px); left: max(12px, calc((100vw - var(--max)) / 2 - 36px));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  writing-mode: vertical-rl; font-size: 13px; color: var(--grafito); letter-spacing: .08em;
  pointer-events: none;
}
.mark b { font-family: var(--jp); font-weight: 700; font-size: 20px; color: var(--hanko); letter-spacing: 0; }
.mark::after { content: ""; width: 1px; height: 64px; background: currentColor; opacity: .4; }
.dark .mark { color: var(--sumi-tenue); }
@media (max-width: 1460px) { .mark { display: none; } }

.dark { background: var(--sumi); color: var(--sumi-texto); }

/* ---------- Revelados al hacer scroll ---------- */
.js .line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.js .line-mask > span { display: block; transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.js .is-in .line-mask > span, .js .line-mask.is-in > span { transform: none; }

.js .clip-reveal { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease-in-out); }
.js .clip-reveal img { transform: scale(1.12); transition: transform 1.6s var(--ease-out); }
.js .clip-reveal.is-in { clip-path: inset(0 0 0 0); }
.js .clip-reveal.is-in img { transform: scale(1); }

.js .fade-in { opacity: 0; transition: opacity .9s ease; transition-delay: calc(var(--i, 0) * 70ms); }
.js .fade-in.is-in { opacity: 1; }

/* ---------- Pie ---------- */
.site-footer { background: var(--sumi); color: var(--sumi-tenue); padding: 72px 0 40px; font-size: 14px; position: relative; overflow: hidden; }
.footer-kanji { position: absolute; right: -2vw; bottom: -6vw; font-family: var(--jp); font-weight: 900; font-size: 28vw; line-height: 1; color: rgba(230,228,222,.035); pointer-events: none; user-select: none; }
.footer-grid { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 1100px) and (min-width: 801px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand .wordmark { color: var(--sumi-texto); display: block; margin-bottom: 8px; }
.site-footer h4 { color: var(--sumi-texto); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer a { text-decoration: none; display: inline-flex; min-height: 34px; align-items: center; }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover { color: var(--sumi-texto); text-decoration: underline; text-underline-offset: 3px; } }
.footer-bottom { position: relative; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--sumi-linea); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Cursor (estilo original Ray-B: punto + anillo)
   ========================================================= */
.cursor, .cursor-ring { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: text !important; }
  html.has-cursor .cursor, html.has-cursor .cursor-ring { display: block; }
}
.cursor {
  position: fixed; top: 0; left: 0; z-index: 10001; pointer-events: none;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: #000; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9);
  transition: opacity .2s ease;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 10000; pointer-events: none;
  width: 0; height: 0;
}
.cursor-ring i {
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1.5px solid #000; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.8);
  display: grid; place-items: center;
  transition: transform .45s var(--ease-out), background-color .25s ease, border-color .25s ease, opacity .2s ease;
}
.cursor-ring b {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(.8);
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  opacity: 0; transition: opacity .2s ease, transform .45s var(--ease-out);
}
html.cursor-hover .cursor-ring i { transform: scale(1.55); background: rgba(0,0,0,.08); }
html.cursor-label .cursor-ring i { transform: scale(2.3); background: var(--hanko); border-color: var(--hanko); box-shadow: none; }
html.cursor-label .cursor-ring b { opacity: 1; transform: translate(-50%, -50%) scale(1); }
html.cursor-label .cursor { opacity: 0; }
html.cursor-lens .cursor-ring i { transform: scale(6.4); border-color: rgba(255,255,255,.85); border-width: .4px; box-shadow: 0 0 0 .4px rgba(0,0,0,.4); background: transparent; }
html.cursor-down .cursor-ring i { transform: scale(.8); }
html.cursor-hidden .cursor, html.cursor-hidden .cursor-ring i { opacity: 0; }

/* =========================================================
   Preloader y paneles shoji
   ========================================================= */
.shoji { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.shoji-panel {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: var(--sumi);
  background-image:
    linear-gradient(rgba(230,228,222,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,228,222,.035) 1px, transparent 1px);
  background-size: 48px 64px;
  transition: transform .9s var(--ease-in-out);
}
.shoji-panel.left { left: 0; border-right: 1px solid rgba(230,228,222,.08); }
.shoji-panel.right { right: 0; border-left: 1px solid rgba(230,228,222,.08); }
.shoji.is-open .shoji-panel.left { transform: translateX(-101%); }
.shoji.is-open .shoji-panel.right { transform: translateX(101%); }
.shoji.is-open { visibility: hidden; transition: visibility 0s .95s; }
.shoji.is-closing { visibility: visible; transition: none; pointer-events: auto; }
.shoji.is-closing .shoji-panel { transition-duration: .55s; }

.preloader {
  position: fixed; inset: 0; z-index: 9100;
  display: flex; align-items: center; justify-content: center;
  color: var(--sumi-texto);
  pointer-events: none;
}
.preloader[hidden] { display: none; }
.pl-unit { display: flex; align-items: center; gap: clamp(18px, 3vw, 30px); }
.pl-seal {
  width: clamp(64px, 8vw, 84px); height: clamp(92px, 11.5vw, 120px);
  font-size: clamp(26px, 3.2vw, 34px); border-radius: 6px;
  opacity: 0; transform: scale(1.3);
  box-shadow: 0 0 0 0 rgba(181,18,44,.0), inset 0 0 0 2px rgba(255,255,255,.18);
  will-change: transform, opacity;
}
.pl-seal.is-stamped { opacity: 1; transform: scale(1); transition: transform .5s var(--ease-out), opacity .2s ease, box-shadow 1.2s ease; box-shadow: 0 0 60px 6px rgba(181,18,44,.35), inset 0 0 0 2px rgba(255,255,255,.18); }
.pl-text { display: flex; flex-direction: column; gap: 10px; transition: opacity .4s ease, filter .4s ease, transform .5s var(--ease-out); }
.pl-title { font-weight: 800; font-size: clamp(30px, 5vw, 56px); letter-spacing: .2em; line-height: 1; min-height: 1em; white-space: nowrap; }
.pl-title .dash { color: var(--hanko); }
.pl-sub { font-family: var(--serif); font-size: clamp(15px, 1.4vw, 18px); color: var(--sumi-tenue); min-height: 1.4em; }
.pl-text { min-width: 0; }
@media (max-width: 560px) {
  .pl-unit { padding: 0 24px; }
  .pl-sub { min-height: 2.8em; max-width: 52vw; }
}
.pl-caret { display: inline-block; width: 3px; height: .9em; margin-left: 4px; vertical-align: -0.05em; background: var(--hanko); animation: plBlink .7s steps(2, start) infinite; }
@keyframes plBlink { to { visibility: hidden; } }
.pl-hud {
  position: absolute; left: 50%; bottom: clamp(32px, 7vh, 64px); transform: translateX(-50%);
  width: min(320px, 70vw); display: grid; gap: 10px; font-size: 13px; color: var(--sumi-tenue);
  transition: opacity .3s ease;
}
.pl-bar { height: 1px; background: rgba(230,228,222,.15); overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: var(--hanko); transform-origin: left; transform: scaleX(0); }
.pl-meta { display: flex; justify-content: space-between; gap: 12px; }
.pl-pct { font-variant-numeric: tabular-nums; color: var(--sumi-texto); font-weight: 600; }
.preloader.is-leaving .pl-text { opacity: 0; filter: blur(6px); transform: translateX(10px); }
.preloader.is-leaving .pl-hud { opacity: 0; }
.preloader .pl-kanji {
  position: absolute; font-family: var(--jp); font-weight: 900; font-size: 46vh; line-height: 1; color: rgba(230,228,222,.03);
  writing-mode: vertical-rl; right: 6vw; top: 50%; transform: translateY(-50%); user-select: none;
}



/* Video vertical (por ejemplo, Chabrier): se ve completo dentro del cuadro horizontal */
.film-player, .p-film { position: relative; isolation: isolate; }
.film-player::before, .p-film::before {
  content: ""; position: absolute; inset: -30px; z-index: -1; opacity: 0;
  background: var(--bg, #000) center / cover no-repeat; filter: blur(28px) brightness(.5) saturate(1.1);
  transition: opacity .4s ease;
}
.film-player.is-vertical::before, .p-film.is-vertical::before { opacity: 1; }
.film-player.is-vertical video, .p-film.is-vertical video { object-fit: contain; background: transparent; }

/* Pie: enlace a Ray-B Scene Manager, en un tono más vivo */
.site-footer a.footer-sm { color: #ff4d64; font-weight: 600; }
.site-footer a.footer-sm::after { content: "→"; margin-left: 6px; transition: transform .3s ease; }
@media (hover: hover) { .site-footer a.footer-sm:hover::after { transform: translateX(3px); } }
