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

:root {
  --bg:         #f8f7f4;
  --surface:    #ffffff;
  --border:     #e8e6e0;
  --ink:        #111110;
  --ink-2:      #555450;
  --ink-3:      #999793;
  --accent:     #1a6b4a;       /* deep green */
  --accent-lt:  #e8f3ee;
  --tag-bg:     #f0eeea;
  --tag-ink:    #555450;
  --font-disp:  'DM Serif Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --radius:     10px;
  --nav-h:      60px;
  --max-w:      1080px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-up {
  opacity: 0;
  animation: fade-up .65s cubic-bezier(.22,.68,0,1) forwards;
  animation-delay: var(--d, 0ms);
}

/* ═══════════════════════════════════════════
   NAV
═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(248, 247, 244, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-logo {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  letter-spacing: .04em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-links a {
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .2s;
}

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

.nav-cta {
  background: var(--ink) !important;
  color: var(--bg) !important;
  padding: .42rem 1rem;
  border-radius: 6px;
  font-size: .82rem !important;
  transition: opacity .2s !important;
}

.nav-cta:hover { opacity: .8; }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 4rem) 2rem 6rem;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0 auto 0 calc((100% - var(--max-w)) / 2 + 2rem);
}

/* decorative vertical rules */
.hero-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  pointer-events: none;
  z-index: 1;
}

.grid-line {
  border-right: 1px solid var(--border);
  opacity: .5;
}

.hero-eyebrow {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.hero-name {
  font-family: var(--font-disp);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.hero-name em {
  font-style: italic;
  color: var(--ink-2);
}

.hero-bio {
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-2);
  max-width: 460px;
  margin-bottom: 2rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  padding: .72rem 1.6rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 500;
  transition: opacity .2s, transform .2s;
}

.btn-primary:hover { opacity: .82; transform: translateY(-1px); }

.btn-ghost {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: .72rem 1.6rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .2s, color .2s, transform .2s;
}

.btn-ghost:hover {
  border-color: var(--ink-3);
  color: var(--ink);
  transform: translateY(-1px);
}

/* Visitor Counter Badge */
.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .38rem 1rem .38rem .7rem;
  font-size: .78rem;
  color: var(--ink-2);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.visitor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-lt); }
  50%       { box-shadow: 0 0 0 6px var(--accent-lt); }
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-3);
  animation: bob 2s ease-in-out infinite;
  z-index: 2;
  transition: color .2s;
}

.scroll-cue:hover { color: var(--ink); }

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

/* ═══════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════ */
.projects {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 2.8rem;
}

.section-header .label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}

.section-header h2 {
  font-family: var(--font-disp);
  font-size: 2.2rem;
  color: var(--ink);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* Project Card */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}

.project-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  transform: translateY(-3px);
  border-color: #d4d2cc;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: .68rem;
  font-weight: 500;
  padding: .2rem .55rem;
  border-radius: 99px;
  letter-spacing: .02em;
}

.card-title {
  font-family: var(--font-disp);
  font-size: 1.18rem;
  color: var(--ink);
  line-height: 1.25;
}

.card-desc {
  font-size: .86rem;
  color: var(--ink-2);
  line-height: 1.7;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.card-link {
  font-size: .82rem;
  font-weight: 500;
  color: var(--accent);
  transition: opacity .2s;
}

.card-link:hover { opacity: .7; }

.card-link-ghost {
  font-size: .82rem;
  color: var(--ink-3);
  transition: color .2s;
}

.card-link-ghost:hover { color: var(--ink-2); }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: .8rem;
  color: var(--ink-3);
}

.footer strong { color: var(--ink-2); font-weight: 500; }

.footer-links {
  display: flex;
  gap: 1.4rem;
}

.footer-links a {
  color: var(--ink-3);
  transition: color .2s;
}

.footer-links a:hover { color: var(--ink); }

/* ═══════════════════════════════════════════
   RESUME PAGE
═══════════════════════════════════════════ */
.resume-page {
  padding-top: var(--nav-h);
  min-height: 100vh;
  background: #d6d0c4;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.resume-wrap {
  width: 100%;
  max-width: 800px;
  padding: 2.5rem 1rem 4rem;
}

/* back link above resume */
.resume-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--ink-2);
  margin-bottom: 1.2rem;
  transition: color .2s;
}

.resume-back:hover { color: var(--ink); }

/* paper */
.paper {
  background: #faf9f6;
  padding: 2.8rem 3rem 3rem;
  box-shadow: 0 4px 32px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.1);
  animation: fade-up .55s cubic-bezier(.22,.68,0,1) both;
}

/* ── Resume Header ── */
.r-header {
  text-align: center;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: .75rem;
  margin-bottom: .6rem;
}

.r-header h1 {
  font-family: var(--font-disp);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1a1a1a;
}

.r-contact {
  font-size: .8rem;
  color: #555;
  margin-top: .4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 .5rem;
}

.r-contact span::before { content: "·"; margin-right: .5rem; }
.r-contact span:first-child::before { content: ""; margin-right: 0; }
.r-contact a { color: #8b0000; }
.r-contact a:hover { text-decoration: underline; }

/* ── Resume Sections ── */
.r-section { margin-top: 1rem; }

.r-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #1a1a1a;
  border-bottom: 1.5px solid #1a1a1a;
  padding-bottom: .18rem;
  margin-bottom: .6rem;
  font-family: var(--font-sans);
}

.r-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  margin-bottom: .65rem;
}

.r-entry-right {
  text-align: right;
  white-space: nowrap;
  font-size: .8rem;
  color: #555;
}

.r-org  { font-weight: 700; font-size: .9rem; }
.r-role { font-style: italic; font-size: .86rem; color: #555; }
.r-edu-degree { font-weight: 700; font-size: .9rem; }
.r-edu-detail { font-size: .82rem; color: #555; }

ul.r-bullets { margin: .3rem 0 0 1.1rem; list-style: disc; }
ul.r-bullets li { font-size: .84rem; line-height: 1.55; margin-bottom: .12rem; }

.r-skills-grid {
  display: grid;
  grid-template-columns: 8rem 1fr;
  row-gap: .28rem;
  font-size: .84rem;
}

.r-skill-cat  { font-weight: 700; }
.r-skill-list { color: #555; }

.r-cert-row {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  margin-bottom: .22rem;
}

.r-cert-name { font-weight: 600; }
.r-cert-date { color: #555; white-space: nowrap; }

/* ═══════════════════════════════════════════
   PRINT
═══════════════════════════════════════════ */
@media print {
  .nav, .resume-back, .footer { display: none; }
  .resume-page { background: #fff; padding: 0; }
  .resume-wrap { padding: 0; max-width: 100%; }
  .paper { box-shadow: none; padding: 1.5cm 2cm; }
  .r-contact a { color: #1a1a1a !important; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero-inner { margin-left: 0; }
  .nav { padding: 0 1.2rem; }
  .projects { padding: 3.5rem 1.2rem 4rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer { padding: 1.5rem 1.2rem; flex-direction: column; align-items: flex-start; }
  .paper { padding: 1.6rem 1.2rem; }
  .r-entry { grid-template-columns: 1fr; }
  .r-entry-right { text-align: left; margin-top: .05rem; }
  .r-skills-grid { grid-template-columns: 1fr; }
  .r-skill-cat { margin-top: .35rem; }
}
