:root {
  color-scheme: light;
  --paper: #f6efe3;
  --ink: #2d201d;
  --muted: #67554a;
  --accent: #833928;
  --line: #d8c8b6;
  --serif: "Songti SC", "Noto Serif CJK SC", STSong, SimSun, serif;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
form, h1, h2, p { margin: 0; }

.shell {
  width: min(100% - 96px, 1320px);
  margin-inline: auto;
}

.site-header, .site-footer {
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.site-header { border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); }

.header-inner, .footer-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .12em;
}

.brand-mark, .letter-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 33px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 20px;
  letter-spacing: 0;
}

.header-note, .footer-inner {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
}

.footer-inner { min-height: 56px; }

.stage {
  flex: 1;
  display: grid;
  align-items: center;
  isolation: isolate;
  position: relative;
  background: #efe3d0;
}

.campus {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 48%;
  background:
    linear-gradient(145deg, rgb(114 63 39 / .04), rgb(82 44 26 / .29)),
    url("/campus.webp") 50% 54% / cover no-repeat;
}

.stage-inner {
  padding-block: clamp(52px, 8vw, 122px);
}

.intro {
  width: 48%;
  padding-right: clamp(18px, 4vw, 64px);
}

.intro h1 {
  font-family: var(--serif);
  font-size: clamp(37px, 4.4vw, 76px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -.025em;
}

.intro h1 em {
  color: var(--accent);
  font-style: normal;
}

.summary {
  margin-block: 22px 30px;
  color: var(--muted);
  line-height: 1.8;
}

.lookup {
  display: grid;
  gap: 10px;
  max-width: 350px;
  padding-block-start: 22px;
  border-top: 1px solid #cbb59e;
}

.lookup label, .letter h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
}

.lookup input, .primary {
  min-height: 50px;
  border-radius: 6px;
}

.lookup input {
  min-width: 0;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #baa793;
  background: #fffaf2;
  color: var(--ink);
}

.lookup input::placeholder { color: #746359; }
.lookup input[aria-invalid] { border-color: var(--accent); }
.form-error { color: #762919; font-size: 14px; line-height: 1.6; }

.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff9ee;
  font-weight: 700;
  letter-spacing: .045em;
}

.primary:hover { background: #692b1e; }
.primary span { font-size: 21px; }

.action-link {
  display: inline-block;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 2px solid #702f20;
  outline-offset: 4px;
}

.stage--result {
  background: #cbb19a;
}

.stage--result .campus {
  inset: 0;
  background-image: linear-gradient(rgb(47 32 26 / .45), rgb(47 32 26 / .59)), url("/campus.webp");
}

.stage--result .stage-inner { padding-block: clamp(28px, 5vw, 64px); }

.letter {
  width: min(100%, 600px);
  margin-inline: auto;
  padding: clamp(25px, 5vw, 54px);
  color: var(--ink);
  background: #fff8ec;
  border: 1px solid #e7d4b9;
  outline: 1px solid #d4bea0;
  outline-offset: -10px;
  box-shadow: 0 18px 56px rgb(29 18 13 / .32);
}

.letter-header { text-align: center; }
.letter-mark { width: 44px; height: 44px; margin: 0 auto 17px; }
.letter-header p { color: var(--muted); font-size: 14px; letter-spacing: .13em; }

.letter h1 {
  margin: 6px 0 25px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(35px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.letter-section { padding-block: 18px; border-top: 1px solid var(--line); }
.letter section p { margin-top: 7px; line-height: 1.85; }
.opener { padding: 16px; background: #f2e5d3; }
.back { margin-top: 20px; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 42px); }
  .header-inner { min-height: 60px; }
  .footer-inner { min-height: 54px; font-size: 11px; }
  .stage { display: block; }
  .campus {
    position: relative;
    inset: auto;
    height: clamp(140px, 34vw, 230px);
    background-position: 50% 60%;
  }
  .stage-inner { padding-block: 29px 38px; }
  .intro { width: 100%; padding-right: 0; }
  .intro h1 { font-size: clamp(33px, 8.7vw, 54px); }
  .summary { margin-block: 13px 20px; }
  .lookup { max-width: none; padding-block-start: 17px; }
  .stage--result .campus { position: absolute; inset: 0; height: auto; }
}
