/* =====================================================
   SEBA GOMEZ — PORTFOLIO
   styles.css
   ===================================================== */

/* ── Custom Properties ── */
:root {
  --black:    #1e1e1e;
  --white:    #ffffff;
  --gray-100: #f4f4f4;
  --gray-200: #e6e6e6;
  --gray-500: #888888;
  --gray-700: #444444;

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --max-w: 960px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img  { display: block; max-width: 100%; height: auto; }
a    { color: inherit; text-decoration: none; }
.text-link {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}
.text-link:hover { opacity: 0.7; }
ul   { list-style: none; }

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.nav { padding: 1.75rem 0; border-bottom: 1px solid #E5EDF5; }
.nav .container { display: flex; justify-content: flex-end; }

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.9375rem;
  transition: opacity 0.2s ease;
}
.nav-links a:hover { opacity: 0.45; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--gray-200);
  padding: 1.75rem 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-contact { font-size: 0.9375rem; }
.footer-contact a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}
.footer-contact a:hover { opacity: 0.45; }

/* =====================================================
   HOME — HERO
   ===================================================== */
.hero { padding: 4rem 0 5rem; }

.hero-greeting {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.4rem;
}

.hero-headline {
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* =====================================================
   HOME — PROJECTS GRID
   ===================================================== */
.work-section { padding-bottom: 2rem; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem 2.5rem;
}

.project-card { display: block; }
.project-card:hover .card-thumb { opacity: 0.82; }

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
  overflow: hidden;
  transition: opacity 0.25s ease;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-info { padding-top: 1.125rem; }

.card-title {
  font-size: 2rem; /* 32px */
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 1rem; /* 16px */
  color: var(--gray-700);
  line-height: 1.65;
}

/* =====================================================
   PROJECT PAGE — BODY WRAPPER
   ===================================================== */
.project-body {
  max-width: var(--max-w);
  margin: 0 auto;
  border-left: 1px solid #E5EDF5;
  border-right: 1px solid #E5EDF5;
  display: flow-root; /* establishes BFC — contains child margins so border runs continuously */
}

/* =====================================================
   PROJECT PAGE — HEADER
   ===================================================== */
.project-header { padding: 3.5rem 0 2.5rem; }
.project-header .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.project-title {
  font-family: var(--font-sans);
  font-size: clamp(1.875rem, 3.5vw, 2.875rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.project-tagline {
  margin-top: 1.25rem;
  font-size: 1.125rem; /* 18px */
  color: var(--black);
  line-height: 1.7;
}

.project-header-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.project-header-visual img { max-width: 100%; }

/* Full-width variant (no right visual) */
.project-header--full .container { grid-template-columns: 1fr; }
.project-header--full .project-title { max-width: 680px; }

/* =====================================================
   PROJECT PAGE — METADATA
   ===================================================== */
/* ── Open Data — two-column intro layout ── */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  gap: 4rem;
  align-items: start;
}

.intro-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.intro-meta {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Two-stats grid (open-data impact) ── */
.impact-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.5rem;
}

.impact-stats-grid .impact-stat {
  margin-top: 0;
}

.project-meta {
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem 0;
  margin-bottom: 3.5rem;
}
.project-meta .container {
  display: flex;
  justify-content: space-between;
}

.meta-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.5rem;
}
.meta-value {
  font-size: 1rem;
  line-height: 1.5;
}

/* =====================================================
   PROJECT PAGE — SECTIONS
   ===================================================== */
.project-section { margin-bottom: 3.5rem; }

.section-label {
  font-size: 1.5rem; /* 24px */
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1rem;
}

.section-body {
  font-size: 1rem; /* 16px */
  color: var(--black);
  line-height: 1.75;
}
.section-body p + p { margin-top: 0.875rem; }
.mt-24 { margin-top: 1.5rem; }

/* =====================================================
   PROJECT PAGE — IMAGES
   ===================================================== */
.project-image {
  width: 100%;
  background: var(--gray-100);
  overflow: hidden;
  margin: 2rem 0;
}
.project-image img { width: 100%; height: auto; }

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}
.image-grid .project-image { margin: 0; }

/* =====================================================
   PROJECT PAGE — IMPACT
   ===================================================== */
.impact-section { margin-bottom: 3.5rem; }

.impact-row {
  display: flex;
  gap: 5rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}

.impact-number {
  font-family: var(--font-sans);
  font-size: clamp(3.5rem, 7vw, 4rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.625rem;
}

.impact-label {
  font-size: 1rem; /* 16px */
  color: var(--black);
  line-height: 1.5;
  max-width: 280px;
}

.impact-stat {
  text-align: center;
  margin-top: 2.5rem;
}

.impact-stat .impact-label {
  max-width: none;
}

.impact-sublabel {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin-top: 0.375rem;
}

.bullet-list {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.bullet-list li {
  font-size: 1rem;
  color: var(--black);
  line-height: 1.75;
  margin-bottom: 0.25rem;
}

/* =====================================================
   PROJECT PAGE — CHALLENGES LIST
   ===================================================== */
.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  margin-top: 1.5rem;
}

.challenge-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.challenge-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--black);
  margin-top: 0.1rem;
}

