/* Adapted for Physlib Arena from the Physlib website, web2/public/blue-palette.css and web2/src/app/globals.css (Apache-2.0). */
@font-face {
  font-family: Geist;
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Approved Arena colors: the strong interaction blue and the light wordmark paint. */
:root {
  --font-sans: Geist, ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --system-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --site-max-width: 80rem;
  --radius: 0.25rem;
  /* Type scale for interface text. Editorial headings set their own sizes. */
  --text-2xs: .6875rem;
  --text-xs: .75rem;
  --text-sm: .8125rem;
  --text-base: .875rem;
  /* One card: physlib.io's guide card (rounded-xl, soft shadow). */
  --card-radius: .75rem;
  --card-surface: var(--surface);
  --card-shadow: 0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;
  --shadow-popover: 0 4px 16px color-mix(in srgb, var(--foreground) 12%, transparent);
  --interaction-blue: #0056b3;
  --brand-blue: #6caae6;
  --night-background: oklch(from var(--interaction-blue) .085 .04 h);
  --action-strong: var(--interaction-blue);
  --action-strong-hover: color-mix(in srgb, var(--action-strong) 80%, black);
  --action-strong-foreground: white;
}

/* Light mode — pure white canvas, blue accent */
:root,
[data-theme="light"] {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0 0 0);
  --accent: var(--interaction-blue);
  --accent-tint: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --accent-foreground: white;
  --action-strong-border: var(--action-strong);
  --wordmark-accent: var(--brand-blue);
  --border: oklch(0 0 0 / 0.08);
  --muted: oklch(0 0 0 / 0.6);
  --surface: var(--background);
  --surface-secondary: oklch(0.97 0 0);
  --toast-bg: var(--night-background);
  --toast-fg: var(--background);
  --control-default: lab(93.0314% .0993609 -.364041);
  --control-default-foreground: #18181b;
  --filter-border: #d1d5db;
  --filter-text: #6b7280;
  --filter-hover: #f3f4f6;
  --success: #187851;
  --warning: #875900;
  --danger: #a92633;
}

/* Dark mode — midnight blue */
[data-theme="dark"] {
  color-scheme: dark;
  --background: var(--night-background);
  --foreground: oklch(1 0 0);
  --accent: color-mix(in srgb, var(--brand-blue) 70%, white);
  --accent-tint: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --accent-foreground: var(--background);
  --action-strong-border: color-mix(in srgb, var(--action-strong) 75%, var(--accent));
  --wordmark-accent: color-mix(in oklab, var(--accent) 60%, transparent);
  --border: oklch(1 0 0 / 0.12);
  --muted: oklch(1 0 0 / 0.55);
  --surface: var(--background);
  --surface-secondary: oklch(from var(--background) .12 c h);
  --toast-bg: var(--foreground);
  --toast-fg: var(--background);
  --control-default: lab(15.7305% .613764 -2.16959);
  --control-default-foreground: #fcfcfc;
  --filter-border: var(--border);
  --filter-text: var(--muted);
  --filter-hover: var(--surface-secondary);
  --success: #72d4ac;
  --warning: #e7bc67;
  --danger: #ff9ba4;
  --card-surface: var(--surface-secondary);
  --card-shadow: 0 0 0 1px var(--border);
}

