@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700;800&display=swap");

/* Shared chrome for every inner page — same tokens and type as index.html. */

:root {
  --navy: #0c2d4a;
  --navy-deep: #081c30;
  --ink: #1c2b3a;
  --muted: #445566;
  --faint: #6b7a88;
  --gold: #e8a317;
  --green: #1f8a4c;
  --green-hover: #187a42;
  --blue: #2b7de9;
  --cream: #f6f0e4;
  --line: #d8dde3;
  --hair: #e6e9ee;
  --bg: #fff;
  --white: #fff;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap,
.wrap.wide {
  width: min(var(--maxw), calc(100% - 128px));
  margin: 0 auto;
  padding: 0;
}

a { color: var(--blue); }
a:hover { color: var(--navy); }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Header — matches index .topbar */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid #e6e9ee;
}
header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand::before {
  content: "";
  width: 32px;
  height: 32px;
  background: url("images/mark.jpg") center / cover no-repeat;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(12, 45, 74, 0.18);
  flex: 0 0 auto;
}
.brand::after {
  content: ".se";
  font-weight: 400;
  font-size: 12px;
  color: #778;
  vertical-align: super;
  margin-left: 1px;
  position: relative;
  top: -8px;
}
.brand:hover { color: var(--navy); }

header nav { margin-left: auto; }
header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  max-width: none;
}
header nav li { margin: 0; }
header nav a {
  text-decoration: none;
  color: #1a2a3a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 24px 0 20px;
  border-bottom: 3px solid transparent;
}
header nav a:hover { color: var(--blue); }
header nav a[aria-current="page"] {
  border-bottom-color: var(--blue);
  color: var(--navy);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-btn {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #334;
  padding: 4px 2px;
}
.lang-btn.active { text-decoration: underline; color: var(--navy); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 0;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--green-hover); color: #fff; }

/* Type */
h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.3px;
  color: var(--navy);
  margin-bottom: 14px;
}
h1 span { color: var(--gold); text-decoration: none; }
h2 {
  font-size: 30px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}
h3 {
  font-size: 20px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 8px;
}
h4 {
  font-size: 16px;
  color: var(--navy);
  margin: 22px 0 6px;
}
p { margin-bottom: 14px; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.lede { font-size: 19px; color: var(--muted); }
.byline { font-size: 14px; color: var(--faint); font-weight: 600; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f3f6f9;
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 0 5px;
}
strong { font-weight: 700; }

ul, ol { margin: 0 0 14px 1.25em; max-width: 68ch; }
li { margin-bottom: 6px; }

section { padding: 40px 0; border-top: 1px solid var(--hair); }
section:first-of-type { border-top: none; }

/* Blocks */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.cta-row p { margin-bottom: 0; }

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-secondary {
  background: transparent;
  border: 1px solid #c5ccd4;
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

.rows {
  margin: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
  max-width: none;
}
.rows > li {
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 14px;
  align-items: start;
}
.rows .marker { font-weight: 700; color: var(--gold); }
.rows h3 { margin-bottom: 4px; }
.rows p { margin-bottom: 0; color: var(--muted); }

.note {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 22px 0;
}
.note p { margin-bottom: 0; }

/* Figures */
figure {
  margin: 24px 0;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(20, 40, 70, 0.08);
  max-width: 820px;
}
figure img {
  border: 0;
  border-radius: 4px;
  width: 100%;
}
.zoom-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}
.zoom-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
figcaption {
  font-size: 13px;
  color: var(--faint);
  padding: 8px 4px 4px;
}

/* Tables */
.scroll-x { overflow-x: auto; margin-bottom: 18px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
}
th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-color: var(--line);
}
td strong { color: var(--navy); }

/* Manual TOC */
.layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding-top: 88px;
  padding-bottom: 60px;
}
.toc {
  position: sticky;
  top: 88px;
  border-right: 1px solid var(--hair);
  padding-right: 16px;
}
.toc h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.toc a {
  display: block;
  font-size: 14px;
  padding: 5px 0;
  text-decoration: none;
  color: var(--ink);
}
.toc a:hover { color: var(--blue); }
.layout main section {
  padding: 0 0 36px;
  border-top: none;
}
.layout main section + section {
  padding-top: 36px;
  border-top: 1px solid var(--hair);
}

.hero + .wrap {
  padding-top: 88px;
}
article { padding: 0 0 72px; }
article h2 { margin-top: 34px; }
article h2:first-child { margin-top: 0; }
.standfirst { font-size: 19px; color: var(--ink); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 48, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 720px;
  width: 100%;
  padding: 28px 26px 32px;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 8px;
}
.modal-logo { display: block; width: 100%; margin: 0 auto 26px; }
.modal-body .formula {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 18px 0;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
}
.modal-figure { display: block; width: 100%; margin: 32px auto; }

/* Inner-page hero — same navy band as the landing */
.hero {
  background: var(--navy);
  color: #e8eef4;
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 80%;
  height: 160%;
  background:
    radial-gradient(circle at 70% 40%, transparent 0 18%, rgba(255,255,255,.03) 18.5% 19%, transparent 19.5% 28%, rgba(255,255,255,.035) 28.5% 29%, transparent 29.5% 40%, rgba(255,255,255,.03) 40.5% 41%, transparent 41.5%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero .eyebrow { color: #9fb4c6; }
.hero h1 { color: var(--gold); margin-bottom: 8px; }
.hero .lede { color: #d5e0ea; max-width: 640px; }
.hero a { color: #fff; }
.hero a:hover { color: var(--gold); }
.hero .byline { color: #9fb4c6; margin-top: 12px; }
.hero-art { margin-top: 26px; max-width: 260px; }
.hero-art-btn {
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  width: 100%;
}
.hero-art-btn img { border: 0; border-radius: 8px; }
.hero-art-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 28, 48, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 24px 32px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 82vh;
  width: auto;
  cursor: default;
  border-radius: 6px;
}
.lightbox-caption {
  color: #fff;
  font-size: 13px;
  margin: 0;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  background: none;
  border: 1px solid #fff;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

.cta-band {
  background: #10263c;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 26px 24px;
  margin: 28px 0 48px;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #d5e0ea; }
.cta-band a { color: #fff; }

/* Footer — same as index */
footer {
  background: var(--navy-deep);
  color: #c5d0da;
  border-top: 0;
  padding: 48px 0 28px;
}
.foot-grid {
  width: min(var(--maxw), calc(100% - 128px));
  margin: 0 auto 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
footer h4 { color: #fff; margin-bottom: 12px; font-size: 16px; }
footer a {
  color: #c5d0da;
  text-decoration: none;
  display: block;
  margin: 6px 0;
  font-size: 14px;
}
footer a:hover { color: #fff; }
.copyr {
  width: min(var(--maxw), calc(100% - 128px));
  margin: 0 auto;
  border-top: 1px solid #1c3348;
  padding-top: 16px;
  font-size: 13px;
  color: #8aa0b3;
}

@media (max-width: 860px) {
  .wrap,
  .wrap.wide,
  .foot-grid,
  .copyr { width: min(var(--maxw), calc(100% - 48px)); }
  .foot-grid { grid-template-columns: 1fr; }
  header .wrap { flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; min-height: 0; }
  header nav { margin-left: 0; width: 100%; }
  header nav ul { gap: 10px 14px; }
  header nav a { padding: 6px 0 8px; }
  .nav-cta { display: none; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
  .toc {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--hair);
    padding: 0 0 16px;
  }
}
@media (max-width: 560px) {
  .rows > li { grid-template-columns: 1fr; gap: 4px; }
  h2 { font-size: 26px; }
}
