/* ═══════════════════════════════════════════════════════════════
   ALFREDO ALANIZ BELLI — Portfolio
   Swiss Minimalist Design System (inspired by adrianhiotis.com)
   Design tokens from Stitch project 13351899424358021531
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Colors — Monochromatic Swiss palette */
  --primary: #000000;
  --on-primary: #ffffff;
  --surface: #ffffff;
  --background: #f9f9f9;
  --on-surface: #000000;
  --on-surface-subtle: #666666;
  --surface-container: #eeeeee;
  --surface-container-high: #e8e8e8;
  --surface-variant: #e2e2e2;
  --border: #000000;
  --border-subtle: #e2e2e2;
  --outline: #7e7576;
  --error: #ba1a1a;
  --inverse-surface: #2f3131;
  --inverse-on-surface: #f0f1f1;

  /* Spacing */
  --margin-mobile: 24px;
  --margin-desktop: 64px;
  --container-max: 1280px;
  --gutter: 32px;
  --section-gap: 160px;
  --unit: 8px;

  /* Typography — Inter only */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Border radius: 0px for Swiss strictness */
  --radius: 0px;
}

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-surface);
  background-color: var(--surface);
  overflow-x: hidden;
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

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

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

/* ── Typography Classes ─────────────────────────────────── */
.display-text {
  font-family: var(--font-family);
  font-size: clamp(48px, 7vw, 80px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
}

.headline-lg {
  font-family: var(--font-family);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.headline-md {
  font-family: var(--font-family);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.headline-sm {
  font-family: var(--font-family);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.3;
}

.body-lg {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
}

.label-caps {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.0;
  text-transform: uppercase;
}

.text-subtle {
  color: var(--on-surface-subtle);
}

.leading-snug {
  line-height: 1.3;
}

/* ── Layout ──────────────────────────────────────────────── */
.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--margin-mobile);
  padding-right: var(--margin-mobile);
}

@media (min-width: 768px) {
  .section-container {
    padding-left: var(--margin-desktop);
    padding-right: var(--margin-desktop);
  }
}

.border-top {
  border-top: 1px solid var(--border);
  padding-top: calc(var(--unit) * 6);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
  height: 80px;
}

@media (min-width: 768px) {
  .nav-container {
    padding: 0 var(--margin-desktop);
  }
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--on-surface);
}

.nav-links {
  display: none;
  align-items: center;
  gap: calc(var(--unit) * 4);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-subtle);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-btn-resume {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--primary);
  color: var(--on-primary);
  padding: 8px 24px;
  border: 1px solid var(--primary);
  transition: all 0.2s ease;
}

.nav-btn-resume:hover {
  background: var(--surface);
  color: var(--primary);
}

.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--on-surface);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ── Language Switcher ────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-divider {
  font-size: 12px;
  font-weight: 400;
  color: var(--border-subtle);
  user-select: none;
}

.lang-btn {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--on-surface-subtle);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--primary);
}

.lang-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.lang-switcher-mobile {
  display: flex;
  gap: calc(var(--unit) * 2);
  margin-top: calc(var(--unit) * 6);
  padding-top: calc(var(--unit) * 4);
  border-top: 1px solid var(--border-subtle);
}

.lang-btn-mobile {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 10px 24px;
  cursor: pointer;
  color: var(--on-surface-subtle);
  transition: all 0.2s ease;
}

.lang-btn-mobile:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lang-btn-mobile.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* ── Mobile Overlay ──────────────────────────────────────── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: var(--margin-mobile);
}

.mobile-overlay.hidden {
  display: none;
}

.mobile-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.mobile-overlay-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-surface);
}

.mobile-overlay-title {
  font-size: 24px;
  font-weight: 700;
}

.mobile-overlay-links {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 6);
  margin-top: calc(var(--unit) * 10);
}

.mobile-link {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}

/* ── Hero Section ────────────────────────────────────────── */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
}

.hero-label-area {
  grid-column: span 12;
  margin-bottom: calc(var(--unit) * 4);
}

.hero-label-area .label-caps {
  color: var(--on-surface-subtle);
}

.hero-title-area {
  grid-column: span 12;
}

@media (min-width: 768px) {
  .hero-title-area {
    grid-column: span 10;
  }
}

@media (min-width: 1024px) {
  .hero-title-area {
    grid-column: span 8;
  }
}

.hero-accent-bar {
  width: 96px;
  height: 4px;
  background: var(--primary);
  margin-top: calc(var(--unit) * 4);
  margin-bottom: calc(var(--unit) * 6);
}

.hero-desc-area {
  grid-column: span 12;
  margin-top: calc(var(--unit) * 4);
}

@media (min-width: 768px) {
  .hero-desc-area {
    grid-column: span 8;
  }
}

@media (min-width: 1024px) {
  .hero-desc-area {
    grid-column: span 6;
  }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 4);
  margin-top: calc(var(--unit) * 6);
}

