/* =====================================================================
   VargasKeo · site.css
   Shared chrome + tokens for every page (welcome, resume, articles,
   article viewer, projects, admin). Articles themselves are sandboxed
   in an <iframe>, so this CSS never reaches their content.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&display=swap');

/* ---------- Tokens (light mode default) ---------- */
:root {
  --bg:           #FFFFFF;
  --bg-surface:   #F5F5F5;
  --bg-elevated:  #FAFAFA;
  --bg-inverse:   #0A0A0A;

  --fg:           #0A0A0A;
  --fg-1:         #171717;
  --fg-2:         #525252;
  --fg-3:         #A3A3A3;
  --fg-4:         #D4D4D4;
  --fg-inverse:   #FFFFFF;

  --border:       #E5E5E5;
  --border-strong:#D4D4D4;

  --accent-live:  #22C55E;
  --color-error:  oklch(55% 0.18 25);
  --color-success:oklch(55% 0.14 145);

  --font-mono:   'JetBrains Mono', 'Courier New', monospace;
  --font-sans:   'DM Sans', 'Helvetica Neue', Arial, sans-serif;

  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:    160ms;
  --dur-normal:  240ms;

  --chrome-h:    64px;
  --content-w:   1200px;
  --text-w:      720px;
}

/* ---------- Dark mode tokens ---------- */
:root[data-theme="dark"] {
  --bg:           #0A0A0A;
  --bg-surface:   #161616;
  --bg-elevated:  #1F1F1F;
  --bg-inverse:   #FFFFFF;

  --fg:           #FFFFFF;
  --fg-1:         #FAFAFA;
  --fg-2:         #A3A3A3;
  --fg-3:         #737373;
  --fg-4:         #404040;
  --fg-inverse:   #0A0A0A;

  --border:       #262626;
  --border-strong:#404040;
}

/* Smooth theme transitions on color-bearing properties only */
:root[data-theme-ready] *,
:root[data-theme-ready] *::before,
:root[data-theme-ready] *::after {
  transition:
    background-color var(--dur-normal) var(--ease),
    border-color var(--dur-normal) var(--ease),
    color var(--dur-normal) var(--ease),
    fill var(--dur-normal) var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-1);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--fg); color: var(--bg); }

a {
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: opacity var(--dur-fast) var(--ease);
}
a:hover { opacity: 0.65; }

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

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

/* ---------- Reusable elements ---------- */
.label, .mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 24px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
  flex-shrink: 0;
  position: relative;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent-live);
  opacity: 0.4;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0; }
  50%      { transform: scale(2.6); opacity: 0.18; }
}

/* ---------- Page intro animation ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter > * { animation: fadeUp 480ms var(--ease) both; }
.page-enter > *:nth-child(2) { animation-delay: 60ms; }
.page-enter > *:nth-child(3) { animation-delay: 120ms; }
.page-enter > *:nth-child(4) { animation-delay: 180ms; }
.page-enter > *:nth-child(5) { animation-delay: 240ms; }

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--chrome-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--content-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-logo__mark {
  width: 32px;
  height: 32px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.04em;
}

.site-logo__wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.site-logo__name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.site-logo__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  padding: 8px 12px;
  transition: color var(--dur-fast) var(--ease);
}
.site-nav__link:hover { opacity: 1; color: var(--fg-1); }
.site-nav__link[aria-current="page"] {
  color: var(--fg-1);
  font-weight: 500;
}
.site-nav__link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--fg-1);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease);
}
.icon-btn:hover {
  opacity: 1;
  color: var(--fg-1);
  background: var(--bg-surface);
  border-color: var(--border);
}
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.mobile-toggle { display: none; }

/* Availability bar */
.availability-strip {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.availability-strip__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.availability-strip__group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.availability-strip__group--right { margin-left: auto; }

/* ── Language toggle (header) ─────────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg-2);
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
}
.lang-toggle:hover {
  color: var(--fg-1);
  background: var(--bg-surface);
  border-color: var(--border);
}
.lang-toggle__current { color: var(--fg-1); font-weight: 700; }
.lang-toggle__sep { color: var(--fg-3); }
.lang-toggle__other { color: var(--fg-3); }

/* ── Footer language buttons ─────────────────────────────────── */
.footer-col__link--btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #D4D4D4;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.footer-col__link--btn:hover { color: var(--fg-inverse); }

.footer-meta--main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-meta__dot { color: #404040; }
.footer-meta__aws {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-meta__aws::before {
  content: 'AWS';
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #FF9900;
  border: 1px solid #FF9900;
  padding: 2px 5px;
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  margin-top: auto;
  padding-top: 40px;
  padding-bottom: 24px;
}

:root[data-theme="dark"] .site-footer {
  background: #050505;
  border-top: 1px solid #1A1A1A;
}

.site-footer__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 28px;
}

.footer-brand__mark {
  width: 48px;
  height: 48px;
  background: var(--fg-inverse);
  color: var(--bg-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

.footer-brand__name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-inverse);
  margin-bottom: 6px;
}

.footer-brand__tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #737373;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col__title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #737373;
  margin-bottom: 16px;
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col__link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #D4D4D4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--dur-fast) var(--ease);
}
.footer-col__link:hover { opacity: 1; color: var(--fg-inverse); }
.footer-col__link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid #1F1F1F;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #525252;
}

/* =====================================================================
   PAGE LAYOUTS
   ===================================================================== */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.page--narrow { max-width: var(--text-w); }

.page-header {
  margin-bottom: 56px;
}

.page-title {
  font-family: var(--font-mono);
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--fg-1);
  margin-bottom: 24px;
}

.page-lede {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--fg-2);
  max-width: 640px;
}

h2 {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  line-height: 1.2;
}

h3 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}

p {
  color: var(--fg-2);
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  height: 44px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { opacity: 1; transform: translateY(-1px); }

.btn--primary {
  background: var(--fg);
  color: var(--bg);
}
.btn--primary:hover { background: var(--fg-1); }

.btn--ghost {
  background: transparent;
  color: var(--fg-1);
  border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--fg-1); background: var(--bg-surface); }

.btn--sm { height: 36px; padding: 0 16px; font-size: 11px; }

.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- Cards / hairlines ---------- */
.hairline { border: 1px solid var(--border); }

/* =====================================================================
   PRINT (resume page)
   ===================================================================== */
@media print {
  .site-header,
  .site-footer,
  .availability-strip,
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .page { padding: 0; max-width: none; }
  a { color: #000 !important; text-decoration: none !important; }
  h2, h3 { page-break-after: avoid; }
  .resume-job { page-break-inside: avoid; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  :root { --chrome-h: 56px; }
  .site-logo__wordmark { display: none; }
  .site-nav { gap: 0; }
  .site-nav__link { padding: 8px 8px; font-size: 11px; }
  .availability-strip__group--right { display: none; }
  .availability-strip__inner { gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .page { padding: 40px 20px 64px; }
}
