:root {
  /* Ottomat homepage light-mode palette */
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-card: rgba(10, 10, 11, 0.025);
  --bg-subtle: rgba(10, 10, 11, 0.025);
  --border: rgba(10, 10, 11, 0.10);
  --border-strong: rgba(10, 10, 11, 0.18);
  --text: #0a0a0b;
  --text-muted: rgba(10, 10, 11, 0.65);
  --text-dim: rgba(10, 10, 11, 0.45);
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.10);
  --accent-border: rgba(245, 158, 11, 0.30);
  --accent-glow: rgba(245, 158, 11, 0.18);

  --serif: 'Frank Ruhl Libre', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --max-width: 760px;
  --sidebar-width: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern', 'liga', 'calt';
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

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

/* ============================================================
   LAYOUT — index page
   ============================================================ */

.page-index .layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 48px 32px;
  overflow-y: auto;
  background: var(--bg);
  z-index: 10;
}

.sidebar-brand {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .mark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-brand .mark .accent { color: var(--accent); font-style: italic; font-weight: 500; }

.sidebar-brand .meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: 8px;
  font-family: var(--mono);
}

/* Bionic toggle */

.bionic-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  width: 100%;
  font-family: var(--sans);
  text-align: left;
}

.bionic-toggle:hover { border-color: var(--accent-border); color: var(--text); }

.bionic-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.bionic-toggle .label-group { display: flex; flex-direction: column; gap: 2px; }
.bionic-toggle .label-main { font-weight: 600; font-size: 12px; }
.bionic-toggle .label-main b { font-weight: 700; }
.bionic-toggle .label-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 600;
  font-family: var(--mono);
}
.bionic-toggle.active .label-sub { color: var(--accent); }

.bionic-toggle .switch {
  width: 28px; height: 16px;
  background: var(--border-strong);
  border-radius: 8px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.bionic-toggle .switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--bg-elevated);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.bionic-toggle.active .switch { background: var(--accent); }
.bionic-toggle.active .switch::after { transform: translateX(12px); }

body.bionic .bionic-bold { font-weight: 700; }

/* sidebar nav */

.sidebar-nav { list-style: none; }

.sidebar-nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
  font-family: var(--mono);
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav a {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 4px;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin-left: -2px;
}

.sidebar-nav a:hover { color: var(--text); background: var(--bg-subtle); }

.sidebar-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-nav .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  min-width: 18px;
}

.sidebar-nav a.active .num { color: var(--accent); }

.sidebar-nav .sub {
  margin-left: 30px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 4px 12px;
  border-left: none;
}

.sidebar-nav .sub:hover { color: var(--text-muted); background: transparent; }
.sidebar-nav .sub.active { color: var(--accent); background: var(--accent-soft); border-left: 2px solid var(--accent); }

/* content */

.content {
  max-width: var(--max-width);
  padding: 80px 64px 120px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* hosts strip — three logos in one row */

.hosts {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 36px;
  margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}

.hosts-logo {
  width: auto;
  display: block;
  opacity: 0.85;
}

.hosts-logo--fusion { height: 36px; }
.hosts-logo--gfs { height: 64px; }
.hosts-logo--ottomat { height: 28px; }

/* doc header */

.doc-header {
  margin-bottom: 80px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.doc-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
  font-family: var(--mono);
}

.doc-title {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text);
}

.doc-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.doc-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 40px;
  font-weight: 300;
  max-width: 60ch;
}

.doc-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  font-size: 13px;
}

.doc-meta-item .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
  font-family: var(--mono);
}

.doc-meta-item .value { color: var(--text); font-weight: 400; }

/* sections */

section { margin-bottom: 72px; scroll-margin-top: 24px; }

.section-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: block;
  font-weight: 500;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}

h2 { font-size: 32px; margin-bottom: 14px; }
h3 { font-size: 22px; margin: 0 0 16px; }

p { margin-bottom: 18px; color: var(--text); }
p.lead { font-size: 16px; color: var(--text-muted); line-height: 1.65; margin-bottom: 32px; }
strong { font-weight: 600; color: var(--text); }
em { font-style: italic; color: var(--text); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

/* ============================================================
   STAGE (session card)
   ============================================================ */

.stage-list { display: grid; gap: 20px; }

.stage {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  background: var(--bg-elevated);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  scroll-margin-top: 24px;
}

.stage:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.stage-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.stage-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stage-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.stage-speaker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.stage-speaker-info { min-width: 0; }

.stage-speaker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

.stage-speaker-role {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

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

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar--md { width: 44px; height: 44px; }
.avatar--sm { width: 32px; height: 32px; }

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.avatar__initials {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 0;
}

.avatar--md .avatar__initials { font-size: 12px; }
.avatar--sm .avatar__initials { font-size: 10px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  letter-spacing: 0.005em;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.btn[data-copied="true"] {
  background: #2c7a4b;
  color: #fff;
  border-color: #2c7a4b;
}

/* ============================================================
   FOOTER
   ============================================================ */

.doc-footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  font-family: var(--serif);
}

/* ============================================================
   VIEWER PAGE
   ============================================================ */

.page-viewer {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.viewer__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.viewer__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--sans);
  transition: background 0.15s, color 0.15s;
}

.viewer__back:hover { background: var(--bg-subtle); color: var(--text); }

.viewer__meta { min-width: 0; }

.viewer__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.viewer__title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.viewer__person {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.viewer__person em { font-style: italic; color: var(--text-muted); }

.viewer__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.viewer__main {
  flex: 1;
  position: relative;
  background: var(--bg-card);
  overflow: hidden;
}

.viewer__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.viewer__note {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

/* ============================================================
   PROMPT MODAL
   ============================================================ */

.prompt-modal[hidden] { display: none; }

.prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.prompt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(2px);
}

.prompt-modal__panel {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: min(820px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prompt-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.prompt-modal__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

.prompt-modal__header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

.prompt-modal__actions { display: inline-flex; gap: 8px; flex-shrink: 0; }

.prompt-modal__body {
  margin: 0;
  padding: 26px;
  overflow: auto;
  background: var(--bg-card);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .page-index .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 28px 28px;
  }
  .sidebar-nav .sub { margin-left: 24px; }
  .content { padding: 56px 28px 80px; }
  .doc-title { font-size: 38px; }
  .doc-meta { grid-template-columns: 1fr 1fr; }

  .viewer__bar {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    row-gap: 12px;
  }
  .viewer__meta { grid-column: 1 / -1; order: 2; }
  .viewer__actions { justify-self: end; }
  .viewer__title { white-space: normal; }
}

@media (max-width: 600px) {
  .doc-title { font-size: 32px; }
  .doc-meta { grid-template-columns: 1fr; }
  .stage { padding: 22px 20px; }
  .hosts { gap: 24px; }
  .stage-actions { width: 100%; }
  .stage-actions .btn { flex: 1; justify-content: center; }
}

@media print {
  body { background: white; }
  body::before { display: none; }
  .sidebar, .bionic-toggle, .stage-actions { display: none; }
  .page-index .layout { grid-template-columns: 1fr; }
  .content { padding: 24px; max-width: 100%; }
  .stage { break-inside: avoid; box-shadow: none; }
}
