/* ═══════════════════════════════════════════════════════
   SHARED BASE STYLES — Juan Martinez Portfolio v11
   Edit here to update all pages at once.
   ═══════════════════════════════════════════════════════ */

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

/* ── TOKENS ── */
:root {
  /* Surface */
  --bg:          #f2f1ef;
  --bg2:         #eceae7;
  --white:       #ffffff;

  /* Ink */
  --ink:         #1a1814;
  --ink-mid:     #3d3a34;
  --ink-muted:   #7a756c;
  --ink-faint:   #b0aa9f;

  /* Accent — default (homepage + pcap) */
  --accent:      #6b3fa0;
  --accent-mid:  #5a2d8f;
  --accent-light:#9b72cc;
  --accent-pale: #f0eaf8;

  /* Aliases kept for legacy */
  --grape:       #6b3fa0;
  --grape-mid:   #5a2d8f;
  --grape-light: #9b72cc;
  --grape-pale:  #f0eaf8;

  /* Elevation */
  --rule:        rgba(26,24,20,0.08);
  --shadow-sm:   0 2px 12px rgba(26,24,20,0.06);
  --shadow-md:   0 8px 32px rgba(26,24,20,0.09);
  --shadow-lg:   0 20px 60px rgba(26,24,20,0.12);

  /* Type */
  --serif: 'Instrument Sans', sans-serif;
  --sans:  'Outfit', sans-serif;
  --mono:  'Outfit', sans-serif;

  /* Radii */
  --r:     28px;
  --r-sm:  16px;
  --r-pill:100px;

  /* Layout */
  --content-w: 860px;
  --content-pad: calc(100% - 6rem);
}

/* ── BASE ── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--ink);
  font-weight: 400; line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
p   { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

/* ── NAV PILL ── */
.nav-wrap {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  width: calc(100% - 6rem); max-width: var(--content-w);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(20px);
  border-radius: var(--r-pill);
  padding: 0.5rem 0.5rem 0.5rem 0.65rem;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(26,24,20,0.06);
}
.nav-id   { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; box-shadow: 0 2px 8px rgba(107,63,160,0.2); }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-name-wrap { display: flex; flex-direction: column; gap: 0; }
.nav-name  { font-family: var(--serif); font-size: 14px; letter-spacing: 0.02em; color: var(--ink); font-weight: 600; line-height: 1.2; }
.nav-title { font-family: var(--sans);  font-size: 11px; letter-spacing: 0.01em; color: var(--ink-faint); }
.nav-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; flex-wrap: nowrap; }
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.nav-link  {
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  color: var(--ink-muted); text-decoration: none;
  padding: 8px 14px; border-radius: var(--r-pill);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--bg2); color: var(--ink); }
.nav-cta  {
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
  color: #fff; background: var(--ink);
  padding: 9px 20px; border-radius: var(--r-pill);
  text-decoration: none; transition: background 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: var(--grape); }
