html {
  --project-surface: #f4f4f4;
  font-family: "Open Runde", sans-serif;
  overscroll-behavior-y: none;
}

html:has(.contact-preview) {
  background-color: #0d111b;
}

:focus-visible {
  outline: 2px solid #504ac7;
  outline-offset: 4px;
}

#work, #about {
  scroll-margin-top: 88px;
}

.si-v2-card:focus-visible {
  outline-offset: -4px;
}

.si-v2-row, .si-v2-mobile-viewport {
  overflow-anchor: none;
}

.placeholder-case {
  max-width: var(--frame-case);
  min-height: 100svh;
  margin-inline: auto;
  padding: 130px 24px 56px;
}

.placeholder-case h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -.04em;
}

.placeholder-case p {
  color: #6b6b6b;
}

.placeholder-case__cover {
  aspect-ratio: 5 / 4;
  background: var(--project-surface);
  border-radius: 18px;
  margin-top: 32px;
}

.case-template__figure {
  margin: 32px 0 0;
}

.case-template__figure-space {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 1;
  padding: 16px;
  border-radius: 18px;
  background: var(--project-surface);
  color: #686868;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.case-template__figure figcaption {
  margin-top: 12px;
  color: #6b6b6b;
  font-size: 14px;
  line-height: 1.45;
}

.case-template__facts {
  margin-top: 28px;
}

.case-template__section {
  margin-top: clamp(56px, 8vw, 104px);
}

.case-template__section h2 {
  color: #171717;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.2;
}

.case-template__instructions {
  max-width: 62ch;
  margin-top: 12px;
  line-height: 1.55;
}

.case-template__grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.case-template__grid .case-template__figure {
  margin: 0;
}

.case-template__note {
  border-radius: 16px;
  padding: 22px;
  background: var(--project-surface);
}

.case-template__note :is(h3, dt) {
  font-size: 16px;
  font-weight: 600;
}

.case-template__note :is(p, dd) {
  margin-top: 8px;
  color: #6b6b6b;
  font-size: 15px;
}

