/* ── Theme tokens ─────────────────────────────────────────── */
:root {
  --bg-0: #ffffff;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --ink: #12161c;
  --ink-soft: #3d4654;
  --muted: #6a7382;
  --line: color-mix(in srgb, #12161c 12%, transparent);
  --accent: #3d6fd8;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Figtree", sans-serif;
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

ul {
  list-style: none;
}

/* ── Atmosphere ───────────────────────────────────────────── */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #ffffff;
}

.atmosphere::before,
.atmosphere::after {
  display: none;
}

/* ── Nav (overlay — does not affect page height) ──────────── */
.nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 2rem, 680px);
  padding: 1.45rem 0 1.1rem;
  pointer-events: none;
}

.nav a {
  pointer-events: auto;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent);
}

.nav__logo {
  justify-self: start;
  z-index: 3;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
  pointer-events: auto;
}

.nav__logo:hover,
.nav__logo:focus-visible {
  color: var(--accent);
}

.nav__toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav__burger {
  display: none;
  pointer-events: auto;
}

.nav__menu {
  display: contents;
}

.nav__links,
.nav__social {
  display: flex;
  align-items: center;
}

.nav__links {
  justify-self: center;
  gap: 1.1rem;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav__action {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.25s var(--ease);
}

.nav__action:hover,
.nav__action:focus-visible {
  color: var(--accent);
}

.nav__links a[aria-current="page"] {
  color: var(--accent);
}

.nav__social {
  justify-self: end;
  gap: 0.7rem;
}

.nav__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
}

.nav__social svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Resume modal ─────────────────────────────────────────── */
.modal-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
  pointer-events: none;
}

.modal-toggle:checked ~ .modal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #12161c 35%, transparent);
  cursor: pointer;
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  min-height: 14rem;
  padding: 2rem 1.75rem 1.35rem;
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.35s var(--ease) both;
}

.modal-toggle:not(:checked) ~ .modal .modal__panel {
  animation: none;
}

.modal__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.modal__text {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.modal__email {
  display: inline-block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0;
}

.modal__email:hover,
.modal__email:focus-visible {
  text-decoration: underline;
}

.modal__close {
  display: inline-block;
  margin-top: auto;
  padding-top: 1.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

.modal__close:hover,
.modal__close:focus-visible {
  color: var(--ink);
}

/* ── Subpages ─────────────────────────────────────────────── */
.page--sub {
  max-width: 720px;
}

.subpage {
  animation: rise 0.9s var(--ease) both;
  max-width: 36rem;
}

.subpage__eyebrow {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.subpage__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.subpage__body {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.subpage__email {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--accent);
}

.subpage__email:hover,
.subpage__email:focus-visible {
  text-decoration: underline;
}

/* ── Layout ───────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vh, 5rem) clamp(1.25rem, 4vw, 3rem) clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vh, 3.5rem);
  text-align: center;
}

/* ── Identity ─────────────────────────────────────────────── */
.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.9s var(--ease) both;
}

.name {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.role {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* ── Work ─────────────────────────────────────────────────── */
.work {
  width: 100%;
  animation: rise 0.9s var(--ease) 0.12s both;
}

.work__heading {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.work__list {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.work__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: clamp(0.85rem, 2vh, 1.15rem) clamp(0.65rem, 1.5vw, 1.1rem);
  border-right: 1px solid var(--line);
  animation: rise 0.75s var(--ease) both;
  animation-delay: calc(0.22s + var(--i) * 0.07s);
}

.work__item:last-child {
  border-right: none;
}

.work__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.work__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  letter-spacing: -0.02em;
  transition: color 0.25s var(--ease);
}

a.work__title:hover,
a.work__title:focus-visible {
  color: var(--accent);
}

.work__role {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.work__desc {
  font-size: clamp(0.75rem, 1vw, 0.85rem);
  color: var(--ink-soft);
  line-height: 1.35;
  max-width: 18ch;
}

.work__link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.35rem;
  position: relative;
  transition: color 0.25s var(--ease);
}

a.work__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}

a.work__link:hover,
a.work__link:focus-visible {
  color: var(--accent);
}

a.work__link:hover::after,
a.work__link:focus-visible::after {
  transform: scaleX(1);
}

.work__link--muted {
  font-weight: 500;
  opacity: 0.85;
}

/* ── Motion ───────────────────────────────────────────────── */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Responsive: keep one viewport, no scroll ─────────────── */
@media (max-width: 900px) {
  .work__list {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.25rem;
  }

  .work__item {
    flex: 1 1 30%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-block: 0.75rem;
  }

  .work__item:nth-child(n + 7) {
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  .nav {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.15rem 0.85rem;
  }

  .nav__logo {
    font-size: 0.9rem;
  }

  .nav__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    z-index: 3;
  }

  .nav__burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  }

  .nav__toggle:checked + .nav__burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav__toggle:checked + .nav__burger span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle:checked + .nav__burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 4.25rem 1.25rem 1.5rem;
    background: color-mix(in srgb, var(--bg-0) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    pointer-events: none;
  }

  .nav__toggle:checked ~ .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__links {
    flex-direction: column;
    gap: 0.85rem;
  }

  .nav__links a,
  .nav__action {
    font-size: 0.95rem;
  }

  .nav__social {
    gap: 1rem;
  }

  .page {
    padding: 3.5rem 0.85rem 1rem;
    gap: 1.25rem;
  }

  .name {
    font-size: clamp(1.85rem, 9vw, 2.6rem);
    margin-bottom: 0.55rem;
  }

  .role {
    font-size: 0.95rem;
  }

  .work__heading {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .work__item--hide-mobile {
    display: none;
  }

  .work__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
  }

  .work__item {
    flex: none;
    padding: 0.6rem 0.45rem;
    border: none;
    background: var(--bg-0);
  }

  .work__item:last-child {
    grid-column: auto;
  }

  .work__desc {
    max-width: 15ch;
    font-size: 0.72rem;
  }

  .work__title {
    font-size: 0.9rem;
  }

  .work__role {
    font-size: 0.6rem;
  }

  .work__link {
    font-size: 0.68rem;
  }
}

@media (max-height: 700px) {
  .page {
    gap: 1.25rem;
    padding-block: 3rem 1rem;
  }

  .name {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 0.45rem;
  }

  .work__heading {
    margin-bottom: 0.65rem;
  }

  .work__item {
    padding-block: 0.55rem;
    gap: 0.3rem;
  }

  .work__desc {
    font-size: 0.72rem;
  }
}
