/* =========================================================
   IFC — CV / Presentación web
   Stack visual: dark luxury · whisky gold · serif Fraunces
   ========================================================= */

:root {
  --bg:        #0a0908;
  --bg-warm:   #14100c;
  --bg-deep:   #050403;
  --gold:      #c9a961;
  --gold-soft: #d4b87a;
  --amber:     #d4a574;
  --amber-hot: #e8b478;
  --text:      #f5f1e8;
  --text-dim:  #8a8275;
  --text-mute: #5a5447;
  --line:      rgba(245,241,232,0.08);
  --line-gold: rgba(201,169,97,0.25);

  --ff-serif: 'Fraunces', 'Times New Roman', serif;
  --ff-sans:  'Inter', system-ui, sans-serif;
  --ff-mono:  'JetBrains Mono', ui-monospace, monospace;

  --pad-x: clamp(1.5rem, 4vw, 4rem);
  --max-w: 1600px;

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-io:  cubic-bezier(.65,.05,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--gold); color: var(--bg); }

html { -webkit-text-size-adjust: 100%; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body { min-height: 100vh; transition: opacity .35s ease; }
body.preload { opacity: 0; }

/* ---------- Section background images ---------- */
.section-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease;
}
.section-bg.is-visible { opacity: 1; }
.section-bg::before {
  content: '';
  position: absolute;
  inset: -15%;
  background-image: var(--bg-img);
  background-size: var(--bg-size, cover);
  background-position: var(--bg-pos, center);
  background-repeat: no-repeat;
  background-color: var(--bg);
  filter: grayscale(.10) contrast(1.05) brightness(.85);
  transform: translate3d(0, var(--bg-y, 0), 0);
  will-change: transform;
}
.section-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(10,9,8, .80) 0%,
      rgba(10,9,8, .25) 30%,
      rgba(10,9,8, .25) 70%,
      rgba(10,9,8, .80) 100%),
    linear-gradient(90deg,
      rgba(10,9,8, .55) 0%,
      rgba(10,9,8, .10) 50%,
      rgba(10,9,8, .55) 100%);
}
.section-bg.right::after {
  background:
    linear-gradient(90deg,
      rgba(10,9,8, .92) 0%,
      rgba(10,9,8, .65) 35%,
      rgba(10,9,8, .15) 100%),
    linear-gradient(180deg,
      rgba(10,9,8, .70) 0%,
      rgba(10,9,8, .15) 30%,
      rgba(10,9,8, .15) 70%,
      rgba(10,9,8, .70) 100%);
}
.section-bg.left::after {
  background:
    linear-gradient(270deg,
      rgba(10,9,8, .92) 0%,
      rgba(10,9,8, .65) 35%,
      rgba(10,9,8, .15) 100%),
    linear-gradient(180deg,
      rgba(10,9,8, .70) 0%,
      rgba(10,9,8, .15) 30%,
      rgba(10,9,8, .15) 70%,
      rgba(10,9,8, .70) 100%);
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ---------- Background canvas (Three.js shader) ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: -1;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.9'/></svg>");
  animation: grainShift 1.6s steps(6) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, 4%); }
  80%  { transform: translate(3%, -1%); }
  100% { transform: translate(0,0); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.6rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-logo {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  text-transform: none;
}
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.nav-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6ee7a4;
  box-shadow: 0 0 10px #6ee7a4, 0 0 0 4px rgba(110,231,164,.15);
  animation: pulse 2s var(--ease-io) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .65; }
}

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: var(--line);
  z-index: 99;
}
.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--amber-hot));
  transition: width .1s linear;
  box-shadow: 0 0 12px var(--gold);
}

/* ========= Common ========= */
section { position: relative; padding: 14vh var(--pad-x); isolation: isolate; }

.section-tag {
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5rem;
  display: inline-block;
}
.section-tag.light  { color: var(--text-dim); }
.section-tag.amber-tag { color: var(--amber-hot); }

.dot-sep { color: var(--gold); margin: 0 .8rem; opacity: .6; }

em {
  font-style: italic;
  font-family: var(--ff-serif);
  color: var(--gold-soft);
  font-weight: 300;
}

.hl {
  position: relative;
  display: inline-block;
  color: var(--text);
  font-style: italic;
  font-family: var(--ff-serif);
}
.hl::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s var(--ease-out);
}
.hl.is-on::after { transform: scaleX(1); }

