/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&display=swap');

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #3d3d3d;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

/* Layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  padding-top: 64px;
  padding-bottom: 96px;
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 48px 0;
}

.nav__brand {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  text-decoration: none;
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.nav__links a {
  font-size: 15px;
  color: #999;
  text-decoration: none;
  transition: color 150ms ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: #111;
}

/* Intro / hero */
.avatar {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar__smile {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 150ms ease;
}

.avatar:hover .avatar__smile {
  opacity: 1;
}

h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111;
  line-height: 1.3;
}

.intro__meta {
  font-size: 16px;
  color: #999;
  margin-top: 8px;
}

.intro__text {
  font-size: 16px;
  color: #666;
  margin-top: 16px;
  max-width: 60ch;
}

/* Section headings */
.section {
  margin-top: 48px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111;
  margin-bottom: 20px;
}

/* List rows */
.rows {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.row {
  display: block;
  text-decoration: none;
}

.row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.row__title {
  font-size: 16px;
  font-weight: 500;
  color: #111;
}

a.row:hover .row__title {
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 3px;
}

.row__meta {
  font-size: 15px;
  color: #999;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row__type {
  font-size: 14px;
  color: #999;
}

.row__desc {
  display: block;
  font-size: 15px;
  color: #666;
  margin-top: 4px;
  max-width: 60ch;
}

.row__source {
  display: block;
  font-size: 14px;
  color: #999;
  margin-top: 2px;
}

/* Row with thumbnail (work page) */
.row--thumb {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.row__body {
  flex: 1;
  min-width: 0;
}

.row__thumb {
  flex: 0 0 148px;
  width: 148px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #f0f0f0;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .row__thumb {
    display: none;
  }
}

/* Image cards (side projects) */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 24px;
}

.card {
  display: block;
  text-decoration: none;
}

.card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
  margin-bottom: 12px;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  font-size: 16px;
  font-weight: 500;
  color: #111;
}

a.card:hover .card__title {
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 3px;
}

.card__meta {
  font-size: 15px;
  color: #999;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card__desc {
  display: block;
  font-size: 15px;
  color: #666;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Coming-soon variant */
.row--soon .row__title {
  color: #999;
}

.row--soon .row__suffix {
  font-size: 14px;
  color: #999;
  margin-left: 6px;
  white-space: nowrap;
}

/* Quiet inline link (e.g. "View all work") */
.link-quiet {
  display: inline-block;
  margin-top: 20px;
  font-size: 15px;
  color: #999;
  text-decoration: none;
  transition: color 150ms ease;
}

.link-quiet:hover {
  color: #111;
}

/* Prose links */
.prose a,
.intro__text a,
.connect__text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}

.prose a:hover,
.intro__text a:hover,
.connect__text a:hover {
  text-decoration-color: #111;
}

/* Connect */
.connect__text {
  font-size: 16px;
  color: #666;
  max-width: 60ch;
}

.connect__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}

.connect__links a {
  font-size: 15px;
  color: #999;
  text-decoration: none;
  transition: color 150ms ease;
}

.connect__links a:hover {
  color: #111;
}

/* Prose block (case studies) */
.prose p {
  font-size: 16px;
  line-height: 1.75;
  color: #3d3d3d;
  margin-bottom: 1.25em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25em 1.25rem;
}

.prose li {
  font-size: 16px;
  line-height: 1.75;
  color: #3d3d3d;
  margin-bottom: 0.4em;
}

.prose blockquote {
  border-left: 1px solid #e0e0e0;
  padding-left: 1.25rem;
  color: #666;
  margin: 0 0 1.25em;
}

.prose h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111;
  margin: 0 0 0.75em;
}

.prose h3 {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  margin: 2em 0 0.5em;
}

.prose h4 {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin: 1.5em 0 0.5em;
}

.prose h3:first-child,
.prose h4:first-child {
  margin-top: 0;
}

/* Case-study header */
.cs-header {
  margin-bottom: 48px;
}

.cs-header__subtitle {
  font-size: 16px;
  color: #666;
  margin-top: 8px;
}

.cs-header__meta {
  font-size: 14px;
  color: #999;
  margin-top: 12px;
}

/* Case-study table of contents */
.cs-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: -24px 0 48px;
}

.cs-toc a {
  font-size: 15px;
  color: #999;
  text-decoration: none;
  transition: color 150ms ease;
}

.cs-toc a:hover {
  color: #111;
}

/* Case-study sections */
.cs-section {
  margin-bottom: 44px;
}

/* Images & captions — figures break out wider than the 640px text column */
.cs-image {
  width: min(920px, calc(100vw - 48px));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 44px;
}

.cs-image img,
.cs-image video,
.cs-image iframe,
.cs-image svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
}

/* Iframes have no intrinsic height — `height: auto` collapses them to the
   150px default and silently overrides the height="" attribute. Give embeds
   a real aspect ratio instead. */
.cs-image iframe {
  aspect-ratio: 16 / 10;
}

.cs-caption {
  font-size: 14px;
  color: #999;
  text-align: left;
  margin-top: 8px;
}

/* Image placeholder */
.cs-placeholder {
  aspect-ratio: 16 / 9;
  background: #f5f5f5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #bbb;
}

/* Metrics */
ul.metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metrics li {
  font-size: 16px;
  color: #666;
}

.metrics__num {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111;
  margin-right: 2px;
}

/* Lightbox — click-to-zoom on case-study images */
.cs-image img.is-zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  cursor: zoom-out;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
}

body.lightbox-open {
  overflow: hidden;
}

/* Prev/next footer nav */
.cs-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  font-size: 15px;
}

.cs-nav a {
  color: #999;
  text-decoration: none;
  transition: color 150ms ease;
}

.cs-nav a:hover {
  color: #111;
}

/* Footer */
.footer {
  border-top: 1px solid #f0f0f0;
  padding-top: 24px;
  margin-top: 96px;
  font-size: 14px;
  color: #999;
}
