@font-face {
  font-family: "Ma Shan Zheng";
  src: url("assets/ziwei-calligraphy.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #fffefa;
  --ink: #252526;
  --muted: #565452;
  --blue: #0b56c6;
  --blue-deep: #08449f;
  --red: #d8442d;
  --line: #e1ddd5;
  --gutter: clamp(1rem, 5vw, 5rem);
  font-family: Montserrat, Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.page-width { width: min(calc(100% - 2 * var(--gutter)), 1312px); margin-inline: auto; }

.site-header {
  min-height: clamp(4.6rem, 8vw, 6.25rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand {
  width: clamp(12rem, 24vw, 19.4rem);
  height: auto;
}
.header-register {
  flex: none;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue-deep);
  font-size: .86rem;
  font-weight: 700;
  padding: .62rem .92rem;
  cursor: pointer;
}
.header-register:hover { background: #eef4ff; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  grid-template-areas: "intro art" "actions art";
  grid-template-rows: auto 1fr;
  column-gap: clamp(1.65rem, 4vw, 3.6rem);
  align-items: start;
  padding-top: clamp(1.5rem, 3.4vw, 3.5rem);
}
.intro { grid-area: intro; min-width: 0; }
.event-type {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.event-type::before { content: ""; width: 1.7rem; height: 2px; background: var(--red); }
h1 { margin-top: 1.15rem; font-size: inherit; }
h1 span { display: block; }
.title-open {
  font-size: clamp(2.15rem, 4.25vw, 4.05rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -.062em;
}
.title-year {
  margin-left: -.052em;
  color: var(--blue);
  font-size: clamp(6.3rem, 13.4vw, 12.5rem);
  font-weight: 900;
  font-variant-numeric: lining-nums;
  line-height: .86;
  letter-spacing: -.095em;
}
.title-topic {
  margin-top: .9rem;
  font-size: clamp(1.35rem, 2.5vw, 2.25rem);
  font-weight: 730;
  line-height: 1.16;
  letter-spacing: -.04em;
}
.intro-date { margin-top: 1.4rem; font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 760; line-height: 1.32; }

.hero-art { position: relative; grid-area: art; min-width: 0; align-self: start; isolation: isolate; container-type: inline-size; }
.collage-ink, .collage-red, .collage-mountains { position: absolute; z-index: -1; pointer-events: none; }
.collage-ink { top: -7%; right: 2%; width: 78%; height: auto; }
.collage-red {
  top: 23%;
  right: -2%;
  width: 45%;
  height: 57%;
  background: linear-gradient(135deg, #e14a30 5%, #d63422 78%);
  clip-path: polygon(0 30%, 12% 17%, 27% 18%, 34% 5%, 48% 12%, 61% 0, 71% 14%, 83% 19%, 100% 34%, 94% 49%, 100% 56%, 92% 89%, 67% 100%, 29% 86%, 0 82%);
}
.collage-mountains { top: 21%; left: -5%; width: 105%; height: auto; max-width: none; }
.scene-image { width: 100%; height: auto; }
.collage-title {
  position: absolute;
  inset: 4.4% auto auto 3.5%;
  color: #164b99;
  font-family: "Ma Shan Zheng", KaiTi, "STKaiti", "Noto Serif CJK SC", serif;
  font-size: clamp(1rem, 8.3cqw, 3.65rem);
  line-height: 1;
  letter-spacing: .09em;
  white-space: nowrap;
}
.chart-sheet {
  position: absolute;
  z-index: 1;
  inset: auto auto 10% .5%;
  width: 42%;
  height: auto;
  padding: clamp(.3rem, .7vw, .66rem);
  border: 1px solid #ded4c3;
  background: #fffefa;
  box-shadow: 0 9px 18px #38262830;
  transform: rotate(-8deg);
}
.speaker {
  position: absolute;
  inset: auto 0 -1.5% auto;
  display: grid;
  gap: .3rem;
  max-width: 55%;
  padding: .64rem clamp(.6rem, 1.65vw, 1.2rem) .7rem;
  border-left: 3px solid var(--red);
  background: var(--paper);
  color: var(--ink);
}
.speaker span { color: var(--muted); font-size: clamp(.7rem, 1vw, .85rem); font-weight: 550; }
.speaker strong { font-size: clamp(.84rem, 1.4vw, 1.12rem); letter-spacing: -.025em; line-height: 1.2; }

.registration-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-width: 0;
  margin-top: clamp(1.35rem, 2.6vw, 1.9rem);
  scroll-margin-top: 1rem;
}
.registration-actions .registration-total {
  flex: 0 0 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: clamp(.8rem, 1.12vw, 1rem);
  font-weight: 650;
  letter-spacing: 0;
}
.registration-actions .registration-total[hidden] { display: none; }
.primary-button, .recording-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: .52rem .84rem;
  border: 1px solid var(--blue);
  border-radius: 2px;
  font-size: .89rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
}
.primary-button { color: #fffdfa; background: var(--blue); }
.primary-button:not(:disabled):hover { background: var(--blue-deep); }
.primary-button:disabled { opacity: .62; cursor: not-allowed; }
.recording-button { color: var(--blue-deep); }
.recording-button:hover { background: #edf3fd; }

html:has(.registration-dialog[open]) { overflow: hidden; }
.registration-dialog {
  width: min(38.75rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: clamp(1.125rem, 4vw, 3rem);
  border: 0;
  border-radius: 3px;
  background: #fcf9f2;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.registration-dialog::backdrop { background: #161925a3; }
.dialog-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 2px;
  background: transparent url("assets/registration-close.svg") no-repeat center / 1.875rem;
  cursor: pointer;
}
.dialog-close:hover { background-color: #0b56c60d; }
.registration-dialog h2 {
  padding-right: 2rem;
  font-size: clamp(1.8rem, 5vw, 2.375rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.12;
}
.registration-dialog h2 span { color: var(--blue); }
.registration-description { margin-top: 1.5rem; font-size: 1.06rem; line-height: 1.5; }
.registration-form {
  display: grid;
  gap: 1.375rem;
  margin-top: 1.375rem;
}
.field { display: grid; gap: .625rem; min-width: 0; font-size: 1rem; font-weight: 750; }
.field input {
  width: 100%;
  min-width: 0;
  min-height: 3.375rem;
  padding: .7rem .85rem;
  border: 1px solid #b7b3ac;
  border-radius: 4px;
  background: #fffefa;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}
.field input::placeholder { color: #72706b; }
.registration-consent {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .82rem;
  line-height: 1.5;
  cursor: pointer;
}
.registration-consent input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.registration-consent a, .form-result a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: .15em; }
.registration-form .primary-button { min-height: 3.625rem; border-radius: 4px; font-size: 1.25rem; font-weight: 800; }
.form-result {
  padding: .55rem .7rem;
  background: #e9efe3;
  color: #2d432c;
  border-left: 2px solid #456640;
  font-size: .8rem;
  line-height: 1.4;
}
.form-result[data-state="error"] { background: #faede8; color: #722a1d; border-color: var(--red); }
.form-result[hidden] { display: none; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  align-items: baseline;
  gap: .75rem 2rem;
  margin-top: clamp(2.15rem, 4.7vw, 4.2rem);
  padding-block: 1.45rem 2.65rem;
  border-top: 1px solid var(--line);
}
.about h2 { font-size: clamp(1.26rem, 2.4vw, 1.95rem); line-height: 1.1; font-weight: 780; letter-spacing: -.045em; }
.about p { max-width: 48rem; font-size: 1rem; color: var(--muted); line-height: 1.59; }

@media (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); }
  .registration-actions { margin-top: 1.45rem; }
}
@media (max-width: 690px) {
  :root { --gutter: clamp(1rem, 5vw, 1.5rem); }
  .site-header { min-height: 3.65rem; }
  .brand { width: min(56%, 14rem); }
  .header-register { padding: .57rem .62rem; font-size: .74rem; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "intro" "art" "actions";
    gap: .78rem;
    padding-top: .7rem;
  }
  .event-type { font-size: .73rem; }
  h1 { margin-top: .6rem; }
  .title-open { font-size: clamp(1.7rem, 7.7vw, 3rem); }
  .title-year { font-size: clamp(4.45rem, 19.5vw, 7.6rem); }
  .title-topic { margin-top: .5rem; font-size: clamp(1.15rem, 4.9vw, 1.75rem); }
  .intro-date { margin-top: .56rem; font-size: .96rem; }
  .hero-art { justify-self: center; width: min(100%, clamp(9rem, calc(100svh - 34rem), 22rem)); }
  .collage-ink { top: -3%; }
  .collage-mountains { left: -3.5%; width: 103.5%; }
  .chart-sheet { inset: auto auto 10% 3.8%; width: 41%; }
  .speaker { inset-block-end: -2%; }
  .registration-actions { margin-top: 0; padding-top: .38rem; }
  .registration-description { margin-top: 1rem; font-size: 1rem; }
  .registration-form { gap: 1.1rem; margin-top: 1rem; }
  .registration-form .primary-button { min-height: 3.125rem; font-size: 1.06rem; }
  .field input { min-height: 3rem; padding: .55rem .7rem; }
  .registration-actions > * { flex: 1 1 max-content; padding-inline: .52rem; font-size: .79rem; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 690px) and (max-height: 760px) {
  .site-header { min-height: 3.35rem; }
  .hero { gap: .5rem; padding-top: .52rem; }
  .title-open { font-size: clamp(1.55rem, 6.8vw, 2.35rem); }
  .title-year { font-size: clamp(3.45rem, 15vw, 6.3rem); }
  .title-topic { font-size: clamp(1.05rem, 4.4vw, 1.5rem); }
  .intro-date { margin-top: .47rem; }
  .hero-art { width: min(100%, clamp(8rem, calc(100svh - 31.35rem), 18.25rem)); }
  .speaker {
    inset: auto auto -.12rem 50%;
    display: flex;
    align-items: baseline;
    gap: .42rem;
    max-width: none;
    width: max-content;
    padding: .24rem .43rem;
    transform: translateX(-50%);
  }
  .speaker strong { font-size: .72rem; }
  .registration-actions > * { min-height: 2.75rem; }
}
@media (max-width: 690px) and (max-height: 620px) {
  .registration-dialog { padding: .9rem; }
  .registration-description { margin-top: .7rem; font-size: .94rem; line-height: 1.4; }
  .registration-form { gap: .7rem; margin-top: .85rem; }
  .registration-form .primary-button { min-height: 2.85rem; }
  .field { gap: .45rem; }
  .field input { min-height: 2.7rem; }
  .registration-consent { gap: .55rem; line-height: 1.35; }
  .registration-consent input { width: 1.125rem; height: 1.125rem; }
}
