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

:root {
  --bg: #080808;
  --surface: #111111;
  --text: #f0ebe3;
  --muted: #8a8278;
  --accent: #e8ff47;
  --accent-dim: rgba(232, 255, 71, 0.12);
  --border: rgba(240, 235, 227, 0.08);
  --font-display: "Syne", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.nav-link:hover,
.nav-link--accent {
  color: var(--accent);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-line {
  display: block;
}

.hero-line--muted {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
}

.hero-role {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--muted);
  max-width: 420px;
  margin-bottom: 2.5rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.75rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 100px;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s;
}

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

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232, 255, 71, 0.25);
}

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

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

/* Sections */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section--compact {
  padding-bottom: 3rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.section-head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* About */
.about-grid {
  display: grid;
  gap: 1.5rem;
}

.about-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.45;
  font-style: italic;
}

.about-lead strong {
  color: var(--accent);
  font-style: normal;
}

.about-text {
  color: var(--muted);
  max-width: 540px;
}

/* Timeline */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 2rem 0 2rem 1.5rem;
  border-left: 1px solid var(--border);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 2.35rem;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

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

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.5rem;
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.timeline-place {
  font-size: 0.75rem;
  color: var(--muted);
}

.timeline-item h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 520px;
}

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

.skill-group h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.skill-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags li {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--text);
  border-radius: 100px;
  border: 1px solid transparent;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.skill-tags li:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background 0.3s, padding-left 0.4s var(--ease);
}

.project-card:hover {
  background: #161616;
  padding-left: 2.25rem;
}

.project-num {
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.project-card:hover .project-num {
  transform: translateX(4px);
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Contact */
.contact {
  padding: 6rem 1.5rem 4rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.contact-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.contact-title {
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.contact-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

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

.contact-phone {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.contact-phone a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

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

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

.contact-links a {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

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

.contact-footer {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.6;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

.hero .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero .reveal:nth-child(2) { transition-delay: 0.1s; }
.hero .reveal:nth-child(3) { transition-delay: 0.15s; }
.hero .reveal:nth-child(4) { transition-delay: 0.2s; }
.hero .reveal:nth-child(5) { transition-delay: 0.25s; }

/* Print */
@media print {
  .nav,
  .grain,
  .hero-actions,
  .btn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  .nav {
    gap: 1rem;
    font-size: 0.65rem;
  }

  .nav-link {
    font-size: 0.65rem;
  }
}

.loading,
.error {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.error p {
  margin-bottom: 0.75rem;
}

.error-hint {
  font-size: 0.9rem;
}

.error pre {
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  margin: 0.5rem 0 1rem;
}

.error code {
  color: var(--accent);
}
