/* East Tech / Titan Foundry — maintained source, not minified output.
   Small labels are 14px or larger. All interface surfaces follow the theme.
   Technical drawings retain their own paper canvas and are never cropped. */

@font-face {
  font-family: "Foundry Display";
  src: url("/fonts/foundry-display.woff?v=50e1adf3e1e1") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: #ffffff;
  --surface-soft: #eaece7;
  --ink: #173442;
  --muted: #4b606a;
  --line: #c1c9c8;
  --field-line: #72838a;
  --accent: #b73e19;
  --accent-soft: #f9e4d8;
  --button: #b73e19;
  --button-ink: #ffffff;
  --focus: #006b91;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Foundry Display", "Arial Narrow", sans-serif;
  --text-small: .875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-card: 1.375rem;
  --text-subhead: 1.75rem;
  --text-section: clamp(1.5rem, 2.6vw, 2rem);
  --text-hero: clamp(2.5rem, 4.5vw, 3.75rem);
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --radius: .5rem;
  --frame: 78rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #102530;
  --surface: #183541;
  --surface-soft: #203f4b;
  --ink: #f5f2e9;
  --muted: #bfd0d5;
  --line: #4f6b77;
  --field-line: #89a2ac;
  --accent: #ffac87;
  --accent-soft: #49392f;
  --button: #ffac87;
  --button-ink: #173442;
  --focus: #83ddfa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--text-body)/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
}
body, button, input, select, textarea { font-family: var(--font-body); }
[hidden] { display: none !important; }
main { min-height: 60vh; }
main:focus { outline: none; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
button, input, textarea, select { font-size: var(--text-body); }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.16; text-wrap: balance; }
h1 { font: 700 var(--text-hero)/1.05 var(--font-display); letter-spacing: -.01em; }
h2 { font-size: var(--text-section); letter-spacing: -.035em; }
h3 { font-size: var(--text-card); letter-spacing: -.02em; }
h4 { font-size: var(--text-lead); }
p + p { margin-top: var(--space-2); }
strong { font-weight: 700; }
ul, ol { padding-left: 1.3rem; margin: 0; }
li + li { margin-top: .6rem; }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
code { overflow-wrap: anywhere; }
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: var(--space-3);
  background: var(--surface-soft);
  border-left: 3px solid var(--accent);
  font-size: var(--text-small);
}
.frame { width: min(var(--frame), calc(100% - 4rem)); margin-inline: auto; }
.section { padding-block: var(--space-6); }
.section + .section { border-top: 1px solid var(--line); }
.surface-section { background: var(--surface); border-block: 1px solid var(--line); }

.eyebrow {
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow + h1, .eyebrow + h2, .eyebrow + h3 { margin-top: var(--space-2); }
.lead { font-size: var(--text-lead); max-width: 43rem; color: var(--muted); }
.small-copy, figcaption { font-size: var(--text-small); color: var(--muted); }
.prose { max-width: 45rem; overflow-wrap: anywhere; }
.prose > * + * { margin-top: var(--space-3); }
.icon { width: 1.3rem; height: 1.3rem; flex: 0 0 auto; vertical-align: middle; }
.skip { position: fixed; top: -6rem; left: var(--space-2); z-index: 100; padding: 1rem; background: var(--ink); color: var(--bg); }
.skip:focus { top: var(--space-2); }

/* Disclosures share one visible, keyboard-accessible control. */
summary { position: relative; display: block; min-height: 52px; padding: 1rem 3.25rem 1rem 1.25rem; list-style: none; cursor: pointer; font-weight: 700; line-height: 1.5; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; top: 1.3rem; right: 1.25rem; width: .55rem; height: .55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
details[open] > summary::after { transform: rotate(225deg); }
summary:hover { background: var(--surface-soft); }

/* Header and navigation */
.mast { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.mast-inner { display: flex; align-items: center; gap: var(--space-3); min-height: 5rem; }
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 2.8rem; height: 2.8rem; background: var(--button); color: var(--button-ink); border-radius: .35rem; display: grid; place-items: center; }
.brand-mark svg { width: 2.4rem; height: 2.4rem; }
.brand-name { font-size: var(--text-lead); font-weight: 800; line-height: 1.2; }
.brand-name > span { display: block; margin-top: .3rem; font-size: var(--text-small); font-weight: 500; color: var(--muted); }
.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav a { display: inline-flex; align-items: center; color: var(--ink); padding: .7rem .6rem; min-height: 44px; font-size: var(--text-body); font-weight: 650; line-height: 1.4; text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.header-tools { display: flex; gap: .5rem; flex: 0 0 auto; }
.theme-toggle, .nav-toggle { min-height: 44px; padding: .55rem .75rem; background: transparent; color: var(--ink); border: 1px solid var(--field-line); border-radius: .25rem; font-size: var(--text-small); font-weight: 650; }
.theme-toggle { border-color: transparent; color: var(--muted); }
.theme-toggle:hover { background: var(--surface-soft); color: var(--ink); }
.nav-toggle { display: none; }

/* Common actions */
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: var(--space-3); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: var(--space-2); min-height: 48px; padding: .75rem 1.1rem; border: 1px solid transparent; border-radius: .3rem; font-size: var(--text-body); font-weight: 700; text-decoration: none; line-height: 1.4; }
.button-primary { background: var(--button); color: var(--button-ink); }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--field-line); }
.button:hover { box-shadow: inset 0 0 0 1px currentColor; text-decoration: none; }
.text-link { display: inline-flex; gap: .65rem; align-items: center; font-weight: 700; min-height: 44px; }

