/* ═══════════════════════════════════════════════════════════
   GABO CHAVEZ — Portfolio Design System
   Shared stylesheet for all pages
   ═══════════════════════════════════════════════════════════ */

/* ─── GOOGLE FONTS ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,700;1,9..144,300;1,9..144,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Colors */
  --cream:       #F5F0E8;
  --warm-white:  #FDFAF4;
  --ink:         #1A1612;
  --ink-soft:    #4A3F35;
  --terracotta:  #C4603A;
  --sage:        #7A9B8A;
  --sand:        #D4C4A8;
  --surface:     #EDE7D9;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  /* Type scale */
  --step-xs:   0.75rem;
  --step-sm:   0.9rem;
  --step-base: 1.0rem;
  --step-md:   1.2rem;
  --step-lg:   1.6rem;
  --step-xl:   2.4rem;
  --step-2xl:  3.6rem;
  --step-3xl:  5.5rem;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  7rem;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   12px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width: 1100px;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── NAVIGATION ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--sand);
  background: rgba(245, 240, 232, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--step-md);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-logo em {
  font-style: italic;
  color: var(--terracotta);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-size: var(--step-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

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

.nav-links .nav-cta {
  background: var(--ink);
  color: var(--cream);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: var(--step-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.2s var(--ease-bounce);
}

.nav-links .nav-cta:hover {
  background: var(--terracotta);
  color: var(--cream);
  transform: translateY(-2px);
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── TYPOGRAPHY UTILITIES ───────────────────────────────── */
.label {
  font-family: var(--font-body);
  font-size: var(--step-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, var(--step-xl));
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--step-lg);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
}

.body-text {
  font-size: var(--step-base);
  color: var(--ink-soft);
  line-height: 1.75;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--step-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.02em;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 4px 16px rgba(26, 22, 18, 0.18);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(26, 22, 18, 0.28); }

.btn-accent {
  background: var(--terracotta);
  color: var(--cream);
  box-shadow: 0 4px 16px rgba(196, 96, 58, 0.28);
}
.btn-accent:hover { box-shadow: 0 8px 28px rgba(196, 96, 58, 0.38); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--sand);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--ink);
}

/* ─── TAGS ───────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--step-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tag-skill {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--sand);
}

.tag-role {
  background: var(--terracotta);
  color: var(--cream);
}

.tag-tech {
  background: var(--ink);
  color: var(--cream);
}

.tag-result {
  background: rgba(122, 155, 138, 0.15);
  color: var(--sage);
  border: 1px solid rgba(122, 155, 138, 0.3);
}

/* ─── CASE STUDY CARD ────────────────────────────────────── */
.card {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand);
  overflow: hidden;
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 56px rgba(26, 22, 18, 0.12);
}

.card-thumb {
  height: 200px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--sand) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-thumb-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  opacity: 0.06;
  user-select: none;
  pointer-events: none;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb-tag {
  position: absolute;
  top: 16px;
  left: 16px;
}

.card-lock {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(26, 22, 18, 0.6);
  color: var(--cream);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-body { padding: var(--space-sm) var(--space-md); }

.card-title {
  font-family: var(--font-display);
  font-size: var(--step-md);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 8px;
}

.card-desc {
  font-size: var(--step-sm);
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.card-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.card-metric-num {
  font-family: var(--font-display);
  font-size: var(--step-xl);
  font-weight: 700;
  color: var(--terracotta);
  line-height: 1;
}

.card-metric-label {
  font-size: var(--step-xs);
  color: var(--ink-soft);
}

.card-footer {
  padding: 14px var(--space-md);
  border-top: 1px solid var(--sand);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-company {
  font-size: var(--step-xs);
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-arrow {
  font-size: var(--step-xs);
  color: var(--terracotta);
  font-weight: 500;
  transition: transform 0.2s var(--ease-bounce);
}

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

/* ─── SECTION WRAPPER ────────────────────────────────────── */
.section {
  padding: var(--space-xl) var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-lg);
}

/* ─── DIVIDER ────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--sand);
  margin: 0;
}

/* ─── SCROLL REVEAL ANIMATIONS ───────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal {
  opacity: 0;
}

.reveal.visible {
  animation: fadeUp 0.7s var(--ease-out-expo) forwards;
}

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

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--sand);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: var(--step-xs);
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--terracotta);
  transition: opacity 0.2s ease;
}

.site-footer a:hover { opacity: 0.7; }

/* ─── PULL QUOTE ─────────────────────────────────────────── */
.pull-quote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--terracotta);
  background: var(--warm-white);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-lg);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-lg: 2.5rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
    gap: var(--space-md);
    border-bottom: 1px solid var(--sand);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    font-size: var(--step-sm);
  }

  .nav-toggle { display: flex; }

  .section {
    padding: var(--space-lg) var(--space-sm);
  }

  .site-footer {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
    padding: var(--space-md) var(--space-sm);
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 12px 24px;
  }
}
