/* =====================================================================
   Composing Agents, Compounding Risks: Tutorial site
   Shared design system. No logos. Palette derived from the RecSys'26
   proposal + the ConnaCF figures.
   ===================================================================== */

:root {
  /* Core ink / paper */
  --ink:        #16202E;
  --ink-soft:   #3A4759;
  --muted:      #6C7A89;
  --line:       #E2E7EC;
  --paper:      #FFFFFF;
  --paper-2:    #F4F6F8;
  --paper-3:    #ECF0F4;

  /* Brand */
  --blue:       #2D6A9F;   /* primary */
  --blue-dk:    #1F4E78;
  --orange:     #E07B39;   /* accent  */
  --green:      #3A9A5B;
  --red:        #C0392B;
  --gray:       #6C7A89;

  /* Risk lenses */
  --amp:        #5B8DBE;   /* amplified */
  --em:         #D4724E;   /* emergent  */

  /* ConnaCF attack/defense families */
  --diss:       #6A4C93;   /* dissemination */
  --extr:       #B5651D;   /* extraction    */
  --bidir:      #9C7A3C;   /* bidirectional */
  --def:        #3A7D44;   /* defense       */

  /* Threat tiers */
  --drift:      #8AA0B3;
  --misalign:   #C99A4A;
  --comp:       #B0473B;

  --maxw: 1140px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(22,32,46,.06), 0 2px 8px rgba(22,32,46,.05);
  --shadow:    0 6px 24px rgba(22,32,46,.10);
  --shadow-lg: 0 18px 48px rgba(22,32,46,.16);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; color: var(--ink); letter-spacing: -.01em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(10px);
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.nav .brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.02rem; color: var(--ink);
  white-space: nowrap; margin-right: auto;
}
.nav .brand b { color: var(--blue); }
.nav a.lk { font-size: .9rem; color: var(--ink-soft); font-weight: 500; }
.nav a.lk:hover { color: var(--blue); text-decoration: none; }
.nav .cta {
  font-size: .88rem; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  background: var(--blue); color: #fff;
}
.nav .cta:hover { background: var(--blue-dk); text-decoration: none; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav .links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 78% -10%, rgba(45,106,159,.12), transparent 60%),
    radial-gradient(900px 460px at 10% 110%, rgba(224,123,57,.10), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--line);
}
.hero .wrap { padding: 70px 24px 64px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.badge {
  font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.badge.hot { background: var(--blue); color: #fff; border-color: var(--blue); }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  margin: .1em 0 .35em; max-width: 17ch;
}
.hero h1 .accent { color: var(--blue); }
.hero .lede {
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  color: var(--ink-soft); max-width: 60ch; margin: 0 0 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; padding: 12px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--blue-dk); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Section scaffolding ---------- */
section.block { padding: 72px 0; border-bottom: 1px solid var(--line); }
section.block.alt { background: var(--paper-2); }
.section-head { max-width: 64ch; margin-bottom: 40px; position: relative; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .25em 0 .35em; }
.section-head p { color: var(--ink-soft); font-size: 1.06rem; margin: 0; }

/* ---------- Collapsible sections ---------- */
.section-head h2 { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.collapse-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #fff; border: 1px solid var(--line); color: var(--blue);
  font-size: .9rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .2s ease;
}
.collapse-toggle:hover { border-color: var(--blue); }
.block.collapsed .collapse-toggle { transform: rotate(-90deg); }
.block .collapsible-body { overflow: hidden; }
.block.collapsed .collapsible-body { display: none; }

/* ---------- Authors ---------- */
.authors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 820px){ .authors { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 460px){ .authors { grid-template-columns: 1fr; } }
.author {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.author .avatar {
  width: 56px; height: 56px; border-radius: 50%; margin-bottom: 14px;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
  font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dk));
}
.author:nth-child(2) .avatar { background: linear-gradient(135deg, var(--orange), #C45F22); }
.author:nth-child(3) .avatar { background: linear-gradient(135deg, var(--green), #2C7344); }
.author:nth-child(4) .avatar { background: linear-gradient(135deg, var(--diss), #4E3670); }
.author h4 { margin: 0 0 2px; font-size: 1.05rem; }
.author .affil { color: var(--muted); font-size: .86rem; }
.author p { font-size: .86rem; color: var(--ink-soft); margin: 12px 0 0; line-height: 1.5; }

/* ---------- Schedule / run of show ---------- */
.schedule { display: flex; flex-direction: column; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.slot {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--line);
}
.slot:last-child { border-bottom: 0; }
.slot.brk { background: var(--paper-3); }
.slot .time { font-family: var(--mono); font-size: .82rem; color: var(--blue); font-weight: 600; }
.slot .what h4 { margin: 0 0 2px; font-size: 1.04rem; font-family: var(--sans); font-weight: 700; }
.slot .what p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.slot .who {
  font-size: .8rem; font-weight: 600; color: var(--ink-soft);
  padding: 4px 12px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.slot.brk .who { background: transparent; border: 0; }
@media (max-width: 640px){
  .slot { grid-template-columns: 70px 1fr; }
  .slot .who { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* ---------- Cards / contributions ---------- */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 820px){ .cards { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); position: relative;
}
.card .num {
  font-family: var(--serif); font-size: 2rem; color: var(--blue); opacity: .35; line-height: 1;
}
.card h3 { font-size: 1.12rem; margin: 10px 0 8px; }
.card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.card .topline { height: 4px; border-radius: 4px 4px 0 0; position: absolute; top: 0; left: 0; right: 0; }

/* ---------- Lens explainer (amplified vs emergent) ---------- */
.lens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px){ .lens-grid { grid-template-columns: 1fr; } }
.lens {
  border-radius: var(--radius); padding: 26px 24px; color: #fff; box-shadow: var(--shadow);
}
.lens.amp { background: linear-gradient(135deg, var(--amp), #3E6E9C); }
.lens.em  { background: linear-gradient(135deg, var(--em), #B45637); }
.lens h3 { color: #fff; font-size: 1.3rem; margin: 0 0 6px; }
.lens .tag { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.lens p { margin: 8px 0 14px; opacity: .96; font-size: .96rem; }
.lens ul { margin: 0; padding-left: 18px; }
.lens li { font-size: .9rem; margin-bottom: 4px; opacity: .96; }

/* ---------- Taxonomy / matrix tables ---------- */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; box-shadow: var(--shadow-sm); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.matrix th, .matrix td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.matrix th { background: var(--paper-3); font-family: var(--sans); font-weight: 700; font-size: .82rem; letter-spacing: .02em; }
.matrix tr td:last-child, .matrix tr th:last-child { border-right: 0; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix td.rowhead { background: var(--paper-2); font-weight: 700; }
.matrix .cell-method { color: var(--ink-soft); }
.matrix .cell-method b { color: var(--ink); font-weight: 600; }

/* ---------- Resource grid ---------- */
.resources { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
@media (max-width: 820px){ .resources { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .resources { grid-template-columns: 1fr; } }
.res {
  display: flex; flex-direction: column; gap: 6px; padding: 22px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .1s ease, box-shadow .2s ease; color: var(--ink);
}
.res:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; border-color: var(--blue); }
.res .ic { font-size: 1.5rem; }
.res h4 { margin: 2px 0 0; font-family: var(--sans); font-size: 1.02rem; font-weight: 700; }
.res p { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.res .status { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.res .status.live { color: var(--green); }
.res .status.soon { color: var(--orange); }

/* ---------- Demo highlight ---------- */
.demo-card {
  background: linear-gradient(135deg, #1B2A3D, #16202E); color: #E8EEF4;
  border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow-lg);
}
.demo-card h3 { color: #fff; font-size: 1.5rem; margin: 0 0 8px; }
.demo-card p { color: #C3CFDC; }
.fam-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill { font-size: .78rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; color: #fff; }
.pill.diss { background: var(--diss); } .pill.extr { background: var(--extr); }
.pill.bidir { background: var(--bidir); } .pill.def { background: var(--def); }
.figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
@media (max-width:760px){ .figrow { grid-template-columns: 1fr; } }
.figrow figure { margin: 0; background: #fff; border-radius: 10px; padding: 10px; }
.figrow img { width: 100%; height: auto; display: block; border-radius: 6px; }
.figrow figcaption { font-size: .78rem; color: var(--muted); margin-top: 6px; text-align: center; }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: #AEBBC9; padding: 48px 0 40px; }
footer a { color: #cfe; }
footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width:760px){ footer .grid { grid-template-columns: 1fr; } }
footer h5 { color: #fff; font-family: var(--sans); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 8px; font-size: .9rem; }
.bibtex {
  background: #0E1620; border: 1px solid #243140; border-radius: 10px; padding: 16px 18px;
  font-family: var(--mono); font-size: .76rem; color: #A9C2D6; overflow-x: auto; white-space: pre;
  margin-top: 10px;
}
.copyline { margin-top: 28px; padding-top: 18px; border-top: 1px solid #243140; font-size: .82rem; color: #7E8D9C; }

/* helpers */
.tag-chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 6px; color: #fff; }
.chip-amp { background: var(--amp); } .chip-em { background: var(--em); }
.chip-drift { background: var(--drift); } .chip-mis { background: var(--misalign); } .chip-comp { background: var(--comp); }
.note { font-size: .82rem; color: var(--muted); font-style: italic; }