.challenge-text {
  font-size: 1rem; /* 16px */
  line-height: 1.7;
  color: var(--black);
}

.challenge-text strong {
  color: var(--black);
  font-weight: 600;
}

/* =====================================================
   CHALLENGE DETAIL — PROCESS FLOW & PROBLEM CARDS
   ===================================================== */
.process-flow {
  display: flex;
  align-items: stretch;
  gap: 0.625rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.process-step {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--black);
  line-height: 1.5;
}

.process-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.problem-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.problem-card {
  background: #FDE8EC;
  border-radius: 0.75rem;
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.problem-card-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.problem-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.625rem;
}

.problem-card-desc {
  font-size: 0.875rem; /* 14px */
  color: var(--black);
  line-height: 1.6;
}

/* =====================================================
   COMPARISON BLOCKS (open-data)
   ===================================================== */
.comparison-block {
  margin-bottom: 3rem;
}

.comparison-block:last-child {
  margin-bottom: 0;
}

.comparison-header {
  display: flex;
}

.comparison-label {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--black);
  text-align: center;
}

.comparison-page-name {
  text-align: center;
  font-size: 1rem;
  color: var(--black);
  margin: 3rem 0 1rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.comparison-grid .project-image { margin: 0; }

/* =====================================================
   ARCHITECTURE DIAGRAM (modular-platform)
   ===================================================== */
.arch-diagram {
  display: flex;
  flex-direction: column;
  margin: 2rem 0;
}

.arch-level {
  border-radius: 0.75rem;
  padding: 1.75rem 2rem;
  color: #ffffff;
}

.arch-level-tag {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 0.375rem;
}

.arch-level-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.375rem;
  color: #ffffff;
}

.arch-level-desc {
  font-size: 1rem;
  opacity: 0.75;
  line-height: 1.5;
  color: #ffffff;
}

.arch-connector {
  width: 2px;
  height: 3rem;
  border-left: 2px dashed #CBD5E1;
  align-self: center;
}

.arch-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.arch-module {
  border: 1.5px solid #C026D3;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}

.arch-module-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #C026D3;
  margin-bottom: 0.375rem;
}

.arch-module-desc {
  font-size: 0.9375rem;
  color: var(--black);
}

.arch-summary {
  margin-top: 2.5rem;
  background: #EFF6FF;
  border-radius: 0.75rem;
  padding: 2rem 2.5rem;
}

.arch-summary-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.75rem;
}

.arch-summary-desc {
  font-size: 1rem;
  color: var(--black);
  line-height: 1.45;
}

/* =====================================================
   PROJECT PAGE — MOCKUPS SECTION
   ===================================================== */
.mockups-section {
  background: var(--gray-100);
  padding: 4rem 0;
  margin-bottom: 3.5rem;
}

.mockups-intro {
  font-size: 1rem;
  color: var(--black);
  margin-bottom: 2rem;
}

.mockups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.mockups-grid .project-image { margin: 0; }

/* =====================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ===================================================== */
@media (max-width: 768px) {

  /* ── Project body: remove side borders ── */
  .project-body {
    border-left: none;
    border-right: none;
  }

  /* ── Home: card grid 1 col ── */
  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-thumb {
    height: 220px;
  }

  /* ── Project header: stack text + image ── */
  .project-header .container {
    grid-template-columns: 1fr;
  }

  .project-header-visual {
    display: none;
  }

  /* ── Project meta: stack vertically ── */
  .project-meta .container {
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
  }

  /* ── Meta label size on mobile ── */
  .meta-label {
    font-size: 1.25rem;
  }

  /* ── Process flow: stack vertically ── */
  .process-flow {
    flex-direction: column;
    align-items: stretch;
  }

  .process-arrow {
    justify-content: center;
    transform: rotate(90deg);
    height: 1.25rem;
  }

  /* ── Problem cards: 1 col ── */
  .problem-cards {
    grid-template-columns: 1fr;
  }

  /* ── Image grid: 1 col ── */
  .image-grid {
    grid-template-columns: 1fr;
  }

  /* ── Mockups grid: 1 col ── */
  .mockups-grid {
    grid-template-columns: 1fr;
  }

  /* ── Architecture modules: 1 col ── */
  .arch-modules {
    grid-template-columns: 1fr;
  }

  /* ── Impact row: stack ── */
  .impact-row {
    flex-direction: column;
    gap: 2rem;
  }

  .impact-label {
    max-width: none;
  }

  /* ── Open Data intro grid: stack ── */
  .intro-grid {
    grid-template-columns: 1fr;
  }

  /* ── Footer ── */
  .site-footer .container {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
