/* Change-of-major applications.
   Palette, type, header anatomy and dark theme follow the AAD Web Family Header & Color Standard
   (v2, July 20, 2026) as implemented on roster, Inside AAD, Fixed Assets and IT.
   Layout rhythm, the layered hero and the state checklist adapt Scrollcraft's taste floor (MIT, Nate Herk).
   No JavaScript and no outside requests (CSP: default-src 'self'). */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand purity: only official Chicago Maroon and Burnt Orange. Orange is decorative on light paper. */
  --maroon: #861f41;
  --maroon-hover: #5f1730;   /* family-approved hover shade for maroon fills only; never text or idle fill */
  --orange: #e5751f;
  --gold: #f2c14e;           /* stripe only */
  --teal: #1b7f82;           /* decorative teal: stripe and borders, never text */
  --teal-fn: #10595c;        /* functional teal: link hover, focus rings */
  --orange-ink: #140f0d;     /* dark ink on orange fills */
  --white: #ffffff;

  /* Surfaces and text (flip in dark) */
  --paper: #ffffff; --paper-2: #f7f8fa; --band: #eef1f5;
  --ink: #20252b; --ink-2: #39414a; --muted: #5d6670;
  --line: #d5dbe1; --field-line: #5d6670;
  --link: var(--maroon); --link-hover: var(--teal-fn); --focus: var(--teal-fn);
  --brand-text: var(--maroon);
  --btn-bg: var(--maroon); --btn-bg-hover: var(--maroon-hover); --btn-fg: var(--white);
  --btn2-fg: var(--maroon);
  --ok: #0d6b3f; --ok-bg: #edf6f0; --bad: #861f41; --bad-bg: #fbf1f4;
  --lockup-filter: none; --lockup-opacity: 1;
  color-scheme: light;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --lane: min(80rem, calc(100vw - 3rem));
  --measure: 66ch;
  --radius-control: 4px; --radius-panel: 6px;
  --control: 2.75rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Warm dark theme (family trait), following the system setting. Maroon stays only as fills with white text. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #140f0d; --paper-2: #1e1815; --band: #2a211d;
    --ink: #f4ecdf; --ink-2: #d4c7b5; --muted: #9a8a7e;
    --line: #3a2f2a; --field-line: #9a8a7e;
    --link: var(--orange); --link-hover: var(--gold); --focus: var(--orange);
    --brand-text: var(--ink);
    --btn-bg: var(--orange); --btn-bg-hover: var(--orange); --btn-fg: var(--orange-ink);
    --btn2-fg: var(--orange);
    --ok: #7fd6aa; --ok-bg: #16231c; --bad: #e5751f; --bad-bg: #2a1a14;
    --lockup-filter: brightness(0) invert(1); --lockup-opacity: .92;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Keep the sticky header from covering the skip-link target and focused fields (heights measured: 78px desktop,
   118px two-row, up to 171px on a phone when the staff menu wraps). */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (max-width: 74.99rem) { html { scroll-padding-top: 9rem; } }
