:root {
  --bg: #ffffff;
  --surface: #f6f7f8;
  --surface-strong: #eef1f4;
  --text: #1f2328;
  --muted: #5e6670;
  --border: #d8dde3;
  --accent: #8b2c2c;
  --accent-soft: rgba(139, 44, 44, 0.08);
  --accent-strong: rgba(139, 44, 44, 0.14);
  --shadow: 0 18px 44px rgba(15, 24, 36, 0.08);
  --radius: 18px;
  --content-width: 820px;
  --sidebar-width: 320px;
  --header-height: 72px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(circle at top left, rgba(139, 44, 44, 0.07), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

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

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(280px, var(--sidebar-width)) 1fr;
  min-height: 100vh;
}

.mobile-header {
  display: none;
}

.sidebar {
  position: relative;
  border-right: 1px solid rgba(216, 221, 227, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.sidebar__inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 40px 28px 28px;
}

.sidebar__brand {
  margin-bottom: 36px;
}

.sidebar__eyebrow,
.section-label,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar__eyebrow,
.meta-label {
  color: var(--muted);
}

.sidebar__brand h1 {
  margin: 10px 0 8px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.sidebar__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.sidebar__nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition:
    background-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
  outline: none;
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar__footer p {
  margin: 0 0 6px;
}

.content {
  padding: 48px clamp(24px, 5vw, 72px) 88px;
}

.section {
  max-width: calc(var(--content-width) + 64px);
  margin: 0 auto;
  padding: 30px 0 60px;
  border-bottom: 1px solid rgba(216, 221, 227, 0.82);
  scroll-margin-top: 32px;
}

.section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-heading {
  margin-bottom: 28px;
}

.section-label {
  margin: 0 0 12px;
  color: var(--accent);
}

h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

h2,
h3 {
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.06;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.hero-section {
  display: grid;
  gap: 28px;
}

.hero-copy {
  max-width: var(--content-width);
}

.hero-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-intro {
  max-width: 720px;
  margin: 24px 0 0;
  font-size: 1.05rem;
}

.hero-grid,
.team-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.info-card,
.team-card,
.callout-panel,
.quote-panel,
.process-step,
.media-card,
.calc-card {
  border: 1px solid rgba(216, 221, 227, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.info-card,
.team-card,
.callout-panel,
.quote-panel {
  padding: 20px 20px 22px;
}

.media-card {
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.media-card img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-photo img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.media-card figcaption {
  padding: 14px 16px 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.92);
}


.code-panel {
  overflow: hidden;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 20px;
  background: #11161c;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.18);
}

.code-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #8ea0b4;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

pre {
  margin: 0;
  padding: 22px 24px 28px;
  overflow-x: auto;
}

pre code {
  display: block;
  color: #e7edf3;
  font-family: "SFMono-Regular", Menlo, Consolas, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre;
}

.info-card h3,
.team-card h3 {
  margin: 8px 0 8px;
}

.info-card p,
.team-card p,
.callout-panel p,
.quote-panel p {
  margin-bottom: 0;
}

.prose {
  max-width: var(--content-width);
}

.prose code,
.callout-panel code,
.bullet-list code,
.compact-list code,
.math-line code {
  padding: 0.12rem 0.36rem;
  border-radius: 6px;
  background: rgba(139, 44, 44, 0.08);
  color: var(--accent);
  font-family: "SFMono-Regular", Menlo, Consolas, Monaco, monospace;
  font-size: 0.92em;
}

.prose p {
  margin-bottom: 18px;
  font-size: 1.03rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.subsection {
  margin-bottom: 44px;
}

.subsection:last-child {
  margin-bottom: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.quote-panel {
  background:
    linear-gradient(180deg, rgba(139, 44, 44, 0.06), rgba(255, 255, 255, 0.92)),
    #ffffff;
}

.callout-panel {
  margin-top: 24px;
  background:
    linear-gradient(180deg, rgba(139, 44, 44, 0.06), rgba(255, 255, 255, 0.9)),
    #ffffff;
}

.callout-panel--compact {
  max-width: 640px;
  margin-top: 0;
  margin-bottom: 22px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.calc-card {
  padding: 20px 20px 22px;
}

.calc-card--full {
  grid-column: 1 / -1;
}

.calc-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.calc-card h4 + .math-line,
.calc-card h4 + .compact-list {
  margin-top: 0;
}

.calc-card p {
  margin-bottom: 0;
}

.calc-card .compact-list {
  margin-top: 10px;
}

.meta-inline {
  margin: 14px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.math-line {
  margin: 0 0 10px;
  font-family: "SFMono-Regular", Menlo, Consolas, Monaco, monospace;
  font-size: 0.94rem;
  line-height: 1.6;
  word-break: break-word;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
}

.compact-list li {
  margin-bottom: 8px;
}

.compact-list li:last-child {
  margin-bottom: 0;
}

.intro-copy {
  margin-bottom: 24px;
}

.top-gap {
  margin-top: 20px;
}

.bullet-list,
.process-list {
  padding: 0;
  list-style: none;
}

.bullet-list {
  display: grid;
  gap: 14px;
  max-width: var(--content-width);
}

.bullet-list li {
  position: relative;
  padding: 16px 18px 16px 48px;
  border: 1px solid rgba(216, 221, 227, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.bullet-list--strong li {
  background:
    linear-gradient(180deg, rgba(139, 44, 44, 0.05), rgba(255, 255, 255, 0.94)),
    #ffffff;
}

.process-list {
  display: grid;
  gap: 18px;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 22px 22px 22px 84px;
}

.process-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 22px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.process-step h3 {
  margin-bottom: 8px;
}

.process-step p {
  margin-bottom: 0;
}

@media (max-width: 1080px) {
  .hero-grid,
  .team-grid,
  .asset-grid,
  .calc-grid,
  .cad-layout,
  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-shell {
    display: block;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--header-height);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(216, 221, 227, 0.85);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
  }

  .mobile-title {
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(216, 221, 227, 0.95);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: currentColor;
    transition:
      transform var(--transition),
      opacity var(--transition);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .sidebar {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    z-index: 25;
    max-height: calc(100vh - var(--header-height));
    border-right: 0;
    border-bottom: 1px solid rgba(216, 221, 227, 0.85);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform var(--transition),
      opacity var(--transition),
      visibility var(--transition);
  }

  body.nav-open .sidebar {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .sidebar__inner {
    min-height: auto;
    max-height: calc(100vh - var(--header-height));
    padding: 22px 20px 20px;
    overflow-y: auto;
  }

  .sidebar__brand {
    margin-bottom: 24px;
  }

  .sidebar__brand h1 {
    font-size: 1.8rem;
  }

  .nav-link.active::before {
    left: auto;
    right: 12px;
    top: 50%;
    bottom: auto;
    width: 8px;
    height: 8px;
    transform: translateY(-50%);
  }

  .content {
    padding: 28px 20px 64px;
  }

  .section {
    scroll-margin-top: calc(var(--header-height) + 24px);
  }
}

@media (max-width: 560px) {
  body {
    line-height: 1.6;
  }

  .content {
    padding-inline: 16px;
  }

  .section {
    padding: 22px 0 46px;
  }

  h2 {
    font-size: 1.85rem;
  }

  .hero-intro,
  .prose p,
  .process-step p,
  .bullet-list li,
  .callout-panel p,
  .quote-panel p {
    font-size: 0.98rem;
  }

  .process-step {
    padding: 76px 18px 18px;
  }

  .process-step::before {
    left: 18px;
    top: 18px;
  }

  pre {
    padding: 18px 16px 22px;
  }
}