.hl-amber {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--amber-hot);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  padding-top: 18vh;
  padding-bottom: 4vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-meta {
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 2.5rem;
}
.hero-name {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(3.5rem, 13vw, 16rem);
  line-height: .88;
  letter-spacing: -.045em;
  font-variation-settings: 'opsz' 144;
}
.hero-name .word {
  display: block;
  overflow: hidden;
}
.hero-name .line-inner {
  display: inline-block;
  will-change: transform;
}
.hero-name .word.amber em {
  color: var(--gold);
  font-style: italic;
}

.hero-roles {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-family: var(--ff-mono);
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero-roles span {
  position: relative;
}
.hero-roles span:not(:last-child)::after {
  content: '·';
  margin-left: 2rem;
  color: var(--gold);
}

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 4rem;
}
.hero-scroll {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero-scroll .scroll-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  position: relative;
  overflow: hidden;
}
.hero-scroll .scroll-line::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--text);
  animation: scrollLineRun 2s var(--ease-io) infinite;
}
@keyframes scrollLineRun {
  0%   { left: -100%; }
  60%  { left: 100%; }
  100% { left: 100%; }
}
.hero-tag {
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* =========================================================
   PERFIL
   ========================================================= */
.profile { padding-top: 22vh; padding-bottom: 18vh; }

.profile h2.reveal-text,
.formation h2.reveal-text,
.awards h2.reveal-text {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  max-width: 1500px;
  margin-bottom: 8rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
  max-width: var(--max-w);
}
.profile-grid p {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.65;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* =========================================================
   EXPERIENCIA — horizontal pin
   ========================================================= */
.experience {
  padding: 0;
  height: 400vh;          /* da scroll vertical = traslación horizontal */
  position: relative;
}
.exp-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.exp-track {
  display: flex;
  gap: 6rem;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  height: 70vh;
  align-items: center;
  will-change: transform;
}
.exp-intro {
  flex: 0 0 auto;
  width: 50vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.exp-intro h2 {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: 1;
  letter-spacing: -.025em;
  margin-bottom: 2rem;
}
.exp-intro-sub {
  font-family: var(--ff-mono);
  font-size: .8rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
}

.exp-card {
  flex: 0 0 auto;
  width: 38vw;
  min-width: 460px;
  max-width: 620px;
  height: 100%;
  background:
    linear-gradient(160deg, rgba(245,241,232,.04), rgba(245,241,232,.01)),
    rgba(255,255,255,.015);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3rem;
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .6s var(--ease-out), transform .6s var(--ease-out);
}
.exp-card:hover {
  border-color: var(--line-gold);
  transform: translateY(-6px);
}
.exp-num {
  font-family: var(--ff-mono);
  font-size: .75rem;
  letter-spacing: .25em;
  color: var(--gold);
  margin-bottom: 2.5rem;
}
.exp-year {
  font-family: var(--ff-mono);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 1rem;
}
.exp-card h3 {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: .8rem;
}
.exp-role {
  font-family: var(--ff-mono);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 2rem;
}
.exp-body {
  color: var(--text-dim);
  font-size: .98rem;
  line-height: 1.65;
  flex: 1;
  overflow-y: auto;
}
.exp-body p + p { margin-top: 1.2rem; }
.exp-body ul.exp-list {
  list-style: none;
  margin: 1.2rem 0;
}
.exp-body ul.exp-list li {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: .5rem;
  color: var(--text);
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 300;
}
.exp-body ul.exp-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
}

@media (max-width: 768px) {
  .experience { height: auto; }
  .exp-pin { position: static; height: auto; padding: 8vh 0; }
  .exp-track { flex-direction: column; height: auto; gap: 3rem; }
  .exp-intro, .exp-card { width: 100%; min-width: 0; max-width: none; height: auto; }
}

/* =========================================================
   FORMACION
   ========================================================= */
.formation { padding-top: 18vh; padding-bottom: 18vh; }
.formation-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 6rem;
  align-items: start;
  max-width: var(--max-w);
}
.formation-text h2 { margin-bottom: 3rem; }
.formation-text p {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 60ch;
}
.formation-text p + p { margin-top: 1.4rem; }

.formation-side { position: sticky; top: 18vh; }
.formation-card {
  border: 1px solid var(--line-gold);
  padding: 3rem 2rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  background: linear-gradient(180deg, rgba(201,169,97,.04), rgba(201,169,97,.01));
}
.formation-card-tag {
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
}
.formation-card-line {
  width: 60%;
  height: 1px;
  background: var(--line-gold);
}
.formation-card-text {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .formation-grid { grid-template-columns: 1fr; gap: 3rem; }
  .formation-side { position: static; }
}

/* =========================================================
   INTERESES
   ========================================================= */
.interests { padding-top: 18vh; padding-bottom: 18vh; perspective: 1500px; }
.interests-title {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: 1;
  letter-spacing: -.025em;
  margin-bottom: 6rem;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: var(--max-w);
  transform-style: preserve-3d;
}
.interest-card {
  position: relative;
  padding: 2.4rem 2rem;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(245,241,232,.03), rgba(245,241,232,.005));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-style: preserve-3d;
  transition:
    border-color .6s var(--ease-out),
    background .6s var(--ease-out);
  cursor: default;
  will-change: transform;
}
.interest-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    radial-gradient(400px circle at var(--mx,50%) var(--my,50%),
      rgba(201,169,97,.14),
      transparent 60%);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
  pointer-events: none;
}
.interest-card:hover {
  border-color: var(--line-gold);
}
.interest-card:hover::before { opacity: 1; }

