:root {
  --ink: #131416;
  --muted: #62666d;
  --line: #dfe2e7;
  --surface: #f1f3f6;
  --white: #ffffff;
  --blue: #3157e7;
  --blue-dark: #2444bd;
  --max-width: 76rem;
  --page-gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-space: clamp(5rem, 10vw, 9rem);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.gallery-open {
  overflow: hidden;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

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

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.hero,
.work-section,
.about-section,
.site-footer {
  width: min(var(--max-width), calc(100% - (var(--page-gutter) * 2)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.5rem;
  border-bottom: 1px solid var(--line);
}

.name-link {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.name-link > span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.site-header nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: center;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

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

.site-header nav .nav-contact {
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  color: var(--white);
  background: var(--ink);
}

.site-header nav .nav-contact:hover,
.site-header nav .nav-contact:focus-visible {
  color: var(--white);
  background: var(--blue);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(22rem, 0.92fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  min-height: calc(100svh - 5.5rem);
  padding-block: clamp(4rem, 8vw, 7rem);
}

.intro-line,
.section-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 10ch;
  margin: 1.25rem 0 1.75rem;
  font-size: clamp(3.2rem, 6.8vw, 5.75rem);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
}

.hero-summary {
  max-width: 39rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-top: 2.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.8rem 1.15rem;
  border-radius: 0.55rem;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  color: var(--white);
  background: var(--blue);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--blue-dark);
}

.text-link {
  font-weight: 700;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--blue);
}

.hero-preview {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 38rem;
  padding: 4.75rem 2.5rem 4rem;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  cursor: zoom-in;
}

.hero-preview img {
  width: min(16rem, 72%);
  max-height: 29rem;
  object-fit: contain;
  filter: drop-shadow(0 1.5rem 2rem rgb(9 22 75 / 24%));
  animation: preview-reveal 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes preview-reveal {
  from {
    clip-path: inset(10% 0 0);
    filter: blur(8px) drop-shadow(0 1.5rem 2rem rgb(9 22 75 / 10%));
    transform: translateY(1.5rem);
  }
  to {
    clip-path: inset(0);
    filter: blur(0) drop-shadow(0 1.5rem 2rem rgb(9 22 75 / 24%));
    transform: translateY(0);
  }
}

.preview-label,
.preview-action {
  position: absolute;
  left: 1.5rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.preview-label {
  top: 1.4rem;
}

.preview-action {
  bottom: 1.4rem;
}

.hero-preview:hover .preview-action,
.hero-preview:focus-visible .preview-action {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.work-section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.section-heading h2,
.about-intro h2,
.contact-section h2 {
  margin: 1rem 0 0;
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

.section-heading > p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.filter-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  margin-top: 4rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-row > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-button {
  min-height: 2.25rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.filter-button.is-selected {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.filter-status:empty {
  display: none;
}

.project-entry[hidden],
.featured-work[hidden],
.more-work[hidden] {
  display: none !important;
}

.featured-project {
  display: grid;
  grid-template-columns: minmax(21rem, 1.1fr) minmax(18rem, 0.9fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
  padding-block: clamp(4.5rem, 8vw, 7.5rem);
  border-bottom: 1px solid var(--line);
}

.project-media {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 31rem;
  padding: 2.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  place-items: center;
  background: var(--surface);
  cursor: zoom-in;
}

.project-media > img {
  max-width: 100%;
  max-height: 26rem;
  object-fit: contain;
}

.project-media > span {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.45rem;
  color: var(--white);
  background: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.project-media:hover > span,
.project-media:focus-visible > span {
  background: var(--blue);
}

.media-blue {
  background: var(--blue);
}

.media-phone > img {
  max-height: 28rem;
  filter: drop-shadow(0 1rem 1.7rem rgb(17 28 67 / 22%));
}

.media-landscape > img {
  max-height: none;
}

.media-landscape {
  min-height: 23rem;
}

.media-brightside > img {
  width: 100%;
  height: 18rem;
  object-fit: contain;
}

.project-stack {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.project-copy h3 {
  margin: 0.7rem 0 1.4rem;
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1;
}

.project-copy > p:not(.project-stack) {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.project-copy .project-detail {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}

.project-detail strong {
  color: var(--ink);
}

.row-action {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 1.75rem;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.row-action:hover,
.row-action:focus-visible {
  color: var(--blue);
}

.more-work {
  padding-top: clamp(5rem, 9vw, 8rem);
}

.more-work > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.more-work > header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.more-work > header p {
  margin: 0;
  color: var(--muted);
}

.project-list {
  border-top: 1px solid var(--ink);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(14rem, 0.9fr) minmax(18rem, 1.4fr) auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: 9rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.project-row h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.project-row > p {
  max-width: 45rem;
  margin: 0;
  color: var(--muted);
}

.project-row .row-action {
  justify-self: end;
  margin-top: 0;
  white-space: nowrap;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(19rem, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(4rem, 9vw, 9rem);
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
}

.about-intro h2 {
  font-size: clamp(2.6rem, 5vw, 4.5rem);
}

.about-intro > p:last-child {
  max-width: 38rem;
  margin: 1.75rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.background-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.background-columns h3 {
  margin: 0 0 1.2rem;
  font-size: 1.1rem;
}

.background-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.background-list li {
  display: grid;
  gap: 0.22rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.background-list time,
.background-list li > span:first-child {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
}

.background-list strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.background-list li > span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  padding: var(--section-space) max(var(--page-gutter), calc((100vw - var(--max-width)) / 2));
  color: var(--white);
  background: var(--blue);
}

.contact-section .section-kicker {
  color: #dce4ff;
}

.contact-section h2 {
  max-width: 11ch;
}

.contact-section > div:last-child > p {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: #edf1ff;
  font-size: 1.08rem;
}

.button-light {
  color: var(--ink);
  background: var(--white);
}

.button-light:hover,
.button-light:focus-visible {
  color: var(--white);
  background: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  min-height: 7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  gap: 1.5rem;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
}

.gallery-modal {
  width: min(68rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  color: var(--ink);
  background: var(--white);
}

.gallery-modal::backdrop {
  background: rgb(12 13 16 / 88%);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  min-height: 5.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.gallery-header p,
.gallery-header h2 {
  margin: 0;
}

.gallery-header p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.gallery-header h2 {
  margin-top: 0.15rem;
  font-size: 1.4rem;
}

.gallery-close,
.gallery-arrow {
  display: grid;
  border: 1px solid var(--line);
  place-items: center;
  color: var(--ink);
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.gallery-close {
  min-height: 2.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.45rem;
}

.gallery-close:hover,
.gallery-arrow:hover,
.gallery-close:focus-visible,
.gallery-arrow:focus-visible {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.gallery-stage {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  gap: 1rem;
  align-items: center;
  min-height: min(66dvh, 43rem);
  padding: 1.25rem;
  background: var(--surface);
}

.gallery-stage figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: min(60dvh, 39rem);
  margin: 0;
  place-items: center;
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-stage figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.gallery-arrow {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.2rem;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.65rem;
  min-height: 6rem;
  padding: 0.85rem 1.25rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.gallery-thumbnail {
  flex: 0 0 4.25rem;
  height: 4.25rem;
  padding: 0.25rem;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  background: var(--surface);
  cursor: pointer;
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbnail:hover,
.gallery-thumbnail:focus-visible,
.gallery-thumbnail.is-current {
  border-color: var(--blue);
}

.noscript-note {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  max-width: 30rem;
  margin: 0;
  padding: 1rem;
  color: var(--white);
  background: var(--ink);
}

@media (max-width: 900px) {
  .site-header nav a:not(.nav-contact) {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding-top: 2rem;
  }

  .hero-preview {
    min-height: 34rem;
  }

  .section-heading,
  .about-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .featured-project {
    grid-template-columns: 1fr;
  }

  .project-copy {
    max-width: 42rem;
  }

  .project-row {
    grid-template-columns: minmax(13rem, 0.8fr) minmax(16rem, 1.2fr);
  }

  .project-row .row-action {
    grid-column: 2;
    justify-self: start;
  }

  .contact-section {
    align-items: start;
  }
}

@media (max-width: 640px) {
  :root {
    --page-gutter: 1.15rem;
    --section-space: 4.5rem;
  }

  .site-header {
    min-height: 4.75rem;
  }

  .name-link {
    font-size: 0;
  }

  .name-link > span {
    font-size: 0.68rem;
  }

  .site-header nav .nav-contact {
    min-height: 2.6rem;
    padding: 0.55rem 0.8rem;
  }

  .hero {
    gap: 3.5rem;
    padding-block: 4rem;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero h1 {
    font-size: clamp(3rem, 14vw, 4.4rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-preview {
    min-height: 30rem;
    padding-inline: 1.25rem;
  }

  .hero-preview img {
    width: min(14rem, 74%);
    max-height: 23rem;
  }

  .section-heading h2,
  .about-intro h2,
  .contact-section h2 {
    font-size: clamp(2.5rem, 12vw, 3.6rem);
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 2.5rem;
  }

  .featured-project {
    gap: 2.5rem;
    padding-block: 4rem;
  }

  .project-media {
    min-height: 27rem;
    padding: 1.5rem;
  }

  .media-landscape {
    min-height: 18rem;
  }

  .project-media > img,
  .media-phone > img {
    max-height: 23rem;
  }

  .media-brightside > img {
    height: 14rem;
  }

  .project-copy h3 {
    font-size: 3rem;
  }

  .more-work > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding-block: 1.75rem;
  }

  .project-row .row-action {
    grid-column: auto;
  }

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

  .contact-section {
    padding-inline: var(--page-gutter);
  }

  .button-light {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 2rem;
  }

  .gallery-modal {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .gallery-stage {
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    gap: 0.45rem;
    min-height: 63dvh;
    padding: 0.75rem;
  }

  .gallery-stage figure {
    height: 58dvh;
  }

  .gallery-arrow {
    width: 2.5rem;
    height: 2.5rem;
  }
}

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

  .hero-preview img {
    animation: none;
  }
}
