/* =========================================================
   Portfolio · Raccoon Web
   ========================================================= */
:root {
  --bg: #0A0B09;
  --bg-2: #0E100C;
  --surface: #11140E;
  --ink: #F2F0E8;
  --muted: #8E9285;
  --muted-2: #6C7064;
  --acid: #D8FF4E;
  --acid-dim: #B6DB3C;
  --line: rgba(242, 240, 232, .12);
  --line-strong: rgba(242, 240, 232, .22);
  --font: 'Space Grotesk', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif;
  --shell: 1320px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--acid); color: #0A0B09; }

.shell {
  width: 100%; max-width: var(--shell);
  margin-inline: auto; padding-inline: var(--pad);
}

.skip {
  position: fixed; top: -80px; left: 1rem; z-index: 200;
  background: var(--acid); color: #0A0B09; padding: .7rem 1.1rem;
  border-radius: 8px; font-weight: 600; transition: top .2s;
}
.skip:focus { top: 1rem; }

/* ---------- Fondos ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(242, 240, 232, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(242, 240, 232, .045) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 78%);
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  left: -18vw; top: -28vw;
  background: radial-gradient(circle, rgba(216, 255, 78, .13), transparent 62%);
  filter: blur(20px);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .95rem 1.4rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; letter-spacing: -.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s;
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; flex: none; transition: transform .4s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-acid { background: var(--acid); color: #0A0B09; }
.btn-acid:hover { background: #E7FF8B; transform: translateY(-2px); }
.btn-line { border-color: var(--line-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--acid); color: var(--acid); transform: translateY(-2px); }
.btn-sm { padding: .65rem 1.1rem; font-size: .82rem; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 9, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s;
}
.topbar.is-stuck { border-bottom-color: var(--line); background: rgba(10, 11, 9, .88); }
.topbar-inner {
  height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.logo { display: inline-flex; align-items: center; gap: .6rem; }
.logo-mark { font-size: 1.25rem; line-height: 1; }
.logo-text { font-size: 1.05rem; font-weight: 500; letter-spacing: -.03em; }
.logo-text em { font-style: normal; color: var(--acid); }
.logo-tag {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 99px;
  padding: .28rem .55rem;
}
.topnav { display: flex; gap: clamp(1rem, 2vw, 2rem); }
.topnav a { font-size: .86rem; color: var(--muted); transition: color .25s; }
.topnav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 1; padding-top: clamp(7rem, 16vh, 11rem); }
.kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.8rem;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 0 0 rgba(216, 255, 78, .6);
  animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(216, 255, 78, .5); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(216, 255, 78, 0); }
}

.hero-title {
  font-size: clamp(2.7rem, 1rem + 8.4vw, 7.4rem);
  font-weight: 500; line-height: .94; letter-spacing: -.045em;
}
.hero-title .l { display: block; overflow: hidden; padding-bottom: .04em; }
.hero-title .l > span { display: block; }
.hero-title s {
  text-decoration: none; position: relative; color: var(--muted-2);
  display: inline;
  white-space: nowrap;
  margin-left: .12em;
}
.hero-title s::after {
  content: ''; position: absolute; left: -1%; right: .16em; top: 54%; height: .06em;
  background: var(--acid); transform: rotate(-2.2deg) scaleX(0); transform-origin: left;
  animation: strike .8s var(--ease) 1.1s forwards;
}
@keyframes strike { to { transform: rotate(-2.2deg) scaleX(1); } }

.hero-foot {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(1.5rem, 5vw, 4rem); align-items: end;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.hero-lead {
  font-size: clamp(1.02rem, .96rem + .4vw, 1.22rem);
  color: var(--muted); max-width: 44ch; line-height: 1.6;
}
.hero-meta {
  display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); flex-wrap: wrap;
  justify-content: flex-end;
}
.hero-meta li {
  font-size: .78rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .1em; display: flex; flex-direction: column; gap: .1rem;
}
.hero-meta b {
  font-size: 1.5rem; font-weight: 500; color: var(--ink);
  letter-spacing: -.03em; line-height: 1;
}

/* ---------- Ticker ---------- */
.ticker {
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding-block: .85rem; overflow: hidden;
}
.ticker-track {
  display: flex; align-items: center; gap: 1.6rem; width: max-content;
  animation: ticker 38s linear infinite;
}
.ticker-track span {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); white-space: nowrap;
}
.ticker-track i { color: var(--acid); font-style: normal; font-size: .7rem; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
section { position: relative; z-index: 1; }
.h2 {
  font-size: clamp(1.9rem, 1rem + 3.4vw, 3.6rem);
  font-weight: 500; letter-spacing: -.04em; line-height: 1;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 4vw, 3.2rem);
}
.section-note {
  font-size: .92rem; color: var(--muted); max-width: 46ch; line-height: 1.6;
}

.projects { padding-block: clamp(4rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); }

/* ---------- Proyecto destacado ---------- */
.project {
  display: grid; grid-template-columns: 1.18fr .82fr;
  gap: clamp(1.6rem, 3.5vw, 3rem);
  padding: clamp(.9rem, 1.6vw, 1.3rem);
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008));
  border: 1px solid var(--line); border-radius: 26px;
  transform-style: preserve-3d;
  transition: border-color .5s, box-shadow .5s;
}
.project:hover { border-color: var(--line-strong); box-shadow: 0 60px 120px -70px rgba(216, 255, 78, .35); }

