/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #0c0f12;
  --bg-elevated: #141a20;
  --bg-card: #1a2229;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf2;
  --text-muted: #8b9aab;
  --accent: #5ec4e6;
  --accent-warm: #e8a87c;
  --accent-glow: rgba(94, 196, 230, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --header-h: 64px;
  --transition: 0.2s ease;
}

/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(232, 168, 124, 0.06), transparent);
  min-height: 100vh;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-warm); }

button { font-family: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 15, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: #7dd4f0;
  color: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 4rem 1.5rem 5rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-photo-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  opacity: 0.5;
  z-index: 0;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.hero-text {
  text-align: center;
  max-width: 640px;
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-tagline {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.contact-block {
  padding-top: 0.25rem;
}

.contact-label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-card);
}

/* ── About ──────────────────────────────────────────────── */
.about {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.about-text {
  margin: 0;
  max-width: 720px;
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── Projects ───────────────────────────────────────────── */
.projects {
  padding: 4rem 1.5rem 6rem;
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

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

.section-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition);
  overflow: hidden;
  position: relative;
}

.project-card--linked {
  cursor: pointer;
}

.project-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.project-card--linked .project-links {
  position: relative;
  z-index: 2;
}

.project-media-wrap {
  margin: -1.5rem -1.5rem 1rem;
  background: #0a0d10;
  border-bottom: 1px solid var(--border);
}

.project-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0a0d10;
}

.project-card:hover {
  border-color: rgba(94, 196, 230, 0.3);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.project-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.project-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.project-links a:hover { color: var(--accent); }

.project-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-tags li {
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 999px;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.25s ease;
}

.modal.is-open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.modal-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  background: #525659;
}

.resume-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  background: #525659;
}

.resume-fallback {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Resume modal — maximize viewport for PDF reading */
.modal--resume {
  padding: 0.375rem;
}

.modal--resume .modal-panel {
  width: calc(100vw - 0.75rem);
  height: calc(100vh - 0.75rem);
  max-width: none;
}

.modal--resume .modal-header h2 {
  display: none;
}

.modal--resume .btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

@media (min-width: 700px) {
  .modal--resume {
    padding: 0.75rem;
  }

  .modal--resume .modal-panel {
    width: calc(100vw - 1.5rem);
    height: calc(100vh - 1.5rem);
  }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (min-width: 700px) {
  .hero-content {
    flex-direction: row;
    text-align: left;
    gap: 3.5rem;
  }

  .hero-text { text-align: left; }

  .hero-photo {
    width: 280px;
    height: 280px;
  }

  .hero-actions { justify-content: flex-start; }
  .contact-links { justify-content: flex-start; }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
