:root {
  --ink: #1a2332;
  --ink-soft: #3d4a5c;
  --mist: #e8eef4;
  --paper: #f4f7fa;
  --teal: #0b6e6a;
  --teal-deep: #085652;
  --sand: #c4a574;
  --white: #ffffff;
  --line: rgba(26, 35, 50, 0.12);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Sora", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 72rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(11, 110, 106, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(196, 165, 116, 0.12), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--mist) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.25s var(--ease);
}

a:hover {
  color: var(--teal-deep);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 100;
}

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

/* —— Header —— */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding: 1rem var(--space);
  transition: background 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(244, 247, 250, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__cta {
  color: var(--white) !important;
  background: var(--teal);
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
}

.nav__cta:hover {
  background: var(--teal-deep);
  color: var(--white) !important;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--white);
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.04);
  animation: hero-drift 18s var(--ease) infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translateY(0);
  }
  to {
    transform: scale(1.08) translateY(-1.5%);
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      rgba(16, 28, 40, 0.92) 0%,
      rgba(16, 28, 40, 0.72) 42%,
      rgba(16, 28, 40, 0.35) 70%,
      rgba(16, 28, 40, 0.2) 100%
    ),
    linear-gradient(to top, rgba(16, 28, 40, 0.85) 0%, transparent 45%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(6rem, 14vh, 8rem) var(--space) clamp(3rem, 8vh, 5rem);
}

.hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.hero__name {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 10vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero__headline {
  margin: 0 0 0.75rem;
  max-width: 28ch;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
}

.hero__lede {
  margin: 0 0 2rem;
  max-width: 40ch;
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.72);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn--primary:hover {
  background: #d4b78a;
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.8);
}

.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  animation: rise 0.9s var(--ease) forwards;
}

.reveal-delay-1 {
  animation-delay: 0.12s;
}
.reveal-delay-2 {
  animation-delay: 0.24s;
}
.reveal-delay-3 {
  animation-delay: 0.36s;
}
.reveal-delay-4 {
  animation-delay: 0.48s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Sections —— */
.section {
  padding: clamp(4rem, 10vw, 7rem) var(--space);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section__label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.section__title {
  margin: 0 0 2.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.about__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about__text {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 42ch;
}

.about__highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 2px solid var(--teal);
  padding-left: 1.5rem;
}

.about__highlights strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.about__highlights span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

.timeline__item {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.timeline__item:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.timeline__meta time {
  font-weight: 600;
  color: var(--ink);
}

.timeline__body h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.timeline__org {
  margin: 0 0 0.85rem;
  color: var(--teal);
  font-weight: 500;
  font-size: 0.95rem;
}

.timeline__body > p:not(.timeline__org):not(.timeline__stack) {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
}

.timeline__stack {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  opacity: 0.85;
}

/* —— Projects —— */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project {
  display: grid;
  grid-template-columns: minmax(12rem, 1.1fr) 1.5fr auto;
  gap: 1.25rem 2rem;
  align-items: baseline;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.35s var(--ease), background 0.35s var(--ease);
}

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

.project:hover {
  padding-left: 0.75rem;
  background: linear-gradient(
    90deg,
    rgba(11, 110, 106, 0.06),
    transparent 60%
  );
}

.project__name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.project__desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.project__meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  white-space: nowrap;
  justify-self: end;
}

.projects__more {
  margin: 2rem 0 0;
}

.projects__more a {
  font-weight: 500;
  text-decoration: none;
}

.projects__more a:hover {
  text-decoration: underline;
}

/* —— Skills —— */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 2.5rem;
}

.skills__grid h3 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.skills__grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* —— Education —— */
.edu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.edu-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.edu-list p {
  margin: 0;
  color: var(--ink-soft);
}

/* —— Contact —— */
.contact {
  background: var(--ink);
  color: var(--white);
  margin-top: 2rem;
}

.contact .section__label {
  color: var(--sand);
}

.contact .section__title {
  color: var(--white);
  max-width: 16ch;
}

.contact__lede {
  margin: -1.5rem 0 2.5rem;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.7);
}

.contact__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
}

.contact__links a {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 0.15rem;
}

.contact__links a:hover {
  color: var(--sand);
  border-color: var(--sand);
}

/* —— Footer —— */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem var(--space);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer p {
  margin: 0;
}

/* —— Scroll reveal —— */
.section.is-visible .section__header,
.section.is-visible .about__grid,
.section.is-visible .timeline,
.section.is-visible .project-list,
.section.is-visible .skills__grid,
.section.is-visible .edu-list,
.section.is-visible .contact__links {
  animation: rise 0.8s var(--ease) both;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

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

  .project__meta {
    justify-self: start;
  }

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

@media (max-width: 720px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    inset: 0 0 auto;
    top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5rem 1.5rem 1.5rem;
    background: rgba(244, 247, 250, 0.98);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform 0.4s var(--ease);
  }

  .nav__links.is-open {
    transform: translateY(0);
  }

  .nav__links a {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .nav__cta {
    margin-top: 0.75rem;
    text-align: center;
    border-bottom: 0 !important;
  }

  .hero__media img {
    object-position: 70% 15%;
  }

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

  .site-footer {
    flex-direction: column;
    text-align: center;
  }
}

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

  .reveal,
  .hero__media img,
  .section.is-visible .section__header,
  .section.is-visible .about__grid,
  .section.is-visible .timeline,
  .section.is-visible .project-list,
  .section.is-visible .skills__grid,
  .section.is-visible .edu-list,
  .section.is-visible .contact__links {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