.project-media {
  position: relative; display: block; overflow: hidden;
  border-radius: 18px; background: #0d0f0b;
  aspect-ratio: 16 / 10;
}
.project-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transform: scale(1.01);
  transition: transform 1.1s var(--ease), filter .6s;
  filter: saturate(.92) contrast(1.02);
}
.project:hover .project-media img { transform: scale(1.045); filter: saturate(1.02) contrast(1.02); }
.project-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 55%, rgba(10, 11, 9, .55));
  opacity: 0; transition: opacity .5s;
}
.project:hover .project-media::after { opacity: 1; }
.project-open {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--acid); color: #0A0B09;
  padding: .6rem .95rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.project-open svg { width: 15px; height: 15px; }
.project:hover .project-open, .project-media:focus-visible .project-open { opacity: 1; transform: none; }

.project-body { display: flex; flex-direction: column; padding: .5rem .4rem .4rem; }
.project-top {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.1rem;
}
.project-index { color: var(--acid); }
.project-state {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: 99px; padding: .22rem .55rem;
  letter-spacing: .1em;
}
.state-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}
.project-body h3 {
  font-size: clamp(1.9rem, 1.2rem + 2vw, 2.7rem);
  font-weight: 500; letter-spacing: -.04em; line-height: 1; margin-bottom: .8rem;
}
.project-body > p { font-size: .93rem; color: var(--muted); line-height: 1.62; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.3rem 0 1.5rem; }
.chips li {
  font-size: .72rem; color: var(--ink); border: 1px solid var(--line);
  border-radius: 99px; padding: .34rem .7rem; background: rgba(255, 255, 255, .03);
}
.project-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.link-ghost { font-size: .82rem; color: var(--muted); transition: color .25s; }
.link-ghost:hover { color: var(--acid); }

.project-specs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: auto; padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.project-specs div { display: flex; flex-direction: column; gap: .1rem; }
.project-specs dt { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.project-specs dd { font-size: .88rem; color: var(--ink); }

/* ---------- Próximas demos ---------- */
.next {
  display: grid; grid-template-columns: .9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  margin-top: clamp(1.2rem, 2vw, 1.6rem);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px dashed var(--line-strong); border-radius: 26px;
  background: rgba(255, 255, 255, .012);
}
.next-label {
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--acid);
}
.next-copy h3 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 500;
  letter-spacing: -.03em; margin: .5rem 0 .6rem;
}
.next-copy p { font-size: .88rem; color: var(--muted); max-width: 40ch; line-height: 1.6; }
.next-list { display: grid; gap: .1rem; }
.next-list li {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem .2rem; border-bottom: 1px solid var(--line);
  font-size: .92rem; color: var(--ink);
}
.next-list li:last-child { border-bottom: 0; }
.next-list span { font-size: .7rem; color: var(--muted-2); letter-spacing: .1em; }
.next-list b {
  margin-left: auto; font-size: .62rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2);
}

/* ---------- Método ---------- */
.method { padding-block: clamp(4rem, 9vw, 7rem); }
.method-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem); margin-top: 1rem;
}
.method-item {
  padding-top: 1.6rem; border-top: 1px solid var(--line-strong);
  position: relative;
}
.method-item::before {
  content: ''; position: absolute; top: -1px; left: 0; width: 0; height: 1px;
  background: var(--acid); transition: width .7s var(--ease);
}
.method-item.is-in::before { width: 56px; }
.method-num {
  display: block; font-size: .72rem; letter-spacing: .16em;
  color: var(--acid); margin-bottom: 1.6rem;
}
.method-item h3 {
  font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); font-weight: 500;
  letter-spacing: -.02em; margin-bottom: .6rem;
}
.method-item p { font-size: .9rem; color: var(--muted); line-height: 1.65; }
.method-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em; background: rgba(216, 255, 78, .1);
  color: var(--acid); padding: .1em .35em; border-radius: 4px;
}

/* ---------- CTA ---------- */
.cta {
  padding-block: clamp(4rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
  background: radial-gradient(90% 120% at 50% 0%, rgba(216, 255, 78, .07), transparent 60%);
}
.cta-inner { text-align: center; }
.cta-inner .kicker { justify-content: center; }
.cta-title {
  font-size: clamp(2.6rem, 1rem + 7vw, 6rem);
  font-weight: 500; letter-spacing: -.045em; line-height: .95;
  margin-bottom: 1.4rem;
}
.cta-lead {
  font-size: clamp(.98rem, .94rem + .3vw, 1.1rem); color: var(--muted);
  max-width: 46ch; margin: 0 auto 2.2rem; line-height: 1.6;
}
.cta-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 1.8rem; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-size: .78rem; color: var(--muted-2);
}
.footer-note { color: var(--muted-2); }
.to-top { color: var(--muted); transition: color .25s; }
.to-top:hover { color: var(--acid); }

/* ---------- Reveals ---------- */
.js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

.js .hero-title .l > span { transform: translateY(110%); }
.js .hero-title.is-in .l > span { animation: lineUp 1.1s var(--ease) forwards; }
.js .hero-title.is-in .l:nth-child(2) > span { animation-delay: .12s; }
@keyframes lineUp { to { transform: translateY(0); } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .project { grid-template-columns: 1fr; }
  .project-body { padding: .4rem .2rem .2rem; }
  .next { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero-foot { grid-template-columns: 1fr; align-items: start; }
  .hero-meta { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .topnav { display: none; }
  .topbar-inner { height: 66px; }
  .logo-tag { display: none; }
  .hero { padding-top: clamp(6rem, 18vh, 8rem); }
  .hero-title { font-size: clamp(2.05rem, 8.9vw, 3.1rem); letter-spacing: -.05em; }
  .project-specs { margin-top: 1.6rem; }
  .project-actions .btn { width: 100%; }
  .project-specs { gap: .6rem; }
  .next-list li { font-size: .86rem; }
  .next-list b { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal, .js .hero-title .l > span { opacity: 1 !important; transform: none !important; }
}
