/* ==========================================================================
   PTRS Documentation Site — Sunset Campus Theme
   Primary: #2D1B69 (deep indigo)
   Accent:  #FF6B35 (sunset orange)
   Designed for non-technical business users
   ========================================================================== */

:root {
  --brand-primary: #2D1B69;
  --brand-primary-dark: #1d1146;
  --brand-primary-light: #4a2fa3;
  --brand-accent: #FF6B35;
  --brand-accent-dark: #e9561f;
  --brand-accent-light: #ffe3d5;

  --sunset-1: #FFB07A;
  --sunset-2: #FF8A5B;
  --sunset-3: #FF6B35;
  --sunset-4: #C7367A;
  --sunset-5: #6E2A8E;
  --sunset-6: #2D1B69;

  --success: #1f9d55;
  --warning: #d97706;
  --danger:  #c53030;
  --info:    #2563eb;

  --ink:       #1a1530;
  --ink-soft:  #4a4468;
  --ink-mute:  #7a7595;
  --line:      #e7e4ef;
  --line-soft: #f2f0f8;
  --paper:     #ffffff;
  --cream:     #fdfbf6;
  --parchment: #f6f1e8;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(45, 27, 105, 0.06);
  --shadow:    0 4px 16px rgba(45, 27, 105, 0.08);
  --shadow-lg: 0 20px 60px rgba(45, 27, 105, 0.12);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Comic Sans MS", "Chalkboard SE", "Marker Felt", "Segoe Script", cursive;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-accent); }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(120deg, var(--brand-primary) 0%, var(--sunset-5) 60%, var(--brand-accent) 110%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .4px;
  color: #fff;
}
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(6px);
}
.logo small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .75;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nav a {
  color: rgba(255,255,255,.85);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all .18s ease;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active { background: #fff; color: var(--brand-primary); font-weight: 600; }
.menu-toggle {
  display: none;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255,107,53,.22), transparent 55%),
    radial-gradient(ellipse at 90% 25%, rgba(199,54,122,.22), transparent 50%),
    linear-gradient(135deg, #1d1146 0%, #2D1B69 55%, #6E2A8E 100%);
  color: #fff;
  padding: 72px 24px 120px;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--cream));
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.06;
  margin: 12px 0 18px;
  font-weight: 800;
  letter-spacing: -1px;
}
.hero h1 .accent { color: var(--brand-accent); }
.hero p.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  max-width: 620px;
  color: rgba(255,255,255,.88);
  margin: 0 0 24px;
}
.eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.hero-badge {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255,255,255,.92);
}

/* ---------- sections ---------- */
section { padding: 72px 0; }
section + section { border-top: 1px dashed var(--line); }
.section-title {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 48px;
}
.section-title .eyebrow {
  background: var(--brand-accent-light);
  color: var(--brand-accent-dark);
  border: none;
}
.section-title h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  margin: 14px 0 10px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ink);
}
.section-title p {
  color: var(--ink-soft);
  font-size: 17px;
  margin: 0;
}

h2 { font-weight: 800; color: var(--ink); }
h3 { font-weight: 700; color: var(--ink); }
h4 { font-weight: 700; color: var(--ink); margin-bottom: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand-accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255,107,53,.35);
}
.btn-primary:hover { background: var(--brand-accent-dark); transform: translateY(-1px); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-accent-light);
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .nav { display: none; position: absolute; top: 100%; right: 0; left: 0;
         flex-direction: column; background: var(--brand-primary);
         padding: 12px; gap: 0; }
  .nav.open { display: flex; }
  .nav a { border-radius: 6px; width: 100%; }
  .menu-toggle { display: inline-block; }
}

/* ---------- stats / numbers ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  backdrop-filter: blur(12px);
}
.stat .num {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.stat .num .unit { font-size: 16px; opacity: .85; margin-left: 2px; }
.stat .label {
  color: rgba(255,255,255,.75);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- icon tiles ---------- */
