/* ═══════════════════════════════════════════════════
   PORTFOLIO — style.css
   Theme: Olive & Eggshell — organic minimal
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;1,400&family=Epilogue:wght@300;400;500&family=DM+Mono:wght@300;400&display=swap');

/* ── Tokens ───────────────────────────────────────── */
:root {
  /* Eggshell / warm neutrals */
  --bg:          #f5f2eb;
  --bg-alt:      #ede9df;
  --surface:     #faf8f3;
  --border:      #ddd8cc;
  --border-soft: #e8e4da;

  /* Olive palette */
  --olive-1:     #8a9164;   /* main olive */
  --olive-2:     #6b7250;   /* deep olive */
  --olive-3:     #b5bc94;   /* light olive */
  --olive-4:     #d4d9be;   /* muted olive */
  --olive-5:     #eef0e5;   /* whisper olive */

  /* Terracotta accent */
  --terra:       #b07050;
  --terra-soft:  #e8d5c8;

  /* Type */
  --text:        #2c2a24;
  --muted:       #6e6a60;
  --hint:        #a09b8f;

  /* Functional */
  --font-serif:  'Lora', Georgia, serif;
  --font-sans:   'Epilogue', sans-serif;
  --font-mono:   'DM Mono', monospace;

  --radius-sm:   5px;
  --radius-md:   10px;
  --radius-lg:   18px;
  --radius-xl:   28px;

  --max-w:       780px;
  --nav-h:       60px;

  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
}

/* ── Dark theme ───────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #1c1d16;
  --bg-alt:      #22231b;
  --surface:     #252620;
  --border:      #363729;
  --border-soft: #2e2f25;

  --olive-1:     #9aa572;
  --olive-2:     #b5bc94;
  --olive-3:     #6b7250;
  --olive-4:     #3a3e2c;
  --olive-5:     #252720;

  --terra:       #c08060;
  --terra-soft:  #3a2820;

  --text:        #e8e4d8;
  --muted:       #a09b8f;
  --hint:        #5a5750;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

/* Subtle paper grain overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ── Nav ──────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.35s var(--ease);
}
#nav.scrolled { border-color: var(--border); }

.nav-name {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 400; font-style: italic;
  color: var(--olive-2);
  letter-spacing: 0.01em;
}

.nav-right { display: flex; align-items: center; gap: 0.25rem; }

.nav-links { display: flex; gap: 0.1rem; list-style: none; }
.nav-links a {
  font-size: 12.5px; font-weight: 400; letter-spacing: 0.02em;
  color: var(--muted); text-decoration: none;
  padding: 5px 11px; border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--olive-5);
}

/* Theme toggle */
.theme-toggle {
  margin-left: 0.75rem;
  width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.2s var(--ease);
  color: var(--text);
}
.theme-toggle:hover { background: var(--bg-alt); transform: rotate(15deg); }

