/* —— Reset & tokens —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --bg-card: #111111;
  --border: #1f1f1f;
  --border-hover: #333333;
  --text: #e8e8e8;
  --text-muted: #888888;
  --text-dim: #5c5c5c;
  --accent: #ffffff;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max-width: 68rem;
  --header-h: 4rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

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

strong {
  font-weight: 500;
  color: var(--accent);
}

/* —— Skip link —— */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 0.25rem;
}

.skip-link:focus {
  top: 1rem;
}

/* —— Header —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.logo {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* —— Layout —— */
main {
  padding-top: var(--header-h);
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem clamp(1.25rem, 4vw, 2.5rem);
}

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

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

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

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

.section-tagline a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— Hero —— */
.hero {
  min-height: calc(100vh - var(--header-h));
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 6rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero-title {
  margin: 0 0 0.65rem;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-tagline {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

.hero-lead {
  max-width: 38rem;
  margin: 0 0 2rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.hero-links a {
  font-size: 0.8125rem;
  font-family: var(--mono);
  color: var(--text-muted);
}

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

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

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

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

.btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
}

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

/* —— About —— */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 14rem) 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo {
  margin: 0;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  filter: grayscale(20%);
}

.about-content p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1.25rem 2rem;
  margin: 2rem 0 0;
}

.about-facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.about-facts dt {
  font-size: 0.6875rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

.about-facts dd {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
}

.about-facts a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— Timeline —— */
.timeline-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 3rem 4rem;
}

.column-title {
  margin: 0 0 1.5rem;
  font-size: 0.6875rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

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

.timeline-item time {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.timeline-item h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
}

.timeline-org {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.timeline-item p:last-child {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* —— Skills —— */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-tags li {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.skill-tags li:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* —— Projects —— */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  overflow: hidden;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: background 0.25s var(--ease);
}

.project-card:hover {
  background: var(--bg-elevated);
}

.project-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}

.project-card:hover .project-card-media img {
  opacity: 1;
  transform: scale(1.02);
}

.project-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem 1.5rem;
}

.project-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.project-card-body p {
  margin: 0 0 1rem;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-meta {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.project-meta li {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* —— Contact —— */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.contact-info p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.contact-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.contact-label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact-form {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  transition: border-color 0.2s var(--ease);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--border-hover);
}

.form-row textarea {
  resize: vertical;
  min-height: 7rem;
}

.form-note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* —— Footer —— */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer-note {
  margin-top: 0.35rem !important;
  font-family: var(--mono);
  font-size: 0.6875rem !important;
}

/* —— Responsive —— */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
  }

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

  .site-nav a {
    font-size: 1rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 12rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
