/* ===== Design tokens ===== */
:root {
  --cream: #FFFEEE;
  --dark: #591C11;
  --terracotta: #EF4F00;
  --terracotta-soft: #E45F21;
  --gray: #6B6B6B;
  --white: #FFFFFF;

  --font-display: 'Space Grotesk', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --container: 1152px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.14'/%3E%3C/svg%3E");
  color: var(--dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  cursor: url('../assets/img/cursor-star.png') 15 15, auto;
}
img { max-width: 100%; display: block; }
a, button {
  color: inherit; text-decoration: none;
  cursor: url('../assets/img/cursor-star.png') 15 15, pointer;
}
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ===== Nav ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 64px;
  flex-wrap: wrap;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
}
.navbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--dark);
}
.navbar .logo svg { width: 18px; height: 18px; fill: var(--terracotta); }
.navbar nav { display: flex; align-items: center; gap: 24px; }
.navbar nav a.link { font-size: 14px; font-weight: 500; color: var(--dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: transform .3s cubic-bezier(.16,.8,.3,1), opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--terracotta);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.outline {
  background: transparent;
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
}

/* ===== Hero (home) ===== */
.hero {
  padding: 240px 64px 56px;
  display: flex;
  align-items: flex-end;
  background-image: radial-gradient(ellipse 900px 500px at top right, rgba(243,230,223,0.9) 0%, rgba(243,230,223,0) 70%);
}
.hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: 40px;
  flex-wrap: wrap;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7.5vw, 98px);
  line-height: 1.04;
  color: var(--terracotta);
  margin: 0;
}
.hero-side { max-width: 400px; }
.hero-side .kicker {
  color: var(--terracotta-soft);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-side .lede { color: var(--gray); font-size: 16px; line-height: 1.5; margin: 0; }

/* ===== Proyectos (home) — editorial list ===== */
.projects { padding: 80px 64px 90px; }
.projects-head { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid rgba(50,9,1,0.12); }
.projects-head .selected-work {
  font-family: var(--font-mono);
  color: var(--dark);
  font-size: 13px;
  margin: 0;
}

.hairline { height: 1px; background: rgba(50,9,1,0.12); margin: 0 64px 40px; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 40px;
}
.project-card { display: block; }
.project-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 12px;
}
.project-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.16,.8,.3,1);
}
.project-card-img.dark img, .project-card-img.light img { object-fit: contain; }
.project-card-img.dark { background: #19191b; }
.project-card-img.light { background: #fff; }
.project-card:hover .project-card-img img { transform: scale(1.04); }
.project-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.project-card-row .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--dark);
  transition: color .3s;
}
.project-card-row .title svg { width: 15px; height: 15px; transition: transform .35s cubic-bezier(.16,.8,.3,1); }
.project-card:hover .title { color: var(--terracotta); }
.project-card:hover .title svg { transform: rotate(45deg); }
.project-card-row .date { color: var(--gray); font-size: 13.5px; flex-shrink: 0; }

@media (max-width: 700px) {
  .project-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav-toggle { display: flex; }
  .navbar nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 18px;
    padding-top: 20px;
  }
  .navbar nav.open { display: flex; }
}
/* ===== Footer / Charlemos ===== */
.footer {
  padding: 64px 64px 96px;
}
.footer .kicker-small {
  font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--dark);
  text-transform: uppercase; margin-bottom: 16px;
}
.footer h2 {
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 10vw, 96px);
  color: var(--terracotta);
  margin: 0 0 32px;
  line-height: 1;
}
.footer .links { display: flex; gap: 28px; }
.footer .links a { font-size: 14px; font-weight: 500; }

/* ===== About page ===== */
.about-stack {
  display: flex; flex-direction: column; align-items: center;
  gap: 44px; max-width: 592px; margin: 0 auto; padding: 80px 24px;
}
.about-hero { text-align: center; }
.about-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 38px); margin: 0; }
.star-photo {
  width: 370px; height: 370px;
  object-fit: contain;
  display: block;
  transition: transform .6s cubic-bezier(.16,.8,.3,1);
}
.star-photo:hover { transform: scale(1.03) rotate(-2deg); }
.about-body { width: 100%; }
.about-body p { color: var(--dark); font-size: 16px; line-height: 1.5; margin: 0 0 20px; }
.about-body p:last-child { margin-bottom: 0; }

.quick-profile {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding: 16px 64px 64px;
}
.quick-profile .col { white-space: nowrap; }
.quick-profile .col .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 8px; }
.quick-profile .col p { font-size: 13.5px; line-height: 1.5; margin: 0; }

/* ===== Project case study page ===== */
.p-nav {
  display: flex; align-items: center;
  padding: 24px 64px; flex-wrap: wrap; gap: 16px;
  position: sticky; top: 0; z-index: 100;
  background: var(--cream);
}
.p-nav .back { font-size: 13px; font-weight: 500; color: var(--dark); }