.plain-list { display: grid; gap: .7rem; }
.plain-list li + li { margin: 0; }
.numbered-list { display: grid; gap: var(--space-2); padding-left: 1.4rem; }
.numbered-list li { padding-left: .4rem; }
.numbered-list li + li { margin: 0; }
.numbered-list li::marker { font-weight: 750; color: var(--accent); }

/* Home and responsive technical diagrams */
.home-hero { max-width: 60rem; padding-block: 3rem 2rem; }
.home-hero h1 span { display: block; color: var(--accent); }
.home-hero .lead { margin-top: var(--space-3); }
.home-hero > div { max-width: 45rem; }
.home-page .quick-paths { max-width: 60rem; margin-bottom: 1.5rem; }
.home-page .orientation-note { max-width: 60rem; }

.diagram { margin: 0; min-width: 0; }
.diagram picture { display: block; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius); background: #f6f3ed; }
.diagram img { width: 100%; height: auto; object-fit: contain; }
.diagram figcaption { margin-top: .75rem; padding-inline: .15rem; line-height: 1.5; }

.quick-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.quick-path { display: block; min-width: 0; padding: 1.25rem; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.quick-path .path-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.quick-path h2 { font-size: var(--text-card); color: var(--accent); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: .06em; }
.quick-path p { margin-top: .75rem; color: var(--muted); line-height: 1.5; }
.quick-path:hover, .quick-path:focus-visible { background: var(--surface-soft); border-color: var(--accent); }

/* Directories and course guides */
.page-intro { padding-block: 2.5rem 2rem; max-width: 60rem; }
.page-intro .lead { margin-top: 1rem; }
.page-intro .eyebrow { margin-bottom: var(--space-2); }
.classes-page main .frame, .projects-page main .frame, .program-page main .frame { max-width: 60rem; }
.course-page main .frame { max-width: 52rem; }
.class-help, .orientation-note { color: var(--muted); line-height: 1.5; }
.class-help { max-width: 48rem; margin-block: 1.25rem; }
.orientation-note { margin-block: 1.5rem 2rem; }
.class-help a, .orientation-note a { font-weight: 650; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; font-size: var(--text-small); color: var(--muted); margin-bottom: var(--space-3); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }

.course-group + .course-group { margin-top: 2rem; }
.course-group > h2 { font-size: var(--text-subhead); margin-bottom: var(--space-3); }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.course-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 1rem; min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.course-card:hover, .course-card:focus-visible, .project-card:hover, .project-card:focus-visible { border-color: var(--accent); background: var(--surface-soft); }
.course-symbol { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: .35rem; }
.course-symbol .icon { width: 1.6rem; height: 1.6rem; }
.course-card-copy { min-width: 0; }
.student-label { color: var(--muted); font-size: var(--text-small); font-weight: 650; }
.course-card h3 { margin-block: .35rem .6rem; }
.course-card h3, .project-card h2, .project-card h3 { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: .06em; }
.course-card-copy > p:not(.student-label) { color: var(--muted); line-height: 1.5; }

.card-arrow { display: inline-flex; align-items: center; color: var(--accent); padding-top: .3rem; }

.lab-list { display: grid; gap: var(--space-3); counter-reset: lab; }
.lab-item { display: grid; grid-template-columns: 2rem 1fr; gap: var(--space-2); }
.lab-item::before { counter-increment: lab; content: counter(lab, decimal-leading-zero); color: var(--accent); font-weight: 750; }
.lab-item p { margin-top: .6rem; color: var(--muted); }
.course-projects { margin-block: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.course-projects h2, .course-projects h3 { font-size: 1.375rem; margin-bottom: .75rem; }
.course-projects p { max-width: 45rem; margin-bottom: .75rem; color: var(--muted); }
.course-projects ul { display: grid; gap: .25rem; list-style: none; padding: 0; }
.course-projects li + li { margin-top: 0; }
.course-projects a { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; padding-block: .4rem; font-weight: 650; }

.lesson-panel { margin-top: var(--space-4); padding: var(--space-4); background: var(--surface-soft); border-radius: var(--radius); }
.lesson-panel h3 { margin-bottom: var(--space-2); }
.lesson-panel > p { color: var(--muted); margin-bottom: var(--space-3); }
.lesson-panel .small-copy { margin-top: var(--space-3); margin-bottom: 0; }
.lesson-items { display: grid; gap: var(--space-3); }
.lesson-items p { margin-top: .5rem; }

/* Program pathway */

.year-list { display: grid; gap: var(--space-3); }
.year-section { display: grid; grid-template-columns: 9rem 1fr; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.year-label { border-right: 1px solid var(--line); color: var(--accent); }
.year-label strong { display: block; font: 700 3rem/1 var(--font-display); margin-top: .4rem; }
.year-copy h3 { margin-bottom: var(--space-2); }
.year-copy p { max-width: 48rem; color: var(--muted); }
.year-copy a { margin-top: .75rem; }

/* Choose a project, then work on one activity at a time. */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.project-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; align-items: start; gap: .75rem; min-width: 0; padding: 1.5rem 3rem 1.5rem 1.5rem; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project-card h2, .project-card h3 { font-size: var(--text-card); line-height: 1.3; }
.project-card p { grid-column: 1 / -1; margin: 0; line-height: 1.5; }
.project-card .project-needs, .project-card .small-copy { padding-top: .25rem; color: var(--muted); font-size: var(--text-small); }
.project-card .card-arrow { position: absolute; top: 1.4rem; right: 1.25rem; }
.activity-page .page-intro { max-width: 48rem; padding-bottom: 1.75rem; }
.activity-page h1 { font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.1; }
.activity-layout { width: min(48rem, calc(100% - 4rem)); margin-inline: auto; padding-bottom: 3rem; }
.activity-start { padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.activity-start > h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.activity-start > p { max-width: 45rem; color: var(--muted); }
.activity-start .actions { margin-block: 1rem; }
.activity-section + .activity-section { margin-top: 2.5rem; }
.activity-section > h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.activity-section > h3 { margin-bottom: .75rem; }
.activity-section > p + ol, .activity-section > p + ul { margin-top: 1rem; }
.setup-steps { display: grid; gap: 1.25rem; padding-left: 1.5rem; }
.setup-steps > li { padding-left: .35rem; }
.setup-steps > li + li { margin-top: 0; }
.setup-steps > li::marker { color: var(--accent); font-weight: 750; }
.setup-steps p + p { margin-top: .5rem; }
.activity-checks li + li { margin-top: 1rem; }
.activity-checks h3 { font-size: 1.125rem; margin-bottom: .4rem; }
.activity-checks p { color: var(--muted); }
table.activity-checks, .activity-checks table { font-size: var(--text-body); }
.activity-layout > .reference-disclosure { margin-top: 2.5rem; }
.activity-layout .reference-content .plain-list a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }

/* Evidence and worked examples */
.catalog-note { padding: var(--space-3); background: var(--surface-soft); border-radius: var(--radius); margin-bottom: var(--space-4); }

.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: .3rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); text-align: left; font-size: var(--text-small); }
th, td { vertical-align: top; padding: .9rem; border-bottom: 1px solid var(--line); min-width: 8rem; }
thead { background: var(--surface-soft); }
tbody tr:last-child > * { border-bottom: 0; }
.worked-example { display: grid; gap: var(--space-4); }

.example-overview { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.example-overview h3 { margin-bottom: var(--space-2); }
.example-result { padding: var(--space-3); border-left: 3px solid var(--accent); background: var(--surface-soft); }
.example-result p + p { margin-top: .5rem; }
.example-page main .frame { max-width: 60rem; }
.example-page .worked-example { gap: 2rem; }
.example-page table { font-size: var(--text-body); }

/* Portfolio workbench */
input:not([type="checkbox"]), select, textarea { border: 1px solid var(--field-line); border-radius: .25rem; color: var(--ink); background: var(--surface); padding: .8rem; max-width: 100%; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; min-height: 7rem; }

.portfolios-page main .frame { max-width: 48rem; }

.draft-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: var(--space-3); margin-bottom: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.draft-toolbar p { flex-basis: 100%; font-size: var(--text-small); color: var(--muted); }
.draft-returning { display: grid; gap: .5rem; margin-bottom: 2rem; padding: 0 0 1.5rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.draft-returning p { margin: 0; }
.draft-returning button { justify-self: start; }
.draft-toolbar button, .builder-actions button { min-height: 44px; padding: .65rem .9rem; border: 1px solid var(--field-line); color: var(--ink); background: var(--surface); border-radius: .25rem; font-weight: 650; }
.import-label { display: grid; gap: .35rem; font-size: var(--text-small); font-weight: 700; max-width: 22rem; }
.import-label input { font-size: var(--text-small); width: 100%; min-height: 44px; padding: .4rem; }
input[type="file"]::file-selector-button { min-height: 36px; margin-right: .6rem; border: 1px solid var(--field-line); background: var(--surface-soft); color: var(--ink); border-radius: .2rem; font: inherit; cursor: pointer; }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; max-width: 48rem; }
.draft-fields { display: grid; gap: var(--space-3); }
.draft-field { display: grid; gap: .55rem; min-width: 0; }
.draft-field > label { font-weight: 750; line-height: 1.35; }
.field-hint { color: var(--muted); font-size: var(--text-small); }
.draft-field input, .draft-field select, .draft-field textarea { width: 100%; }

.draft-preview { overflow: auto; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 20rem; overflow-wrap: anywhere; }
.draft-preview-content h3 { font-size: var(--text-subhead); margin-bottom: var(--space-3); }
.draft-preview-section + .draft-preview-section { margin-top: var(--space-3); }
.draft-preview-section h4 { margin-bottom: .6rem; }
.draft-preview-placeholder { color: var(--muted); }
.draft-example-label { font-size: var(--text-small); color: var(--accent); font-weight: 750; margin-bottom: var(--space-2); }
.builder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.builder-actions [data-save-draft] { min-height: 48px; padding: .75rem 1.1rem; color: var(--button-ink); background: var(--button); border-color: var(--button); }
.builder-actions > p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: var(--text-small); }
.save-help { max-width: 42rem; margin-top: .75rem; }
.draft-status { margin-top: 1rem; color: var(--muted); font-size: var(--text-small); }
.draft-status:empty { display: none; }
.writeup-finish { margin-block: 2rem 1.5rem; }
.writeup-finish h2 { font-size: 1.375rem; margin-bottom: .5rem; }
.writeup-finish p { color: var(--muted); }
.writeup-finish .small-copy { margin-top: .75rem; }
.secondary-actions button { background: transparent; color: var(--accent); border-color: var(--field-line); }
.draft-options [data-clear-draft] { background: transparent; border-color: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }

.draft-copy-fallback { margin-top: var(--space-4); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); }
.draft-copy-fallback label { display: block; margin-bottom: .75rem; font-weight: 700; }
.draft-copy-fallback textarea { width: 100%; min-height: 16rem; font-size: var(--text-body); font-family: ui-monospace, Consolas, monospace; }
.portfolio-example { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; max-width: 48rem; }
.entry-section + .entry-section { margin-top: var(--space-3); }
.entry-section h3 { margin-bottom: .6rem; font-size: var(--text-lead); }

