/* ═══════════════════════════════════════════════════════
   Rodrigo Vargas Fotografia — Design System
   Inspired by studiofred.fr editorial approach
   ═══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../assets/fonts/outfit-latin.woff2') format('woff2');
}

/* ── Tokens ── */
:root {
  color-scheme: dark;
  --bg: #181818;
  --bg-dark: var(--bg);
  --text: #ECE9E2;
  --text-light: #B5B3AD;
  --text-muted-dark: var(--text-light);
  --text-white: var(--text);
  --border: #383837;
  --border-strong: #666662;
  --radius: 0px;
  --font: 'Outfit', sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --pad: clamp(20px, 3vw, 40px);
  --section-gap: clamp(60px, 10vw, 120px);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible {
  outline: 3px solid #2F6FED;
  outline-offset: 4px;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s ease, color 0.3s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.header.is-transparent { color: #fff; background: transparent; }
.header.is-solid { background: var(--bg); color: var(--text); border-bottom-color: var(--border); }

.header__logo {
  font-weight: 800;
  font-size: clamp(14px, 1.2vw, 18px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.header__nav { display: flex; gap: 32px; align-items: center; }
.header__nav a {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
}
.header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1.5px;
  background: currentColor;
  transition: width 0.3s ease;
}
.header__nav a:hover::after,
.header__nav a.active::after { width: 100%; }

.header__contact {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Mobile Menu ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  width: 44px;
  height: 44px;
  padding: 9px 10px;
  z-index: 210;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: 0.3s ease;
}
.menu-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition-delay: 0s;
}
.mobile-menu a {
  color: var(--text-white);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* ── Hero ── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: var(--pad);
  padding-bottom: 60px;
}
.hero__bg {
  position: absolute;
  inset: 0;
}
.hero__bg picture {
  display: block;
  width: 100%;
  height: 100%;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg), rgba(24,24,24,0.55) 10%, transparent 28%),
              linear-gradient(to right, rgba(0,0,0,0.55), transparent 65%);
}
.hero__content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 700px;
}
.hero__eyebrow {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}
.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 550;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero__subtitle {
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 300;
  opacity: 0.8;
  margin-bottom: 32px;
  max-width: 460px;
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  transition: all 0.3s ease;
}
.hero__cta:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}
/* ── Credibility ── */
.credibility {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px var(--pad) 24px;
  max-width: 1120px;
  margin-inline: auto;
  scroll-margin-block-start: min(34vh, 256px);
}
.credibility__heading {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-wrap: balance;
}
.credibility__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline-start: 24px;
  border-inline-start: 1px solid var(--border);
}
.credibility__item--primary {
  padding-inline-start: 0;
  border-inline-start: 0;
}
.credibility__item strong {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.credibility__item span {
  color: var(--text-light);
  font-size: 13px;
}

/* ── Section ── */
.section {
  padding: var(--section-gap) var(--pad);
}
.credibility + #portfolio {
  max-width: 1120px;
  margin-inline: auto;
  padding-top: 24px;
  scroll-margin-top: 64px;
}
.credibility + #portfolio .section__header {
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 0;
}
.credibility + #portfolio .section__title {
  font-size: clamp(28px, 2.4vw, 34px);
}

@media (min-width: 1025px) {
  .credibility {
    --credibility-gutter: clamp(24px, 3vw, 40px);
    width: calc(100% - 2 * var(--pad));
    max-width: calc(1120px - 2 * var(--pad));
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    column-gap: 32px;
    row-gap: 0;
    margin-block-start: 16px;
    padding: 20px var(--credibility-gutter);
    border-block: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg), var(--text) 4%);
  }
  .credibility__heading {
    grid-row: 1;
    margin-block-end: 12px;
  }
  .credibility__item {
    min-width: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
  }
  .credibility__item--primary {
    grid-column: 1;
    grid-row: 2 / span 2;
    align-self: center;
    gap: 4px;
  }
  .credibility__item--primary strong {
    font-size: clamp(52px, 4.7vw, 64px);
    font-weight: 550;
    line-height: 1.05;
    letter-spacing: -0.045em;
  }
  .credibility__item:not(.credibility__item--primary) {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    align-items: baseline;
    gap: 16px;
    padding-block: 12px;
  }
  .credibility__item--primary + .credibility__item {
    border-block-end: 1px solid var(--border);
  }
  .credibility__item:not(.credibility__item--primary) strong {
    font-size: clamp(20px, 1.9vw, 24px);
    line-height: 1.1;
  }
  .credibility__item span {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    text-wrap: pretty;
  }
  .credibility + #portfolio {
    padding-block-start: 40px;
  }
  .credibility + #portfolio .section__header {
    margin-block-end: 20px;
  }
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.section__title {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 450;
  letter-spacing: -0.035em;
}
.section__link {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.section__link::after {
  content: ' →';
}

/* ── Category covers: natural frames in close-set independent columns ── */
.projects-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  column-gap: 36px;
  row-gap: 48px;
  align-items: start;
}
.project-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.project-column--offset {
  padding-top: 44px;
}
.project-card {
  display: block;
  position: relative;
  min-width: 0;
}
.project-card__img {
  overflow: hidden;
  border-radius: var(--radius);
}
.project-card__img img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.project-card:is(:hover, :focus-visible) .project-card__title {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.project-card__info {
  padding-bottom: 12px;
}
.project-card__title {
  font-weight: 500;
  font-size: clamp(16px, 1.4vw, 20px);
  letter-spacing: -0.01em;
}
.project-card__cat {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

.project-card--panorama { grid-column: 1 / -1; }

/* ── Gallery Page ── */
.gallery-header {
  padding: 140px var(--pad) 0;
}
.gallery-header__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 40px;
}
.gallery-header__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 450;
  letter-spacing: -0.035em;
}
.gallery-header__count {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 400;
}
.gallery-header__details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 32px;
  margin: -12px 0 42px;
}
.gallery-header__intro {
  flex: 1 1 560px;
  max-width: 760px;
  color: var(--text-light);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.7;
}
.gallery-header__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: border-color 0.3s;
}
.gallery-header__contact:hover { border-color: var(--text); }

