@font-face {
  font-family: 'Cardo';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/cardo-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Cardo';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('fonts/cardo-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Cardo';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/cardo-700.woff2') format('woff2');
}

:root {
  --color: #000;
  --accent: #00524e;
  --muted: #252525;
  --bg: #fff;
  --font: 'Cardo', Georgia, 'Times New Roman', serif;
  --container: 1100px;
  --margin: 40px;
  --gap: 40px;
}

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

html {
  font-size: 10px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--color);
  font-family: var(--font);
  font-size: 1.8rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul {
  margin: 0;
  font-weight: 400;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--margin);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px var(--margin);
}

.logo {
  display: block;
  width: 73px;
  height: 57px;
}

.logo img {
  width: 100%;
  height: 100%;
}

.site-nav {
  display: flex;
  gap: 24px;
  font-size: 2.2rem;
}

.site-nav a {
  color: var(--color);
}

.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Intro */

.intro {
  padding: 80px 0;
  text-align: center;
}

.intro h1 {
  font-size: 2.2rem;
  line-height: 1.6;
}

.intro h2 {
  max-width: 900px;
  margin: 0 auto;
  font-size: 4.5rem;
  line-height: 1.6;
}

.intro h2 .tight {
  letter-spacing: -0.04em;
}

/* Work grid */

.work {
  padding-bottom: 80px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.thumb {
  display: block;
  color: var(--color);
}

.thumb:hover {
  text-decoration: none;
}

.thumb-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f2f2;
}

.thumb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 500ms ease;
}

.thumb:hover .thumb-media::after,
.thumb:focus-visible .thumb-media::after {
  opacity: 0.5;
}

.thumb h3 {
  margin-top: 16px;
  font-size: 1.8rem;
  line-height: 1.53;
  letter-spacing: 0.01em;
  text-align: center;
}

/* Contact */

.contact {
  padding: 40px 0 100px;
  text-align: center;
}

.contact h4 {
  margin-bottom: 20px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.51;
  letter-spacing: 0.04em;
}

.contact p {
  font-size: 1.8rem;
}

.social {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.social a {
  display: inline-block;
  padding: 10px;
  color: var(--muted);
}

.social svg {
  display: block;
  width: 40px;
  height: 40px;
}

/* About */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  padding-top: 60px;
  padding-bottom: 120px;
}

