:root {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --dim: rgba(242, 242, 242, 0.45);
  --faint: rgba(242, 242, 242, 0.12);
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

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

/* the page itself is black too, so while the body fades in or out you see black, never white */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* every page fades up from black (no forward fill, so nothing lingers once it's done) */
  animation: page-in 420ms cubic-bezier(0.25, 0.6, 0.3, 1) backwards;
}

@keyframes page-in { from { opacity: 0; } }

/* nav.js adds this when a link to another page is followed, so pages dip to black between */
body.is-leaving { opacity: 0; transition: opacity 180ms ease-in; }

[hidden] { display: none !important; }

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

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 0.95; }

.dim { color: var(--dim); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Nav ---- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background-color 300ms var(--ease), backdrop-filter 300ms var(--ease);
}

.nav--solid {
  background: rgba(10, 10, 10, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.nav__name { font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }

.nav__links { display: flex; gap: clamp(20px, 3vw, 40px); }

.nav__links a {
  font-size: 14px; color: var(--dim);
  transition: color 200ms var(--ease);
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}

.nav__links a:hover, .nav__links a[aria-current='page'] { color: var(--fg); }
.nav__links a[aria-current='page'] { border-bottom-color: var(--fg); }

.nav__toggle { display: none; font-size: 14px; color: var(--dim); }

@media (max-width: 640px) {
  .nav__toggle { display: block; }
  .nav__toggle, .nav__name { position: relative; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; gap: 12px;
    padding: 0 var(--gutter);
    background: var(--bg);
    opacity: 0; visibility: hidden;
    transition: opacity 250ms var(--ease), visibility 0s linear 250ms;
  }
  .nav__links a { font: 400 clamp(2.5rem, 12vw, 3.5rem)/1.1 var(--serif); border: 0; }
  .nav--open .nav__links { opacity: 1; visibility: visible; transition: opacity 250ms var(--ease); }
}

/* ---- Phones: bigger tap targets, the same look ----
   An invisible layer around each small link grows the area a finger can hit to about 44px tall
   without moving anything that is drawn. */
@media (max-width: 640px) {
  .nav__toggle, .nav__name, .project__back,   /* (.viewer__back is already positioned) */
  .about__links a, .about-page__contact a, .about__more a, .experience__contact a { position: relative; }
  .nav__toggle::after, .nav__name::after, .project__back::after, .viewer__back::after,
  .about__links a::after, .about-page__contact a::after, .about__more a::after, .experience__contact a::after {
    content: ''; position: absolute; inset: -12px -10px;
  }
}

/* ---- Placeholder pages ---- */

.placeholder {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 48px) var(--gutter) clamp(48px, 10vh, 120px);
}

.placeholder h1 { margin: 0; font-size: clamp(4rem, 14vw, 12rem); }

.placeholder p { margin: 24px 0 0; max-width: 32ch; font-size: clamp(1rem, 1.6vw, 1.25rem); }

.placeholder .soon {
  margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--faint);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}

/* ---- Footer ---- */

.footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 32px var(--gutter);
  font-size: 13px; color: var(--dim);
  border-top: 1px solid var(--faint);
}

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