.gallery-grid {
  columns: 3;
  column-gap: 1.75rem;
  padding: 0 var(--pad) var(--section-gap);
}
.gallery-item {
  display: block;
  break-inside: avoid;
  overflow: hidden;
  border-radius: var(--radius);
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  margin-bottom: 1.75rem;
  width: 100%;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease);
}
.gallery-item:hover img {
  transform: scale(1.04);
}

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
#lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition-delay: 0s;
}
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.lb-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #F2F0ED;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
  line-height: 1;
}
.lb-close:hover { opacity: 1; }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #F2F0ED;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
  padding: 20px;
  line-height: 1;
}
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #F2F0ED;
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* ── About Page ── */
.about-hero {
  padding: 140px var(--pad) 40px;
}
.about-hero__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 450;
  letter-spacing: -0.035em;
}
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  padding: 40px var(--pad) var(--section-gap);
  align-items: start;
}
.about-content__img {
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 100px;
}
.about-content__img img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.about-content__text h2 {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 32px;
}
.about-content__text p {
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 20px;
}
.about-content__text strong {
  color: var(--text);
  font-weight: 550;
}
.about-content__meta {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted-dark);
  line-height: 2;
}
.about-content__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}
.about-content__cta:hover {
  border-color: var(--text);
}

/* ── Contact Page ── */
.contact-hero {
  padding: 140px var(--pad) 40px;
}
.contact-hero__label {
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 300;
  color: var(--text-light);
  margin-bottom: 8px;
}
.contact-hero__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 450;
  letter-spacing: -0.035em;
}
.contact-hero__intro {
  margin: 8px 0 22px;
  color: var(--text-light);
  font-size: clamp(16px, 1.3vw, 18px);
  text-wrap: pretty;
}
.contact-hero__whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 2px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.3s;
}
.contact-hero__whatsapp:hover { opacity: 0.85; }
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  padding: 0 var(--pad) var(--section-gap);
}
.contact-form__title {
  margin: 0 0 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500;
}
.contact-form label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 32px;
  outline: none;
  transition: border-color 0.3s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-light);
  opacity: 1;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-bottom-color: var(--text);
}
.contact-form textarea { resize: vertical; min-height: 100px; }
.contact-form button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color 0.3s;
}
.contact-form button:hover { border-color: var(--text); }
.contact-form button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.field-label__optional {
  text-transform: none;
  letter-spacing: normal;
}
.form-expectation {
  margin: -14px 0 24px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
}
.form-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
}
.form-status[hidden] { display: none; }
.form-status.is-success {
  background: #E7F4EA;
  color: #245C30;
}
.form-status.is-error {
  background: #FBE9E7;
  color: #8A2E24;
}
.form-status a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-info {
  padding-top: 8px;
}
.contact-info__block {
  margin-bottom: 40px;
}
.contact-info__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.contact-info__value {
  font-size: 18px;
  font-weight: 500;
}
.contact-info__value a {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.3s;
}
.contact-info__value a:hover { border-color: var(--text); }

/* ── Footer ── */
.footer {
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
  padding: var(--section-gap) var(--pad) 40px;
}
.footer__cta { margin-bottom: 60px; }
.footer__cta-label {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-muted-dark);
  margin-bottom: 18px;
}
.footer__cta-link {
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: 450;
  letter-spacing: -0.03em;
  display: inline-block;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 8px;
  transition: opacity 0.3s;
}
.footer__cta-link:hover { opacity: 0.7; }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.footer__col-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted-dark);
  margin-bottom: 14px;
}
.footer__col a,
.footer__col p {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
  transition: opacity 0.3s;
}
.footer__col a:hover { opacity: 0.6; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 80px;
  font-size: 12px;
  color: var(--text-muted-dark);
}

/* ── Scroll Reveal ── */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Page Load Animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero__content { animation: fadeUp 0.55s ease 0.05s both; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid {
    columns: 2;
    column-gap: 1.5rem;
  }
  .about-content { grid-template-columns: 1fr; }
  .about-content__img { position: static; }
  .contact-content { grid-template-columns: 1fr; }
  .credibility { grid-template-columns: 1fr; gap: 18px; }
  .credibility__item {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .header__nav { display: none; }
  .header__contact { display: none; }
  .menu-toggle { display: block; }
  .hero { min-height: 500px; padding-bottom: 40px; }
  .hero__title { font-size: 36px; }
  .gallery-header { padding-top: 100px; }
  .gallery-grid {
    columns: 1;
    column-gap: 0;
  }
  .gallery-item {
    margin-bottom: 1.5rem;
  }
  .about-hero { padding-top: 100px; }
  .contact-hero { padding-top: 100px; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .footer__bottom { flex-direction: column; gap: 8px; }
  .lb-nav { font-size: 28px; padding: 12px; }
}

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