.link-underline-primary {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
  transition: padding-bottom 0.2s ease;
  display: inline-block;
}

.link-underline-primary:hover {
  padding-bottom: 8px;
}

.link-subtle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-subtle);
  transition: color 0.2s ease;
  display: inline-block;
}

.link-subtle:hover {
  color: var(--primary);
}

/* ── About Section ───────────────────────────────────────── */
.about-section {
  padding: var(--section-gap) 0;
}

.about-title-col {
  grid-column: span 12;
}

@media (min-width: 768px) {
  .about-title-col {
    grid-column: span 4;
  }
}

.sticky-title {
  position: relative;
}

@media (min-width: 768px) {
  .sticky-title {
    position: sticky;
    top: 128px;
  }
}

.about-content-col {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 6);
}

@media (min-width: 768px) {
  .about-content-col {
    grid-column: span 8;
  }
}

.approach-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  padding: calc(var(--unit) * 4) 0;
}

@media (min-width: 768px) {
  .approach-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.approach-item .label-caps {
  margin-bottom: calc(var(--unit) * 2);
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 3);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  padding: calc(var(--unit) * 4) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
}

.stat-number {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--on-surface-subtle);
  line-height: 1.4;
}

.about-image {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.95);
  transition: filter 0.6s ease;
}

.about-image:hover {
  filter: grayscale(0%) brightness(1);
}

/* ── Projects Section ────────────────────────────────────── */
.projects-section {
  padding: var(--section-gap) 0;
  background: var(--primary);
  color: var(--on-primary);
}

.projects-header {
  margin-bottom: calc(var(--unit) * 10);
  padding-top: calc(var(--unit) * 6);
}

.projects-title {
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 16);
}

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: calc(var(--unit) * 6);
  cursor: pointer;
}

@media (min-width: 768px) {
  .project-card {
    grid-template-columns: 5fr 7fr;
  }

  .project-card.reverse {
    grid-template-columns: 7fr 5fr;
  }
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-label {
  opacity: 0.6;
  margin-bottom: calc(var(--unit) * 2);
  display: block;
}

.project-name {
  margin-bottom: calc(var(--unit) * 2);
  transition: text-decoration 0.3s ease;
}

.project-card:hover .project-name {
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 1px;
}

.project-desc {
  opacity: 0.8;
  margin-bottom: calc(var(--unit) * 4);
  font-size: 16px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--unit) * 2);
  margin-bottom: calc(var(--unit) * 4);
}

.project-tag {
  border: 1px solid var(--on-primary);
  padding: 4px 12px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.project-link {
  color: var(--on-primary);
  border-bottom-color: var(--on-primary);
}

.project-image-wrapper {
  overflow: hidden;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 0.7s ease, filter 0.5s ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
  filter: grayscale(50%);
}

@media (max-width: 767px) {
  .order-2-mobile {
    order: 2;
  }
}

/* ── Certifications Section ──────────────────────────────── */
.certifications-section {
  padding: var(--section-gap) 0;
}

.certs-header {
  margin-bottom: calc(var(--unit) * 6);
}

.certs-header .label-caps {
  color: var(--on-surface-subtle);
  margin-bottom: calc(var(--unit) * 2);
}

.tabs-container {
  margin-top: calc(var(--unit) * 4);
}

.tabs-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: calc(var(--unit) * 4);
}

.tab-btn {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--on-surface-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--unit) * 2);
}

@media (min-width: 768px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

.cert-card {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--unit) * 2);
  padding: calc(var(--unit) * 3);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cert-card:hover {
  border-color: var(--primary);
  background: var(--background);
}

.cert-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.cert-info {
  flex: 1;
  min-width: 0;
}

.cert-info h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cert-info p {
  font-size: 13px;
  color: var(--on-surface-subtle);
  line-height: 1.5;
  margin-bottom: 4px;
}

.cert-issuer {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--outline);
}

.cert-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Contact Section ─────────────────────────────────────── */
.contact-section {
  padding: var(--section-gap) 0;
}

.contact-center {
  text-align: center;
  max-width: 800px;
}

.contact-label {
  color: var(--on-surface-subtle);
  letter-spacing: 0.4em;
  margin-bottom: calc(var(--unit) * 6);
}

.contact-section .headline-lg {
  margin-bottom: calc(var(--unit) * 4);
}

.contact-subtitle {
  color: var(--on-surface-subtle);
  margin-bottom: calc(var(--unit) * 8);
}

.contact-email {
  font-size: clamp(24px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  display: inline-block;
  position: relative;
  transition: color 0.3s ease;
}

.contact-email:hover {
  color: var(--on-surface-subtle);
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  padding-top: calc(var(--unit) * 6);
  padding-bottom: calc(var(--unit) * 6);
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
}

.footer-name {
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--unit) * 4);
}

.footer-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-subtle);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Scroll Reveal Animation ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