@media (max-width: 30rem) { html { scroll-padding-top: 12rem; } }
body { margin: 0; font: 1.0625rem/1.55 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
main:focus { outline: none; }
::selection { background: var(--maroon); color: var(--white); }
input, textarea { caret-color: var(--link); }
img { max-width: 100%; }
.wrap { width: var(--lane); margin: 0 auto; }
main > .wrap:last-child { padding-top: var(--s6); padding-bottom: var(--s8); }

/* Type: more space above a heading than below it. */
h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem); margin: var(--s2) 0 var(--s4); }
h2 { font-size: clamp(1.25rem, 1.15rem + .4vw, 1.5rem); margin: var(--s7) 0 var(--s3); }
h3 { font-size: 1.1rem; margin: var(--s5) 0 var(--s2); }
p, li { max-width: var(--measure); text-wrap: pretty; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.muted { color: var(--muted); }

/* Focus: always visible, functional teal on light paper, orange on dark, white on maroon. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.skip-link { position: absolute; left: var(--s4); top: -4rem; z-index: 60; background: var(--paper); color: var(--link); padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: var(--radius-control); font-weight: 600; }
.skip-link:focus { top: var(--s3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Family header: paper background, canonical lockup, divider, wordmark, 1px rule, 4px spectrum stripe. */
header.site { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
/* Short viewports and high zoom: the header scrolls away instead of covering the content. */
@media (max-height: 40rem) { header.site { position: relative; } html { scroll-padding-top: 1rem; } }
header.site::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px; background: linear-gradient(90deg, #861f41, #e5751f, #f2c14e, #1b7f82); pointer-events: none; }
header.site .lane { width: var(--lane); margin: 0 auto; min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.lockup-link { display: inline-flex; flex: 0 0 auto; }
.lockup { display: block; height: 2.05rem; width: auto; filter: var(--lockup-filter); opacity: var(--lockup-opacity); }
.divider { width: 1px; height: 2rem; background: var(--line); flex: 0 0 auto; }
.wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.1; color: var(--brand-text); text-decoration: none; }
.wordmark:hover { color: var(--brand-text); text-decoration: underline; text-decoration-thickness: 2px; }
header.site nav { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: flex-end; gap: 0 var(--s1); }
header.site nav a, header.site nav button.link { display: inline-flex; align-items: center; min-height: var(--control); line-height: inherit; padding: 0 .75rem; border-bottom: 3px solid transparent; color: var(--ink-2); font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
header.site nav a:hover, header.site nav button.link:hover { color: var(--link-hover); }
header.site nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--maroon); }
header.site nav form { display: flex; margin: 0; }
@media (max-width: 74.99rem) {
  /* M2 shell: brand row, then a navigation row. */
  header.site .lane { flex-direction: column; align-items: stretch; gap: 0; }
  .brand { min-height: 4rem; }
  header.site nav { justify-content: flex-start; min-height: 3rem; margin: 0 -.75rem; }
}
@media (max-width: 30rem) {
  /* Narrow phones: the wordmark moves under the lockup rather than being cut off. */
  .brand { flex-wrap: wrap; gap: var(--s1) .75rem; padding: var(--s3) 0 var(--s1); }
  .divider { display: none; }
  .wordmark { flex-basis: 100%; }
}

footer.site { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); background: var(--paper-2); }
footer.site .wrap { padding: var(--s5) 0; display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
footer.site p { margin: 0; }
footer.site strong { color: var(--ink-2); }

/* Hero (landing page). Inside AAD panel language: maroon into burnt orange, soft rings at the upper right.
   White text stays over the maroon side; the rings are separate layers for depth. */
.hero-wrap { padding-top: var(--s6); }
.hero { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius-panel); color: var(--white); background: linear-gradient(100deg, var(--maroon) 0%, var(--maroon) 48%, var(--orange) 100%); view-timeline: --hero block; --focus: var(--white); }
.hero__copy { position: relative; z-index: 2; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem); max-width: 42rem; }
.hero h1 { color: var(--white); font-size: clamp(2.2rem, 1.5rem + 3vw, 3.75rem); line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 var(--s5); }
.hero__lede { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); line-height: 1.6; color: var(--white); margin: 0 0 var(--s6); }
.hero__copy p:last-child { margin-bottom: 0; }
.hero__planes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.plane { position: absolute; display: block; border-radius: 50%; }
.plane--ring { width: 34rem; height: 34rem; right: -9rem; top: -14rem; border: 2px solid rgb(255 255 255 / 30%); }
.plane--ring-inner { width: 20rem; height: 20rem; right: -2rem; top: -6rem; border: 1px solid rgb(255 255 255 / 22%); }
.plane--disc { width: 16rem; height: 16rem; right: 14%; bottom: -9rem; background: rgb(255 255 255 / 10%); }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .plane { animation: auto linear both; animation-timeline: --hero; animation-range: exit 0% exit 100%; }
    .plane--ring { animation-name: drift-ring; }
    .plane--ring-inner { animation-name: drift-inner; }
    .plane--disc { animation-name: drift-disc; }
  }
}
@keyframes drift-ring { to { transform: translateY(5rem); } }
@keyframes drift-inner { to { transform: translateY(9rem); } }
@keyframes drift-disc { to { transform: translateY(-4rem); } }

/* Landing: cycles, empty state, steps */
.cycle { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5) var(--s7); padding: var(--s6) 0; border-bottom: 1px solid var(--line); }
.cycle__school { margin: 0; font-weight: 600; color: var(--brand-text); }
.cycle h2 { margin-top: var(--s1); }
.cycle__body h3 { margin-top: var(--s5); }
.dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s4); margin: 0; }
.dates div { border-left: 3px solid var(--maroon); padding-left: var(--s3); }
.dates dt { font-size: .85rem; font-weight: 600; color: var(--muted); }
.dates dd { margin: 0; font-variant-numeric: tabular-nums; }
.programs { list-style: none; padding: 0; margin: 0 0 var(--s5); border-top: 1px solid var(--line); }
.programs li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.empty { padding: var(--s5) var(--s5) var(--s5) var(--s6); margin: var(--s4) 0; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius-panel); }
.empty h2 { margin-top: 0; }
.empty p { margin-bottom: 0; }
.steps { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5) var(--s7); margin-top: var(--s7); }
.steps h2 { margin-top: 0; }
.steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 var(--s5) 3.25rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--maroon); color: var(--white); font-weight: 700; font-variant-numeric: tabular-nums; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(1.125rem - 1px); top: 2.4rem; bottom: .3rem; width: 2px; background: var(--line); }
.steps li strong { display: block; }

