/* =====================================================
   FERRADÁS ARCHITECTURE — DESIGN SYSTEM
   Pure CSS Editorial Architecture Magazine Website
   ===================================================== */

/* ——— CSS Custom Properties ——— */
:root {
  --bg-primary: #F3F0EA;
  --text-primary: #111111;
  --accent: #D94A1E;
  --line: #111111;
  --line-subtle: rgba(17, 17, 17, 0.15);
  --menu-bg: #D94A1E;
  --menu-text: #111111;
  --white: #ffffff;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --hero-size: clamp(80px, 12vw, 160px);
  --hero-sub-size: clamp(48px, 6vw, 90px);
  --section-title-size: clamp(60px, 8vw, 120px);
  --menu-item-size: clamp(48px, 7vw, 100px);
  --project-title-size: clamp(36px, 4vw, 64px);
  --contact-headline-size: clamp(48px, 7vw, 96px);
  --data-title-size: clamp(36px, 4vw, 56px);
  --body-size: 18px;
  --small-size: 14px;
  --label-size: 12px;
  --service-title-size: 36px;

  --max-width: 1400px;
  --side-padding: clamp(24px, 5vw, 80px);
  --section-gap: clamp(120px, 12vw, 200px);

  --transition-fast: 200ms ease;
  --transition-medium: 300ms ease;
  --transition-slow: 400ms ease;
  --menu-easing: cubic-bezier(0.25, 0.1, 0.25, 1);
  --scroll-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ——— Reset & Base ——— */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background-color: var(--accent);
  color: var(--white);
}

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

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

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ——— Typography ——— */
.heading-hero {
  font-size: var(--hero-size);
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.heading-hero-sub {
  font-size: var(--hero-sub-size);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.heading-section {
  font-size: var(--section-title-size);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.heading-menu {
  font-size: var(--menu-item-size);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--menu-text);
}

.heading-project {
  font-size: var(--project-title-size);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.heading-contact {
  font-size: var(--contact-headline-size);
  font-weight: 600;
  line-height: 0.95;
  color: var(--text-primary);
}

.heading-data {
  font-size: var(--data-title-size);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-body {
  font-size: var(--body-size);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
}

.text-small {
  font-size: var(--small-size);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
}

.text-label {
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.text-label-wide {
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.text-accent {
  color: var(--accent);
}

/* ——— Layout Containers ——— */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--side-padding);
  padding-right: var(--side-padding);
}

.section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.section-compact {
  padding-top: calc(var(--section-gap) * 0.6);
  padding-bottom: calc(var(--section-gap) * 0.6);
}

/* ——— Thin Lines ——— */
.line {
  height: 1px;
  background: var(--line);
  width: 100%;
}

.line-subtle {
  height: 1px;
  background: var(--line-subtle);
  width: 100%;
}

.line-animated {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--scroll-easing);
}

.line-animated.is-visible {
  transform: scaleX(1);
}

/* ——— Scroll Fade Animations ——— */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ——— Image Hover ——— */
.img-hover {
  overflow: hidden;
}

.img-hover img {
  transition: transform 0.4s ease-out;
  will-change: transform;
}

.img-hover:hover img {
  transform: scale(1.02);
}

/* ——— Links & CTAs ——— */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--body-size);
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.link-arrow:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.link-arrow::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* ——— Buttons ——— */
.btn-primary {
  display: inline-block;
  padding: 16px 48px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: var(--body-size);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

/* ——— Form Styles ——— */
.form-field {
  position: relative;
  margin-bottom: 32px;
}

.form-field label {
  display: block;
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-field input,
.form-field textarea {
  width: 100%;
  max-width: 600px;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--body-size);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

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

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

/* ——— Hamburger Menu Button ——— */
.hamburger {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 100;
  width: 32px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.hamburger:hover {
  transform: scale(1.05);
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.35s var(--menu-easing), opacity 0.2s ease;
  transform-origin: center;
}

.hamburger.is-open .hamburger-line:first-child {
  transform: translateY(11px) rotate(45deg);
}

.hamburger.is-open .hamburger-line:last-child {
  transform: translateY(-11px) rotate(-45deg);
}

/* ——— Off-Canvas Menu ——— */
.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 60%;
  height: 100vh;
  background: var(--menu-bg);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.35s var(--menu-easing);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--side-padding);
  overflow-y: auto;
}

.menu-overlay.is-open {
  transform: translateX(0);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.3);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--menu-easing);
}

.menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

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

.menu-item {
  border-bottom: 1px solid var(--menu-text);
  padding: 24px 0;
  overflow: hidden;
}

.menu-item:first-child {
  border-top: 1px solid var(--menu-text);
}

.menu-link {
  display: block;
  font-size: var(--menu-item-size);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--menu-text);
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: left center;
}

