:root {
  --bg: #f4f2ed;
  --paper: #fbfaf7;
  --ink: #11110f;
  --muted: #706c65;
  --soft: #e8e2d8;
  --line: rgba(17, 17, 15, 0.12);
  --line-strong: rgba(17, 17, 15, 0.2);
  --black: #171614;
  --clay: #b9aa95;
  --moss: #74816e;
  --steel: #737b7b;
  --amber: #b49455;
  --white: rgba(255,255,255,0.82);
  --shadow: 0 26px 80px rgba(25, 23, 20, 0.12);
  --shadow-soft: 0 16px 42px rgba(25, 23, 20, 0.08);
  --radius: 24px;
  --radius-lg: 34px;
  --sidebar: 292px;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 70% -10%, rgba(255,255,255,.9), transparent 32rem),
    linear-gradient(135deg, #f8f7f3 0%, #f0ece4 48%, #f8f6f1 100%);
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .45;
  background-image:
    linear-gradient(rgba(17,17,15,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,15,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 80%);
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

.portal-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 16px;
  background: rgba(251,250,247,.72);
  backdrop-filter: blur(24px);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.8), var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.brand strong {
  display: block;
  letter-spacing: -.03em;
  font-size: 1.08rem;
}

.brand span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.nav-section-label {
  margin: 8px 8px 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-radius: 16px;
  padding: 0 12px;
  color: rgba(17,17,15,.68);
  font-size: .92rem;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--ink);
  background: rgba(17,17,15,.07);
  transform: translateX(2px);
}

.side-nav a.active::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 5px rgba(116,129,110,.14);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.console-card {
  border-radius: 20px;
  padding: 16px;
  background: #191815;
  color: #fff;
  box-shadow: 0 18px 44px rgba(17,17,15,.18);
}

.console-card strong {
  display: block;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}

.console-card p {
  margin: 0 0 14px;
  color: rgba(255,255,255,.68);
  font-size: .86rem;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 18px 22px 42px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 12px 10px 22px;
  background: rgba(251,250,247,.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-soft);
}

.crumb {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 28px rgba(17,17,15,.18);
}

.btn-light {
  background: rgba(255,255,255,.72);
  border-color: var(--line);
  color: var(--ink);
}

.btn-flat {
  background: rgba(17,17,15,.06);
  color: var(--ink);
}

.btn-wide { width: 100%; }

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(251,250,247,.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, .98fr) minmax(360px, .82fr);
  gap: 28px;
  align-items: stretch;
  padding: clamp(26px, 5vw, 56px);
}

.hero::after {
  content: "";
  position: absolute;
  right: -12%;
  top: -30%;
  width: 52%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185,170,149,.36), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 6px rgba(116,129,110,.13);
}

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

h1 {
  max-width: 940px;
  margin: 18px 0 22px;
  font-size: clamp(3.2rem, 7vw, 7.2rem);
  line-height: .9;
  letter-spacing: -.075em;
}

h1 span,
.dim {
  color: rgba(17,17,15,.48);
}

.lead {
  max-width: 760px;
  color: rgba(17,17,15,.68);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.52;
  letter-spacing: -.02em;
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 26px;
}

.hero-visual {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: #201f1c;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
  filter: grayscale(.15) contrast(.92);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,17,15,.1), rgba(17,17,15,.84));
}

.visual-copy {
  position: relative;
  z-index: 1;
  padding: 24px;
}

.visual-copy strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -.04em;
}

.visual-copy span {
  color: rgba(255,255,255,.68);
  line-height: 1.45;
}

.section {
  margin-top: 22px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(280px, .48fr);
  gap: 28px;
  align-items: end;
  margin: 34px 0 18px;
}

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(2.1rem, 4.5vw, 4.8rem);
  line-height: .94;
  letter-spacing: -.065em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.card.dark {
  background:
    radial-gradient(circle at 84% 10%, rgba(255,255,255,.12), transparent 18rem),
    #1b1a17;
  color: #fff;
}

