@font-face {
  font-family: "Libre Franklin";
  src: url("assets/libre-franklin.woff2") format("woff2");
  font-weight: 700 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("assets/source-serif.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --soot: #0f0f0f;
  --charcoal: #1a1a1a;
  --white: #fff;
  --paper: #f3f4ed;
  --soft-ink: #515449;
  --soft-white: #c3c6ba;
  --lime: #dafa9c;
  --lime-hover: #c8ed80;
  --display: "Libre Franklin", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --text: "Source Serif 4", "PingFang TC", "Microsoft JhengHei", serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --radius: 0.375rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--soot); background: var(--white); font: 1rem/1.6 var(--text); }
h1, h2, p, ul, ol { margin: 0; }
h1, h2, nav, footer, button, label, .action, .assignments { font-family: var(--display); }
h2 { font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: 1.12; letter-spacing: -0.055em; }
a { color: inherit; text-underline-offset: 0.27em; }
a:hover { text-decoration-thickness: 0.13em; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }
.wrap { width: min(100% - 2 * var(--gutter), 82rem); margin-inline: auto; }

.hero { background: var(--soot); color: var(--white); }
.header-row, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.header-row { min-height: 5rem; font-size: 0.91rem; font-weight: 700; }
.header-row a, .footer-row a { text-decoration: none; }
.header-row a:hover, .footer-row a:hover { text-decoration: underline; }
.hero-content { padding-block: clamp(3.2rem, 7vw, 6.4rem) 3.5rem; }
h1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(0.7rem, 2.5vw, 2.1rem);
  font-weight: 800;
  font-size: clamp(4.25rem, 11vw, 10.2rem);
  line-height: 1;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.title-start, .title-end { flex: none; }
.latin { margin-inline-start: 0.045em; }
.court-photo {
  display: inline-block;
  flex: 1 1 2em;
  min-width: 0;
  height: 0.8em;
  background: var(--charcoal);
  overflow: hidden;
  animation: shutter 920ms cubic-bezier(.2,.65,.25,1) both;
}
.court-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; animation: settle 1.3s ease-out both; }
.hero-meta { display: flex; justify-content: space-between; align-items: end; gap: 1.4rem; margin-top: clamp(2rem, 5vw, 4rem); }
.season { font: 700 clamp(1.35rem, 2.4vw, 2.1rem)/1.15 var(--display); font-variant-numeric: tabular-nums; }
.hours { color: var(--soft-white); margin-top: 0.35rem; font-size: 1.075rem; }
.hours span { font-family: var(--display); margin-inline-start: 0.35rem; font-size: 0.88rem; }

.action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  padding: 0.85rem 1.15rem;
  min-height: 3.1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--soot);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease;
}
.action:hover { background: var(--lime-hover); }
.action:active { transform: translateY(2px); }
.hero .action:focus-visible { outline-color: var(--white); }

.lookup, .import-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: clamp(2rem, 7vw, 7.5rem);
  padding-block: clamp(3rem, 6.8vw, 6.4rem);
}
.lookup-copy p { margin-top: 1rem; max-width: 24ch; font-size: 1.07rem; }
.selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: grid; gap: 0.4rem; font-weight: 700; }
select {
  width: 100%;
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.65rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--soot);
  font: 400 1rem var(--display);
  cursor: pointer;
}
select:disabled { color: var(--soft-ink); cursor: default; opacity: 1; }
.result-summary:empty { display: none; }
.result-summary { margin-top: 1.45rem; font-weight: 600; }
.assignments { list-style: none; padding: 0; margin-top: 0.65rem; }
.assignments li {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) auto auto;
  align-items: baseline;
  gap: clamp(0.65rem, 2vw, 1.5rem);
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
}
.assignments li:nth-child(odd) { background: var(--paper); }
.assignments time { font-size: 1.32rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.weekday { margin-inline-start: 0.45rem; font-size: 0.9rem; }
.assignment-hour, .assignment-status { color: var(--soft-ink); font-size: 0.9rem; white-space: nowrap; }
.download-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem 1.1rem; margin-top: 1.1rem; }
.download-status { margin-top: 0.65rem; color: var(--soft-ink); }

.import-section { background: var(--paper); }
.import-grid h2 { font-size: clamp(1.85rem, 3.6vw, 3.4rem); }
ol { padding-inline-start: 1.5rem; font-size: 1.065rem; }
li + li { margin-top: 0.25rem; }
.import-link { display: inline-block; margin-top: 1.2rem; font-weight: 700; }
.import-note { margin-top: 0.9rem; color: var(--soft-ink); font-size: 0.94rem; }
footer { background: var(--soot); color: var(--white); font-size: 0.875rem; }
.footer-row { min-height: 5rem; }

@keyframes shutter { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.header-row, .title-start, .title-end, .hero-meta > *, .lookup-copy > *, .selectors > * {
  animation: arrive 520ms ease-out both;
}
.title-start, .lookup-copy p, .selectors label:first-child { animation-delay: 45ms; }
.title-end, .hero-meta > div, .selectors label:last-child { animation-delay: 105ms; }
.hero-meta .action { animation-delay: 170ms; }

@media (max-width: 680px) {
  .header-row { min-height: 4rem; }
  .hero-content { padding-block: 1.5rem 2.2rem; }
  h1 { display: grid; grid-template-columns: 1fr; gap: 0.15em; font-size: clamp(3.5rem, 16vw, 6rem); }
  .title-end { justify-self: end; }
  .court-photo { width: 100%; height: clamp(7rem, 32vw, 13rem); }
  .hero-meta { margin-top: 1.5rem; }
  .hero-meta .action { gap: 0.55rem; padding-inline: 0.78rem; }
  .lookup, .import-grid { grid-template-columns: 1fr; gap: 1.35rem; }
  .lookup-copy p { margin-top: 0.6rem; max-width: none; }
}
@media (max-width: 355px) {
  .hero-meta { align-items: start; flex-direction: column; gap: 0.9rem; }
  .assignments li { grid-template-columns: minmax(5rem, 1fr) auto; }
  .assignment-status { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
