/* =========================================================
   MUSUBI STUDIO — one page
   Dos almas: ingeniería (fría, precisa) + arte (color, mano)
   ========================================================= */

/* Tipografías alojadas en el propio servidor (sin llamadas a Google) */
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Architects Daughter"; src: url("../fonts/architects-daughter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* base */
  --paper: #F5F2EC;
  --ink: #1B1B1B;
  --muted: #6A6862;
  --rule: rgba(27, 27, 27, .12);

  /* alma ingeniera */
  --slate: #2C3136;
  --slate-2: #3A4046;
  --steel: #9AA1A8;
  --cool: #E4E6E8;
  --taupe: #867152;
  --ochre: #C98A2E;

  /* alma artística */
  --cream: #FBF3E4;
  --sun: #F4B400;
  --leaf: #5DA83A;
  --forest: #2F7D4F;
  --teal: #00A99D;
  --coral: #EF6F5E;
  --rose: #F3A7B5;

  /* hilo rojo del destino */
  --red: #C8372D;

  --f-sans: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-hand: "Caveat", "Segoe Print", cursive;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; line-height: 1.1; margin: 0; }
p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
.mono { font-family: var(--f-mono); font-weight: 400; letter-spacing: .02em; }
.hand { font-family: var(--f-hand); font-weight: 500; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin-bottom: 20px; }
.lead { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.45; max-width: 34ch; }
.lead--soft { color: var(--muted); font-size: clamp(17px, 1.7vw, 20px); max-width: 44ch; }
h2 { font-size: clamp(34px, 5vw, 60px); letter-spacing: -.01em; margin-bottom: 28px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: background .3s, box-shadow .3s, transform .3s;
}
.nav.is-scrolled { background: rgba(245, 242, 236, .92); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--rule); }
.nav__logo img { width: 78px; height: auto; opacity: 0; transition: opacity .3s; }
.nav.is-scrolled .nav__logo img { opacity: 1; }
.nav__links { display: flex; gap: clamp(16px, 3vw, 36px); padding: 8px 18px; border-radius: 999px; background: rgba(251, 243, 228, .72); backdrop-filter: blur(6px); transition: background .3s; }
.nav.is-scrolled .nav__links { background: transparent; backdrop-filter: none; }
.nav__links a {
  text-decoration: none; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; font-weight: 400;
  position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px; background: var(--red);
  transition: right .3s;
}
.nav__links a:hover::after { right: 0; }