.card h3 {
  margin: 12px 0 10px;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -.04em;
}

.card p,
.card li {
  color: rgba(17,17,15,.66);
  line-height: 1.48;
}

.card.dark p,
.card.dark li {
  color: rgba(255,255,255,.68);
}

.metric {
  display: grid;
  gap: 12px;
  min-height: 160px;
}

.metric strong {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: .9;
  letter-spacing: -.06em;
}

.metric span {
  color: var(--muted);
  font-weight: 800;
}

.tag {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(17,17,15,.065);
  color: rgba(17,17,15,.72);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.dark .tag {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
}

.list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
}

.list li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: .48em;
  border-radius: 50%;
  background: var(--moss);
}

.product-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0;
}

.price strong {
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: .9;
  letter-spacing: -.07em;
}

.price span {
  color: var(--muted);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th, td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

td { font-weight: 750; }

tr:last-child td { border-bottom: 0; }

.stage {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(116,129,110,.12);
  color: #485344;
  font-size: .78rem;
  font-weight: 900;
}

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

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(17,17,15,.7);
  font-size: .84rem;
  font-weight: 900;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(17,17,15,.14);
  border-radius: 16px;
  padding: 14px;
  outline: none;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  box-shadow: inset 2px 2px 10px rgba(17,17,15,.035);
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(17,17,15,.34);
  box-shadow: 0 0 0 4px rgba(17,17,15,.055);
}

textarea { min-height: 126px; resize: vertical; }
.full { grid-column: 1 / -1; }

.kit-layout,
.handbook-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}

.subnav {
  position: sticky;
  top: 108px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.subnav a,
.subnav button {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.62);
  color: rgba(17,17,15,.68);
  cursor: pointer;
  text-align: left;
  font-weight: 900;
}

.subnav .active,
.subnav a:hover,
.subnav button:hover {
  background: var(--ink);
  color: #fff;
}

.kit-block {
  margin-bottom: 14px;
}

.pitch-box {
  border-left: 4px solid var(--moss);
  padding: 18px;
  border-radius: 0 20px 20px 0;
  background: rgba(116,129,110,.1);
  color: rgba(17,17,15,.76);
  line-height: 1.55;
}

.usecase-result {
  min-height: 280px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.resource-card {
  min-height: 240px;
}

.doc-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 900;
  border-bottom: 1px solid var(--ink);
}

.agent-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
}

.agent-panel {
  width: min(360px, calc(100vw - 44px));
  display: none;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  padding: 16px;
  background: rgba(24,23,20,.94);
  color: #fff;
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
}

.agent-panel.open { display: block; }

.agent-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ede8df;
  color: var(--ink);
  font-weight: 950;
}

.agent-panel p {
  color: rgba(255,255,255,.7);
  line-height: 1.45;
}

.agent-toggle {
  min-width: 62px;
  min-height: 62px;
  border: 0;
  border-radius: 50%;
  background: #171614;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 48px rgba(17,17,15,.28);
  font-weight: 950;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 100px;
  z-index: 60;
  max-width: 360px;
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(17,17,15,.94);
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu {
  display: none;
}

@media (max-width: 1080px) {
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding-bottom: 0;
  }
  .sidebar-inner { height: auto; }
  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sidebar-footer { display: none; }
  .hero,
  .section-head,
  .kit-layout,
  .handbook-layout { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subnav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .main { padding: 12px 12px 32px; }
  .sidebar { padding: 12px; }
  .side-nav { grid-template-columns: 1fr; }
  .topbar { top: 8px; border-radius: 18px; padding: 10px; }
  .top-actions .btn-light { display: none; }
  .hero { padding: 22px; min-height: 0; }
  .grid-4, .grid-3, .grid-2, .form-grid, .subnav { grid-template-columns: 1fr; }
  h1 { font-size: clamp(3rem, 18vw, 4.6rem); }
}
