/**
 * AgentSemantics — Pipeline vs Workflow vs Agent
 * Main Stylesheet
 */

/* ============================================
   CSS Variables & Base Styles
   ============================================ */

:root {
  --ink: #1a1a1a;
  --muted: #6b6560;
  --paper: #fefcf9;
  --warm: #f5f3ef;
  --card: #ffffff;
  --line: #e8e5e0;
  --accent: #e8503a;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  text-align: center;
  padding: 72px 24px 48px;
  background: linear-gradient(to bottom, #fdfbf7, var(--paper));
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232, 80, 58, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 1.15;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
}

/* ============================================
   Audience Bar
   ============================================ */

.aud-wrap {
  margin-top: 28px;
}

.aud-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: var(--warm);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.aud-btn {
  position: relative;
  padding: 12px 22px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}

.aud-btn:hover {
  color: var(--ink);
}

.aud-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Tooltip for audience buttons */
.aud-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1a1a1a;
  color: #f5f5f5;
  font-size: 12px;
  font-weight: 400;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aud-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.aud-btn::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.aud-btn:hover::before {
  opacity: 1;
}

/* ============================================
   Section Styles
   ============================================ */

.sec {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.sec-t {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  margin-bottom: 6px;
}

.sec-s {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 15px;
}

/* ============================================
   Comparison Table
   ============================================ */

.cw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -24px;
  padding: 0 24px;
}

.ct {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.ct th,
.ct td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ct th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: var(--paper);
}

.ct th:first-child {
  width: 160px;
}

.ct td:first-child {
  font-weight: 600;
  font-size: 13px;
}

.ct tr:last-child td {
  border-bottom: none;
}

.ct td {
  min-width: 140px;
}

/* ============================================
   Tags / Pills
   ============================================ */

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
}

/* Tag color variants */
.tag-f {
  background: #f0eee9;
  color: #6b6560;
}

.tag-d {
  background: #dbeafe;
  color: #1e40af;
}

.tag-dev {
  background: #fef3c7;
  color: #92400e;
}

.tag-llm {
  background: #ede9fe;
  color: #6d28d9;
}

.tag-c {
  background: #d1fae5;
  color: #065f46;
}

.tag-e {
  background: #dcfce7;
  color: #166534;
}

.tag-h {
  background: #fee2e2;
  color: #991b1b;
}

.tag-m {
  background: #fef9c3;
  color: #854d0e;
}

/* Timestamp pill */
.ts-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  color: var(--muted);
  background: var(--warm);
  border: 1px solid var(--line);
}

.ts-pill .td {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

/* Footnote */
.fn {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 10px;
}

/* ============================================
   Example Cards
   ============================================ */

.exg {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 700px) {
  .exg {
    grid-template-columns: repeat(3, 1fr);
  }
}

.exc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.exc:hover {
  border-color: var(--accent);
}

.exc.active {
  border-color: var(--accent);
}

.exh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.exi {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.exh h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.exh p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0 0;
  line-height: 1.3;
}

/* ============================================
   Mode Bar (Pipeline/Workflow/Agent Toggle)
   ============================================ */

.mb {
  display: flex;
  background: var(--warm);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.mbtn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  text-align: center;
}

.mbtn:hover {
  color: var(--ink);
}

.mbtn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Split Panels (Design/Runtime)
   ============================================ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

@media (max-width: 700px) {
  .split {
    grid-template-columns: 1fr !important;
  }
}

.pnl {
  padding: 16px;
  min-height: 200px;
  position: relative;
}

.pnl-l {
  background: var(--warm);
  border-right: 1px solid var(--line);
}

.pnl-r {
  background: #fefcf9;
}

.pnl-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pnl-h .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
}

/* Run Button */
.run-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--accent);
  background: rgba(232, 80, 58, 0.08);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.run-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   Flowchart Wrapper
   ============================================ */

.fc-wrap {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 8px 0;
}

.fc-wrap svg {
  font-family: 'Instrument Sans', sans-serif !important;
  max-width: 100%;
}

.fc-wrap .node rect,
.fc-wrap .node polygon,
.fc-wrap .node circle {
  rx: 10;
  ry: 10;
}

.fc-wrap .edgePath path {
  stroke-width: 2px !important;
}

.fc-wrap .edgeLabel {
  font-size: 11px !important;
  font-weight: 600;
}

.fc-wrap .node .label {
  font-size: 13px !important;
}

.fc-wrap .node .label small {
  font-size: 11px !important;
  opacity: 0.6;
}

/* ============================================
   Callouts
   ============================================ */

.co {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-top: 14px;
}

.co-i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Callout variants */
.co-p {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.co-w {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}

.co-a {
  background: #fff7ed;
  border: 1px solid #fdba74;
}

/* ============================================
   Knobs Row
   ============================================ */

.krow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.kc {
  background: var(--warm);
  border-radius: 10px;
  padding: 9px 11px;
  overflow: hidden;
}

.kc .kl {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.kc .tag {
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
}

/* ============================================
   Decision Cards Grid
   ============================================ */

.dg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

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

.dc h4 {
  font-size: 14px;
  margin-bottom: 5px;
}

.dc p {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  text-align: center;
  padding: 36px 24px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 36px;
}