.portrait {
  order: 2;
  margin-left: 100px;
  aspect-ratio: 1 / 1;
  clip-path: circle(50% at center);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-name {
  font-size: 4rem;
  line-height: 1.5;
}

.bio {
  margin-top: 30px;
  font-size: 2rem;
  line-height: 1.5;
}

.bio p + p,
.bio p + ul {
  margin-top: 1.5em;
}

.bio .tight {
  margin-top: 0 !important;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-bottom: 100px;
}

.details h3 {
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.details ul {
  font-size: 2rem;
  line-height: 1.5;
}

/* Artifacts */

.artifact {
  margin: 0 0 80px;
}

.artifact button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.artifact img {
  width: 100%;
  height: auto;
}

.artifact figcaption {
  padding: 16px 25% 0;
  font-size: 1.8rem;
  text-align: center;
}

/* Case studies */

.case {
  padding-bottom: 100px;
}

.cs-details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  padding-bottom: 80px;
  font-size: 2rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.cs-meta {
  padding-right: 30px;
}

.cs-meta strong {
  display: block;
  margin-top: 1.2em;
}

.cs-meta p:first-child strong {
  margin-top: 0;
}

.cs-role p + p {
  margin-top: 0.4em;
}

.cs-section {
  display: grid;
  grid-template-columns: 1fr 3fr;
  padding-top: 50px;
  padding-bottom: 50px;
}

.cs-section h2 {
  padding-right: 20px;
  color: var(--accent);
  font-size: 3rem;
  line-height: 1.37;
  letter-spacing: -0.04em;
}

.cs-body {
  font-size: 2rem;
  line-height: 1.61;
  letter-spacing: 0.05em;
}

.cs-body p + p,
.cs-body p + ul,
.cs-body ul + p {
  margin-top: 1em;
}

.cs-body ul {
  padding: 0;
  list-style: none;
}

.cs-figure {
  margin: 30px 0 50px;
}

.cs-figure button,
.cs-slide {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.cs-figure img,
.cs-slide img {
  width: 100%;
  height: auto;
}

.cs-figure figcaption {
  padding: 10px 25% 0;
  font-size: 1.8rem;
  text-align: center;
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 20px;
  margin: 30px auto 50px;
}

.cs-grid-col .cs-figure {
  margin: 0 0 20px;
}

.cs-carousel {
  margin: 30px auto 50px;
}

.cs-track {
  display: flex;
  align-items: center;
  gap: 50px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cs-track::-webkit-scrollbar {
  display: none;
}

.cs-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.cs-slide img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.cs-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.cs-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color);
  opacity: 0.25;
  cursor: pointer;
}

.cs-dots button[aria-current='true'] {
  opacity: 1;
}

/* Locked case studies */

.locked {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px var(--margin) 160px;
  text-align: center;
}

.locked h1 {
  font-size: 4rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.locked p {
  margin-top: 20px;
  font-size: 2rem;
}

.unlock {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.unlock input {
  width: min(260px, 100%);
  padding: 12px 14px;
  border: 1px solid #c8c8c8;
  border-radius: 0;
  font: inherit;
  font-size: 1.8rem;
}

.unlock input:focus {
  outline: none;
  border-color: var(--accent);
}

.unlock button {
  padding: 12px 22px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1.8rem;
  cursor: pointer;
}

.locked .unlock-error {
  color: #b3261e;
  font-size: 1.6rem;
}

.locked .unlock-help {
  margin-top: 40px;
  font-size: 1.6rem;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  cursor: zoom-out;
  outline: none;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  transition: opacity 200ms ease;
}

.lightbox.open .lightbox-bg {
  opacity: 1;
}

.lightbox-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: left top;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 40px 28px;
  font-size: 1.8rem;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transition: opacity 300ms ease-in;
  pointer-events: none;
}

.lightbox-caption a {
  pointer-events: auto;
}

.lightbox-caption.show {
  opacity: 1;
}

/* Motion: blocks slide up as they scroll into view, the page fades in on
   load, and the outgoing page slides up before navigating. */

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

.js .site-header,
.js main {
  animation: fade-in 500ms ease-out backwards;
}

.js .reveal {
  opacity: 0;
  transform: translateY(50px);
  visibility: hidden;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1), opacity 500ms ease-out;
}

.leaving main {
  opacity: 0;
  transform: translateY(-60px);
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1), opacity 400ms ease-out;
}

.leaving .site-header {
  opacity: 0;
  transition: opacity 250ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .js .site-header,
  .js main {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .lightbox-bg,
  .lightbox-caption {
    transition: none;
  }
}

/* Phone */

@media (max-width: 768px) {
  :root {
    --margin: 20px;
    --gap: 32px;
  }

  .site-header {
    padding: 20px var(--margin);
  }

  .intro {
    padding: 48px 0;
  }

  .intro h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .intro h2 {
    font-size: clamp(2.6rem, 8vw, 4.5rem);
    line-height: 1.35;
  }

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

  .thumb h3 {
    font-size: clamp(1.6rem, 5vw, 2rem);
  }

  .about,
  .details {
    grid-template-columns: 1fr;
  }

  .about {
    padding-top: 20px;
    padding-bottom: 60px;
  }

  .portrait {
    order: 0;
    margin: 0 30px 32px;
  }

  .about-name {
    font-size: 3.2rem;
  }

  .details {
    gap: 40px;
  }

  .artifact {
    margin-bottom: 48px;
  }

  .artifact figcaption {
    padding: 12px 0 0;
  }

  .locked h1 {
    font-size: 3rem;
  }

  .cs-details,
  .cs-section {
    grid-template-columns: 1fr;
  }

  .cs-details {
    gap: 20px;
    padding-bottom: 40px;
    font-size: clamp(1.6rem, 4vw, 2rem);
  }

  .cs-section {
    gap: 16px;
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .cs-section h2 {
    padding: 0;
    font-size: clamp(2.2rem, 6vw, 3rem);
    letter-spacing: 0;
  }

  .cs-body {
    font-size: clamp(1.6rem, 4.5vw, 2rem);
  }

  .cs-figure figcaption {
    padding: 8px 0 0;
    font-size: 1.5rem;
  }

  .cs-grid {
    gap: 10px;
  }

  .cs-grid-col .cs-figure {
    margin-bottom: 10px;
  }

  .cs-track {
    gap: 20px;
  }
}
