:root {
  --cream: #FFFCEE;
  --lime: #C2CE24;
  --green: #01BC8F;
  --ink: #413C36;
  --pink: #F28BE8;
  --soft: #F4F0DC;
  --sans: "Outfit", system-ui, sans-serif;
  --dotf: "Doto", ui-monospace, monospace;
  --pad: clamp(16px, 5vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
.dot { font-family: var(--dotf); font-weight: 900; letter-spacing: 0.02em; }

/* nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.nav nav { display: flex; gap: clamp(12px, 2.5vw, 32px); }
.nav nav a { text-decoration: none; font-size: 0.95rem; opacity: 0.8; }
.nav nav a:hover { opacity: 1; color: var(--green); }
@media (max-width: 720px) { .nav nav { display: none; } }

/* hero */
.hero {
  position: relative; min-height: 100svh;
  display: grid; align-items: center;
  padding: 120px var(--pad) 80px;
}
#mycelium { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text { position: relative; z-index: 2; max-width: 620px; margin-left: auto; pointer-events: none; }
.hero h1 { font-size: clamp(4rem, 13vw, 10rem); }
.hero .dot { font-size: clamp(1.6rem, 4.5vw, 3rem); margin: 4px 0 0; }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 34ch; margin-bottom: 32px; }
@media (max-width: 720px) {
  .hero { align-items: start; padding-top: 96px; }
  .hero-text { margin-left: 0; }
}
.cta {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  background: var(--ink); color: var(--cream); text-decoration: none; font-weight: 600;
  transition: transform .2s, background .2s;
}
.cta:hover { transform: translateY(-2px); background: var(--green); }
.cta.light { background: var(--cream); color: var(--ink); }
.cta.light:hover { background: var(--lime); }

/* services band */
.band { position: relative; padding: 0; margin-top: clamp(40px, 8vw, 120px); }
.marquee { overflow: hidden; padding: 18px 0; position: relative; z-index: 1; }
.track { display: flex; gap: 28px; align-items: center; width: max-content; animation: slide 46s linear infinite; }
.marquee.rev .track { animation-direction: reverse; animation-duration: 52s; }
.track span { font-weight: 600; font-size: clamp(1.2rem, 2.4vw, 1.7rem); letter-spacing: 0.02em; text-transform: uppercase; opacity: .75; white-space: nowrap; }
.track i { color: var(--green); font-style: normal; font-size: 1.4rem; }
@keyframes slide { to { transform: translateX(-50%); } }
.glow { position: relative; height: clamp(260px, 38vw, 440px); display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse 45% 55% at 50% 50%, rgba(194,206,36,.75), rgba(194,206,36,.18) 55%, transparent 75%); animation: breathe 7s ease-in-out infinite; }
.glow canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.amar { position: relative; font-weight: 700; font-size: clamp(2.2rem, 6vw, 4.4rem); letter-spacing: -0.02em; }
@keyframes breathe { 0%,100% { background-size: 100% 100%; } 50% { background-size: 118% 118%; } }

/* section motion */
.sec { opacity: 0; transform: translateY(60px); filter: blur(6px); transition: opacity 1.1s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1), filter 1.1s ease; }
.sec.in { opacity: 1; transform: none; filter: none; }
.kicker { display: flex; align-items: flex-end; gap: 8px; }
.sprout { width: 54px; height: 54px; flex: none; margin-bottom: -6px; }
.gallery img, .gallery .tile { clip-path: inset(100% 0 0 0 round 24px); transition: clip-path 1.2s cubic-bezier(.7,0,.2,1), transform .8s ease; }
.gallery.in img, .gallery.in .tile { clip-path: inset(0 0 0 0 round 24px); }
.gallery.in > :nth-child(2) { transition-delay: .15s; } .gallery.in > :nth-child(3) { transition-delay: .3s; }
.case-text > * { opacity: 0; transform: translateX(-24px); transition: opacity .8s ease, transform .8s ease; }
.case.in .case-text > * { opacity: 1; transform: none; }
.case.in .case-text > :nth-child(2) { transition-delay: .1s; } .case.in .case-text > :nth-child(3) { transition-delay: .2s; } .case.in .case-text > :nth-child(4) { transition-delay: .3s; }

/* sections */
section { padding: clamp(80px, 12vw, 160px) var(--pad); }
.kicker { color: var(--green); font-size: 1.3rem; margin-bottom: 16px; }
section > h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); max-width: 16ch; }
.intro { font-size: 1.2rem; max-width: 52ch; margin-top: 24px; opacity: 0.85; }

