/* ---------------------------------------------
   Design tokens
--------------------------------------------- */
:root {
  --ink: #15181d;
  --ink-soft: #4b515c;
  --ink-faint: #7a808c;
  --paper: #f1f3ef;
  --surface: #ffffff;
  --line: #dde2dc;
  --accent: #2d5f4c;
  --accent-soft: #dde9e2;
  --accent-strong: #1f4335;
  --amber: #c7742b;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --max-width: 1080px;
  --radius: 14px;
}

/* ---------------------------------------------
   Reset
--------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

/* ---------------------------------------------
   Reveal on scroll
--------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------
   Header / Nav
--------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 243, 239, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.logo-dot {
  color: var(--accent);
}

.nav-links,
.nav-external {
  display: flex;
  gap: 1.5rem;
}

.nav-links {
  flex: 1;
}

.nav-links a,
.nav-external a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-external a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ---------------------------------------------
   Hero
--------------------------------------------- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 1.5rem;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(45, 95, 76, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 95, 76, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(45, 95, 76, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 95, 76, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero card */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(21, 24, 29, 0.06);
}

.profile-frame {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--accent-soft);
  margin-bottom: 1.25rem;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--line);
}

.meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meta-row dt {
  color: var(--ink-faint);
}

.meta-row dd {
  color: var(--ink);
  font-weight: 500;
}

/* ---------------------------------------------
   Sections
--------------------------------------------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  border-top: 1px solid var(--line);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 2rem;
}

/* About */
.about-text {
  max-width: 68ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.email-link svg {
  fill: var(--accent);
}

.email-link:hover {
  text-decoration: underline;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.4rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.timeline-content ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-content li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(21, 24, 29, 0.08);
  border-color: var(--accent-soft);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-bottom: 0.6rem;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.project-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  min-height: 3.6rem;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}

.project-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

/* Skills */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.skills-group h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-badge {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.skill-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Contact */
.contact-section {
  text-align: center;
}

.contact-lede {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.contact-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
}

.contact-alt {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.contact-alt a {
  text-decoration: none;
  color: var(--ink-soft);
}

.contact-alt a:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .hero-card {
    max-width: 360px;
  }
}

@media (max-width: 720px) {
  .nav {
    flex-wrap: wrap;
  }

  .nav-links,
  .nav-external {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.9rem;
    padding-top: 1rem;
  }

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

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .section {
    padding: 3.5rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-card {
    padding: 2rem 1.5rem;
    width: 100%;
  }

  .contact-alt {
    flex-direction: column;
    gap: 0.8rem;
  }
}