:root {
  --bg: #0d0d0d;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.75);
  --field-bg: rgba(217, 217, 217, 0.15);
  --field-border: rgba(255, 255, 255, 0.25);
  --accent: #f5c518;
  --max-width: 1280px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-display: 'Syne', 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
}

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

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

/* Degradé original de Figma (assets/degrade.svg rasterizado a degrade.webp) */
.bg-glow {
  position: absolute;
  inset: 0;
  background: url('assets/degrade.webp') center top / 229% 100% no-repeat;
  z-index: 0;
  pointer-events: none;
}

header, main, footer { position: relative; z-index: 1; }

.navbar { z-index: 10; }

.rule {
  display: block;
  width: 76px;
  height: 2px;
  background: var(--white);
  margin-bottom: 24px;
}

/* Navbar */
.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px 0;
}

.brand img { width: 110px; height: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.nav-links .dot { opacity: 0.4; }

.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  display: block;
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px 40px 0;
}

.section-heading h2 { margin: 0; }

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 16px; letter-spacing: -0.01em; }

h1 {
  font-weight: 800;
  font-size: 64px;
  line-height: 1.1;
  max-width: 560px;
}

h2 {
  font-weight: 800;
  font-size: 64px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 96px;
}

.hero h1 { font-size: 54px; max-width: 640px; }

.hero-lead {
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-photo {
  justify-self: end;
  width: 100%;
  max-width: 528px;
  aspect-ratio: 1 / 1;
  position: relative;
  perspective: 900px;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform;
}

/* About */
.about-text {
  columns: 2;
  column-gap: 48px;
  margin-top: 40px;
}

.about-text p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 18px;
  break-inside: avoid;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  margin-top: 48px;
}

.service {
  border-top: 1px solid var(--field-border);
  padding-top: 24px;
}

.service h3 { font-size: 26px; font-weight: 700; margin-bottom: 12px; }

.service p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 56px;
  align-items: start;
}


.project { display: block; }

.project-media {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
  transition: transform 0.25s ease;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-cta {
  position: absolute;
  inset: auto 16px 16px auto;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--accent);
  color: #111;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.project:hover .project-media,
.project:focus-visible .project-media { transform: translateY(-4px); }
.project:hover .project-media img { transform: scale(1.03); }
.project:hover .project-cta,
.project:focus-visible .project-cta { opacity: 1; transform: none; }
.project:hover .project-caption h3,
.project:hover .project-caption h4 { color: var(--accent); }

.projects-sub { margin-top: 96px; }

.projects-subtitle {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
}

.projects-grid--pair { margin-top: 32px; }

.project--tall .project-media { aspect-ratio: 525 / 742; }
.project--wide .project-media { aspect-ratio: 526 / 372; }
.project--square .project-media { aspect-ratio: 1 / 1; }

/* Featured grid: tall poster on the left spanning two rows, the rest in pairs */
.projects-grid--featured { row-gap: 48px; }
.projects-grid--featured .project--tall { grid-row: span 2; }

.projects-grid--trio { grid-template-columns: repeat(3, 1fr); }
.projects-grid--trio .project-caption h4 { font-size: 22px; }

.project-caption .project-tag { margin-top: 10px; }

.project-caption { padding: 16px 0 0; }

.project-caption h3,
.project-caption h4 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
  transition: color 0.2s ease;
}

.project-caption p {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}

/* Project detail pages */
.project-page { padding-top: 80px; }

.back-link {
  display: inline-flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 48px;
}

.back-link:hover { color: var(--accent); }

.project-hero h1 { max-width: 900px; font-size: 56px; }

.project-kicker {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.project-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  margin-top: 40px;
}

.project-body p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 18px;
}

.project-meta { margin: 0; display: grid; gap: 20px; align-content: start; }
.project-meta div { border-top: 1px solid var(--field-border); padding-top: 12px; }
.project-meta dt { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.project-meta dd { margin: 0; font-size: 18px; }

.project-gallery { display: grid; gap: 32px; margin-top: 72px; }

.project-gallery figure { margin: 0; }

.project-gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #1a1a1a;
}

.project-gallery .is-narrow img { max-width: 720px; margin: 0 auto; }

.project-gallery figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

/* Case study sections */
.project-hero .project-tag { margin: 0 0 16px 12px; vertical-align: 2px; }

.project-cover { margin: 48px 0 0; }
.project-cover img,
.project-cover video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #1a1a1a;
}
.project-cover.is-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.project-cover .media-placeholder { aspect-ratio: 16 / 10; }

.project-body { margin-top: 64px; }
.project-description h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
}
.project-description h2 ~ h2 { margin-top: 32px; }

.project-meta dd a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.project-meta dd a:hover { color: #ffd84d; }

.case-gallery { margin-top: 72px; }
.case-gallery h2 { font-size: 32px; font-weight: 800; margin: 0 0 24px; }
.case-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.case-gallery-grid figure { margin: 0; }
.case-gallery-grid img,
.case-gallery-grid video { display: block; width: 100%; height: auto; border-radius: 4px; }
.case-gallery-grid .media-placeholder { aspect-ratio: 4 / 3; }
.case-gallery-grid .is-wide { grid-column: 1 / -1; }
.case-gallery-grid .is-wide .media-placeholder { aspect-ratio: 16 / 9; }

/* Placeholder until the real image is added */
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px dashed var(--field-border);
  border-radius: 4px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 12px, transparent 12px 24px),
    rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-tag {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--field-border);
}