/* Panels and messages */
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--s4) var(--s5); margin: var(--s4) 0; }
.panel > :first-child { margin-top: 0; }
.notice, .status, .errors { border: 1px solid var(--line); border-left: 4px solid; padding: var(--s3) var(--s4); margin: var(--s4) 0; border-radius: var(--radius-panel); max-width: 48rem; }
.notice { border-left-color: var(--orange); background: var(--paper-2); }
.status { border-left-color: var(--ok); background: var(--ok-bg); }
.errors { border-left-color: var(--bad); background: var(--bad-bg); }
.errors ul { margin: var(--s1) 0 0; padding-left: 1.25rem; }
.answer { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); padding: var(--s3); border-radius: var(--radius-panel); max-width: 48rem; }

/* Forms: simple and roomy. Labels bold, fields 44px tall, borders at 3:1 or more. */
form h2 { padding-top: var(--s5); border-top: 1px solid var(--line); }
label { display: block; font-weight: 600; margin: var(--s4) 0 var(--s1); max-width: 40rem; }
label.inline { display: inline; font-weight: normal; margin: 0; }
input[type=text], input[type=number], input[type=datetime-local], input[type=search], select, textarea { width: 100%; max-width: 40rem; min-height: var(--control); padding: var(--s2) var(--s3); border: 1px solid var(--field-line); border-radius: var(--radius-control); background: var(--paper); color: var(--ink); font: inherit; }
textarea { min-height: 10rem; line-height: 1.55; resize: vertical; }
input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: 0 var(--s2) 0 0; vertical-align: -.25rem; accent-color: var(--maroon); }
input[type=file] { font: inherit; max-width: 100%; margin: var(--s1) var(--s3) var(--s2) 0; color: var(--ink); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: var(--s3); min-height: var(--control); padding: var(--s2) var(--s4); border: 1px solid var(--btn2-fg); border-radius: var(--radius-control); background: var(--paper); color: var(--btn2-fg); cursor: pointer; }
.row { display: flex; flex-wrap: wrap; gap: 0 var(--s4); align-items: end; max-width: 40rem; }
.row > div { flex: 1 1 12rem; }

/* Buttons: 4px corners. Primary maroon (orange with dark ink in dark mode), secondary outlined, light on the hero. */
button, .button { display: inline-block; min-height: var(--control); background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg); border-radius: var(--radius-control); padding: var(--s2) var(--s5); font: inherit; font-weight: 600; line-height: 1.6; cursor: pointer; text-decoration: none; margin: var(--s1) var(--s2) var(--s1) 0; transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out); }
button.secondary, .button.secondary { background: var(--paper); color: var(--btn2-fg); border-color: var(--btn2-fg); }
.button--light, .button--light:hover { background: var(--white); color: var(--maroon); border-color: var(--white); }
button.link { background: none; border: 0; min-height: 0; color: var(--link); padding: 0; margin: 0; font-weight: inherit; text-decoration: underline; text-underline-offset: .18em; }
button:active, .button:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  button:hover, .button:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); color: var(--btn-fg); }
  button.secondary:hover, .button.secondary:hover { background: var(--band); color: var(--btn2-fg); border-color: var(--btn2-fg); }
  .button--light:hover { background: var(--band); color: var(--maroon); border-color: var(--band); }
  button.link:hover { background: none; color: var(--link-hover); }
}
.actions { display: flex; flex-wrap: wrap; gap: var(--s2) 0; margin-top: var(--s5); }
form.start { margin: var(--s2) 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: var(--s2) 0; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--band); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 36rem; }
.badge { display: inline-block; font-size: .85rem; padding: 0 var(--s2); border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--paper); }
.badge.submitted { border-color: var(--ok); color: var(--ok); }
.badge.draft { border-color: var(--muted); color: var(--muted); }

/* Below the 1200px family breakpoint the hero stacks: copy on maroon at the top, orange and rings in the 8rem below it. */
@media (max-width: 74.99rem) {
  .hero { background: linear-gradient(180deg, var(--maroon) 0, var(--maroon) calc(100% - 8rem), var(--orange) 100%); }
  .hero__copy { padding-bottom: 8rem; }
  .plane--ring { width: 22rem; height: 22rem; right: -10rem; top: auto; bottom: -15rem; }
  .plane--ring-inner { width: 12rem; height: 12rem; right: -3rem; top: auto; bottom: -5.5rem; }
  .plane--disc { width: 9rem; height: 9rem; right: 55%; bottom: -5.5rem; }
}

/* Phones: stack the split layouts. */
@media (max-width: 760px) {
  .cycle, .steps { grid-template-columns: 1fr; gap: var(--s2); }
}

/* Reduced motion: no scroll-linked motion and no transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