.manifesto .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 48px); margin-top: 64px; }
@media (max-width: 860px) { .manifesto .cols { grid-template-columns: 1fr; } }
.manifesto article { background: var(--soft); border-radius: 28px; padding: 32px; }
.num { color: var(--lime); font-size: 2.6rem; display: block; margin-bottom: 18px; -webkit-text-stroke: 0.5px var(--ink); }
.manifesto h3 { font-size: 1.6rem; margin-bottom: 12px; }

/* projects */
.case { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: center; margin-top: clamp(56px, 8vw, 110px); }
.case.reverse .case-art { order: 2; }
@media (max-width: 860px) { .case { grid-template-columns: 1fr; } .case.reverse .case-art { order: 0; } }
.case-art { aspect-ratio: 4 / 3; border-radius: 32px; overflow: hidden; background: var(--soft); box-shadow: 0 30px 60px -40px rgba(65,60,54,.45); }
.case-art canvas { width: 100%; height: 100%; display: block; }
.art-mcs { background: var(--ink); }
.art-suteki { background: #F7E9F4; }
.tag { color: var(--pink); font-size: 1.2rem; margin-bottom: 8px; }
.case h3 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); margin-bottom: 20px; }
.case-text p + p { margin-top: 14px; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 14px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.facts b { min-width: 90px; font-weight: 600; color: var(--green); }

/* galleries */
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 4 / 3; }
.gallery > * { border-radius: 24px; overflow: hidden; width: 100%; height: 100%; object-fit: cover; display: block; box-shadow: 0 30px 60px -40px rgba(65,60,54,.45); }
.gallery .big { grid-row: 1 / 3; }
.gallery img { transition: transform .8s ease; }
.gallery img:hover { transform: scale(1.03); }
.gallery .tile { background: #F7E9F4; }
.gallery .tile canvas { width: 100%; height: 100%; display: block; }
.case.reverse .gallery { order: 2; }
@media (max-width: 860px) { .case.reverse .gallery { order: 0; } }
.one { font-size: clamp(1.25rem, 2.2vw, 1.6rem); max-width: 22ch; }
.link { display: inline-block; margin-top: 22px; color: var(--green); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--lime); }

.links { display: flex; flex-wrap: wrap; gap: 18px; }