.interest-num {
  font-family: var(--ff-mono);
  font-size: .7rem;
  letter-spacing: .25em;
  color: var(--gold);
}
.interest-label {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--text);
  transform: translateZ(20px);
}
@media (max-width: 900px) { .interests-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .interests-grid { grid-template-columns: 1fr; } }

/* =========================================================
   WHISKY
   ========================================================= */
.whisky {
  padding-top: 22vh;
  padding-bottom: 22vh;
  position: relative;
  overflow: hidden;
}
.whisky-bg {
  position: absolute;
  inset: -10%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(212,165,116,.18), transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(201,169,97,.10), transparent 60%);
  filter: blur(40px);
}
.whisky-title {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 11rem);
  line-height: .92;
  letter-spacing: -.04em;
  margin-bottom: 6rem;
  color: var(--amber-hot);
}
.whisky-title em { color: var(--gold); }
.whisky-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
  max-width: var(--max-w);
  margin-bottom: 8rem;
}
.whisky-grid p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
}
.whisky-quote {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  color: var(--amber);
  max-width: 1100px;
  line-height: 1.4;
}
@media (max-width: 768px) { .whisky-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* =========================================================
   AWARDS / RECONOCIMIENTOS
   ========================================================= */
.awards { padding-top: 18vh; padding-bottom: 12vh; }
.awards .reveal-text { margin-bottom: 6rem; }
.awards-marquee {
  position: relative;
  width: 100vw;
  margin-left: calc(-1 * var(--pad-x));
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.awards-marquee-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 3rem);
  color: var(--gold-soft);
  font-weight: 300;
  animation: marqueeRun 32s linear infinite;
}
@keyframes marqueeRun {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   FILOSOFIA — quote
   ========================================================= */
.philosophy {
  min-height: 100vh;
  padding: 22vh var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.quote {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 6rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  max-width: 1500px;
  position: relative;
}
.quote-mark {
  font-size: 1.4em;
  color: var(--gold);
  font-family: var(--ff-serif);
  line-height: 0;
  vertical-align: -.2em;
}
.quote-mark.close { display: inline-block; transform: translateY(-.05em); }
.quote-author {
  margin-top: 4rem;
  font-family: var(--ff-mono);
  font-size: .8rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
}

/* =========================================================
   CONTACTO / FOOTER
   ========================================================= */
.contact {
  min-height: 100vh;
  padding: 18vh var(--pad-x) 4vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  position: relative;
}
.contact-meta {
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
}
.contact-title {
  font-family: var(--ff-serif);
  font-weight: 300;
  font-size: clamp(3.5rem, 14vw, 18rem);
  line-height: .88;
  letter-spacing: -.045em;
  margin: 4rem 0;
}
.contact-title .word { display: block; overflow: hidden; }
.contact-title .line-inner {
  display: inline-block;
}
.contact-title .word.amber em { color: var(--gold); font-style: italic; }

.contact-sub {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  color: var(--text-dim);
}
.contact-bottom {
  display: flex;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 8rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .hero-name .line-inner,
  .contact-title .line-inner { translate: 0 0; }
  .hero-roles span { opacity: 1; translate: 0 0; }
  .hero-meta { opacity: 1; }
}