/* ── Main layout ──────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: var(--nav-h);
  position: relative; z-index: 1;
}

section {
  padding: 5rem 2.5rem;
}
section + section { border-top: 1px solid var(--border-soft); }

.section-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--olive-1);
  margin-bottom: 2.25rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--olive-4), transparent);
}

/* ── Scroll reveal ────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger children */
.reveal-children > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal-children.visible > *:nth-child(1) { opacity:1; transform:translateY(0); transition-delay: 0.05s; }
.reveal-children.visible > *:nth-child(2) { opacity:1; transform:translateY(0); transition-delay: 0.12s; }
.reveal-children.visible > *:nth-child(3) { opacity:1; transform:translateY(0); transition-delay: 0.19s; }
.reveal-children.visible > *:nth-child(4) { opacity:1; transform:translateY(0); transition-delay: 0.26s; }
.reveal-children.visible > *:nth-child(5) { opacity:1; transform:translateY(0); transition-delay: 0.33s; }
.reveal-children.visible > *:nth-child(n+6) { opacity:1; transform:translateY(0); transition-delay: 0.38s; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 400;
  padding: 8px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer; text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { color: var(--text); background: var(--olive-5); border-color: var(--olive-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--olive-2); color: var(--bg);
  border-color: var(--olive-2); font-weight: 500;
}
.btn-primary:hover { background: var(--olive-1); border-color: var(--olive-1); color: var(--bg); }

/* ── Tags ─────────────────────────────────────────── */
.tag {
  display: inline-block; font-size: 11.5px;
  background: var(--olive-5); color: var(--olive-2);
  border: 1px solid var(--olive-4);
  padding: 2px 9px; border-radius: 20px;
}
.tag-mono { font-family: var(--font-mono); font-size: 10.5px; }

/* ── About ────────────────────────────────────────── */
#about { padding-top: 6rem; }
.about-eyebrow {
  font-size: 12px; font-weight: 400; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--olive-1);
  margin-bottom: 1rem;
}
.about-headline {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 400; line-height: 1.3;
  letter-spacing: -0.01em; margin-bottom: 1.25rem;
  color: var(--text);
}
.about-headline em { color: var(--olive-1); font-style: italic; }
.about-bio { color: var(--muted); max-width: 520px; margin-bottom: 2rem; }
.about-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Deco dot */
.about-deco {
  width: 6px; height: 6px; border-radius: 50%; border: 0.5px solid black;
  background: #00C853; display: inline-block;
  margin-right: 0.5rem; vertical-align: middle;
  animation: pulse 3s ease-in-out infinite;
}

/* Text Animations */
.eyebrow-cursor {
  display: inline-block;
  font-weight: 300;
  color: var(--olive-1);
  margin-left: 1px;
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pulse { 0%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.6} 100%{transform:scale(1);opacity:1} }