/* Shared page defaults and the workspace frame. */
:root {
  font: 16px/1.5 var(--font-sans);
  color: var(--foreground);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .16em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
input, textarea, select { border: 1px solid var(--border); border-radius: var(--radius); color: var(--foreground); background: var(--surface); font-size: var(--text-sm); padding: 6px 8px; }
/* One closed-state picker for both static and dynamically rendered forms. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  min-height: 34px;
  padding-inline-end: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23808080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right .6rem center;
  background-size: .875rem .875rem;
  background-repeat: no-repeat;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]) { appearance: auto; background-image: none; }
}
textarea { resize: vertical; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
main p, main li { text-wrap: pretty; }
time { font-variant-numeric: tabular-nums; }
.site-frame { width: min(100%, var(--site-max-width)); margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 40rem) { .site-frame { padding-inline: 2rem; } }

/* Physlib wordmark and footer, also loaded inside the footer's shadow root. */
.site-wordmark {
  color: var(--foreground);
  font: 550 22px/1 var(--font-sans);
  letter-spacing: -.04em;
  text-decoration: none;
}
.site-wordmark-lib { font-family: var(--system-mono); color: var(--wordmark-accent); }
.site-wordmark-suffix {
  margin-inline-start: .5em;
  color: var(--muted);
  font: 500 .74em/1 var(--mono);
  letter-spacing: .075em;
}

:host([data-physlib-footer]) {
  display: block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.site-footer { border-top: 1px solid var(--border); background: var(--surface-secondary); }
.site-footer > .site-frame { padding-block: 2.25rem; }
.site-footer-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2rem clamp(2rem, 5.5vw, 6rem); }
.site-footer-brand { grid-column: span 2; }
.site-footer .site-wordmark { display: inline-block; font-weight: 600; }
.site-footer a { text-underline-offset: auto; }
.site-footer-brand p, .site-footer li > :is(a, span) { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; letter-spacing: -.01em; }
.site-footer-brand p { margin-block-start: .75rem; }
.site-footer .label-mono { margin-block-end: .5rem; color: var(--muted); }
.site-footer ul { padding: 0; margin: 0; list-style: none; }
.site-footer-brand ul { margin-block-start: .625rem; }
.site-footer li:not(:last-child) { margin-block-end: .5rem; }
.site-footer li a { text-decoration: none; transition: color 150ms cubic-bezier(.4, 0, .2, 1); }
@media (hover: hover) {
  .site-footer li a:hover { color: var(--foreground); }
}
@media (min-width: 40rem) {
  .site-footer > .site-frame { padding-block: 3rem; }
  .site-footer .label-mono { margin-block-end: .75rem; }
}
@media (min-width: 48rem) {
  .site-footer-grid { grid-template-columns: minmax(12rem, 16rem) repeat(4, minmax(min-content, max-content)); }
  .site-footer-brand { grid-column: span 1; }
}
@media (min-width: 64rem) {
  .site-footer-grid { grid-template-columns: minmax(12rem, 17rem) repeat(4, minmax(0, 1fr)); }
}

/* Shared buttons and navigation text. Keep view geometry in styles.css. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-weight: 550;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { background: var(--surface-secondary); }
@media (max-width: 700px) { .button { min-height: 36px; } }
.button:is(.primary, .button--blue-dark) {
  background: var(--action-strong);
  color: var(--action-strong-foreground);
  border-color: var(--action-strong-border);
}
.button:is(.primary, .button--blue-dark):hover { background: var(--action-strong-hover); }
.button.button--blue-light { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-tint); }
.button.button--blue-light:hover { background: color-mix(in srgb, var(--accent-tint) 90%, var(--accent)); }
/* Physlib's secondary ButtonLink colors, as used on Get Involved. */
.button.button--secondary { border-color: transparent; background: var(--control-default); color: var(--accent); }
.button.button--secondary:hover { background: color-mix(in oklab, var(--control-default) 96%, var(--control-default-foreground)); }
.text-button { padding: 0; border: 0; background: none; color: var(--accent); font-size: var(--text-sm); font-weight: 535; text-underline-offset: 2px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.site-nav-type { font-size: var(--text-xs); font-weight: 400; line-height: 1rem; letter-spacing: -.01em; }
@media (min-width: 64rem) { .site-nav-type { font-size: var(--text-base); line-height: 1.25rem; } }

/* PaperView Feed's directional icon is defined once in index.html. */
.site-icons { position: absolute; }
.site-chevron {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-chevron[data-direction="left"] { transform: rotate(180deg); }
.site-chevron[data-direction="up"] { transform: rotate(-90deg); }
.site-chevron[data-direction="down"] { transform: rotate(90deg); }
.site-disclosure, .site-back { display: inline-flex; align-items: center; gap: 6px; }
.site-disclosure { cursor: pointer; list-style: none; }
.site-disclosure::-webkit-details-marker { display: none; }
details[open] > .site-disclosure > .site-chevron { transform: rotate(90deg); }
.article-sort[open] > .site-disclosure > .site-chevron, .agent-choice-trigger[aria-expanded="true"] > .site-chevron { transform: rotate(-90deg); }
.site-arrow {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
}
.site-arrow:not(:disabled):hover { color: var(--accent); }

.site-page-tabs { display: flex; align-items: stretch; gap: clamp(9px, 2vw, 20px); }
.site-page-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 2px;
  color: var(--muted);
  text-decoration: none;
}
.site-page-tabs a:is(:hover, [aria-current]) { color: var(--accent); }
.site-page-tabs a, .site-filter-tabs label { border-block: 2px solid transparent; }
.site-page-tabs a[aria-current], .site-filter-tabs input:checked + label { border-bottom-color: var(--accent); }

/* Physics & Prompts filter group selector, using the Arena theme. */

.site-filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.site-filter-tabs .filter-group-radio { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.site-filter-tabs label { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; white-space: nowrap; cursor: pointer; }
.site-filter-tabs label:hover, .site-filter-tabs input:checked + label { color: var(--accent); }
.site-filter-tabs input:checked + label { text-shadow: 0 0 .6px currentColor; }
.site-filter-tabs input:focus-visible + label { text-decoration: underline; text-underline-offset: 3px; }

.article-sort { position: relative; color: var(--muted); font-size: var(--text-xs); }
.article-sort > summary { white-space: nowrap; }
.article-sort-menu {
  position: absolute;
  z-index: 5;
  inset: 100% 0 auto auto;
  display: flex;
  flex-direction: column;
  min-width: 130px;
  padding: 4px 0;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.article-sort-menu button {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  line-height: 1.4;
  text-align: start;
  white-space: nowrap;
}
.article-sort-menu button:hover { background: var(--surface-secondary); color: var(--accent); }
.article-sort-menu button[aria-current="true"] { color: var(--accent); text-shadow: 0 0 .6px currentColor; }
.article-sort-menu button:focus-visible { outline-offset: -2px; }

.site-filter-bar { display: grid; gap: 6px; }
.site-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--filter-border);
  border-radius: 0;
  background: var(--surface);
  color: var(--filter-text);
  font-size: var(--text-2xs);
  text-transform: lowercase;
  white-space: nowrap;
}
button.filter-chip:hover, label:hover > .filter-chip { background: var(--filter-hover); color: var(--accent); }
button.filter-chip[aria-pressed="true"], label > input:checked + .filter-chip { border-color: var(--accent); background: var(--accent); color: var(--accent-foreground); }
label > input:focus-visible + .filter-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-chip {
  color: var(--action-strong-foreground);
  background: var(--action-strong);
  border-color: var(--action-strong-border);
}
button.filter-clear-chip, button.filter-clear-chip:hover {
  padding-inline: 2px;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .02em;
}

  .site-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.125rem 0.5rem;
    font-size: var(--text-xs);
    line-height: 1rem;
    color: var(--foreground);
    background: var(--surface-secondary);
    transition: border-color 120ms, color 120ms;
  }
  .site-tag-accent {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 25%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .site-tag-warning {
    border-color: color-mix(in oklch, var(--warning) 35%, transparent);
    background: color-mix(in oklch, var(--warning) 12%, transparent);
  }
  .site-tag-success {
    border-color: color-mix(in oklch, var(--success) 35%, transparent);
    background: color-mix(in oklch, var(--success) 12%, transparent);
  }
  .site-tag-danger {
    border-color: color-mix(in oklch, var(--danger) 35%, transparent);
    background: color-mix(in oklch, var(--danger) 10%, transparent);
  }
  .site-tag-muted { border-style: dashed; background: transparent; color: var(--muted); }
  button.site-tag { cursor: pointer; }
  button.site-tag:hover { border-color: var(--accent); }

/* Physlib editorial layout and Sponsor styles, expanded for the static site.
 * Source: web2/src/app/{page-layout.css,globals.css,sponsor/page.tsx} and
 * web2/src/components/table-of-contents.tsx. See vendor-navbar/UPSTREAM.md.
 */
.page-editorial-layout { display: flex; width: 100%; max-width: var(--site-max-width); margin-inline: auto; }
.page-editorial-content { flex: 1; min-width: 0; }
.page-frame-editorial {
  width: 100%;
  max-width: 56rem;
  margin-inline: max(0px, calc((100% - 64rem) / 2)) auto;
  padding: 3rem 1.25rem;
}
:is(.sponsor-page, .page-frame-editorial--narrow).page-frame-editorial { max-width: 48rem; }
.page-frame-editorial--narrow .page-section-heading h2 { font-size: 1.5rem; line-height: 2rem; }
.label-mono {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .055em;
  font-size: .69rem;
  font-weight: 500;
}
.page-editorial-label { margin-bottom: 1.25rem; color: var(--muted); }
.page-title-editorial {
  margin-bottom: 1rem;
  color: var(--foreground);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.06;
}
.page-intro-editorial {
  margin-bottom: 2.5rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.page-section-editorial { margin-bottom: 3rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.page-section-editorial:last-child { margin-bottom: 0; }
.page-section-heading { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.page-section-heading h2 { font-size: 1.5rem; line-height: 2rem; font-weight: 500; letter-spacing: -.04em; }
.page-section-heading > span {
  flex-shrink: 0;
  color: var(--accent);
  font: 500 1rem/1.5rem var(--system-mono);
}
.page-frame-editorial .prose-physlib { color: var(--foreground); line-height: 1.625; }
.page-frame-editorial .prose-physlib p { margin-block: .75rem; }
.page-frame-editorial .prose-physlib ol { display: grid; gap: .25rem; margin-block: .75rem; padding-inline-start: 1.5rem; }
.page-frame-editorial .prose-physlib a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
.page-frame-editorial .prose-physlib a:hover { text-decoration: underline; }
.sponsor-pitch .prose-physlib h3 {
  margin-block: 2.5rem .75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--accent);
  font: 500 .75rem/1.625 var(--mono);
  text-transform: uppercase;
  letter-spacing: .055em;
}
.page-frame-editorial figure { margin: 1rem 0; }
.page-frame-editorial figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 31rem; border-radius: var(--radius); }
.page-frame-editorial figcaption { margin-top: .375rem; color: var(--muted); font-size: var(--text-base); }
.page-editorial-table { max-width: 100%; overflow-x: auto; }
.prose-physlib table { width: 100%; border-collapse: collapse; margin-block: 1rem; }
.prose-physlib :is(th, td) { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; vertical-align: top; }
.prose-physlib th { font-weight: 500; }
.prose-physlib thead th { background: var(--surface-secondary); }
.sponsor-pitch .prose-physlib :is(th, td):last-child { white-space: nowrap; text-align: right; }

.page-editorial-sidebar { display: none; flex: 0 0 13rem; padding-top: .5rem; }
.page-editorial-sidebar nav { position: sticky; top: 4rem; max-height: calc(100vh - 4rem); overflow-y: auto; padding: 2rem .75rem 2rem 1.5rem; }
.page-editorial-sidebar ul { list-style: none; margin: 0; padding: 0; }
.site-nav-heading {
  margin-bottom: .5rem;
  padding-inline: .5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: color-mix(in srgb, var(--foreground) 30%, transparent);
}
.site-nav-link {
  color: color-mix(in srgb, var(--foreground) 68%, var(--background));
  letter-spacing: -.01em;
  text-decoration: none;
  transition: color 120ms, background-color 120ms;
}
.site-nav-link:hover { color: var(--foreground); background: var(--surface-secondary); }
.site-nav-link[aria-current] { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 500; }
.page-editorial-sidebar .site-nav-link:focus-visible { outline-offset: -2px; }
.site-sidebar-link { display: flex; padding: .375rem .5rem; border-radius: var(--radius); font-size: var(--text-base); line-height: 1.25rem; }

@media (min-width: 40rem) { .page-frame-editorial { padding-inline: 2rem; } }
@media (min-width: 48rem) {
  .page-frame-editorial { padding-block: 4rem; }
  .page-title-editorial { font-size: 3rem; }
  .page-section-heading h2 { font-size: 1.875rem; line-height: 2.25rem; }
  .page-section-heading > span { font-size: 1.125rem; line-height: 1.75rem; }
  .sponsor-page .prose-physlib :is(p, li),
  .page-frame-editorial--narrow .prose-physlib p { text-align: justify; }
}
@media (max-width: 48rem) { .sponsor-pitch .prose-physlib :is(th, td) { padding-inline: .5rem; font-size: var(--text-base); } }
@media (min-width: 64rem) { .page-editorial-sidebar { display: block; } }