@media (min-width: 768px) {
  .case-template__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.nav-cta--pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 100px;
  background: var(--nav-cta-background, #0d111b);
  color: var(--nav-cta-color, #fff);
  font-family: "Open Runde", sans-serif;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: -.025em;
  text-decoration: none;
}

.contact-preview {
  --footer-bg: #0d111b;
  --footer-line: #343b4b;
  position: relative;
  background: var(--footer-bg);
  color: #fff;
}

.contact-preview__inner {
  max-width: var(--frame-home);
  margin-inline: auto;
  padding: clamp(56px, 8vw, 96px) 24px 32px;
  box-sizing: border-box;
}

.contact-preview--reveal .contact-preview__inner {
  position: fixed;
  inset: auto 0 0;
}

.contact-preview__heading {
  max-width: 12em;
  margin: 0;
  font-family: "Open Runde", sans-serif;
  font-size: clamp(38px, 6vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.contact-preview__links {
  --nav-cta-background: #fff;
  --nav-cta-color: var(--footer-bg);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 clamp(50px, 7vw, 80px);
}

.contact-preview__links :focus-visible {
  outline-color: #fff;
}

.contact-preview__links .nav-cta-icon img {
  max-width: none;
}

.contact-preview__socials {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  max-width: 100%;
}

@media (max-width: 520px) {
  .contact-preview__links .nav-cta {
    min-width: 78px;
    max-width: 100%;
    padding: 0 16px;
    transition: none;
  }

  /* Touch/focus must not change button widths or move adjacent controls. */
  .contact-preview__links .nav-cta .nav-cta-icon {
    display: none;
  }
}

.contact-preview__email {
  appearance: none;
  cursor: pointer;
}

.contact-preview__email-label {
  display: grid;
}

.contact-preview__email-label > span {
  grid-area: 1 / 1;
}

.contact-preview__email[data-copied] .contact-preview__email-label > :first-child {
  visibility: hidden;
}

.contact-preview__meta {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--footer-line);
  font-size: 14px;
}

.contact-preview__meta dt {
  color: #a4adbd;
}

.contact-preview__meta dd {
  margin: 4px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .si-v2-row, .si-v2-mobile-viewport {
    overflow-x: auto !important;
  }

  .si-v2-track, .si-v2-mob-track {
    animation: none !important;
    transform: none !important;
  }
}

body:has(.contact-preview) {
  background-color: #0d111b;
}

.si-v2-row:has(.si-v2-card:focus-visible) .si-v2-track,
.si-v2-mobile-viewport:has(.si-v2-card:focus-visible) .si-v2-mob-track {
  animation: none;
  transform: none;
}

@media (min-width: 1280px) {
  .contact-preview__inner {
    padding-inline: 0;
  }
}

.hero-content {
  padding-block: 112px 64px;
}

.hero-content .hero-headline {
  margin-bottom: 0 !important;
}

.hero-portrait {
  display: block;
  width: 168px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
}

.hero-content .hero-building-word {
  padding-right: 0;
}

.case-study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.case-study-header h2 {
  color: #737373;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.case-study-controls {
  display: flex;
  gap: 8px;
}

.case-study-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e4e4e4;
  border-radius: 50%;
  color: #171717;
  cursor: pointer;
}

.case-study-arrow:disabled {
  opacity: .36;
  cursor: default;
}

.case-study-arrow:not(:disabled):hover {
  background: #f1f1f1;
}

.work-grid {
  /* Center a card using the same width and side padding as the home text column. */
  --case-gutter: max(24px, calc((100% - var(--frame-home)) / 2 + 24px));
  display: grid;
  position: relative;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: 4px 12px;
  padding-inline: var(--case-gutter);
}

.work-grid::-webkit-scrollbar {
  display: none;
}

.work-grid > li {
  min-width: 0;
  scroll-snap-align: center;
}

.work-grid:is([data-dragging], [data-settling]) {
  scroll-snap-type: none;
}

@media (hover: hover) and (pointer: fine) {
  .work-grid {
    user-select: none;
  }

  html .work-grid[data-dragging],
  html .work-grid[data-dragging] * {
    cursor: grabbing !important;
  }

  html:has(.work-grid[data-dragging]) :is(.custom-cursor-dot, .custom-cursor-label-pos) {
    visibility: hidden;
  }
}

.work-card:focus-visible {
  outline-offset: -3px;
  border-radius: 18px;
}

.experience-toggle:focus-visible {
  outline-offset: -3px;
}

@media (min-width: 768px) {
  .hero-content {
    padding-block: 128px 72px;
  }

  .hero-portrait {
    width: 188px;
    margin-bottom: 24px;
  }

  .work-grid {
    gap: 16px;
  }
}

@media (min-width: 80rem) {
  .work-grid {
    --case-gutter: max(0px, calc((100% - var(--frame-home)) / 2));
  }
}

/* Reuse the existing About body typography for the supporting copy. */
.portfolio-body-copy {
  margin: 0;
  font-family: "Open Runde", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -.3px;
  color: #8d8d8d;
}

.hero-content .portfolio-body-copy {
  max-width: 480px;
  margin-top: 18px;
}

.hero-content .hero-headline + .portfolio-body-copy + .portfolio-body-copy {
  margin-top: 12px;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 20px 28px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.about-facts > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.about-facts dt {
  font-family: "Caveat", cursive;
  font-size: 16px;
  font-weight: 600;
  color: #8d8d8d;
  letter-spacing: .04em;
  line-height: 24px;
}

.about-facts dd {
  margin: 4px 0 0;
  font-weight: 600;
  color: #171717;
}

.contact-preview__description {
  max-width: var(--frame-home);
  margin-top: 18px;
  color: #a4adbd;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .about-content-col {
    gap: 48px;
  }
}

@media (max-width: 767px) {
  .about-content-col {
    gap: 28px;
  }
}

@media (max-width: 520px) {
  .about-facts {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }

  .about-facts > :last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) {
  .about-facts {
    column-gap: 40px;
  }
}

/* Readable initial HTML when JavaScript is unavailable; replaced by React. */
.static-page {
  max-width: 760px;
  margin-inline: auto;
  padding: 40px 24px;
  color: #171717;
  line-height: 1.6;
}
.static-page h1, .static-page h2, .static-page h3 {
  font-weight: 600;
  margin-block: 24px 12px;
}
.static-page h1 { font-size: 28px; }
.static-page h2 { font-size: 22px; }
.static-page h3 { font-size: 18px; }
.static-page p { margin-block: 12px; }
.static-page ul { list-style: disc; padding-left: 24px; }
.static-page a { text-decoration: underline; }
