/* =====================================================================
   JOSÉ MOYA · ALPHAWEB — Dirección "Dossier"
   Papel hueso · Tinta cálida · Azul tinta · Serif editorial + mono técnico
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #f0ede5;
  --paper-2: #e8e4d9;
  --ink: #17161a;
  --ink-soft: #3b3830;
  --muted: #6a655a;
  --accent: #1c3c6e;
  --accent-deep: #142c52;
  --accent-2: #93b1dd;

  --line: rgba(23, 22, 26, 0.16);
  --line-strong: rgba(23, 22, 26, 0.34);
  --line-light: rgba(255, 255, 255, 0.16);

  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, Cambria, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1320px;
  --gut: clamp(16px, 4vw, 56px);
  --hairline: 1px solid var(--line);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: var(--paper); }

/* ---------- Foco de teclado visible (on-brand) ---------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.langtog button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.hud__nav a:focus-visible::after { width: 100%; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.mono { font-family: var(--font-mono); }
.kick {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kick::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.accent { color: var(--accent); font-weight: 500; border-bottom: 1px solid currentColor; }

/* ---------- Overlays globales ---------- */
.grid-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gut);
  display: grid; grid-template-columns: repeat(12, 1fr);
}
.grid-overlay span { border-right: 1px solid rgba(23,22,26,0.03); }
.grid-overlay span:first-child { border-left: 1px solid rgba(23,22,26,0.03); }
@media (max-width: 760px){ .grid-overlay { grid-template-columns: repeat(6, 1fr); } }

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- HUD / top bar ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0;
  z-index: 800;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
  padding-inline: var(--gut);
  background: rgba(240,237,229,0.85);
  backdrop-filter: blur(10px);
  border-bottom: var(--hairline);
}
.hud__brand { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.04em; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.hud__brand .pulse { width: 9px; height: 9px; background: var(--accent); border: 1px solid var(--ink); border-radius: 50%; animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(28,60,110,.5);} 50%{ box-shadow: 0 0 0 6px rgba(28,60,110,0);} }
.hud__nav { display: flex; align-items: center; gap: 22px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.hud__nav a { position: relative; padding: 4px 0; color: var(--muted); transition: color .25s var(--ease); }
.hud__nav a:hover { color: var(--ink); }
.hud__nav a::after { content:""; position:absolute; left:0; bottom:0; width:0; height:1.5px; background: var(--accent); transition: width .3s var(--ease); }
.hud__nav a:hover::after { width: 100%; }
.hud__nav .hud__ext { color: var(--accent); font-weight: 500; }
.hud__nav .hud__ext:hover { color: var(--accent-deep); }
.hud__right { display: flex; align-items: center; gap: 18px; }
.langtog { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em; border: 1px solid var(--ink); padding: 5px 10px; display:flex; gap:6px; }
.langtog button { font-family: inherit; opacity: .35; transition: opacity .2s; }
.langtog button.on { opacity: 1; color: var(--ink); }
.langtog .sep { opacity: .3; }
@media (max-width: 860px){ .hud__nav { display: none; } }

/* ---------- Menú móvil ---------- */
.hud__burger { display: none; width: 36px; height: 34px; flex-direction: column; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--ink); }
.hud__burger span { display: block; width: 16px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s var(--ease); }
.hud__burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.hud__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.mobnav {
  position: fixed; inset: 58px 0 auto 0; z-index: 790;
  background: rgba(240,237,229,0.97); backdrop-filter: blur(10px);
  border-bottom: var(--hairline);
  display: flex; flex-direction: column;
  padding: 14px var(--gut) 26px;
  transform: translateY(-14px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
.mobnav.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.mobnav a { font-family: var(--font-mono); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; padding: 16px 2px; border-bottom: var(--hairline); }
.mobnav a:last-child { border-bottom: none; }
@media (min-width: 861px){ .mobnav { display: none; } }
@media (max-width: 860px){ .hud__burger { display: flex; } }

/* ---------- Sections ---------- */
section { position: relative; }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(28px, 5vw, 64px); border-top: 1px solid var(--line-strong); padding-top: 18px; }
.sec-head .idx { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.sec-head h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 50px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.04; }
.sec-pad { padding-block: clamp(70px, 11vw, 150px); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(40px, 7vw, 90px); padding-top: 96px; overflow: hidden; }
#grid-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__inner { position: relative; z-index: 2; width: 100%; }
.hero__meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: var(--hairline); padding-bottom: 14px; margin-bottom: clamp(24px, 5vw, 52px); }
.hero__meta b { color: var(--ink); font-weight: 500; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 112px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.018em;
  max-width: 15ch;
}
.hero h1 .rot { color: var(--accent); display: inline-block; border-bottom: 5px solid var(--accent); line-height: .9; }
.hero__sub { font-family: var(--font-body); margin-top: clamp(22px, 3vw, 38px); max-width: 56ch; font-size: clamp(16px, 1.5vw, 20px); color: var(--ink-soft); }
.hero__sub .pipe { color: var(--accent); }
.hero__cta { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 14px 22px; border: 1px solid var(--ink); transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:hover .arr { transform: translateX(5px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn--accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--paper); }

.scrollcue { position: absolute; left: var(--gut); bottom: 22px; z-index: 2; font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.scrollcue .ln { width: 1px; height: 34px; background: var(--accent); animation: drop 1.8s infinite var(--ease); transform-origin: top; }
@keyframes drop { 0%{ transform: scaleY(0);} 40%{ transform: scaleY(1);} 100%{ transform: scaleY(0); transform-origin: bottom; } }

/* =====================================================================
   TICKER
   ===================================================================== */
.ticker { border-block: 1px solid var(--ink); background: var(--ink); color: var(--paper); overflow: hidden; padding-block: 16px; }
.ticker__track { display: inline-flex; white-space: nowrap; gap: 0; animation: marquee 32s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__track span { font-family: var(--font-mono); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; padding-inline: 26px; display: inline-flex; align-items: center; gap: 26px; }
.ticker__track span::after { content: "◆"; color: var(--accent-2); font-size: 9px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =====================================================================
   MANIFIESTO
   ===================================================================== */
.manifesto { padding-block: clamp(80px, 13vw, 180px); }
.manifesto__lead { font-family: var(--font-mono); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }
.manifesto p { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 58px); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; max-width: 21ch; }
.manifesto .stmt { opacity: .18; transition: opacity .6s var(--ease); margin-bottom: .35em; }
.manifesto .stmt.in { opacity: 1; }
.manifesto .stmt em { font-style: italic; color: var(--accent); }

/* =====================================================================
   WORK / PROYECTOS
   ===================================================================== */
.work__grid { border-top: var(--hairline); border-left: var(--hairline); display: grid; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px){ .work__grid { grid-template-columns: 1fr; } }
.proj {
  border-right: var(--hairline); border-bottom: var(--hairline);
  padding: clamp(24px, 3vw, 42px);
  position: relative; overflow: hidden;
  min-height: 320px; display: flex; flex-direction: column;
  background: var(--paper);
  transition: background .35s var(--ease), color .35s var(--ease);
}
.proj::after { content: attr(data-num); position: absolute; right: clamp(16px,2vw,28px); top: clamp(12px,2vw,22px); font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.proj:hover { background: var(--ink); color: var(--paper); }
.proj:hover .proj__tag { border-color: rgba(240,237,229,.4); color: var(--paper); }
.proj:hover .chip { border-color: rgba(240,237,229,.3); color: var(--paper); }
.proj:hover::after { color: var(--accent-2); }
.proj__top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.proj__tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-strong); padding: 4px 9px; transition: .35s var(--ease); }
.proj__tag.prod { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.proj:hover .proj__tag.prod { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.proj h3 { font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 44px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.0; margin-bottom: 14px; }
.proj__desc { font-size: 16px; color: inherit; opacity: .85; max-width: 42ch; margin-bottom: auto; }
.proj__chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; border: 1px solid var(--line); padding: 3px 8px; transition: .35s var(--ease); }
.proj__more { display: none; margin-top: 18px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; align-items: center; gap: 8px; }

/* =====================================================================
   ECOSISTEMA (trabajo) — bento
   ===================================================================== */
.eco__note { margin-bottom: 38px; }
.eco__bento { display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--hairline); border-left: var(--hairline); }
.cell {
  border-right: var(--hairline); border-bottom: var(--hairline);
  padding: clamp(22px, 2.4vw, 36px);
  min-height: 210px; display: flex; flex-direction: column;
  background: var(--paper); position: relative;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.cell--wide { grid-column: span 2; }
.cell--dark { background: var(--ink); color: var(--paper); }
.cell--accent { background: var(--accent); color: var(--paper); }
.cell__k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: auto; }
.cell--dark .cell__k { color: var(--accent-2); }
.cell--accent .cell__k { color: rgba(240,237,229,.7); }
.cell h4 { font-family: var(--font-display); font-size: clamp(20px, 2vw, 29px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.08; margin: 26px 0 12px; }
.cell p { font-size: 15px; line-height: 1.55; opacity: .85; max-width: 46ch; }
.cell--accent h4 { font-size: clamp(24px, 2.6vw, 36px); }
.cell--plain:hover { background: var(--ink); color: var(--paper); }
.cell--plain:hover .cell__k { color: var(--accent-2); }
.cell--dark:hover { background: #211f24; }
.cell__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.cell__tags span { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .03em; border: 1px solid var(--line-strong); padding: 4px 9px; }
.cell--accent .cell__tags span { border-color: rgba(240,237,229,.4); }
.cell mark { background: transparent; color: var(--accent); font-style: italic; padding: 0; }
.cell--dark mark { color: var(--accent-2); }
@media (max-width: 900px){ .eco__bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .eco__bento { grid-template-columns: 1fr; } .cell--wide { grid-column: span 1; } }

/* =====================================================================
   MÉTODO
   ===================================================================== */
.method { background: var(--ink); color: var(--paper); }
.method .sec-head { border-color: var(--line-light); }
.method .sec-head h2 { color: var(--paper); }
.method .sec-head .idx { color: var(--accent-2); }
.method__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-left: 1px solid var(--line-light); border-top: 1px solid var(--line-light); }
@media (max-width: 820px){ .method__grid { grid-template-columns: 1fr; } }
.princ { border-right: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light); padding: clamp(24px,2.6vw,38px); transition: background .3s var(--ease); }
.princ:hover { background: #211f24; }
.princ .pn { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); letter-spacing: .12em; }
.princ h4 { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; margin: 16px 0 12px; }
.princ p { font-size: 15px; color: #c4c1b8; max-width: 38ch; }

/* =====================================================================
   ABOUT
   ===================================================================== */
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
@media (max-width: 820px){ .about__grid { grid-template-columns: 1fr; } }
.portrait { position: relative; width: min(380px, 82%); aspect-ratio: 1 / 1; margin: 0 auto; }
.portrait__disc { position: absolute; inset: 12%; border-radius: 50%; overflow: hidden; border: 1px solid var(--ink); background: var(--ink); }
.portrait__disc img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; filter: grayscale(1) contrast(1.05); transform: scale(1.2); transition: transform .8s var(--ease); }
.portrait:hover .portrait__disc img { transform: scale(1.26); }
.portrait__disc::after { content: ""; position: absolute; inset: 0; background: var(--accent); mix-blend-mode: multiply; opacity: 0; transition: opacity .5s var(--ease); }
.portrait:hover .portrait__disc::after { opacity: .45; }
.portrait__ring { position: absolute; inset: 0; animation: spin 24s linear infinite; transform-origin: 50% 50%; }
.portrait:hover .portrait__ring { animation-duration: 9s; }
.portrait__ring svg { width: 100%; height: 100%; overflow: visible; }
.portrait__ring text { font-family: var(--font-mono); font-weight: 500; font-size: 8.4px; letter-spacing: 1.4px; text-transform: uppercase; fill: var(--ink); }
.portrait__dot { position: absolute; top: 6%; left: 50%; width: 12px; height: 12px; background: var(--accent); border: 1px solid var(--ink); border-radius: 50%; transform: translate(-50%, -50%); z-index: 3; }
@keyframes spin { to { transform: rotate(360deg); } }
.about__body p { font-size: clamp(17px, 1.7vw, 21px); line-height: 1.6; margin-bottom: 22px; max-width: 60ch; }
.about__body p .accent { font-weight: 500; }
.studio__cta { margin-top: 4px; margin-bottom: 8px; align-self: flex-start; }
.mobnav .hud__ext, .mobnav a[href*="personal.alphaweb"] { color: var(--accent); }
.about__facts { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line-strong); margin-top: 30px; }
.fact { padding: 18px 28px 18px 0; margin-right: 28px; border-right: var(--hairline); }
.fact:last-child { border-right: none; }
.fact .n { font-family: var(--font-display); font-size: clamp(30px, 4vw, 50px); font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.fact .n .u { color: var(--accent); }
.fact .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* =====================================================================
   NOTAS / blog seeds
   ===================================================================== */
.notes__list { border-top: var(--hairline); }
.note { display: grid; grid-template-columns: 90px 1fr auto; gap: 24px; align-items: center; padding: 26px 0; border-bottom: var(--hairline); transition: padding-left .3s var(--ease), background .3s var(--ease); }
.note:hover { padding-left: 18px; }
.note .nt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.note h4 { font-family: var(--font-display); font-size: clamp(19px, 2.4vw, 27px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.note .go { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); transition: color .3s; }
.note:hover .go { color: var(--accent); }
.note:hover .nt { color: var(--accent); }
@media (max-width: 640px){ .note { grid-template-columns: 1fr; gap: 8px; } .note .go { display:none; } }

/* =====================================================================
   CONTACTO
   ===================================================================== */
.contact { background: var(--accent); color: var(--paper); }
.contact h2 { font-family: var(--font-display); font-size: clamp(40px, 8.5vw, 116px); font-weight: 600; letter-spacing: -0.02em; line-height: .95; }
.contact .lead { font-family: var(--font-mono); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 26px; color: rgba(240,237,229,.75); }
.contact__mail { display: inline-block; margin-top: 28px; font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 42px); font-weight: 500; border-bottom: 2px solid var(--paper); padding-bottom: 4px; transition: padding-left .3s var(--ease); }
.contact__mail:hover { padding-left: 14px; }
.contact__links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
.contact__links a { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid rgba(240,237,229,.5); padding: 12px 18px; transition: background .25s var(--ease), color .25s var(--ease); }
.contact__links a:hover { background: var(--paper); color: var(--accent); border-color: var(--paper); }

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding-block: 40px; }
.foot__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: #a39f96; }
.foot__row b { color: var(--paper); font-weight: 500; }
.foot__row .lime { color: var(--accent-2); }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .manifesto .stmt { opacity: 1; }
}