.menu-link:hover {
  transform: translateX(12px) scale(1.02);
}

.menu-close {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 95;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.menu-close span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--menu-text);
  position: absolute;
}

.menu-close span:first-child {
  transform: rotate(45deg);
}

.menu-close span:last-child {
  transform: rotate(-45deg);
}

.menu-overlay.is-open .menu-close {
  display: flex;
}

.menu-overlay.is-open ~ .hamburger {
  opacity: 0;
  pointer-events: none;
}

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--side-padding);
  background: var(--bg-primary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-size: var(--body-size);
  font-weight: 500;
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: var(--small-size);
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

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

.footer-copyright {
  width: 100%;
  text-align: center;
  font-size: var(--label-size);
  color: rgba(17, 17, 17, 0.5);
  margin-top: 24px;
}

/* ——— Page Transition ——— */
.page-wrapper {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.page-wrapper.is-loading {
  opacity: 0;
}

/* =====================================================
   PAGE-SPECIFIC LAYOUTS
   ===================================================== */

/* ——— Hero Section ——— */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--side-padding) 80px;
  position: relative;
  overflow: hidden;
}

.hero-label {
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.hero-title-block {
  max-width: 900px;
}

.hero-title {
  font-size: var(--hero-size);
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: var(--hero-sub-size);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-top: 0.1em;
}

.hero-line {
  width: 80px;
  height: 1px;
  background: var(--line);
  margin-top: 48px;
}

.hero-text {
  max-width: 480px;
  margin-top: 32px;
  font-size: var(--body-size);
  line-height: 1.6;
}

.hero-cta {
  margin-top: 40px;
}

/* ——— Intro Section ——— */
.intro-section {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  align-items: start;
}

.intro-left .text-body {
  font-size: 20px;
  line-height: 1.7;
}

.intro-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro-right h3 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 16px;
}

.intro-data-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-subtle);
  align-items: baseline;
}

.intro-data-row:first-of-type {
  border-top: 1px solid var(--line-subtle);
}

/* ——— Sectores Section ——— */
.sectores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 60px;
}

.sector-column h3 {
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.sector-list {
  margin-top: 16px;
}

.sector-list li {
  font-size: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-subtle);
  color: rgba(17, 17, 17, 0.8);
}

/* ——— Projects Section ——— */
.projects-editorial {
  display: flex;
  flex-direction: column;
  gap: 120px;
  margin-top: 60px;
}

.project-block {
  display: grid;
  gap: 24px;
}

.project-block-large-left {
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
}

.project-block-medium-right {
  grid-template-columns: 1fr 1.2fr;
  align-items: start;
  margin-top: 40px;
  margin-left: auto;
  width: 90%;
}

.project-block-full {
  grid-template-columns: 1fr;
  width: 85%;
  margin: 0 auto;
}

.project-info h3 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 8px;
}

.project-info p {
  font-size: 14px;
  color: rgba(17, 17, 17, 0.6);
}

.project-img img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ——— Services Section ——— */
.services-list {
  margin-top: 60px;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line-subtle);
  align-items: start;
}

.service-row:first-of-type {
  border-top: 1px solid var(--line-subtle);
}

.service-title {
  font-size: var(--service-title-size);
  font-weight: 500;
  line-height: 1.1;
}

.service-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-items li {
  font-size: var(--body-size);
  color: rgba(17, 17, 17, 0.8);
}

/* ——— Estudio Section ——— */
.estudio-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  align-items: start;
}

.estudio-portrait img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.estudio-data h2 {
  font-size: var(--data-title-size);
  font-weight: 600;
  margin-bottom: 40px;
  line-height: 1.1;
}

