:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --text: #172033;
  --muted: #5f6b7a;
  --border: #e4ded2;
  --navy: #10233f;
  --teal: #1f6f68;
  --amber: #c9822b;
  --soft-teal: #e7f2ef;
  --soft-amber: #fff3df;
  --shadow: 0 18px 48px rgba(16, 35, 63, 0.08);
  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

body.lightbox-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 4.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0 1.4rem;
}

.site-name {
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem 1rem;
}

.section-nav a,
.inline-link {
  color: var(--teal);
  font-weight: 700;
  text-decoration-color: rgba(31, 111, 104, 0.28);
  text-underline-offset: 0.22em;
}

.section-nav a {
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.section-nav a:hover,
.section-nav a:focus-visible,
.inline-link:hover,
.inline-link:focus-visible {
  color: var(--navy);
  text-decoration-color: currentColor;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: stretch;
  padding: clamp(1.35rem, 4vw, 3.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker,
.project-tag,
.focus-label,
.architecture-kicker {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 13ch;
  color: var(--navy);
  font-size: clamp(2.45rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.lead,
.section-text,
.project-copy p {
  font-size: 1.04rem;
}

.lead {
  max-width: 64ch;
  margin: 1.25rem 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.button.primary {
  background: var(--navy);
  color: #ffffff;
}

.button.secondary {
  border-color: rgba(31, 111, 104, 0.22);
  background: var(--soft-teal);
  color: var(--teal);
}

.hero-aside {
  display: flex;
}

.focus-card {
  width: 100%;
  padding: 1.15rem;
  border: 1px solid rgba(31, 111, 104, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--soft-teal), #ffffff 72%);
}

.focus-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: project;
}

.focus-list li {
  position: relative;
  min-height: 98px;
  padding: 0.95rem 1rem 0.95rem 3.15rem;
  border: 1px solid rgba(16, 35, 63, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
}

.focus-list li::before {
  position: absolute;
  top: 0.95rem;
  left: 0.95rem;
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-amber);
  color: var(--amber);
  content: counter(project);
  counter-increment: project;
  font-size: 0.82rem;
  font-weight: 850;
}

.focus-list strong,
.focus-list span {
  display: block;
}

.focus-list strong {
  color: var(--navy);
  line-height: 1.2;
}

.focus-list span {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.section-block {
  margin-top: 1.35rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.intro-block {
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf6 100%);
}

.section-heading {
  margin-bottom: 1.15rem;
}

.section-heading h2,
.project-meta h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
  line-height: 1.12;
}

.section-text {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
}

.section-text + .section-text {
  margin-top: 0.85rem;
}

.project-card {
  display: grid;
  gap: 1.25rem;
  padding-top: 1.35rem;
  margin-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.project-card:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.project-copy {
  max-width: 86ch;
}

.project-copy p {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.truth-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0.85rem;
}

.truth-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.38rem 0.65rem;
  border: 1px solid rgba(201, 130, 43, 0.24);
  border-radius: var(--radius-sm);
  background: var(--soft-amber);
  color: #76501f;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.capability-list li {
  min-height: 44px;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(31, 111, 104, 0.18);
  border-radius: var(--radius-sm);
  background: var(--soft-teal);
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.25;
}

.proof-note {
  max-width: 72ch;
  font-weight: 700;
}

.media-grid {
  display: grid;
  gap: 0.9rem;
}

.proof-gallery {
  gap: 1rem;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-placeholder {
  grid-template-columns: minmax(0, 1fr);
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbfaf6;
  box-shadow: 0 12px 30px rgba(16, 35, 63, 0.06);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.proof-gallery .media-card:hover,
.proof-gallery .media-card:focus-within {
  border-color: rgba(31, 111, 104, 0.32);
  box-shadow: 0 16px 38px rgba(16, 35, 63, 0.09);
  transform: translateY(-2px);
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.lightbox-trigger:focus-visible {
  outline: 3px solid rgba(31, 111, 104, 0.48);
  outline-offset: -3px;
}

.lightbox-trigger img,
.media-card img {
  width: 100%;
  height: clamp(190px, 24vw, 286px);
  object-fit: cover;
  object-position: center top;
  background: #edf1ee;
}

.media-card figcaption {
  min-height: 54px;
  padding: 0.72rem 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
}

.architecture-panel {
  padding: 1.05rem;
  background: linear-gradient(180deg, var(--soft-teal), #ffffff 64%);
}

.architecture-header {
  margin-bottom: 1rem;
}

.architecture-header p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
}

.architecture-flow {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.architecture-node {
  display: flex;
  flex: 1 1 0;
  min-height: 128px;
  flex-direction: column;
  justify-content: center;
  padding: 0.95rem;
  border: 1px solid rgba(16, 35, 63, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
}

.architecture-node strong {
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.2;
}

.architecture-node span {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.architecture-link {
  align-self: center;
  flex: 0 0 24px;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, rgba(31, 111, 104, 0.2), var(--teal));
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.proof-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.proof-card:hover,
.proof-card:focus-visible {
  border-color: rgba(31, 111, 104, 0.42);
  transform: translateY(-2px);
}

.proof-card span {
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.proof-card strong {
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stack-diagram {
  display: grid;
  gap: 0.7rem;
}

.stack-layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--soft-teal), #ffffff 66%);
}

.stack-name {
  color: var(--navy);
  font-size: 1rem;
  font-weight: 850;
}

.stack-role {
  color: var(--muted);
}

.stack-arrow {
  width: 2px;
  height: 22px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(31, 111, 104, 0.18), var(--teal));
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 32, 0.86);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1100px);
  max-height: calc(100vh - 2rem);
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(16, 35, 63, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.lightbox-close {
  display: flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.75rem auto;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font: inherit;
  cursor: pointer;
}

.lightbox-close:focus-visible {
  outline: 2px solid #f8fafc;
  outline-offset: 2px;
}

.lightbox-figure {
  margin: 0;
}

.lightbox-image {
  width: 100%;
  max-height: calc(100vh - 9rem);
  border-radius: var(--radius-md);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
}

.lightbox-caption {
  margin-top: 0.8rem;
  color: rgba(248, 250, 252, 0.84);
  font-size: 0.96rem;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 16ch;
  }

  .three-up,
  .two-up,
  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .architecture-flow {
    flex-direction: column;
  }

  .architecture-link {
    width: 2px;
    height: 20px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(31, 111, 104, 0.2), var(--teal));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-bottom: 3rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-nav {
    justify-content: flex-start;
  }

  .hero,
  .section-block {
    border-radius: 14px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.1rem, 12vw, 3rem);
  }

  .lead,
  .section-text,
  .project-copy p {
    font-size: 1rem;
  }

  .button {
    width: 100%;
  }

  .focus-list li {
    min-height: auto;
  }

  .three-up,
  .two-up,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .capability-list {
    grid-template-columns: 1fr;
  }

  .media-card figcaption {
    min-height: auto;
  }

  .lightbox-trigger img,
  .media-card img {
    height: clamp(190px, 56vw, 260px);
  }

  .stack-layer {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox {
    padding: 0.7rem;
  }

  .lightbox-panel {
    max-height: calc(100vh - 1.4rem);
    padding: 0.75rem;
  }

  .lightbox-image {
    max-height: calc(100vh - 8.5rem);
  }
}