.nav-open-dot { width: 6px; height: 6px; border-radius: 50%; background: #4caf50; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 50%; transition: background 0.15s;
}
.nav-hamburger:hover { background: var(--bg2); }
.nav-hamburger span { display: block; width: 18px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; transform-origin: center; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav-mobile-menu { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.97); backdrop-filter: blur(24px); z-index: 199; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; }
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link { font-family: var(--serif); font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; padding: 0.4rem 1.5rem; border-radius: var(--r-pill); transition: color 0.15s; }
.nav-mobile-link:hover { color: var(--grape); }
.nav-mobile-cta { margin-top: 1.5rem; font-family: var(--sans); font-size: 14px; font-weight: 500; color: #fff; background: var(--ink); padding: 12px 28px; border-radius: var(--r-pill); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: background 0.2s; }
.nav-mobile-cta:hover { background: var(--grape); }

@media (max-width: 600px) {
  .nav-right    { display: none; }
  .nav-hamburger{ display: flex; }
  .nav-wrap     { width: calc(100% - 2.5rem); }
  .sec-inner, .sec-wrap, .content-wrap { width: calc(100% - 2.5rem); }
  [style*="calc(100% - 6rem)"] { width: calc(100% - 2.5rem) !important; }
}

/* ── LAYOUT ── */
.content-wrap {
  max-width: var(--content-w);
  width: var(--content-pad);
  margin: 0 auto;
}

/* ── TYPE UTILITIES ── */
.sec-eyebrow {
  font-family: var(--serif); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem;
}
.sec-eyebrow::before { content: ''; width: 16px; height: 1px; background: var(--ink-faint); }
.sec-title {
  font-family: var(--serif); font-size: clamp(1.6rem,3vw,2.2rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink);
}
.sec-title em {
  font-style: normal;
  background: linear-gradient(110deg, #7b4fcc, #5b8fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── BUTTONS ── */
/* .btn / .btn-ghost used by case study bottom navs */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  padding: 10px 22px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; text-decoration: none;
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(26,24,20,0.2);
}
.btn:hover { background: linear-gradient(110deg, #7b4fcc, #5b8fff); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ink-muted);
  border: 1px solid var(--rule); box-shadow: none;
}
.btn-ghost:hover { background: var(--bg2); color: var(--ink); transform: translateY(-1px); }
html.dark .btn { background: #f0ece4; color: #1a1814; }
html.dark .btn:hover { background: var(--grape-light); color: #fff; }

/* .bottom-nav used by case study pages */
.bottom-nav {
  background: var(--white); border-radius: var(--r);
  padding: 1.75rem 2rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--rule);
  margin-bottom: 3rem;
}

.btn-dark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  padding: 12px 24px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(26,24,20,0.2);
}
.btn-dark:hover { background: var(--grape); transform: translateY(-1px); }
.btn-light {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 400; letter-spacing: 0.01em;
  padding: 12px 24px; border-radius: var(--r-pill);
  background: var(--white); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--rule);
  transition: all 0.2s;
}
.btn-light:hover { background: var(--bg2); transform: translateY(-2px); }

/* ── TAGS ── */
.tag {
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--bg2); color: var(--ink-muted); border: 1px solid var(--rule);
}
.tag.grape { background: var(--grape-pale); color: var(--grape); border-color: rgba(107,63,160,0.15); }

/* ── CARDS ── */
.card { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }

/* ── STATS ROW (hero stats on case study pages) ── */
.stats-row {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--white); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.stat-cell { flex: 1; min-width: 130px; padding: 1.25rem 1.5rem; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.stat-cell:last-child { border-right: none; }
.stat-k { font-family: var(--sans); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.stat-v { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--ink-mid); letter-spacing: -0.01em; line-height: 1.2; }

/* ── QUOTE BLOCK ── */
.quote-block {
  border-radius: var(--r);
  padding: 3.5rem clamp(2rem,5vw,4rem);
}
.quote-text {
  font-family: var(--serif); font-size: clamp(1.3rem,3vw,2rem);
  font-weight: 300; font-style: italic; line-height: 1.5;
  letter-spacing: -0.01em; margin-bottom: 1rem;
}
.quote-attr {
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(245,240,232,0.25);
}

/* ── IMAGE FRAMES ── */
.img-frame  { width: 100%; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow-md); }
.img-frame img { width: 100%; display: block; object-fit: cover; }
.img-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.img-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
@media(max-width:640px){ .img-grid-2, .img-grid-3 { grid-template-columns: 1fr; } }

/* ── BOTTOM NAV (case study pages) ── */
.bottom-nav-wrap {
  max-width: var(--content-w);
  width: var(--content-pad);
  margin: 0 auto; padding: 2.5rem 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid var(--rule);
}
.bn-copy  { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: 0.06em; color: var(--ink-faint); }
.bn-links { display: flex; gap: 10px; flex-wrap: wrap; }
.bn-link  {
  font-family: var(--sans); font-size: 12px; font-weight: 400;
  color: var(--ink-muted); text-decoration: none;
  padding: 8px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--rule); transition: all 0.15s;
}
.bn-link:hover { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── FOOTER ── */
footer {
  padding: 1.5rem clamp(1.5rem,4vw,3rem) 2rem;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem;
}
.ft-copy { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--ink-faint); }
.ft-links { display: flex; gap: 8px; align-items: center; }
.ft-link  {
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  color: var(--ink-muted); text-decoration: none;
  padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--rule); transition: all 0.15s;
}
.ft-link:hover { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible  { opacity: 1; transform: none; }
.reveal-delay-1  { transition-delay: 0.1s; }
.reveal-delay-2  { transition-delay: 0.2s; }
.reveal-delay-3  { transition-delay: 0.3s; }