/* TSA: two distinct actions, three areas of shared work */

.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.join-card { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.join-card h2 { font-size: var(--text-subhead); margin-block: .75rem var(--space-2); }
.join-card p { color: var(--muted); }
.join-card .button { margin-top: var(--space-3); }

.interest-links { display: grid; gap: .6rem; margin-top: var(--space-3); }
.interest-links a { min-height: 44px; display: inline-flex; align-items: center; }
.not-found { max-width: 50rem; padding-block: 6rem; }
.not-found .error-code { font: 700 5rem/1 var(--font-display); color: var(--accent); margin-bottom: var(--space-3); }
.not-found p { margin-top: var(--space-3); max-width: 38rem; color: var(--muted); }

/* Compact, useful footer */
.site-footer { border-top: 1px solid var(--line); padding-top: 0; }

/* Compact default pages: one task, optional reference material. */
.compact-section { padding-block: 2rem; }

.catalog-footnote { margin-top: 1.5rem; color: var(--muted); font-size: var(--text-small); }

.compact-course-intro { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem; }
.compact-course-intro h1 { font-size: clamp(2.25rem, 4vw, 3rem); }
.compact-course-intro .breadcrumb { margin-bottom: 1rem; }
.course-title-symbol { display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: .75rem; background: var(--accent-soft); color: var(--accent); }
.course-title-symbol .icon { width: 3rem; height: 3rem; }
.compact-course-labs { max-width: 60rem; padding-block: 1rem 2.5rem; }
.compact-course-labs > h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.compact-course-labs .lab-list { max-width: 48rem; }
.course-evidence { margin-block: 2rem; max-width: 48rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.course-evidence h3 { font-size: 1.125rem; margin-bottom: .5rem; }
.course-evidence p { color: var(--muted); }
.course-evidence .text-link { margin-top: .5rem; }
.reference-disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.reference-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.reference-content { padding: 1.5rem; }
.reference-content, .worked-example > *, .example-overview > * { min-width: 0; }
.reference-content > * + * { margin-top: 1.5rem; }
.reference-content section > h3 { margin-bottom: .75rem; }
.reference-content section > p + ul { margin-top: 1rem; }
.reference-content .diagram { max-width: 45rem; margin-inline: auto; }

.reference-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.reference-links a { display: inline-flex; align-items: center; min-height: 44px; }
.compact-years { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.5rem; }
.compact-years .year-section { grid-template-columns: 7rem 1fr; gap: 1.25rem; padding: 1.5rem; }
.program-page #program-details { margin-top: 1.5rem; }

.example-section { padding-top: 0; }

.draft-options { margin-block: 1rem 1.5rem; }
.draft-options .draft-toolbar { margin: 0; border: 0; border-radius: 0; background: transparent; }
.preview-disclosure { margin-bottom: 1rem; }
.preview-disclosure .draft-preview { border: 0; border-radius: 0; min-height: 12rem; max-height: 30rem; }
#entry-details { margin-top: 1.5rem; }
.draft-leave-dialog { width: min(28rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--radius); box-shadow: 0 1rem 4rem rgb(0 0 0 / .25); }
.draft-leave-dialog::backdrop { background: rgb(0 0 0 / .55); }
.draft-leave-dialog h2 { font-size: 1.5rem; }
.draft-leave-dialog p { margin-top: .75rem; color: var(--muted); }
.draft-leave-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.draft-leave-actions button { min-height: 44px; padding: .6rem .9rem; border: 1px solid var(--field-line); border-radius: .25rem; background: var(--surface); color: var(--ink); }
.draft-leave-actions button:first-child { background: var(--button); border-color: var(--button); color: var(--button-ink); }
.compact-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.5rem; font-size: var(--text-small); }
.compact-footer p { color: var(--muted); margin-top: .25rem; }
.compact-contact { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; }
.compact-contact a { min-height: 44px; display: inline-flex; align-items: center; }
.tsa-actions .join-card { padding: 1.5rem; }
.tsa-actions .join-card h2 { font-size: 1.5rem; }
.tsa-action-note { margin-top: 1rem; }
.tsa-cost-note { padding-block: 1.25rem; color: var(--muted); font-size: var(--text-small); }
.tsa-more { padding-bottom: 2.5rem; }
.tsa-details-body { padding: 1.5rem; }
.tsa-interest-list { display: grid; gap: 2rem; margin-top: 2rem; }
.tsa-interest { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.tsa-interest h3 { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.tsa-interest-copy { max-width: 45rem; }

.tsa-event-details { margin-top: 2rem; }
.tsa-official-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* Reflow keeps the same reading and keyboard order. */
@media (max-width: 1100px) {
  .mast-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); padding-block: .75rem; }
  .nav { grid-row: 2; grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; }
  .nav a { padding: .7rem 1rem; }
  :root[data-menu-ready="true"] .nav { display: none; }
  :root[data-menu-ready="true"] .nav-toggle { display: inline-flex; align-items: center; gap: .25rem; }
  :root[data-menu-open="true"] .nav { display: flex; }
}

@media (max-width: 800px) {
  :root { --space-6: 3rem; --text-hero: clamp(2.5rem, 7vw, 3.5rem); }
  .frame { width: calc(100% - 2rem); }
  .activity-layout { width: min(48rem, calc(100% - 2rem)); }
  .portfolio-example, .example-overview {
    grid-template-columns: 1fr;
  }
  .quick-paths, .course-grid, .project-grid { grid-template-columns: 1fr; }
  .quick-path { padding: 1.25rem; }

  .year-section { grid-template-columns: 6rem 1fr; gap: var(--space-3); padding: var(--space-3); }
  .draft-preview { max-height: 38rem; }
  .join-grid { grid-template-columns: 1fr; }

  .compact-years { grid-template-columns: 1fr; }
  .compact-footer { display: grid; }
}

@media (max-width: 600px) {

  .reference-content { padding: 1rem; }
  .tsa-details-body { padding: 1rem; }

  .reference-content .diagram { max-width: 26rem; }
  .compact-course-intro { grid-template-columns: 1fr; }
  .course-title-symbol { display: none; }
  .compact-years .year-section { grid-template-columns: 1fr; gap: .75rem; padding: 1rem; }
  .compact-years .year-label { display: flex; align-items: center; gap: .75rem; border-right: 0; }
  .compact-years .year-label strong { order: -1; font-size: 1.75rem; margin: 0; }
  .compact-contact { gap: .25rem 1rem; }
}

@media (max-width: 520px) {
  :root { --space-5: 2rem; --space-6: 2.5rem; --text-hero: 2.5rem; }
  html { scroll-padding-top: 7rem; }
  .mast-inner { column-gap: .5rem; }
  .brand { gap: .5rem; }
  .brand-mark { width: 2rem; height: 2rem; flex: 0 0 auto; }
  .brand-mark svg { width: 1.75rem; height: 1.75rem; }
  .brand-name { font-size: var(--text-body); }
  .brand-name > span { display: none; }
  .header-tools { gap: .25rem; }
  .theme-toggle, .nav-toggle { padding-inline: .5rem; }
  .theme-toggle { max-width: 4rem; font-size: var(--text-small); line-height: 1.2; }
  :root[data-menu-open="true"] .nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nav a { padding: .7rem .4rem; }

  .home-hero { padding-block: 2rem 1.5rem; }
  .page-intro { padding-block: 1.75rem 1.5rem; }
  .course-card { gap: .75rem; padding: 1rem; }
  .course-symbol { width: 2rem; height: 2rem; }
  .course-symbol .icon { width: 1.4rem; height: 1.4rem; }
  .project-card { padding: 1.25rem 3rem 1.25rem 1.25rem; }
  .project-card .card-arrow { top: 1.2rem; right: 1rem; }

  .lesson-panel, .join-card, .draft-preview { padding: var(--space-3); }
  .year-section { grid-template-columns: 1fr; }
  .year-label { border-right: 0; display: flex; align-items: center; gap: .75rem; }
  .year-label strong { font-size: var(--text-subhead); margin: 0; }

  .button { width: 100%; justify-content: space-between; }
  .actions { width: 100%; }
  .actions > * { width: 100%; }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  :root { color-scheme: light; --bg: white; --surface: white; --surface-soft: #f1f1f1; --ink: #111; --muted: #333; --line: #aaa; --accent: #73331b; }
  .mast, .site-footer, .header-tools, .draft-toolbar, .builder-actions, .skip { display: none !important; }
  .frame { width: 100%; }
  .section { padding-block: 1.5rem; }

  .draft-preview { max-height: none; overflow: visible; }
  a { color: inherit; }
}