.project-pager a { display: flex; flex-direction: column; gap: 6px; }
.project-pager a:last-child { text-align: right; }
.project-pager span { font-size: 14px; color: var(--muted); }
.project-pager strong { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.project-pager a:hover strong { color: var(--accent); }

.project-contact {
  text-align: center;
  padding-bottom: 40px;
}

.project-contact .rule { margin: 0 auto 24px; }

.project-contact p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

.btn-link {
  display: inline-block;
  padding: 10px 38px;
  background: var(--accent);
  color: #111;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-link:hover { background: #ffd84d; transform: translateY(-2px); }

.btn-link--ghost {
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--field-border);
}

.btn-link--ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--accent); }

/* Experience */
.experience-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  margin-top: 48px;
  align-items: start;
}

.experience-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
}

.skills .experience-title { margin-top: 40px; }
.skills .experience-title:first-child { margin-top: 0; }

.xp-list { list-style: none; margin: 0; padding: 0; }

.xp-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  border-top: 1px solid var(--field-border);
  padding: 20px 0;
}

.xp-date {
  margin: 4px 0 0;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.xp-item h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.xp-role { margin: 0 0 8px; color: var(--accent); font-size: 16px; }

.xp-item p:not(.xp-date):not(.xp-role) {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips li {
  padding: 6px 16px;
  border: 1px solid var(--field-border);
  border-radius: 20px;
  font-size: 15px;
}

.plain-list { margin: 0; padding-left: 18px; }

.plain-list li {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Contact */
.contact {
  position: relative;
  padding-bottom: 100px;
}

.contact-illustration {
  position: absolute;
  left: 0;
  top: 40px;
  width: 40%;
  max-width: 480px;
  z-index: -1;
  opacity: 0.9;
  animation: float 7s ease-in-out infinite;
}

/* La ilustración de contacto flota lentamente */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .contact-illustration { animation: none; }
}

.contact-inner {
  margin-left: auto;
  max-width: 600px;
}

.contact h2 { font-size: 48px; line-height: 1.1; }

.contact-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 12px;
}

.contact-note {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
  margin-bottom: 40px;
}

.contact-note a { color: var(--white); text-decoration: underline; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
}

.field input,
.field textarea {
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 2px;
  padding: 8px 12px;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-submit {
  align-self: flex-start;
  margin-top: 8px;
  padding: 10px 38px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 20px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-submit:hover { background: #ffd84d; transform: translateY(-2px); }

.btn-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.form-status {
  font-size: 14px;
  margin: 0;
  min-height: 1.4em;
  color: var(--muted);
}

.form-status[data-type="success"] { color: #7ee2a8; }
.form-status[data-type="error"] { color: #ff8a80; }

.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Footer */
.social-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 40px 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.social-footer .dot { opacity: 0.3; }
.social-footer a:hover { color: var(--white); }

/* Responsive */
@media (max-width: 960px) {
  .bg-glow { background-size: 250% auto; background-repeat: repeat-y; }
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .hero-photo { justify-self: center; max-width: 340px; order: -1; }
  .hero h1 { font-size: 44px; }
  .about-text { columns: 1; }
  .services-grid { grid-template-columns: 1fr; }
  .experience-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact h2 { font-size: 40px; }
  .projects-grid,
  .projects-grid--trio { grid-template-columns: 1fr; gap: 40px; }
  .projects-grid--featured .project--tall { grid-row: auto; }
  .project-body { grid-template-columns: 1fr; gap: 40px; }
  .project-hero h1 { font-size: 40px; }
  .contact-illustration { display: none; }
  .contact-inner { margin: 0 auto; }
  h1, h2 { font-size: 40px; }
}

@media (max-width: 640px) {
  .navbar { padding: 20px 20px 0; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    right: 20px;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px 20px;
    gap: 12px;
    z-index: 10;
  }
  .nav-links.open .dot { display: none; }
  .nav-toggle { display: flex; }
  .section { padding: 80px 20px 0; }
  h1, h2 { font-size: 32px; }
  .about-text p { font-size: 16px; }
  .hero h1 { font-size: 34px; }
  .hero-lead { font-size: 17px; }
  .service h3 { font-size: 22px; }
  .service p { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .project-caption h3,
  .project-caption h4 { font-size: 22px; }
  .projects-sub { margin-top: 64px; }
  .projects-subtitle { font-size: 26px; }
  .xp-item { grid-template-columns: 1fr; gap: 6px; }
  .experience-title { font-size: 22px; }
  .contact h2 { font-size: 32px; }
  .contact-lead { font-size: 16px; }
  .project-cta { opacity: 1; transform: none; font-size: 12px; padding: 6px 14px; }
  .project-hero h1 { font-size: 32px; }
  .project-body p { font-size: 16px; }
  .project-pager { grid-template-columns: 1fr; }
  .case-gallery-grid { grid-template-columns: 1fr; }
  .case-gallery h2 { font-size: 26px; }
  .project-pager a:last-child { text-align: left; }
  .social-footer { flex-wrap: wrap; padding: 32px 20px; }
}