/* ---------- THREAD ---------- */
main { position: relative; }
.thread {
  position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; z-index: 1; overflow: visible;
}
.thread path {
  fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; overflow: hidden;
}
.hero__half { position: absolute; top: 0; bottom: 0; width: 50%; }
.hero__half--eng {
  left: 0; background-color: var(--cool);
  background-image:
    linear-gradient(rgba(44, 49, 54, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 49, 54, .07) 1px, transparent 1px),
    linear-gradient(rgba(44, 49, 54, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 49, 54, .035) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}
.hero__half--art { right: 0; background: var(--cream); }
/* --- lado ingeniería: esquema eléctrico dibujado a mano --- */
.hero__half--eng { overflow: hidden; }
.schem {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: #2C3136; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: .78;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 100% 44%, transparent 30%, #000 80%);
          mask-image: radial-gradient(ellipse 62% 58% at 100% 44%, transparent 30%, #000 80%);
}
.schem text { font-family: "Architects Daughter", "Segoe Print", cursive; fill: #2C3136; stroke: none; }
.schem .f { fill: #2C3136; }
.schem path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(.4, .1, .2, 1) forwards; }
.schem .b1 path { animation-delay: .2s; } .schem .b2 path { animation-delay: .7s; }
.schem .b3 path { animation-delay: 1.2s; } .schem .b4 path { animation-delay: 1.7s; }
.schem text, .schem circle { opacity: 0; animation: fadein .8s forwards; animation-delay: 1.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* --- lado artístico: acuarela + ilustración --- */
.hero__half--art { overflow: hidden; }
.wcol {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 0% 44%, transparent 28%, #000 78%);
          mask-image: radial-gradient(ellipse 60% 55% at 0% 44%, transparent 28%, #000 78%);
}
.wc { mix-blend-mode: multiply; }
.wc-layer { animation: bloom 2.2s ease-out both; transform-origin: 60% 50%; }
.ill { animation: fadein 1s 1s both; opacity: 0; }
.sf-petals { animation: spin 90s linear infinite; }
@keyframes bloom { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.hero__content { position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter); }
.hero__logo {
  width: min(560px, 78vw); height: auto; margin: 0 auto;
  animation: reveal 1.4s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__claim {
  margin-top: 28px; font-size: clamp(15px, 1.6vw, 18px); letter-spacing: .22em; text-transform: uppercase; font-weight: 400;
  animation: reveal 1.4s .35s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__claim em { font-style: normal; color: var(--red); }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); filter: blur(4px) } to { opacity: 1; transform: none; filter: none } }

.hero__kanji {
  position: absolute; right: var(--gutter); top: 110px; z-index: 2;
  writing-mode: vertical-rl; font-size: 22px; letter-spacing: .4em; color: var(--ink); opacity: .55;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
.hero__scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--muted);
}
.hero__scroll:hover { color: var(--red); }

/* ---------- CONCEPTO ---------- */
.concept { padding: clamp(100px, 14vw, 180px) 0 clamp(80px, 10vw, 140px); }
.concept__title { font-size: clamp(48px, 8vw, 104px); font-weight: 300; margin-bottom: 40px; display: flex; align-items: baseline; gap: .3em; flex-wrap: wrap; }
.concept__title .jp { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; color: var(--red); font-size: .7em; }
.concept .lead { margin-bottom: 20px; }

.triad {
  list-style: none; padding: 0; margin: clamp(60px, 8vw, 100px) 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--rule);
}
.triad__item { padding: 36px 32px 8px 0; position: relative; }
.triad__item + .triad__item { padding-left: 32px; border-left: 1px solid var(--rule); }
.triad__kanji {
  display: block; font-size: 44px; line-height: 1; margin-bottom: 20px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; color: var(--ink);
}
.triad h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .22em; margin-bottom: 10px; font-weight: 500; }
.triad p { font-size: 16px; color: var(--muted); max-width: 28ch; }

/* ---------- DOS ALMAS ---------- */
.souls { padding-top: clamp(40px, 6vw, 80px); }
.souls__head { margin-bottom: clamp(40px, 5vw, 64px); }
.souls__grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 680px; }
.soul { position: relative; padding: clamp(40px, 6vw, 88px) clamp(24px, 5vw, 72px); overflow: hidden; }
.soul__inner { position: relative; z-index: 2; max-width: 460px; }
.soul--eng .soul__inner { margin-left: auto; margin-right: clamp(0px, 3vw, 40px); }
.soul--art .soul__inner { margin-left: clamp(0px, 3vw, 40px); }
.soul__top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .18em; margin-bottom: 56px; }
.soul__title { font-size: clamp(44px, 6vw, 76px); margin-bottom: 14px; }
.soul__sub { font-size: 20px; margin-bottom: 18px; line-height: 1.4; }
.soul p { font-size: 16.5px; }
.soul__link { display: inline-block; margin-top: 36px; text-decoration: none; font-size: 13px; letter-spacing: .08em; padding: 12px 0; border-bottom: 1px solid currentColor; }

