:root {
  --bg: #ffffff;
  --ink: #141414;
  --ink-soft: #4a4a48;
  --accent: #0f6e6a;
  --chrome-pad: clamp(1.1rem, 3vw, 2rem);
  --font-display: 'Syne', 'Noto Sans SC', sans-serif;
  --font-body: 'Instrument Sans', 'Noto Sans SC', sans-serif;
  color-scheme: light;
}

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

html,
body {
  min-height: 100%;
  min-height: 100dvh;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 20, 0.28) transparent;
  /* keep layout stable without opaque gutter */
  scrollbar-gutter: auto;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}

body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: rgba(20, 20, 20, 0.28);
  border-radius: 999px;
  background-clip: padding-box;
  border: 1px solid transparent;
}

body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 20, 20, 0.42);
}

.home-bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  /* 100vw covers the scrollbar column so image isn't cropped */
  width: 100vw;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background-color: transparent;
  opacity: 0;
  transition: opacity 420ms ease;
}

.home-bg img,
.home-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.home-bg--video {
  z-index: 0;
}

.home-bg--hover {
  z-index: 1;
}

.home-bg.is-visible {
  opacity: 1;
}

body.has-home-video {
  background-color: transparent;
}

body.has-home-video .shell,
body.has-home-video .main,
body.has-home-video .home {
  background: transparent;
}

body.has-home-video .chrome--top,
body.has-home-video .chrome--bottom {
  background: transparent;
  backdrop-filter: none;
}

body.is-home-bg {
  background-color: transparent;
  scrollbar-width: none;
}

body.is-home-bg .shell,
body.is-home-bg .main,
body.is-home-bg .home {
  background: transparent;
}

body.is-home-bg .chrome--top,
body.is-home-bg .chrome--bottom {
  background: transparent;
  backdrop-filter: none;
}

body.is-home-bg::-webkit-scrollbar,
html:has(body.is-home-bg)::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
  background: transparent;
}

body.is-home-bg::-webkit-scrollbar-track,
body.is-home-bg::-webkit-scrollbar-thumb,
html:has(body.is-home-bg)::-webkit-scrollbar-track,
html:has(body.is-home-bg)::-webkit-scrollbar-thumb {
  background: transparent;
  display: none;
}

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

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

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

.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chrome {
  display: flex;
  align-items: center;
  padding: var(--chrome-pad);
  pointer-events: none;
}

.chrome > * {
  pointer-events: auto;
}

.chrome--top {
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
  backdrop-filter: blur(6px);
}

.chrome--bottom {
  justify-content: flex-start;
  align-items: flex-end;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 2rem;
  max-width: min(52vw, 15rem);
}

.logo__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo__wordmark {
  display: block;
  height: clamp(1.46rem, 3.46vw, 2rem);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.logo-mark--corner {
  position: fixed;
  right: var(--chrome-pad);
  bottom: var(--chrome-pad);
  z-index: 12;
  line-height: 0;
  pointer-events: auto;
  opacity: 0.9;
  transition: transform 220ms ease, opacity 220ms ease;
}

.logo-mark--corner__img {
  display: block;
  width: clamp(2.45rem, 6.3vw, 4.025rem);
  height: auto;
}

.logo-mark--corner:hover {
  transform: scale(1.04);
  opacity: 1;
}

.logo-mark--inlist {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.nav__link {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: #000000;
  position: relative;
  transition: color 220ms ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: #000000;
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.chrome--top .nav {
  display: flex;
}

.dock {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dock__social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.dock__link {
  display: none;
}

.contact-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #000000;
  line-height: 1;
  transition: transform 220ms ease, opacity 220ms ease;
}

.contact-mark__icon {
  display: block;
  width: 1.15rem;
  height: auto;
  flex-shrink: 0;
}

.contact-mark:hover {
  transform: translateY(-1px);
}

.contact-mark.is-active {
  opacity: 0.55;
  pointer-events: none;
}

.ig {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #000000;
  transition: color 220ms ease, transform 220ms ease;
}

.ig:hover {
  color: #000000;
  transform: translateY(-1px);
}

.main {
  padding: 0 var(--chrome-pad) 4rem;
}

.home {
  min-height: calc(100dvh - 9rem);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  padding: 2.5rem 0 3.5rem;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-list__item {
  opacity: 0;
  animation: rise 640ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.project-list__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.4rem;
}

.project-list__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.6vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #4dff2a;
  text-shadow:
    0 0 1px rgba(57, 255, 20, 1),
    0 0 8px rgba(57, 255, 20, 0.45),
    0 0 16px rgba(57, 255, 20, 0.25);
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 320ms ease, letter-spacing 320ms ease, text-shadow 320ms ease;
}

.project-list__link:hover .project-list__title {
  background-size: 100% 1px;
  letter-spacing: 0.01em;
  text-shadow:
    0 0 1px rgba(57, 255, 20, 1),
    0 0 10px rgba(57, 255, 20, 0.55),
    0 0 22px rgba(57, 255, 20, 0.3);
}

.project-list__sub {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.85;
}

.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 0 2rem;
  animation: fade 420ms ease both;
}

.page--narrow {
  max-width: 34rem;
}

.page--about {
  max-width: 42rem;
  padding-bottom: 4rem;
}

.page__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}

.page__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 1.02rem;
}

