:root {
  --paper: #f6f4ef;
  --ink: #131210;
  --ink-soft: #55524c;
  --hairline: #d8d4ca;
  --display-font: "Fraunces", serif;
  --body-font: "Inter", sans-serif;
  --mono-font: "JetBrains Mono", monospace;
  --max-width: 760px;
  --gap: 2px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.preloading {
  overflow: hidden;
}

/* Preloader */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.preloader.hide {
  transform: translateY(-100%);
}

.preloader-text {
  font-family: var(--mono-font);
  font-size: 15px;
  color: var(--paper);
  letter-spacing: 0.02em;
}

.preloader-text::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  background: var(--paper);
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader {
    transition: none;
  }
  .preloader-text::after {
    animation: none;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px 24px;
  border-bottom: 1px solid var(--hairline);
}

.section:last-of-type {
  border-bottom: none;
}

.label {
  display: block;
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 244, 239, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
  transition: padding 0.2s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.2s ease;
}

.nav.scrolled .nav-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-name {
  font-family: var(--mono-font);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.nav-links a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}

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

/* Hero */

.hero {
  padding-top: 120px;
  padding-bottom: 120px;
}

.hero-name {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.05;
  margin: 0 0 8px;
}

.hero-role {
  font-family: var(--body-font);
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.hero-statement {
  max-width: 520px;
  font-size: 18px;
  margin: 0 0 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-block;
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: #000;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.hero-meta {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
}

.hero > * {
  opacity: 0;
  transform: translateY(16px);
}

.hero.reveal > * {
  animation: hero-fade-up 0.6s ease forwards;
}

.hero.reveal > *:nth-child(1) { animation-delay: 0.05s; }
.hero.reveal > *:nth-child(2) { animation-delay: 0.15s; }
.hero.reveal > *:nth-child(3) { animation-delay: 0.25s; }
.hero.reveal > *:nth-child(4) { animation-delay: 0.35s; }
.hero.reveal > *:nth-child(5) { animation-delay: 0.45s; }
.hero.reveal > *:nth-child(6) { animation-delay: 0.55s; }

@keyframes hero-fade-up {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero > * {
    opacity: 1;
    transform: none;
  }
  .hero.reveal > * {
    animation: none;
  }
}

/* About */

.about-grid {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.about-photo {
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ece9e1;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-photo-placeholder {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--ink-soft);
}

.about-text p {
  margin: 0 0 16px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .about-grid {
    flex-direction: column;
  }
}

/* Skills */

.skills-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.skills-row:last-child {
  border-bottom: none;
}

.skills-category {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
}

.skills-items {
  font-size: 16px;
}

@media (max-width: 560px) {
  .skills-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Projects */

.project-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
}

.project-row:last-child {
  border-bottom: none;
}

.project-thumb {
  width: 96px;
  height: 96px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  background: #ece9e1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-thumb-placeholder {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--ink-soft);
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-name {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 20px;
}

.project-name-link {
  border-bottom: 1px solid transparent;
}

.project-name-link:hover {
  border-color: var(--ink);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.project-link {
  border-bottom: 1px solid transparent;
}

.project-link:hover {
  border-color: var(--ink);
}

.project-description {
  margin: 0 0 10px;
}

.project-outcomes {
  margin: 0 0 12px;
  padding-left: 18px;
}

.project-outcomes li {
  margin-bottom: 4px;
}

.project-outcomes li:last-child {
  margin-bottom: 0;
}

.project-tech {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
}

@media (max-width: 560px) {
  .project-row {
    grid-template-columns: 64px 1fr;
  }
  .project-thumb {
    width: 64px;
    height: 64px;
  }
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Experience */

.experience-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}

.experience-row:last-child {
  border-bottom: none;
}

.experience-range {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 3px;
}

.experience-role {
  font-weight: 500;
  margin: 0 0 8px;
}

.experience-role .company {
  color: var(--ink-soft);
  font-weight: 400;
}

.experience-impact {
  margin: 0;
  padding-left: 18px;
}

.experience-impact li {
  margin-bottom: 4px;
}

.experience-impact li:last-child {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .experience-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Education */

.education-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}

.education-row:last-child {
  border-bottom: none;
}

.education-range {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 3px;
}

.education-degree {
  font-weight: 500;
  margin: 0 0 4px;
}

.education-school {
  color: var(--ink-soft);
  margin: 0;
}

@media (max-width: 560px) {
  .education-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Contact */

.contact-statement {
  font-size: 18px;
  margin: 0 0 24px;
}

.contact-email {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ink);
}

.contact-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.contact-links a {
  border-bottom: 1px solid transparent;
}

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

/* Footer */

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--ink-soft);
}
