/* ThinkAgain website. Bauhaus utility on white, one light theme (as the extension).
   Layout: a 1120px column with a 20px gutter; square corners; one dark band per page at most. */
@font-face { font-family: "Besley"; src: url("fonts/besley-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --soft: #F7F8FA;
  --ink: #26231F;
  --muted: #5E5A52;
  --hair: #E4E5EA;
  --blue: #2347B0;
  --blue-deep: #1A3790;
  --yellow: #F2C230;
  --on-dark: #FFFFFF;
  --on-dark-muted: #CFCBC3;
  --grad: linear-gradient(90deg, #2347B0, #6E5BEA 60%, #A9B8FF);
  --display: "Besley", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(38px, 6vw, 64px); }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: 22px; }
p { margin: 0; }
p, li, td, th, summary, dd, .lead { text-wrap: pretty; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.strip { height: 4px; background: var(--grad); }
.lines { white-space: pre-line; }
.muted { color: var(--muted); }
.eyebrow { font-weight: 600; font-size: 14px; letter-spacing: .04em; color: var(--muted); }
.ph { background: #FFF4CC; padding: 0 3px; }

/* Header: matches the extension's settings bar (mark, name, page, then the links) */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 16px 32px; background: var(--paper); border-bottom: 1px solid #ECECEF; }
.topbar .home { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.topbar .home:hover { color: var(--ink); }
.topbar svg { width: 32px; height: 32px; flex: none; }
.topbar .name { font: 600 20px/1 var(--display); }
.topbar .sub { flex: 1; color: var(--muted); font-size: 14px; }
.topbar nav { display: flex; gap: 20px; margin-left: auto; font-weight: 600; font-size: 14px; }
.topbar nav a { color: var(--ink); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); }
@media (max-width: 640px) { .topbar { padding: 12px 16px; } .topbar .sub { display: none; } .topbar nav { gap: 16px; } }
@media (max-width: 420px) { .topbar nav .opt { display: none; } }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 600 16px/1 var(--body); text-decoration: none; }
.btn:hover { background: var(--yellow); color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #FFFFFF; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.dark .btn { background: transparent; color: var(--on-dark); border-color: var(--on-dark); }
.dark .btn:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* Sections */
section { padding-block: 72px; }
.band-soft { background: var(--soft); border-block: 1px solid var(--hair); }
.dark { background: var(--ink); color: var(--on-dark); }
.dark .muted, .dark .eyebrow { color: var(--on-dark-muted); }
.dark a { color: #A9B8FF; }
.dark h3 { color: var(--on-dark); }
.on-dark-muted { color: var(--on-dark-muted); max-width: 680px; }

/* Exceptions table on the dark band; rows become cards on phones */
.xtable { border: 1px solid rgba(255,255,255,.22); }
.xtable table { font-size: 15px; }
.xtable th { background: rgba(255,255,255,.06); color: var(--on-dark); border-bottom: 1px solid rgba(255,255,255,.22); }
.xtable td { color: var(--on-dark-muted); border-bottom: 1px solid rgba(255,255,255,.14); }
.xtable td:first-child { color: var(--on-dark); font-weight: 600; width: 26%; }
.xtable td:nth-child(2) { width: 36%; }
@media (max-width: 680px) {
  .xtable thead { display: none; }
  .xtable table, .xtable tbody, .xtable tr, .xtable td { display: block; width: auto !important; }
  .xtable tr { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
  .xtable tr:last-child { border-bottom: 0; }
  .xtable td { padding: 2px 0; border: 0; }
  .xtable td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--on-dark); font-weight: 600; }
}
.head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin-bottom: 36px; }

/* Hero */
.hero { padding-block: 64px 72px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; gap: 56px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 60px); }
.hero-art { justify-self: end; width: 100%; max-width: 380px; }
.hero-text { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); max-width: 36em; }
.chain { width: 100%; height: auto; }
.note { font-size: 14px; color: var(--muted); }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; } .hero-art { order: -1; justify-self: start; max-width: 140px; } }

/* App cards */
.apps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .apps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .apps { grid-template-columns: minmax(0, 1fr); } }
.app { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--paper); border: 1px solid var(--hair); min-width: 0; }
.app.live { border: 2px solid var(--ink); }
.app svg { width: 64px; height: 64px; }
.app h3 { font-size: 22px; }
.tag { align-self: flex-start; font-size: 13px; font-weight: 600; padding: 3px 8px; border: 1px solid var(--hair); color: var(--muted); }
.tag.on { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.app p { font-size: 15px; color: var(--muted); }
.app .more { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 15px; }

/* Principles */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid4 { grid-template-columns: minmax(0, 1fr); } }
.grid4 > div { display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--ink); padding-top: 16px; min-width: 0; }
.grid4 h3 { font-family: var(--body); font-weight: 700; font-size: 18px; }
.grid4 p { font-size: 16px; color: var(--muted); }

/* Feature cards */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
.card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid var(--hair); background: var(--paper); min-width: 0; }
.card h3 { font-family: var(--body); font-weight: 700; font-size: 19px; }
.card p { font-size: 16px; color: var(--muted); }

/* Flags */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.blur-box { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.flags { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; list-style: none; }
.flags li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; }
.flags b { display: block; font-size: 17px; }
.flags span { font-size: 15px; }
.dot { width: 32px; height: 32px; }
.mock { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 380px; }
.mock .bar { height: 3px; background: var(--grad); }
.mock .in { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.mock .title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mock dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 15px; }
.mock dt { color: var(--muted); }
.mock dd { margin: 0; }
.mock-wrap { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mock-cap { font-size: 14px; }

/* Lists and tables on text pages */
.doc { display: flex; flex-direction: column; gap: 18px; }
.doc > * { max-width: 760px; }
.doc h2 { font-size: 30px; margin-top: 28px; }
.doc h3 { font-family: var(--body); font-weight: 700; font-size: 19px; margin-top: 8px; }
.doc ul, .doc ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.table-box { overflow-x: auto; border: 1px solid var(--hair); background: var(--paper); }
.doc > .table-box { max-width: none; }
.table-box td:first-child { font-weight: 600; }
@media (min-width: 681px) { .table-box td:first-child { min-width: 11em; } .table-box td:nth-child(2):not(:last-child) { min-width: 10em; } }
/* On phones, each row becomes a small card: the first cell as its title, the rest labelled */
@media (max-width: 680px) {
  .table-box thead { display: none; }
  .table-box table, .table-box tbody, .table-box tr, .table-box td { display: block; width: auto; }
  .table-box tr { padding: 14px 16px; border-bottom: 1px solid var(--hair); }
  .table-box tr:last-child { border-bottom: 0; }
  .table-box td { padding: 2px 0; border: 0; }
  .table-box td:not(:first-child)::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
}
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
th { background: var(--soft); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
details { border-top: 1px solid var(--hair); padding-block: 16px; }
details:last-of-type { border-bottom: 1px solid var(--hair); }
summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 24px; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p, details ul { margin-top: 10px; color: var(--muted); }
.page-head { padding-block: 56px 8px; }
.page-head .wrap { display: flex; flex-direction: column; gap: 14px; }

/* Footer */
.foot { border-top: 1px solid var(--hair); padding-block: 40px; font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .topbar nav a { transition: background-color .15s, color .15s, border-color .15s; }
}
@media (max-width: 480px) { body { font-size: 16px; } section { padding-block: 52px; } .lead { font-size: 18px; } }