.page__body p {
  margin: 0;
}

.page__body--justify p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.page__lead {
  color: var(--ink-soft);
}

.page__note {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  opacity: 0.7;
}

.cv-block {
  margin-top: 2.75rem;
}

.cv-block__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--ink);
}

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.cv-list__tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.text-link {
  display: inline-block;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: color 200ms ease;
}

.text-link:hover {
  color: var(--accent);
}

.project {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  animation: fade 420ms ease both;
}

.project__header {
  margin-bottom: 1.5rem;
}

.project__lead {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.project__copy {
  margin-top: 0;
  margin-bottom: 2rem;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.project__back {
  margin-bottom: 1.25rem;
}

.project__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.035em;
  margin: 0.75rem 0 0.35rem;
  line-height: 1.1;
}

.project__subtitle {
  margin: 0;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.project__meta {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.project__desc {
  margin: 1rem 0 0;
  max-width: none;
  width: 100%;
  font-size: 1.125rem; /* ~18px */
  line-height: 1.65;
  color: var(--ink-soft);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.project__copy .project__desc {
  margin: 0;
}

.project__quote {
  margin: 0.25rem 0;
  padding: 0.85rem 0 0.85rem 1rem;
  border-left: 1px solid rgba(20, 20, 20, 0.18);
  color: var(--ink);
  font-style: italic;
  line-height: 1.6;
}

.project__quote-line {
  display: block;
}

.project__cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.88rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.project__gallery {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project__figure {
  margin: 0;
  overflow: hidden;
}

.project__figure img {
  width: 100%;
  background: rgba(255, 255, 255, 0.35);
}

.artwork-info {
  margin: -0.35rem 0 0.35rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.artwork-info__title {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 500;
}

.artwork-info__line {
  margin: 0.15rem 0 0;
}

.project__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.project__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.project__video--fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #161616;
  color: #f2f2f2;
  padding: 1.5rem;
  box-sizing: border-box;
}

.project__video-link {
  color: #39ff14;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project__video-note {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  max-width: 28rem;
  line-height: 1.45;
}

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

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 15px; /* one step down from 16px */
  }

  .home-bg {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
  }

  /* hide scrollbar on mobile home so it never covers hover images */
  html,
  body {
    overflow-y: auto;
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .chrome--top {
    justify-content: flex-start;
  }

  .chrome--top .nav {
    display: none;
  }

  .chrome--bottom {
    justify-content: center;
    align-items: flex-end;
    padding-bottom: calc(var(--chrome-pad) + env(safe-area-inset-bottom, 0px));
  }

  .logo-mark--corner:not(.logo-mark--inlist) {
    display: none !important;
  }

  .logo-mark--inlist {
    display: flex !important;
    position: static;
    justify-content: center;
    align-items: center;
    margin: 2.75rem auto 1.25rem;
    width: 100%;
    max-width: 100%;
    z-index: 2;
  }

  .logo-mark--inlist .logo-mark--corner__img {
    width: clamp(2.38rem, 29.4vw, 4.55rem);
  }

  .dock {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: nowrap;
  }

  .dock__social {
    display: contents;
  }

  .dock__link {
    display: inline;
  }

  .nav__link,
  .ig span,
  .contact-mark span {
    font-size: 0.75rem;
  }

  .contact-mark {
    gap: 0.3rem;
  }

  .contact-mark__icon {
    width: 1rem;
  }

  .ig {
    gap: 0.3rem;
  }

  .ig svg {
    width: 15px;
    height: 15px;
  }

  .main {
    padding-bottom: 5.5rem;
  }

  .home {
    min-height: calc(100dvh - 8rem);
    padding-bottom: 4.5rem;
  }

  .project-list {
    gap: 1.25rem;
  }

  .project-list__link {
    gap: 0.05rem;
  }

  .project-list__title {
    font-size: clamp(1.15rem, 6vw, 1.45rem);
    letter-spacing: -0.04em;
    line-height: 1.08;
  }

  .project-list__link:hover .project-list__title {
    letter-spacing: -0.02em;
  }

  .project-list__sub {
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
  }

  .logo__wordmark {
    height: clamp(1.38rem, 5.76vw, 1.74rem);
  }

  .nav__link,
  .ig {
    letter-spacing: 0.01em;
  }

  .page__body,
  .project__desc,
  .project__copy {
    line-height: 1.5;
    gap: 0.85rem;
  }

  .project__desc {
    font-size: 1rem; /* keep mobile from inheriting the desktop bump too strongly */
  }

  .project__title {
    letter-spacing: -0.045em;
    line-height: 1.05;
  }

  .project__subtitle,
  .cv-block__title {
    letter-spacing: 0.03em;
  }

  .cv-list {
    gap: 0.5rem;
    line-height: 1.4;
  }

  .project__quote {
    line-height: 1.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-list__item,
  .page,
  .project {
    animation: none;
    opacity: 1;
  }

  .project-list__title,
  .nav__link::after,
  .ig {
    transition: none;
  }
}
