:root {
  color-scheme: dark;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  --black: #0b0908;
  --paper: #f1eee8;
  --orange: #ff5a1f;
  --red: #cf2617;
  --line-dark: rgb(255 255 255 / 0.17);
  --line-light: rgb(11 9 8 / 0.16);
  background: var(--black);
  color: white;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
html, body { width: 100%; max-width: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--black); }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 3rem);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.site-header,
.site-header.scrolled { background: transparent; backdrop-filter: none; }
.brand { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.08em; }
.brand span { color: var(--orange); }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); font-size: 0.7rem; font-weight: 650; }
.nav a:not(.nav-cta) { position: relative; color: rgb(255 255 255 / 0.68); transition: color 0.2s; }
.nav a:not(.nav-cta)::after { content: ""; position: absolute; right: 0; bottom: -.45rem; left: 0; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .25s ease; }
.nav a.active:not(.nav-cta) { color: white; }
.nav a.active:not(.nav-cta)::after { transform: scaleX(1); }
.nav a:hover { color: white; }
.nav-cta { padding: 0.58rem 1rem; border: 1px solid rgb(255 255 255 / 0.45); border-radius: 99px; }
.site-header.on-light { color: var(--black); }
.site-header.on-light .brand span { color: var(--red); }
.site-header.on-light .nav a:not(.nav-cta) { color: rgb(11 9 8 / .58); }
.site-header.on-light .nav a.active:not(.nav-cta), .site-header.on-light .nav a:hover { color: var(--black); }
.site-header.on-light .nav-cta { border-color: rgb(11 9 8 / .4); color: var(--black); }
.menu-toggle { display: none; border: 0; background: none; }

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.background, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.background { max-width: 100vw; overflow: hidden; }
.background { background: linear-gradient(135deg, #fff1e8, #ff5a1f 50%, #8e0900); }
.hero-shade { z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgb(10 5 3 / 0.72), rgb(10 5 3 / 0.12) 70%), linear-gradient(0deg, rgb(8 4 3 / 0.45), transparent 50%); }
.hero-content {
  position: relative;
  z-index: 2;
  top: -5.5vh;
  width: 100%;
  margin: 0;
  padding: 5rem clamp(9rem, 12vw, 13rem) 6.5rem clamp(1.25rem, 6vw, 7rem);
}
.eyebrow, .section-number { margin: 0; font-size: 0.67rem; font-weight: 750; letter-spacing: 0.2em; text-transform: uppercase; }
.eyebrow { margin-bottom: clamp(.8rem, 2vh, 1.6rem); color: rgb(255 255 255 / 0.72); }
.hero h1 { max-width: 11ch; margin: 0; font-size: clamp(4rem, min(8vw, 13.5vh), 7.5rem); font-weight: 540; letter-spacing: -0.075em; line-height: 0.84; }
.hero h1 em { display: inline-block; margin-top: .32em; color: #fff0e9; font-family: Georgia, serif; font-size: .8em; font-weight: 400; }
.hero-intro { max-width: 34rem; margin: clamp(1rem, 2.5vh, 2rem) 0 0; color: rgb(255 255 255 / 0.78); font-size: clamp(.9rem, 1.35vw, 1.15rem); line-height: 1.5; }
.hero-actions { position: absolute; z-index: 3; left: clamp(1.25rem, 6vw, 7rem); bottom: 3.25rem; display: flex; gap: 0.7rem; margin: 0; }
.button { display: inline-flex; align-items: center; gap: .8rem; padding: .82rem 1.2rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-3px); }
.button-primary { background: white; color: var(--black); }
.button-ghost { border: 1px solid rgb(255 255 255 / 0.45); }
.hero-meta { position: absolute; z-index: 2; left: clamp(1.25rem, 6vw, 7rem); right: clamp(9rem, 12vw, 13rem); bottom: 1.35rem; display: flex; justify-content: space-between; color: rgb(255 255 255 / 0.55); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-height: 700px) and (min-width: 801px) {
  .hero-content { top: 0; padding-top: 4rem; padding-bottom: 4.5rem; }
  .hero h1 { font-size: clamp(3.4rem, 12.5vh, 6.4rem); }
  .hero-intro { max-width: 31rem; }
  .hero-meta { bottom: .75rem; }
}

.section {
  position: relative;
  min-height: 100svh;
  padding: clamp(6rem, 8vh, 8rem) clamp(9rem, 12vw, 13rem) clamp(6rem, 8vh, 8rem) clamp(1.25rem, 6vw, 7rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
.projects, .skills, .tech { background: var(--paper); color: var(--black); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 3rem; margin-bottom: clamp(2.5rem, 5vh, 5rem); }
.section-number { padding-top: 0.65rem; color: #79736d; }
.section-heading h2, .about h2, .contact h2 { margin: 0; font-size: clamp(3rem, 7vw, 7.5rem); font-weight: 520; letter-spacing: -0.065em; line-height: 0.94; }

.projects { display: flex; flex-direction: column; }
.projects .section-heading h2 { font-size: clamp(3rem, min(6vw, 9.5vh), 6.5rem); }
.project-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: clamp(1rem, 2vw, 2rem);
  min-height: 0;
  transform: translateX(var(--panel-shift, 0));
  transition: transform .12s linear;
}
.project-featured { grid-column: auto; }
.project-card { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.project-visual { position: relative; flex: 1 1 auto; min-height: 12rem; display: grid; place-items: center; overflow: hidden; }
.project-featured .project-visual { min-height: 12rem; }
.project-index { position: absolute; top: 1.3rem; left: 1.3rem; font-size: 0.7rem; font-weight: 800; }
.visual-one { background: #e44c22; color: #140b08; }
.visual-two { background: #19130f; color: #f6d6c8; }
.visual-three { background: #d7d1c6; color: #cf2617; }
.mock-window { width: min(76%, 58rem); aspect-ratio: 16/9; padding: 1rem; border-radius: .8rem; background: #f4e7da; box-shadow: 0 3rem 7rem rgb(43 8 0 / .3); transform: rotate(-3deg); }
.mock-window i { display: inline-block; width: .55rem; height: .55rem; margin-right: .25rem; border-radius: 50%; background: #d5bfb2; }
.mock-window b { height: calc(100% - 2rem); display: grid; place-items: center; font-size: clamp(3rem, 10vw, 9rem); letter-spacing: -.09em; }
.visual-two strong { font-family: Georgia, serif; font-size: clamp(3.5rem, 7vw, 7rem); font-weight: 400; line-height: .8; transform: rotate(-7deg); }
.prism { width: 12rem; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: 7rem; }
.project-info { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: start; padding-top: 1rem; }
.project-info h3 { margin: 0 0 .4rem; font-size: 1.35rem; }
.project-info p { margin: 0; color: #77716b; font-size: .8rem; }
.project-info > a { font-size: 1.8rem; transition: transform .2s; }
.project-info > a:hover { transform: translate(4px, -4px); }

.about { display: grid; grid-template-columns: .45fr 1.55fr; align-items: center; gap: 3rem; background: var(--black); }
.about h2 span { color: #6e6965; }
.about-details { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; max-width: 55rem; margin: 4rem 0 3rem; color: #aaa39e; line-height: 1.75; }
.about-details p { margin: 0; }
.about-details strong { color: white; }
.text-link { display: inline-flex; gap: 2rem; padding-bottom: .5rem; border-bottom: 1px solid #706a65; font-size: .8rem; font-weight: 700; }

.skills { display: flex; flex-direction: column; justify-content: center; }
.deck-mode .skills { padding-top: 8rem; }
.skills .section-heading h2 { text-align: right; }
.skill-list { border-top: 1px solid var(--line-light); }
.skill { display: grid; grid-template-columns: .15fr .7fr 1fr; gap: 2rem; align-items: center; padding: 2.3rem 0; border-bottom: 1px solid var(--line-light); }
.skill span { color: var(--red); font-size: .7rem; font-weight: 800; }
.skill h3 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 550; }
.skill p { max-width: 35rem; margin: 0; color: #77716b; line-height: 1.6; }

.experience { display: grid; grid-template-columns: .65fr 1.35fr; align-items: center; gap: 5rem; background: #c93620; }
.experience .section-heading { display: block; }
.experience .section-number { color: rgb(255 255 255 / .62); margin-bottom: 1.5rem; }
.timeline { border-top: 1px solid var(--line-dark); }
.timeline article { display: grid; grid-template-columns: .45fr 1fr; padding: 2rem 0; border-bottom: 1px solid var(--line-dark); }
.timeline time { grid-row: 1 / 4; color: rgb(255 255 255 / .6); font-size: .75rem; }
.timeline h3, .timeline p { margin: 0; }
.timeline h3 { font-size: 1.5rem; }
.timeline p { margin-top: .35rem; color: rgb(255 255 255 / .72); }
.timeline span { margin-top: 1rem; color: rgb(255 255 255 / .5); font-size: .72rem; }

.tech { padding-left: 0; padding-right: clamp(9rem, 12vw, 13rem); overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.tech > .section-number { margin-left: clamp(1.25rem, 6vw, 7rem); }
.marquee { display: flex; width: max-content; margin-top: 5rem; animation: marquee 24s linear infinite; }
.marquee > div { display: flex; align-items: center; }
.marquee span { font-size: clamp(4rem, 10vw, 10rem); font-weight: 520; letter-spacing: -.07em; }
.marquee i { margin: 0 3vw; color: var(--orange); font-style: normal; font-size: 2.5rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

.contact { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; background: #11100e; }
.contact-content { margin: auto 0; }
.contact .section-number { margin-bottom: 2.5rem; }
.contact h2 em { color: #ff6c34; font-family: Georgia, serif; font-weight: 400; }
.contact-mail { display: flex; justify-content: space-between; align-items: center; max-width: 58rem; margin-top: 4rem; padding-bottom: 1rem; border-bottom: 1px solid #716b66; color: #c9c3be; font-size: clamp(1.1rem, 2.5vw, 2rem); }
footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; padding-top: 2rem; border-top: 1px solid var(--line-dark); color: #77716d; font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
footer p { margin: 0; }
footer div { display: flex; gap: 2rem; }
footer > a { justify-self: end; }

.reveal { opacity: 0; transform: translateY(2.5rem); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

/* Modo scrollytelling: el documento no se desplaza; solo cambia el contenido del panel. */
body.deck-mode {
  height: 100svh;
  overflow: hidden;
}

.deck-mode main {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
}

.deck-mode .hero,
.deck-mode .section {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 1;
  pointer-events: none;
  scroll-snap-align: none;
}

.deck-mode .panel-active {
  z-index: 2;
  visibility: visible;
  pointer-events: auto;
}

.deck-mode .panel-behind {
  z-index: 2;
  visibility: visible;
  pointer-events: none;
}

.deck-mode .panel-sliding {
  z-index: 4;
  visibility: visible;
  box-shadow: 0 -2rem 6rem rgb(0 0 0 / .22);
}

.deck-mode .panel-piece {
  will-change: transform, opacity;
}

.deck-mode .panel-entering .panel-piece {
  transition: transform .52s cubic-bezier(.16, 1, .3, 1), opacity .42s ease;
}

.deck-mode .projects .section-heading { margin-bottom: 2.5rem; }
.deck-mode .projects .project-grid { min-height: 0; overflow: hidden; }
.deck-mode .contact { padding-bottom: 2rem; }

.section-wheel { position: fixed; z-index: 30; right: -5.25rem; bottom: -5.25rem; width: 10.5rem; height: 10.5rem; touch-action: none; user-select: none; }
.section-wheel svg { width: 100%; height: 100%; overflow: visible; transition: transform .16s cubic-bezier(.2,.7,.2,1); }
.section-wheel .dial-tick { stroke: rgb(255 255 255 / .22); stroke-width: .65; pointer-events: none; transition: stroke .2s, stroke-width .2s; }
.section-wheel .dial-tick.major { stroke: rgb(255 255 255 / .55); stroke-width: 1.15; }
.section-wheel .dial-tick.progressed { stroke: #ff6a32; }
.section-wheel .dial-tick.major.active { stroke: white; stroke-width: 2; }
.section-wheel .dial-tick.major.hover { stroke: white; stroke-width: 2.4; }
.section-wheel .dial-hit { stroke: transparent; stroke-width: 16; cursor: pointer; pointer-events: stroke; outline: none; }
.section-wheel .dial-rim { fill: none; stroke: rgb(255 255 255 / .12); stroke-width: .5; pointer-events: none; }
.section-wheel.on-light .dial-tick { stroke: rgb(11 9 8 / .27); }
.section-wheel.on-light .dial-tick.major { stroke: rgb(11 9 8 / .55); }
.section-wheel.on-light .dial-tick.progressed { stroke: #d6321f; }
.section-wheel.on-light .dial-tick.major.active, .section-wheel.on-light .dial-tick.major.hover { stroke: #0b0908; }
.section-wheel.on-light .dial-rim { stroke: rgb(11 9 8 / .14); }
.wheel-center {
  position: absolute;
  inset: 32% auto auto 32%;
  color: rgb(255 255 255 / .9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-style: italic;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.08em;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%,-50%);
}
.section-wheel.on-light .wheel-center { color: rgb(11 9 8 / .86); }
.deck-mode .panel-preparing .panel-piece { opacity: 0 !important; transition: none !important; }


.section.is-active .section-heading,
.section.is-active .about-copy,
.section.is-active .timeline,
.section.is-active .contact-content {
  will-change: transform, opacity;
}

@media (max-width: 800px) {
  .menu-toggle { display: grid; gap: 5px; padding: .5rem; }
  .menu-toggle > span:not(.sr-only) { width: 1.5rem; height: 1px; background: white; }
  .site-header.on-light .menu-toggle > span:not(.sr-only) { background: var(--black); }
  .site-header.on-light:has(.nav.open) .menu-toggle > span:not(.sr-only) { background: white; }
  .nav { position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; justify-content: center; gap: 2rem; background: #0b0908; font-size: 1.8rem; opacity: 0; visibility: hidden; transition: .25s; }
  .nav.open { opacity: 1; visibility: visible; }
  .nav.open a, .site-header.on-light .nav.open a:not(.nav-cta), .site-header.on-light .nav.open .nav-cta { color: white; border-color: rgb(255 255 255 / .45); }
  .hero h1 { font-size: clamp(3.4rem, min(15vw, 12vh), 6.2rem); }
  .hero-content { top: -1vh; padding: 5.5rem 1.25rem 6.5rem; }
  .section { padding: 4.75rem 1.25rem 7.5rem; }
  .tech { padding-left: 0; padding-right: 1.25rem; }
  .hero-meta { right: 1.25rem; }
  .hero-actions { left: 1.25rem; bottom: 7.25rem; }
  .hero-meta span { display: none; }
  .hero-meta { justify-content: flex-end; }
  .section-heading, .about, .experience { display: block; }
  .section-heading h2 { margin-top: 1.5rem; }
  .project-grid {
    display: flex;
    gap: 1rem;
    width: calc(100vw - 1.25rem);
    margin-right: -1.25rem;
    padding-right: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  body.deck-mode .projects .project-grid {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .project-grid::-webkit-scrollbar { display: none; }
  .project-card { flex: 0 0 82vw; height: 100%; min-height: 0; scroll-snap-align: start; }
  .project-featured { grid-column: auto; }
  .projects { min-height: auto; padding-top: 4.4rem; padding-bottom: 5.2rem; }
  .project-grid { transform: none !important; }
  .project-visual, .project-featured .project-visual { min-height: 10rem; height: auto; flex: 1 1 auto; }
  .project-info { flex: 0 0 auto; padding-top: .85rem; }
  .about-copy { margin-top: 3rem; }
  .about-details { grid-template-columns: 1fr; gap: 1.2rem; }
  .skills .section-heading h2 { text-align: left; }
  .skill { grid-template-columns: .12fr 1fr; }
  .skill p { grid-column: 2; }
  .timeline { margin-top: 3rem; }
  footer { grid-template-columns: 1fr; }
  footer div { flex-wrap: wrap; }
  footer > a { justify-self: start; }

  .deck-mode .hero,
  .deck-mode .section { padding-bottom: 7.5rem; }
  .deck-mode .projects { padding-top: 4.4rem; padding-bottom: 5.2rem; }
  .deck-mode .projects .section-heading { flex: 0 0 auto; margin-bottom: 1rem; }
  .section-heading h2, .about h2, .contact h2 { font-size: clamp(2.5rem, 11vw, 4.2rem); }
  .section-heading { margin-bottom: 2rem; }
  .about-details { margin: 2rem 0 1.5rem; font-size: .86rem; line-height: 1.5; }
  .skill { padding: 1.25rem 0; gap: 1rem; }
  .deck-mode .skills { padding-top: 6.5rem; }
  .skill h3 { font-size: 1.2rem; }
  .skill p { font-size: .8rem; line-height: 1.4; }
  .experience .section-heading { margin-bottom: 1rem; }
  .timeline { margin-top: 1.5rem; }
  .timeline article { padding: 1.1rem 0; }
  .timeline h3 { font-size: 1.1rem; }
  .contact-mail { margin-top: 2rem; }
  footer { gap: .8rem; font-size: .58rem; }

  .section-wheel {
    top: auto;
    right: auto;
    bottom: -3.6rem;
    left: 50%;
    width: 7.2rem;
    height: 7.2rem;
    transform: translateX(-50%);
  }
  .wheel-center { inset: 33% auto auto 50%; font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee { animation-play-state: paused; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