/* past projects carousel */
.past { padding-right: 0; }
.past-head { display: flex; justify-content: space-between; align-items: center; padding-right: var(--pad); }
.past-nav { display: flex; gap: 10px; }
.arrow { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 1.2rem; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.arrow:hover { background: var(--ink); color: var(--cream); transform: scale(1.06); }
.carousel { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 28px; cursor: grab; -webkit-overflow-scrolling: touch; }
.carousel::-webkit-scrollbar { display: none; }
.carousel.dragging { cursor: grabbing; scroll-snap-type: none; }
.track-cards { display: flex; gap: 20px; padding: 6px var(--pad) 30px 0; width: max-content; }
.card { scroll-snap-align: start; width: clamp(240px, 30vw, 380px); text-decoration: none; color: inherit; opacity: 0; transform: translateY(30px) scale(.96); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.past.in .card { opacity: 1; transform: none; }
.card-img { aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: var(--soft); box-shadow: 0 24px 50px -36px rgba(65,60,54,.55); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s cubic-bezier(.2,.8,.2,1), filter .5s; filter: saturate(.92); }
.card:hover .card-img img { transform: scale(1.07); filter: saturate(1.1); }
.card:hover { transform: translateY(-6px); }
.card-text { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.card-text .dot { color: var(--green); font-size: .95rem; }
.card-text b { font-size: 1.25rem; font-weight: 600; }
.behance { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .sec, .case-text > * { opacity: 1; transform: none; filter: none; transition: none; }
  .gallery img, .gallery .tile { clip-path: none; }
  .wave span, .dots i, .glow { animation: none; } .card { opacity: 1; transform: none; } }

.chips { list-style: none; padding: 0; margin: 18px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 999px; padding: 5px 14px; font-size: .95rem; }

/* interactive textures */
.play { cursor: crosshair; touch-action: pan-y; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.glow .fx { z-index: 0; } .glow .amar { z-index: 1; pointer-events: none; }
.hint { position: absolute; bottom: 14px; right: 18px; font-size: 1.15rem; color: var(--green); opacity: .7; animation: pulse 2.4s ease-in-out infinite; }
.split span { display: inline-block; opacity: 0; transform: translateY(40px) rotate(4deg); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.band.in .split span { opacity: 1; transform: none; }

/* contact form */
.write { display: grid; justify-items: center; }
.form { width: min(560px, calc(100vw - 32px)); text-align: left; display: grid; gap: 12px; margin-top: 4px; background: color-mix(in srgb, var(--cream) 14%, transparent); border: 1px solid color-mix(in srgb, var(--cream) 40%, transparent); border-radius: 26px; padding: 22px; backdrop-filter: blur(6px); animation: unfold .6s cubic-bezier(.2,.8,.2,1); }
@keyframes unfold { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
.form label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-weight: 600; font-size: .95rem; }
.form label input, .form label textarea { flex-basis: 100%; }
button.cta { font: inherit; font-weight: 600; cursor: pointer; border: 0; }
.form small { font-weight: 400; opacity: .75; }
.form input, .form textarea { font: inherit; color: var(--ink); background: var(--cream); border: 0; border-radius: 14px; padding: 11px 14px; outline: 2px solid transparent; transition: outline-color .2s; }
.form input:focus, .form textarea:focus { outline-color: var(--lime); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.send { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cta.ghost { background: transparent; color: var(--cream); border: 1.5px solid var(--cream); }
.cta.ghost:hover { background: var(--cream); color: var(--ink); }
.form .err { color: var(--ink); background: var(--lime); border-radius: 10px; padding: 6px 10px; font-weight: 600; }
.write.open .open-form { animation: none; }
.form-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .7s cubic-bezier(.2,.8,.2,1), opacity .5s ease, margin .5s ease; margin-top: 0; }
.form-wrap > .form { overflow: hidden; min-height: 0; animation: none; }
.write.open .form-wrap { grid-template-rows: 1fr; opacity: 1; margin-top: 18px; }
.write:not(.open) .form { padding-block: 0; border-width: 0; }
.open-form { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 34px; position: relative; animation: nudge 3.2s ease-in-out infinite; }
.open-form .b1 { font-size: 1.15rem; }
.open-form .b2 { font-size: .85rem; font-weight: 400; opacity: .7; }
.open-form::after { content: ""; position: absolute; inset: -2px; border-radius: 999px; border: 2px solid var(--lime); opacity: 0; animation: ring 3.2s ease-out infinite; pointer-events: none; }
.write.open .open-form::after { animation: none; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 76% { transform: translateY(-4px) rotate(-2deg); } 82% { transform: translateY(0) rotate(2deg); } 88% { transform: translateY(-2px) rotate(-1deg); } }
@keyframes ring { 0%, 60% { opacity: 0; transform: scale(1); } 70% { opacity: .9; } 100% { opacity: 0; transform: scale(1.35, 1.6); } }

/* neon: titles light up as people grow connections */
.play { --glow: 0; --neon: #F28BE8; }
/* letters stay black; only their outline lights up like neon */
.hero h1, .hero .dot, .amar { color: var(--ink);
  text-shadow: 0 0 calc(var(--glow) * 1px) #fff, 0 0 calc(var(--glow) * 3px) #fff, 0 0 calc(var(--glow) * 7px) #fff,
    0 0 calc(var(--glow) * 16px) rgba(255,255,255,.95), 0 0 calc(var(--glow) * 32px) rgba(255,255,255,.8); }
.hero h1, .hero .dot { pointer-events: auto; cursor: default; white-space: nowrap; }
.hero h1 .ch, .hero .dot .ch { display: inline-block; will-change: transform; }
.contact h2 { color: #fff; text-shadow: 0 0 calc(var(--glow) * 4px) #fff, 0 0 calc(var(--glow) * 14px) #fff, 0 0 calc(var(--glow) * 34px) rgba(255,255,255,.9), 0 0 calc(var(--glow) * 80px) rgba(255,255,255,.7); }

/* Suteki: videos first */
.case.reverse .videos { order: 2; }
@media (max-width: 860px) { .case.reverse .videos { order: 0; } }
.videos { display: grid; gap: 12px; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer; border-radius: 24px; overflow: hidden;
  background: #000 center / cover no-repeat; box-shadow: 0 30px 60px -40px rgba(65,60,54,.45); transition: transform .4s ease; }
.yt:hover { transform: translateY(-3px); }
.yt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%); }
.yt .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: var(--cream); z-index: 1;
  box-shadow: 0 0 0 0 rgba(255,252,238,.6); animation: ring-yt 2.6s ease-out infinite; transition: transform .3s; }
.yt:hover .play { transform: scale(1.08); }
.yt .play::before { content: ""; position: absolute; left: 27px; top: 21px; border-left: 20px solid var(--ink); border-top: 13px solid transparent; border-bottom: 13px solid transparent; }
@keyframes ring-yt { 0% { box-shadow: 0 0 0 0 rgba(255,252,238,.55); } 80%,100% { box-shadow: 0 0 0 22px rgba(255,252,238,0); } }
.yt .cap { position: absolute; left: 18px; bottom: 14px; z-index: 1; color: #fff; font-weight: 600; font-size: .95rem; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.more { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; align-items: start; }
.more .yt { border-radius: 18px; }
.more .yt .play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.more .yt .play::before { left: 19px; top: 14px; border-left-width: 14px; border-top-width: 10px; border-bottom-width: 10px; }
.more .igv { aspect-ratio: 4 / 5; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(20,18,16,.78); backdrop-filter: blur(6px); padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(420px, 100%); height: min(760px, 86vh); background: #fff; border-radius: 18px; animation: unfold .4s ease; }
.modal-body { border-radius: 18px; overflow: hidden; }
.modal-body, .modal-body iframe { width: 100%; height: 100%; border: 0; }
.modal-x { position: absolute; top: -14px; right: -14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: var(--cream); font-size: 22px; cursor: pointer; }
@media (max-width: 560px) { .more { grid-template-columns: 1fr 1fr; } .more .yt:not(.igv) { grid-column: 1 / -1; } }

.gallery.g-mcs { grid-template-columns: 2fr 1fr 1fr; }

/* journal */
.journal { background: var(--ink); color: var(--cream); }
.journal .kicker { color: var(--lime); }
.timeline { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 960px) { .timeline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .timeline { grid-template-columns: 1fr; } }
.timeline li { border-top: 2px solid var(--lime); padding-top: 20px; }
.timeline .when { color: var(--lime); font-size: 1.2rem; }
.timeline h3 { font-size: 1.4rem; margin: 10px 0; }
.timeline p { opacity: 0.8; }
.timeline .pending { border-top-style: dashed; opacity: 0.6; }

/* team */
.people { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 64px); margin-top: 56px; }
.person { text-align: center; }
.avatar { width: clamp(140px, 22vw, 200px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--soft); }
.avatar canvas { width: 100%; height: 100%; display: block; }
.person p { margin-top: 14px; font-weight: 600; font-size: 1.2rem; }

/* contact */
.contact { position: relative; overflow: hidden; background: var(--green); color: var(--cream); text-align: center; min-height: 70vh; display: grid; place-items: center; }
.contact-art { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 70vh; opacity: .45; }
.contact .fx { bottom: auto; height: 70vh; }
.contact-art.mirror { top: 70vh; transform: scaleY(-1); opacity: 0; transition: opacity 1s ease .2s; }
.contact:has(.write.open) .contact-art.mirror { opacity: .45; }
.contact-inner { position: relative; }
.contact h2 { font-size: clamp(3rem, 10vw, 8rem); max-width: none; }
.wave span { display: inline-block; animation: bob 2.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.dots { display: flex; gap: 10px; justify-content: center; margin: 18px 0 30px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); animation: pulse 1.4s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }

.foot { position: relative; overflow: hidden; padding: 64px var(--pad) 40px; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.foot-art { position: absolute; right: -40px; bottom: -40px; width: 320px; height: 320px; opacity: .5; pointer-events: none; }
.foot-grid { position: relative; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid > div { display: flex; flex-direction: column; gap: 8px; }
.foot-grid p.dot { color: var(--green); margin-bottom: 4px; }
.foot-grid a { text-decoration: none; opacity: .8; transition: opacity .2s, color .2s; }
.foot-grid a:hover { opacity: 1; color: var(--green); }
.foot-brand b { font-size: 1.4rem; }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .track { animation: none; }
  html { scroll-behavior: auto; }
}

.hero .fx { z-index: 1; } .glow .fx { z-index: 1; } .glow .amar { z-index: 2; position: relative; }

/* "Limpiar" button: slides in from the side when the drawing gets busy */
.clean { position: absolute; right: clamp(12px, 3vw, 28px); bottom: 28px; z-index: 5; display: flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 16px; cursor: pointer;
  opacity: 0; transform: translateX(40px); pointer-events: none; transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1), background .2s, color .2s; }
.clean.show { opacity: 1; transform: none; pointer-events: auto; }
.clean:hover { background: var(--ink); color: var(--cream); }
.clean:hover svg { animation: scrub .5s ease-in-out infinite; }
@keyframes scrub { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(-3px) rotate(-12deg); } }
.glow .clean { bottom: 52px; }
@media (max-width: 720px) { .clean span { display: none; } .clean { padding: 10px; } }
