:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --band: rgba(255, 255, 255, 0.86);
  --text: #1b1f24;
  --muted: #4a515b;
  --line: #d9dcd8;
  --accent: #0a6658;
  --accent-text: #ffffff;
  --focus: #1a4fd6;
  --tag-bg: #eceee9;
  --chip-bg: #eef5f3;
  --notice-bg: #f6f7f4;
  --shadow: 0 1px 2px rgba(20, 24, 20, 0.06), 0 10px 28px rgba(20, 24, 20, 0.07);
  /* The egg, lightened a little so the boxes stand out from it. */
  --page-veil: rgba(250, 249, 245, 0.30);
  /* The forest, darkened so white text on it keeps at least 4.5:1. */
  --head-veil: linear-gradient(90deg, rgba(3, 20, 10, 0.84) 0%, rgba(3, 20, 10, 0.74) 55%, rgba(3, 20, 10, 0.66) 100%);
  --head-text: #ffffff;
  --head-muted: #d9ece4;
  --head-accent: #8fe3cb;
  --gutter: clamp(16px, 3vw, 56px);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #181d25;
    --band: rgba(21, 26, 33, 0.94);
    --text: #e7e9ec;
    --muted: #b0b7c1;
    --line: #2d3440;
    --accent: #5fd0b8;
    --accent-text: #0c1a17;
    --focus: #8fb4ff;
    --tag-bg: #232a35;
    --chip-bg: #1d2a2a;
    --notice-bg: #151a21;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.25);
    --page-veil: rgba(13, 17, 23, 0.88);
    --head-veil: linear-gradient(90deg, rgba(2, 12, 7, 0.86) 0%, rgba(2, 12, 7, 0.78) 55%, rgba(2, 12, 7, 0.72) 100%);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* The egg behind the whole page. A fixed layer, not background-attachment: fixed, which phones
   ignore or blow up. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image: linear-gradient(var(--page-veil), var(--page-veil)), url("img/bg-egg-1672.webp");
  background-size: cover;
  background-position: center;
}
@media (max-width: 60rem) {
  body::before { background-image: linear-gradient(var(--page-veil), var(--page-veil)), url("img/bg-egg-960.webp"); }
}

/* Language: Swedish by default, English when <html lang="en"> */
html[lang="en"] .l-sv { display: none; }
html:not([lang="en"]) .l-en { display: none; }

/* Full width: the page uses the whole screen, with gutters that grow with it. */
.wrap {
  width: 100%;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--mono); }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -4rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.625rem; font-weight: 650; margin-bottom: 1rem; }
h3 { font-size: 1.1875rem; font-weight: 650; }

/* Header: the forest, under a dark veil */
.masthead {
  color: var(--head-text);
  background-color: #0b2a17;
  background-image: var(--head-veil), url("img/bg-forest-1672.webp");
  background-size: cover;
  background-position: center 40%;
  border-bottom: 3px solid var(--accent);
}
@media (max-width: 60rem) {
  .masthead { background-image: var(--head-veil), url("img/bg-forest-960.webp"); }
}
.masthead a { color: var(--head-accent); }
.masthead :focus-visible { outline-color: #ffffff; }
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  padding-block: 0.625rem;
  min-height: 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.kicker { margin: 0; font-weight: 600; font-size: 0.9375rem; color: var(--head-muted); }
.lang {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  padding: 0.375rem 0.875rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.lang:hover { background: #ffffff; color: #0b2a17; }

.hero { padding-block: clamp(1.75rem, 4vw, 3.25rem) clamp(1.75rem, 4vw, 3rem); }
.hero h1 { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
.hero .sep { color: var(--head-accent); }
.theme {
  margin: 0.5rem 0 0;
  font-size: clamp(1.25rem, 2.6vw, 1.875rem);
  font-weight: 600;
  color: var(--head-accent);
  letter-spacing: -0.01em;
}
.lead { font-size: 1.1875rem; color: var(--head-muted); max-width: 52rem; margin: 0.875rem 0 1.25rem; }
.callout {
  border-left: 4px solid var(--head-accent);
  background: rgba(0, 0, 0, 0.38);
  padding: 0.75rem 1rem;
  margin: 0;
  max-width: 52rem;
  font-size: 0.9375rem;
  border-radius: 0 6px 6px 0;
}

/* The 2x2 grid: one column in the order 1, 2, 3, 4 on narrow screens */
.grid4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 1.6vw, 2rem);
  padding-block: clamp(1rem, 2vw, 2rem) clamp(2rem, 4vw, 3.5rem);
}
@media (min-width: 60rem) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1rem, 1.6vw, 1.75rem);
  min-width: 0;
  box-shadow: var(--shadow);
}
.box h2 { margin-bottom: 0.5rem; }
/* A comfortable line length inside the wide boxes. */
.box > p, .box .try, .papers > p, .guide { max-width: 72ch; }
.box > p { margin: 0.625rem 0 0; }
.box .sub { font-size: 1.125rem; font-weight: 600; margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }
.box .small.mono { margin-top: 0.375rem; color: var(--muted); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Circle portraits of the family's AI experts */
.avatar {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tag-bg);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
}
.avatar-lg { width: 88px; height: 88px; }
.avatar-ph {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-text);
  background: var(--accent);
}
.box-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.25rem; }
.box-head h2 { margin-bottom: 0.125rem; }
.box-head .sub { margin: 0; }

