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

:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --border-sidebar: #ececee;
  --border-card: #ececec;
  --ink: #09090b;
  --ink-soft: #52525b;
  --ink-muted: #71717a;
  --radius-card: 36px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Host Grotesk", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 20px;
  flex: 0 0 400px;
  width: 400px;
  max-width: 400px;
  height: calc(100dvh - 40px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-card);
}

.sidebar-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-text {
  font-size: 20px;
  line-height: 32px;
  letter-spacing: -0.09px;
  text-wrap: pretty;
}

/* Work */
.work {
  flex: 1 1 0;
  min-width: 0;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
}

.project-image {
  width: 100%;
  overflow: hidden;
  padding: 4px;
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Empty slot (placeholder image) keeps a fixed ratio until the real cover arrives */
.project-image--system {
  aspect-ratio: 928 / 500;
}

.project-image--system img {
  height: 100%;
  object-fit: cover;
}

.project-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: 32px;
}

.project-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 18px;
  letter-spacing: -0.065px;
  white-space: nowrap;
}

.dot {
  width: 4px;
  height: 4px;
  margin: 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.project-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  color: var(--ink);
  font-size: 32px;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: -0.7px;
  text-wrap: balance;
}

.project-description {
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.09px;
  text-wrap: pretty;
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 22.5px;
  letter-spacing: -0.075px;
  white-space: nowrap;
}

.story-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.story-link:hover .story-link-icon {
  transform: translateX(4px);
}

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

  .story-link-icon {
    transition: none;
  }
}

@media (max-width: 1100px) {
  .page {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }

  .sidebar {
    position: static;
    flex: none;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    gap: 40px;
  }

  .work {
    flex: none;
    width: 100%;
  }

  .projects {
    gap: 24px;
  }


  .project-info {
    padding: 24px;
  }

  .project-title {
    font-size: 26px;
    line-height: 30px;
  }
}

/* Case study page */
.sidebar--case {
  height: calc(100dvh - 40px);
}

.story-link--back {
  align-self: flex-start;
}

.story-link-icon--back img {
  transform: rotate(180deg);
}

.story-link--back:hover .story-link-icon {
  transform: translateX(-4px);
}

.toc {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.toc-item {
  display: block;
  padding: 10px 0 11px;
  border-top: 1px solid var(--border-sidebar);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.07px;
}

.toc-item:hover,
.toc-group-head:hover,
.toc-sub:hover {
  color: var(--ink);
}

.toc-item--disabled,
.toc-item--disabled:hover {
  color: rgba(82, 82, 91, 0.6);
  cursor: default;
}

.toc-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  border-top: 1px solid var(--border-sidebar);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.07px;
}

.toc-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 8px);
  padding: 4px;
  margin: 0 -4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.toc-subs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-subs[hidden] {
  display: none;
}

.toc-chevron {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.toc-group-head[aria-expanded="false"] .toc-chevron {
  transform: none;
}

.toc-sub {
  display: block;
  padding: 4px 0 4px 40px;
}

.case-card {
  position: sticky;
  top: 20px;
  flex: 1 1 0;
  min-width: 0;
  height: calc(100dvh - 40px);
  min-height: 560px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-card);
}

.case-card::-webkit-scrollbar {
  display: none;
}

.case {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.case-head {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.case-title-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-title {
  color: var(--ink);
  font-size: 32px;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: -0.7px;
  text-wrap: balance;
}

.case-company {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 18px;
  letter-spacing: -0.065px;
}

.case-rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--border-sidebar);
}

.case-facts {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.case-meta {
  flex: 0 0 237px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-summary {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.fact dt,
.fact-label {
  color: var(--ink-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: -0.065px;
}

.fact dd,
.fact p {
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.09px;
  text-wrap: pretty;
}

.case-image {
  width: 100%;
  overflow: hidden;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-card);
}

.case-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.case-summary--tight {
  gap: 0;
}

.case-image-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.case-image-row .case-image {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.case-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-margin-top: 40px;
}

.case-heading {
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
  line-height: 31.92px;
  letter-spacing: -0.7px;
  text-wrap: balance;
}

.case-subheading {
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 31.92px;
  letter-spacing: -0.3px;
  text-wrap: balance;
}

.case-text {
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.09px;
  text-wrap: pretty;
}

.case-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-features {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-section--takeaway {
  gap: 20px;
}

.case-prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.case-list {
  display: flex;
  flex-direction: column;
}

@media (max-width: 1100px) {
  .sidebar--case {
    flex: none;
    width: 100%;
    max-width: none;
    height: auto;
    gap: 24px;
  }

  .case-card {
    position: static;
    flex: none;
    width: 100%;
    height: calc(100dvh - 40px);
    min-height: 480px;
    padding: 24px;
  }

  .case {
    gap: 40px;
  }

  .case-facts {
    flex-direction: column;
    gap: 32px;
  }

  .case-meta {
    flex: none;
    width: 100%;
  }


}

/* Mobile: image rows stack one under another */
@media (max-width: 640px) {
  .case-image-row {
    flex-direction: column;
    align-items: stretch;
  }

  .case-image-row .case-image {
    flex: none;
    width: 100%;
  }
}