/* ── Certifications ───────────────────────────────── */
.cert-grid {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.cert-card {
  display: flex; align-items: center; gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  text-decoration: none; color: inherit;
  position: relative;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.cert-card:hover {
  border-color: var(--olive-3);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.cert-badge {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--olive-5);
  border: 1px solid var(--olive-4);
  color: var(--olive-2);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}
.cert-card:hover .cert-badge { background: var(--olive-4); }
.cert-body { flex: 1; min-width: 0; }
.cert-title  { font-size: 14px; font-weight: 500; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-issuer { font-size: 12.5px; color: var(--muted); margin-bottom: 0.3rem; }
.cert-meta   { display: flex; align-items: center; gap: 0.4rem; font-size: 11.5px; color: var(--hint); flex-wrap: wrap; }
.cert-sep    { color: var(--border); }
.cert-noexpiry { color: var(--olive-1); }
.cert-id     { font-family: var(--font-mono); font-size: 10.5px; color: var(--hint); margin-top: 0.25rem; }
.cert-arrow  {
  flex-shrink: 0; font-size: 14px; color: var(--hint);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.cert-card:hover .cert-arrow { opacity: 1; transform: translate(0, 0); }

/* ── Skills ───────────────────────────────────────── */
.skills-groups { display: flex; flex-direction: column; gap: 1.75rem; }
.skill-group-name {
  font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.04em; margin-bottom: 0.65rem;
}
.skill-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ── Timeline (Experience) ────────────────────────── */
.timeline-tabs {
  display: flex; gap: 0.35rem; margin-bottom: 2rem;
}
.tab-btn {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 400;
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer;
  transition: all 0.18s;
}
.tab-btn.active {
  background: var(--olive-2); color: var(--bg);
  border-color: var(--olive-2);
}
.tab-btn:not(.active):hover { background: var(--olive-5); color: var(--text); }

.timeline-panel { display: none; }
.timeline-panel.active { display: block; }

.timeline {
  position: relative; padding-left: 1.92rem;
}
.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.timeline-item {
  position: relative; margin-bottom: 2.25rem;
  opacity: 0; transform: translateX(-10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }

.timeline-item::before {
  content: '';
  position: absolute; left: -1.75rem; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--olive-1);
  transition: background 0.2s;
}
.timeline-item:hover::before { background: var(--olive-1); }

.timeline-dates {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--olive-1); margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
}
.timeline-company { font-size: 15px; font-weight: 500; margin-bottom: 0.15rem; }
.timeline-role    { font-size: 13px; color: var(--muted); margin-bottom: 0.5rem; }
.timeline-desc    { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* ── GitHub ───────────────────────────────────────── */
#github .github-intro { color: var(--muted); margin-bottom: 1.75rem; }

.github-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.gh-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem 1.1rem;
  transition: border-color 0.2s;
}
.gh-stat:hover { border-color: var(--olive-3); }
.gh-stat-value { font-size: 22px; font-weight: 500; color: var(--olive-2); font-family: var(--font-serif); }
.gh-stat-label { font-size: 11.5px; color: var(--hint); margin-top: 2px; }

/* Contribution grid */
.gh-grid-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  overflow-x: auto;
}
.gh-grid-title {
  font-size: 12px; color: var(--hint); margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  text-align: center;
}
.contrib-grid {
  display: flex; gap: 3px; justify-content: center;
}
.contrib-col { display: flex; flex-direction: column; gap: 3px; }
.contrib-cell {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--olive-5);
  transition: transform 0.15s, opacity 0.15s;
  cursor: default;
}
.contrib-cell:hover { transform: scale(1.4); opacity: 0.9; }
.contrib-cell[data-level="1"] { background: var(--olive-4); }
.contrib-cell[data-level="2"] { background: var(--olive-3); }
.contrib-cell[data-level="3"] { background: var(--olive-1); }
.contrib-cell[data-level="4"] { background: var(--olive-2); }

.gh-legend {
  display: flex; align-items: center; gap: 4px;
  margin-top: 0.65rem; font-size: 11px; color: var(--hint);
  justify-content: flex-end;
}
.gh-legend span { width: 10px; height: 10px; border-radius: 2px; }

.gh-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ── Contact ──────────────────────────────────────── */
#contact .contact-intro { color: var(--muted); margin-bottom: 1.75rem; }

.contact-layout { display: flex; flex-direction: column-reverse; gap: 2rem; }

.contact-links { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

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

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-group label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--hint); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--olive-1);
  box-shadow: 0 0 0 3px var(--olive-5);
}

.form-submit { align-self: flex-start; }

.form-status {
  font-size: 12.5px;
  color: var(--hint);
  min-height: 1.2em;
}
.form-status.success { color: var(--olive-1); }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Footer ───────────────────────────────────────── */
footer {
  text-align: center; padding: 2.5rem 2rem;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--hint); border-top: 1px solid var(--border-soft);
  position: relative; z-index: 1;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  #nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  section { padding: 3.5rem 1.25rem; }
  .about-headline { font-size: 24px; }
  .timeline { padding-left: 1.25rem; }
}

/* ── Resume Download Modal ────────────────────────── */
.resume-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(44, 42, 36, 0.45);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
}

.resume-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 2rem 1.5rem;
  width: 340px; max-width: 90vw;
  position: relative;
}

.resume-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 13px; color: var(--hint);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.resume-modal-close:hover { background: var(--bg-alt); color: var(--text); }

.resume-modal-title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 400;
  color: var(--text); margin-bottom: 0.4rem;
}

.resume-modal-sub {
  font-size: 13px; color: var(--muted);
  line-height: 1.6; margin-bottom: 1.5rem;
}

.resume-modal-filename {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--olive-2); margin-bottom: 1.5rem;
}

.resume-modal-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--olive-1); flex-shrink: 0;
}

.resume-modal-actions { display: flex; gap: 0.6rem; }
.resume-modal-actions .btn { flex: 1; justify-content: center; }