.p-hero { text-align: center; padding: 88px 160px 40px; }
.p-hero h1 { font-family: var(--font-body); font-weight: 600; font-size: clamp(26px, 4vw, 42px); line-height: 1.22; max-width: 860px; margin: 0 auto; color: var(--dark); }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 48px;
  padding: 40px 64px 48px; border-bottom: 1px solid rgba(17,17,17,0.12);
}
.meta-row .col .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 6px; }
.meta-row .col p { margin: 0; font-size: 13.5px; }

.p-row { display: flex; align-items: center; gap: 64px; padding: 56px 64px; }
.p-row.reverse { flex-direction: row-reverse; }
.p-row .text { flex: 0 0 460px; }
.p-row .text .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 12px; }
.p-row .text h3 { font-family: var(--font-display); font-size: 26px; margin: 0 0 12px; }
.p-row .text p { color: var(--gray); font-size: 14px; line-height: 1.58; margin: 0; }
.p-row .text p.dark-copy { color: var(--dark); }
.p-row .img { flex: 1; height: 340px; }
.p-row .img img { width: 100%; height: 340px; object-fit: contain; }

.p-system {
  padding: 56px 64px;
}
.p-system .frame {
  display: flex; align-items: center; gap: 40px;
  height: 320px; padding: 0 40px;
}
.p-system .img { flex: 0 0 55%; height: 100%; overflow: hidden; }
.p-system .img img { width: 100%; height: 100%; object-fit: contain; }
.p-system .text { flex: 1; }
.p-system .text .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.p-system .text h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 10px; }
.p-system .text p { color: var(--gray); font-size: 13.5px; line-height: 1.55; margin: 0; }

.p-proceso { padding: 56px 64px; }
.p-proceso .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 20px; }
.p-proceso .step { display: flex; gap: 20px; padding: 22px 0; align-items: baseline; }
.p-proceso .step .num { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--terracotta); flex: 0 0 auto; }
.p-proceso .step p { margin: 0; font-size: 14px; }
.p-proceso .strip { display: flex; gap: 16px; margin-top: 48px; flex-wrap: wrap; }
.p-proceso .strip img { flex: 1; min-width: 220px; height: 260px; object-fit: contain; }

.p-mi-aporte { padding: 8px 64px; }
.p-mi-aporte .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.p-mi-aporte p { font-size: 14px; max-width: 700px; margin: 0; }

.p-resultado { padding: 64px; }
.p-resultado .panel { padding: 48px 56px; }
.p-resultado .label { color: var(--terracotta); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 16px; }
.p-resultado p { font-family: var(--font-body); font-weight: 500; font-size: 22px; line-height: 1.45; margin: 0; color: var(--dark); }
.p-resultado p.semibold { font-weight: 600; }

.p-cta { display: flex; flex-direction: column; align-items: center; gap: 30px; padding: 16px 0 64px; }
.p-cta .pill.outline { border-color: var(--terracotta-soft); color: var(--terracotta-soft); border-radius: 28px; padding: 14px 28px; }
.p-cta .pill.outline:hover { background: var(--terracotta-soft); color: var(--white); }
.p-cta .caption { font-style: italic; font-size: 11px; color: var(--dark); text-align: center; margin: 0; }

/* ===== Motion ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.16,.8,.3,1), transform .7s cubic-bezier(.16,.8,.3,1);
  }
  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal-stagger.in > * { transition-delay: calc(var(--i, 0) * 90ms); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

.spin-slow { animation: spin-slow 18s linear infinite; transform-origin: center; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* link underline sweep */
.links a, .navbar nav a.link, .p-next .row a {
  position: relative;
}
.links a::after, .navbar nav a.link::after {
  content: "";
  position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s cubic-bezier(.16,.8,.3,1);
}
.links a:hover::after, .navbar nav a.link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* pill buttons */
.pill { transition: transform .35s cubic-bezier(.16,.8,.3,1), background .25s, color .25s, box-shadow .25s; }
.pill:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(228,95,33,.25); }
.pill.outline:hover { background: var(--terracotta); color: var(--white); }

.p-row .img { overflow: hidden; }

/* fade-in page load */
body { animation: page-in .5s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .navbar, .p-nav, .hero, .hairline, .footer, .p-hero, .meta-row, .p-row, .p-proceso, .p-mi-aporte, .p-resultado, .quick-profile, .projects {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  .hero { padding-top: 100px !important; padding-bottom: 48px !important; }
  .hero-inner { gap: 24px; }
  .quick-profile { flex-direction: column; gap: 28px; }
  .quick-profile .col { white-space: normal; }
  .p-row, .p-row.reverse { flex-direction: column; gap: 24px; }
  .p-row .text { flex: none; }
  .p-hero { padding-left: 24px; padding-right: 24px; }
  .p-system .frame { flex-direction: column; height: auto; padding: 24px; }
  .p-system .img { flex-basis: auto; width: 100%; height: 220px; }
}