.icon-tile {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(45,27,105,.25);
}
.icon-tile.orange { background: linear-gradient(135deg, #FF8A5B, var(--brand-accent)); box-shadow: 0 6px 20px rgba(255,107,53,.3); }
.icon-tile.magenta { background: linear-gradient(135deg, #E24E87, var(--sunset-4)); }
.icon-tile.green { background: linear-gradient(135deg, #2eba76, var(--success)); }
.icon-tile.blue { background: linear-gradient(135deg, #4f8bff, var(--info)); }
.icon-tile.amber { background: linear-gradient(135deg, #f5b945, var(--warning)); }
.icon-tile.red { background: linear-gradient(135deg, #ea6565, var(--danger)); }
.icon-tile.dark { background: linear-gradient(135deg, #3a2a75, var(--brand-primary-dark)); }

/* ---------- pain points ---------- */
.pain {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff6f1;
  border: 1px dashed #ffb694;
  margin-bottom: 14px;
}
.pain .x {
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
  font-weight: 800;
  border: 2px solid #ffb694;
}
.solve {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: #f0fbf4;
  border: 1px dashed #8dd4aa;
  margin-bottom: 14px;
}
.solve .x {
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  font-weight: 800;
  border: 2px solid #8dd4aa;
}

/* ---------- regulation cards ---------- */
.reg-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.reg-card.purple { border-left-color: var(--brand-primary); }
.reg-card.green  { border-left-color: var(--success); }
.reg-card.amber  { border-left-color: var(--warning); }
.reg-card.blue   { border-left-color: var(--info); }
.reg-card .tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--brand-accent-light);
  color: var(--brand-accent-dark);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.reg-card.purple .tag { background: #ece7fa; color: var(--brand-primary); }
.reg-card.green  .tag { background: #defbe9; color: #1f9d55; }
.reg-card.amber  .tag { background: #fff2d7; color: #b07100; }
.reg-card.blue   .tag { background: #dfe9ff; color: #1d4cc9; }

/* ---------- module cards ---------- */
.mod {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: all .2s ease;
  overflow: hidden;
}
.mod::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: .9;
}
.mod:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.mod h3 {
  margin: 0 0 6px;
  font-size: 19px;
}
.mod .sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brand-accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.mod .desc {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 14px;
}
.mod ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}
.mod ul li { margin-bottom: 4px; }

/* ---------- feature pills ---------- */
.pill {
  display: inline-block;
  background: var(--line-soft);
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 6px;
}
.pill.primary { background: var(--brand-primary); color: #fff; }
.pill.accent { background: var(--brand-accent-light); color: var(--brand-accent-dark); }

/* ---------- number callouts ---------- */
.callout {
  background: linear-gradient(135deg, #fff 0%, var(--parchment) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}
.callout .figure {
  font-size: 44px;
  font-weight: 800;
  color: var(--brand-accent);
  line-height: 1;
}
.callout .cap {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 6px;
  font-weight: 500;
}

/* ---------- report table ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 16px 0;
  font-size: 14px;
}
.tbl th, .tbl td { padding: 12px 14px; text-align: left; }
.tbl thead th {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .3px;
}
.tbl tbody tr { border-top: 1px solid var(--line); }
.tbl tbody tr:nth-child(even) { background: var(--line-soft); }
.tbl tbody tr:hover { background: var(--brand-accent-light); }

/* ---------- scenario / story card ---------- */
.story {
  background: linear-gradient(135deg, #fff 0%, #fff8f2 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.story::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0; width: 6px;
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-primary));
}
.story .story-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.story .story-head .who {
  background: var(--brand-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.story .ask {
  background: #fff;
  border: 1px dashed var(--brand-accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 10px 0;
  position: relative;
}
.story .ask::before { content: "“"; color: var(--brand-accent); font-size: 38px; position: absolute; left: 6px; top: -6px; font-weight: 800; }

/* ---------- diagram canvas ---------- */
.diagram-wrap {
  background: var(--cream);
  border: 2px dashed var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  overflow: auto;
}
.diagram-title {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--brand-primary);
  margin-bottom: 16px;
}
.hand { font-family: var(--font-hand); }

/* SVG hand-drawn roughness filter applied inline per svg */
.rough { filter: url(#roughen); }

/* ---------- footer ---------- */
footer {
  background: var(--brand-primary-dark);
  color: rgba(255,255,255,.72);
  padding: 44px 24px;
  margin-top: 60px;
  text-align: center;
}
footer strong { color: #fff; }
footer .links { margin: 14px 0; }
footer .links a { color: rgba(255,255,255,.8); margin: 0 10px; }
footer .links a:hover { color: var(--brand-accent); }

/* ---------- breadcrumb / page header ---------- */
.page-head {
  background: linear-gradient(120deg, var(--brand-primary) 0%, #3a2277 60%, #5d2a8a 100%);
  color: #fff;
  padding: 56px 24px 68px;
  text-align: center;
}
.page-head h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  margin: 10px 0 8px;
  font-weight: 800;
}
.page-head p {
  color: rgba(255,255,255,.82);
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
}

/* ---------- anchor navigation (module index) ---------- */
.anchor-nav {
  position: sticky;
  top: 72px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.anchor-nav h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
}
.anchor-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
}
.anchor-nav a:hover { background: var(--line-soft); color: var(--brand-primary); }
.anchor-nav a.active {
  background: var(--brand-accent-light);
  color: var(--brand-accent-dark);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .anchor-nav { position: static; }
}

/* ---------- flow / step chips ---------- */
.steps {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 160px;
  position: relative;
}
.step .n {
  position: absolute; top: -12px; left: -10px;
  background: var(--brand-accent); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  box-shadow: 0 4px 10px rgba(255,107,53,.3);
}
.step h5 { margin: 0 0 4px; font-size: 14px; }
.step p { margin: 0; font-size: 12.5px; color: var(--ink-mute); }

/* ---------- ai chat-style bubble ---------- */
.chat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  max-width: 640px;
  margin: 0 auto 22px;
  box-shadow: var(--shadow);
}
.bubble {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.bubble.me { flex-direction: row-reverse; }
.bubble .ava {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.bubble.me .ava { background: var(--brand-accent); }
.bubble .msg {
  background: var(--line-soft);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  max-width: 80%;
  font-size: 14px;
}
.bubble.me .msg {
  background: var(--brand-primary);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

/* ---------- check list ---------- */
.checks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checks li {
  position: relative;
  padding: 10px 0 10px 34px;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: #defbe9; color: var(--success);
  border-radius: 50%;
  font-weight: 900;
  font-size: 13px;
}

/* ---------- helpers ---------- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 28px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.muted { color: var(--ink-mute); }
.brand { color: var(--brand-primary); }
.accent { color: var(--brand-accent); }
.small { font-size: 13px; }

/* ---------- key / legend ---------- */
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- subnav anchor smooth ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

/* ---------- print ---------- */
@media print {
  .topbar, footer, .menu-toggle { display: none; }
  body { background: #fff; }
}