.estudio-data-grid {
  display: flex;
  flex-direction: column;
}

.estudio-data-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.estudio-data-row:first-of-type {
  border-top: 1px solid var(--line);
}

.estudio-bio {
  margin-top: 40px;
  font-size: 18px;
  line-height: 1.7;
  max-width: 540px;
}

/* ——— Contact Section ——— */
.contact-section {
  padding-top: 120px;
  padding-bottom: 80px;
}

.contact-headline {
  margin-bottom: 48px;
}

.contact-subtext {
  margin-bottom: 48px;
  font-size: 18px;
}

/* =====================================================
   OBRAS PAGE
   ===================================================== */

.obras-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 24px;
  margin-top: 60px;
}

.obras-grid .project-block:nth-child(3n+1) {
  grid-column: 1 / -1;
  width: 90%;
  margin: 0 auto;
}

.obras-grid .project-block:nth-child(3n+2) {
  margin-top: 60px;
}

.obras-grid .project-block:nth-child(3n+3) {
  margin-top: 0;
}

.project-link {
  display: block;
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.85;
}

/* =====================================================
   PROJECT DETAIL PAGE
   ===================================================== */

.project-hero-img {
  width: 100%;
  height: 70vh;
  object-fit: cover;
}

.project-detail-header {
  padding: 80px var(--side-padding) 0;
}

.project-detail-title {
  font-size: var(--contact-headline-size);
  font-weight: 600;
  line-height: 0.95;
  margin-bottom: 24px;
}

.project-detail-meta {
  display: flex;
  gap: 24px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(17, 17, 17, 0.6);
  margin-bottom: 16px;
}

.project-detail-services {
  font-size: 14px;
  color: rgba(17, 17, 17, 0.5);
  margin-bottom: 48px;
}

.project-description {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

.project-description p {
  font-size: 20px;
  line-height: 1.7;
}

.gallery-editorial {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 80px var(--side-padding);
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-img-wide {
  width: 100%;
  height: 50vh;
  object-fit: cover;
}

.gallery-img-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.gallery-img-half img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.gallery-img-offset {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: center;
}

.gallery-img-offset img:first-child {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.gallery-img-offset img:last-child {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.project-data-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--side-padding);
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.project-data-item h4 {
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: rgba(17, 17, 17, 0.6);
}

.project-data-item p {
  font-size: 16px;
  font-weight: 400;
}

.project-nav-footer {
  display: flex;
  justify-content: space-between;
  padding: 40px var(--side-padding);
  border-top: 1px solid var(--line-subtle);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 1024px) {
  .intro-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sectores-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-block-large-left,
  .project-block-medium-right {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 0;
  }

  .estudio-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .estudio-portrait {
    max-width: 400px;
  }

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

  .obras-grid {
    grid-template-columns: 1fr;
  }

  .obras-grid .project-block:nth-child(3n+1) {
    width: 100%;
  }

  .gallery-img-half {
    grid-template-columns: 1fr;
  }

  .gallery-img-offset {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 100px 24px 60px;
  }

  .hero-title {
    font-size: clamp(48px, 14vw, 80px);
  }

  .hero-subtitle {
    font-size: clamp(32px, 10vw, 56px);
  }

  .sectores-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .projects-editorial {
    gap: 60px;
  }

  .project-block-full {
    width: 100%;
  }

  .intro-data-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .estudio-data-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-detail-title {
    font-size: clamp(36px, 10vw, 64px);
  }

  .project-data-grid {
    grid-template-columns: 1fr 1fr;
  }
}


@media (max-width: 1024px) {
  .menu-overlay {
    width: 75%;
  }

  .hamburger {
    top: 24px;
    right: 24px;
  }

  .section {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

@media (max-width: 768px) {
  :root {
    --body-size: 16px;
    --service-title-size: 28px;
  }

  .menu-overlay {
    width: 100%;
  }

  .menu-link {
    font-size: clamp(36px, 10vw, 64px);
  }

  .hamburger {
    top: 20px;
    right: 20px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .heading-contact {
    font-size: clamp(36px, 10vw, 64px);
  }
}