/* Film */
.film-title { margin-top: 0.75rem; font-size: 1.3125rem; }
.film {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-top: 0.75rem;
  background: #000;
  border-radius: 8px;
}

/* Whitepapers */
.papers {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.papers summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 1.125rem;
  padding: 0.375rem 0;
  min-height: 2.75rem;
  display: list-item;
}
.papers summary:hover { color: var(--accent); }
.papers > p { margin: 0.25rem 0 0.75rem; font-size: 0.9375rem; }
.paper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  column-gap: 1.5rem;
}
.paper-list li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--line);
}
.paper-list .pn { color: var(--accent); font-weight: 600; padding-top: 0.05rem; }
.paper-list p { margin: 0; }
.paper-list .pt { font-weight: 600; }
.paper-list .pl { font-size: 0.9375rem; color: var(--muted); }
.paper-list .pl a { display: inline-block; padding: 0.25rem 0; margin-right: 0.875rem; }

/* Ask the AI */
.guide { margin-top: 1rem; }
.guide-label { display: block; font-weight: 650; margin-bottom: 0.375rem; }
.guide textarea {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
}
.guide-row { display: flex; align-items: center; gap: 1rem; margin-top: 0.625rem; flex-wrap: wrap; }
button.btn { font: inherit; font-weight: 650; border: 0; cursor: pointer; }
button.btn[disabled] { opacity: 0.6; cursor: progress; }
.chips-label { margin: 0.875rem 0 0.375rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  min-height: 2.5rem;
  cursor: pointer;
  text-align: left;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.notice {
  max-width: 72ch;
  margin: 0.875rem 0 0;
  padding: 0.625rem 0.875rem;
  background: var(--notice-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.guide-out { margin-top: 0.75rem; }
.guide-out:empty { display: none; }
.guide-out > p { margin: 0.5rem 0 0; max-width: 72ch; }
.rec-mode { font-weight: 600; }
.rec-err { border-left: 4px solid var(--accent); padding-left: 0.75rem; }
.recs {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.75rem;
}
.rec {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--notice-bg);
}
.rec .avatar { width: 56px; height: 56px; }
.rec p { margin: 0; }
.rec-name { font-weight: 650; font-size: 1.0625rem; }
.rec-why { margin-top: 0.125rem !important; }
.rec .link { font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; margin-top: 0.25rem !important; }

/* Buttons (links that look like buttons) */
.cta { margin-top: 1rem !important; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  text-decoration: none;
  line-height: 1.35;
}
.btn:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* ANTON */
.try-h {
  font-size: 0.9375rem;
  font-weight: 650;
  margin-top: 1.25rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.try { margin: 0.375rem 0 0; padding-left: 1.5rem; }
.try li { margin: 0.25rem 0; }

/* The sibling apps: a portrait on the left, two or three across on a wide screen */
.apps {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  column-gap: 1.5rem;
}
.app {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}
.apps h3 { font-size: 1.0625rem; }
.apps p { margin: 0.125rem 0 0; }
.apps .hint { color: var(--muted); font-size: 0.9375rem; }
.apps .link { font-family: var(--mono); font-size: 0.9375rem; overflow-wrap: anywhere; }
.apps .link a { display: inline-block; padding: 0.25rem 0; }
.tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* Programme and after the session */
main > .band { padding: clamp(2rem, 4vw, 3rem) 0; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 60rem) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.two-col > div { max-width: 52rem; }
.two-col h2 { font-size: 1.375rem; margin-bottom: 0.75rem; }
.programme { list-style: none; margin: 0; padding: 0; }
.programme li {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}
.programme li:first-child { border-top: 0; }
.programme .time { font-weight: 600; color: var(--accent); }
.two-col .small { margin: 0.5rem 0 0; }
.after { margin: 0; padding-left: 1.25rem; }
.after li { margin: 0.5rem 0; }

/* Footer: on a plain surface strip, so it reads on the egg in both themes */
.foot { padding: 1.5rem 0 2rem; color: var(--muted); font-size: 0.9375rem; background: var(--band); }
.foot p { margin: 0; }
.foot p + p { margin-top: 0.25rem; }

@media (max-width: 30rem) {
  .box { padding: 1rem; }
  .avatar-lg { width: 72px; height: 72px; }
  .app { grid-template-columns: 52px minmax(0, 1fr); }
  .app .avatar { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  :root {
    --bg: #ffffff; --surface: #ffffff; --band: #ffffff;
    --text: #000000; --muted: #333333; --line: #999999; --accent: #000000;
  }
  body { font-size: 11pt; }
  body::before { display: none; }
  .masthead { background: none; color: #000; border: 0; }
  .masthead a, .kicker, .lead, .theme, .hero .sep { color: #000; }
  .hero h1 { text-shadow: none; }
  .callout { background: none; }
  .lang, .skip, .guide, .guide-out, .notice { display: none !important; }
  .box { box-shadow: none; }
  .film, .film-title + p, .film + p { display: none; }
  .box, .app, .paper-list li, .programme li { break-inside: avoid; }
  .btn { background: none; color: #000; padding: 0; min-height: 0; }
  a { color: #000; text-decoration: none; }
}
