/* ============================================
   RESET & BASE
   ============================================ */

:root {
  --black: #212121;
  --text: #6A655E;
  --bg: #F9F8F6;
  --gray: #948F88;
  --ui-muted: #A39E96;
  --stroke: 1px solid var(--black);
  --font-sans: "Host Grotesk", sans-serif;
  --text-size: 1rem;
  --text-weight: 400;
  --ui-weight: 500;
  --content-max-width: 1600px;
  --page-padding: 1rem;
  --content-padding: 3rem;
  --gap: 2rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: normal;
  background-color: var(--bg);
  color: var(--black);
  line-height: 1.6;
}

::selection {
  background-color: rgb(230 226 219 / 50%);
}

::-moz-selection {
  background-color: rgb(230 226 219 / 50%);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: normal;
  color: var(--black);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.1;
}

.hero-text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: normal;
  font-size: 5rem;
  line-height: 1.05;
  color: var(--black);
  letter-spacing: -0.03em;
}

.hero-text__first-line,
.hero-text__second-line {
  display: block;
}

.hero-text__first-line {
  white-space: nowrap;
  height: 1.05em;
  line-height: 1.05;
}

.hero-text__typed {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  vertical-align: baseline;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.3;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 500;
  font-style: normal;
  color: var(--black);
  letter-spacing: 0;
}

p {
  font-family: var(--font-sans);
  font-weight: var(--text-weight);
  font-size: var(--text-size);
  line-height: 1.6;
  color: var(--black);
}

ul, ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

li {
  font-family: var(--font-sans);
  font-weight: var(--text-weight);
  font-size: var(--text-size);
  line-height: 1.6;
  color: var(--black);
  padding-left: 1em;
  position: relative;
}

li::before {
  content: '•';
  position: absolute;
  left: 0;
}

.nav__links li {
  padding-left: 0;
}

.nav__links li::before {
  display: none;
}

.image-caption {
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--gray);
}

.video-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}

.video-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

/* Stroke drawn on top of the video so subpixel gaps can't show through */
.video-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border: var(--stroke);
  pointer-events: none;
  z-index: 2;
}