/* Ingeniería: frío, técnico, rejilla */
.soul--eng {
  background-color: var(--slate); color: #E7E9EB;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}
.soul--eng .soul__top { color: var(--steel); }
.soul--eng .soul__title { font-weight: 300; letter-spacing: .06em; text-transform: uppercase; font-size: clamp(34px, 4.4vw, 56px); }
.soul--eng .soul__sub { color: #fff; }
.soul--eng p { color: #C2C7CC; }
.spec { margin: 36px 0 0; font-size: 12.5px; border-top: 1px solid rgba(255, 255, 255, .14); }
.spec div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.spec dt { color: var(--steel); text-transform: uppercase; letter-spacing: .12em; }
.spec dd { margin: 0; color: #fff; text-align: right; }
.soul--eng .soul__link { color: var(--ochre); }
.soul--eng .soul__link:hover { color: #fff; }
.corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--steel); opacity: .7; z-index: 2; }
.c-tl { top: 20px; left: 20px; border-top-width: 1px; border-left-width: 1px; }
.c-tr { top: 20px; right: 20px; border-top-width: 1px; border-right-width: 1px; }
.c-bl { bottom: 20px; left: 20px; border-bottom-width: 1px; border-left-width: 1px; }
.c-br { bottom: 20px; right: 20px; border-bottom-width: 1px; border-right-width: 1px; }

/* Ilustración: color, mano, formas orgánicas */
.soul--art { background: var(--cream); }
.soul--art .soul__top { color: var(--coral); font-size: 24px; letter-spacing: 0; justify-content: flex-start; gap: 24px; }
.soul--art .soul__title { font-family: var(--f-hand); font-weight: 600; font-size: clamp(60px, 8vw, 104px); color: var(--forest); line-height: .9; }
.soul--art p { color: #4E4A42; }
.deco { position: absolute; z-index: 1; pointer-events: none; }
.deco--sun { width: clamp(90px, 10vw, 130px); top: 28px; right: 28px; }
.deco--leaf { width: clamp(80px, 9vw, 120px); right: 12%; bottom: 36px; }
.deco-dot { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); z-index: 1; }
.sunflower { animation: spin 60s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { rotate: 360deg; } }
.tags { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li {
  font-size: 15px; font-weight: 400; padding: 7px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, #fff); border: 1.5px solid var(--c); color: var(--ink);
}
.soul__link--art { font-family: var(--f-hand); font-size: 28px; letter-spacing: 0; color: var(--coral); border-bottom: 2px dashed var(--coral); padding: 4px 0; }
.soul__link--art:hover { color: var(--forest); border-color: var(--forest); }

/* ---------- CRITERIO ---------- */
.meet { padding: clamp(110px, 14vw, 180px) 0; text-align: center; }
.meet .eyebrow { margin-bottom: 36px; }
.meet__quote { margin: 0 auto; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.35; font-weight: 300; max-width: 22em; }
.meet__quote span { display: inline-block; margin-top: .5em; color: var(--red); }

/* ---------- CONTACTO ---------- */
.contact { padding: clamp(60px, 8vw, 100px) 0 clamp(100px, 12vw, 160px); border-top: 1px solid var(--rule); }
.contact__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: end; }
.contact__card { background: var(--paper); padding: 8px 0; }
.contact__mail {
  display: inline-block; font-size: clamp(24px, 3.2vw, 40px); text-decoration: none; font-weight: 400;
  border-bottom: 2px solid var(--red); padding-bottom: 4px; transition: color .2s;
}
.contact__mail:hover { color: var(--red); }
.contact__meta { margin-top: 24px; font-size: 12px; letter-spacing: .14em; color: var(--muted); line-height: 1.9; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--rule); padding: 26px 0; font-size: 13px; color: var(--muted); position: relative; z-index: 2; background: var(--paper); }
.footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__legal { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.footer__legal:hover { color: var(--ink); }

.legal { max-width: 620px; width: calc(100% - 32px); border: 0; padding: 40px; background: var(--paper); color: var(--ink); font-size: 15px; }
.legal::backdrop { background: rgba(27, 27, 27, .5); }
.legal h2 { font-size: 28px; margin-bottom: 18px; }
.legal h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .18em; margin: 24px 0 10px; font-weight: 500; }
.legal ul { padding-left: 18px; }
.legal__close { position: absolute; top: 14px; right: 18px; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .souls__grid { grid-template-columns: 1fr; min-height: 0; }
  .soul--eng .soul__inner, .soul--art .soul__inner { margin: 0; max-width: none; }
  .contact__grid { grid-template-columns: 1fr; align-items: start; gap: 24px; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .nav__links a { font-size: 11px; letter-spacing: .14em; }
  .nav__logo img { width: 60px; }
  .hero__half { width: 100%; }
  .hero__half--eng { height: 50%; bottom: auto; }
  .hero__half--art { top: 50%; }
  .schem { -webkit-mask-image: linear-gradient(to bottom, #000 25%, rgba(0,0,0,.12) 95%); mask-image: linear-gradient(to bottom, #000 25%, rgba(0,0,0,.12) 95%); }
  .wcol { -webkit-mask-image: linear-gradient(to top, #000 45%, rgba(0,0,0,.15) 100%); mask-image: linear-gradient(to top, #000 45%, rgba(0,0,0,.15) 100%); }
  .hero__kanji { top: 88px; font-size: 18px; }
  .triad { grid-template-columns: 1fr; }
  .triad__item, .triad__item + .triad__item { padding: 28px 0 12px; border-left: 0; }
  .triad__item + .triad__item { border-top: 1px solid var(--rule); }
  .spec div { flex-direction: column; gap: 2px; }
  .spec dd { text-align: left; }
  .legal { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .schem path { stroke-dashoffset: 0; }
  .schem text, .schem circle, .ill { opacity: 1; }
}