.video-container video {
  border: none;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container video.loaded {
  opacity: 1;
}

.video-container .video-loader.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

img,
video {
  width: 100%;
  height: auto;
  display: block;
  border: var(--stroke);
  box-sizing: border-box;
}

.image-stroke {
  border: var(--stroke);
}

a {
  color: var(--gray);
  text-decoration: none;
  font-size: 1em;
}

a:hover {
  color: inherit;
}

/* Work cards — media left, text right */
.work-card-link {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  align-items: start;
  color: inherit;
}

.work-card__media {
  display: block;
  text-decoration: none;
  color: inherit;
  outline: none;
  min-width: 0;
  overflow: hidden;
}

/* Single stroke on the wrapper for image tiles (video tiles use .video-container) */
.work-card__media:has(> img) {
  border: var(--stroke);
  box-sizing: border-box;
}

.work-card__media:focus,
.work-card__media:focus-visible {
  outline: none;
}

.work-card-link__text {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: sticky;
  top: var(--content-padding);
  align-self: start;
}

.work-card-link__text .button {
  align-self: start;
}

.work-card-link h2,
.work-card-link p {
  margin: 0;
}

.work-card-link img,
.work-card-link video {
  width: 100%;
  display: block;
  border: none;
}

@media (hover: hover) and (pointer: fine) {
  .work-card__media,
  .work-card__media *,
  .job-header,
  .job-header * {
    cursor: none;
  }
}

.work-cursor,
.job-cursor {
  --x: 0px;
  --y: 0px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100002;
  pointer-events: none;
  opacity: 0;
  translate: var(--x) var(--y);
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: transform, opacity, translate;
}

.job-cursor {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--black);
  color: var(--bg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
}

.work-cursor.is-on,
.job-cursor.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (hover: none), (pointer: coarse) {
  .work-cursor,
  .job-cursor {
    display: none;
  }
}

.button {
  display: inline-block;
  padding: 1.125rem 1.35rem;
  background-color: var(--black);
  color: var(--bg);
  font-family: var(--font-sans);
  font-weight: var(--text-weight);
  font-size: var(--text-size);
  line-height: 1;
  font-style: normal;
  text-decoration: none;
  border: var(--stroke);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  background-color: var(--bg);
  color: var(--black);
  text-decoration: none;
}

.work-cursor.button {
  background-color: var(--black);
  color: var(--bg);
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  background-color: var(--bg);
  z-index: 1000;
  opacity: 0;
  animation: navDropIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.nav__container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  color: var(--black);
}

.nav__logo img {
  display: block;
  height: 18px;
  width: auto;
  border: none;
  transform: scale(1.25);
  transform-origin: left center;
}

.nav__links {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: var(--gap);
  align-items: center;
  margin: 0 0 0 auto;
  padding: 0;
}

.nav__link {
  font-family: var(--font-sans);
  font-weight: var(--ui-weight);
  font-size: var(--text-size);
  color: var(--ui-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  text-align: left;
  position: relative;
  padding-bottom: 0.15em;
}

.nav__link:hover {
  color: var(--ui-muted);
}

.nav__link.is-active {
  color: var(--black);
}

.nav__hamburger {
  display: none;
  position: relative;
  width: 28px;
  height: 24px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.nav__hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--black);
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.nav__hamburger-bar:first-child {
  margin-top: -7px;
}

.nav__hamburger-bar:last-child {
  margin-top: 7px;
}

.nav__hamburger.open .nav__hamburger-bar:first-child {
  margin-top: 0;
  transform: translateY(-50%) rotate(45deg);
}

.nav__hamburger.open .nav__hamburger-bar:last-child {
  margin-top: 0;
  transform: translateY(-50%) rotate(-45deg);
}

/* ============================================
   MOBILE MENU
   ============================================ */

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg);
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  padding: calc(var(--content-padding) * 2.5) var(--content-padding);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu__close {
  position: absolute;
  top: calc(var(--page-padding) + var(--content-padding) * 0.4);
  right: calc(var(--page-padding) + var(--content-padding));
  display: block;
}

.mobile-menu__link {
  font-family: var(--font-sans);
  color: var(--black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mobile-menu__link h1 {
  margin: 0;
  color: var(--black);
  font-size: 2.25rem;
  line-height: 1.1;
}

.mobile-menu__link:hover,
.mobile-menu__link:hover h1 {
  color: var(--black);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main {
  width: calc(100% - 2 * var(--page-padding));
  max-width: var(--content-max-width);
  margin: var(--page-padding) auto;
  padding: 0;
  border: var(--stroke);
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fadeIn 0.75s ease-out 0.75s forwards;
}

.main > .nav,
.main > .section {
  padding: var(--content-padding);
  border-bottom: var(--stroke);
}

.main > .nav {
  padding-top: calc(var(--content-padding) * 0.4);
  padding-bottom: calc(var(--content-padding) * 0.4);
}

.main > :last-child {
  border-bottom: none;
}

.main > .section.work,
.main > .section.about {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main--project {
  max-width: 900px;
}

.main--project > .section {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main--project .section > .section__block {
  padding: var(--content-padding);
  border-bottom: var(--stroke);
  gap: var(--gap);
}

.main--project .section > .section__block:last-child {
  border-bottom: none;
}

.main--project .section__block .section__block {
  padding: 0;
  border: none;
}

.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  border-bottom: var(--stroke);
}

.about-columns__item {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  padding: var(--content-padding);
}

.about-columns__item + .about-columns__item {
  border-left: var(--stroke);
}

.about-columns__item h2 {
  margin: 0;
}

.jobs {
  display: flex;
  flex-direction: column;
}

.job-item {
  padding: var(--content-padding);
  border-bottom: var(--stroke);
}

.job-item:last-child {
  border-bottom: none;
}

.contact h1 {
  margin: 0 0 var(--gap);
}

.contact h2 {
  margin: 0;
  max-width: 36ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-top: var(--gap);
}

.contact-link {
  display: flex;
  flex-direction: column;
}

.contact-link__value {
  color: var(--black);
  font-size: 1.125rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}

.contact-link__value:hover {
  color: var(--black);
}

.work > * {
  padding: var(--content-padding);
  border-bottom: var(--stroke);
}

.work > *:last-child {
  border-bottom: none;
}

.work-intro {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.work-intro p {
  margin: 0;
  max-width: 68ch;
}

.work-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.work-item.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.work-item.is-hidden {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .main {
    animation: none;
    opacity: 1;
  }

  .work-item {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

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

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

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

.work-filter {
  font-family: var(--font-sans);
  font-weight: var(--ui-weight);
  font-size: var(--text-size);
  color: var(--ui-muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.work-filter:hover {
  color: var(--ui-muted);
}

.work-filter.is-active {
  color: var(--black);
}

.section__block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.job-header {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--gap);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
}

.job-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.job-right-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap);
  text-align: right;
  width: 100%;
  min-width: 0;
}

.job-title,
.job-year {
  margin: 0;
  color: var(--black);
}

.job-company {
  margin: 0;
  color: var(--text);
}

.job-year {
  text-align: right;
}

.job-toggle-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--black);
  transition: transform 0.3s ease;
}

.job-header[aria-expanded="true"] .job-toggle-icon {
  transform: rotate(45deg);
}

.job-description {
  max-height: 0;
  max-width: 68ch;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-top 0.3s ease;
  padding-top: 0;
}

.job-header[aria-expanded="true"] + .job-description {
  max-height: 500px;
  padding-top: var(--gap);
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

@media (max-width: 1024px) {
  .about-columns {
    grid-template-columns: 1fr;
  }

  .about-columns__item + .about-columns__item {
    border-left: none;
    border-top: var(--stroke);
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: block;
  }

  .hero-text {
    font-size: 4.5rem;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --page-padding: 0.5rem;
    --content-padding: 1.5rem;
    --gap: 1rem;
  }

  .main > .nav {
    padding-top: var(--content-padding);
    padding-bottom: var(--content-padding);
  }

  .mobile-menu__close {
    top: calc(var(--page-padding) + var(--content-padding));
  }

  .work-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .work-card-link {
    grid-template-columns: 1fr;
  }

  .work-card-link__text {
    position: static;
  }

  .job-header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .job-right-wrapper {
    justify-content: flex-end;
    text-align: right;
    width: auto;
  }

  .job-year {
    text-align: right;
  }

  h1 {
    font-size: 1.75rem;
  }

  .mobile-menu__link h1 {
    font-size: 2.25rem;
    line-height: 1.1;
  }

  .hero-text {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.0625rem;
  }
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */

html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  inset: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 100001;
}

.custom-cursor__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: var(--black);
  border-radius: 50%;
  transform: translate3d(0, 0, 0);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
  will-change: transform, width, height, margin;
}

.custom-cursor.custom-cursor--hover {
  mix-blend-mode: difference;
}

.custom-cursor.custom-cursor--hover .custom-cursor__dot {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  background: #ffffff;
  opacity: 1;
}

.custom-cursor.is-suppressed .custom-cursor__dot {
  opacity: 0;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  html.has-custom-cursor,
  html.has-custom-cursor * {
    cursor: auto !important;
  }

  .custom-cursor {
    display: none !important;
  }
}
