:root {
  --hall: #d5dde6;
  --sheet: #f7f9fb;
  --ink: #132033;
  --mute: #3a4a5c;
  --rule: #b7c4d2;
  --mark: #8d3014;
  --btn: #132033;
  --btn-ink: #f7f9fb;
  --quiet: var(--mute);
  --line: var(--rule);
  --paper: #eef2f6;
  --rust-ink: var(--mark);
}

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

html {
  background: var(--hall);
  color: var(--ink);
  scrollbar-color: var(--ink) var(--hall);
}

body {
  margin: 0;
  background: var(--hall);
  color: var(--ink);
  font-family: "Noto Sans HK", "PingFang HK", "Heiti TC", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

::selection {
  background: var(--ink);
  color: var(--sheet);
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--sheet);
  padding: 0.5rem 0.75rem;
}

.skip:focus {
  transform: none;
  z-index: 2;
}

a {
  color: inherit;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

.sheet {
  width: min(1080px, calc(100% - 1.5rem));
  margin: 1.25rem auto 3rem;
  background: var(--sheet);
  padding: 1.75rem 1.75rem 2.5rem;
  box-shadow: 0 18px 40px rgba(19, 32, 51, 0.12);
}

header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem 2rem;
  align-items: end;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
}

h1 {
  margin: 0 0 0.35rem;
  font-family: "Noto Serif HK", "Songti SC", serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede {
  margin: 0;
  max-width: 52ch;
  color: var(--mute);
}

.aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.start {
  margin: 0;
  color: var(--mute);
  font-size: 0.9375rem;
  text-align: right;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  background: var(--btn);
  color: var(--btn-ink);
  text-decoration: none;
  font-weight: 500;
}

.actions a:hover {
  background: #0c1624;
}

.actions a.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.actions a.ghost:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(240px, 1.05fr);
  gap: 1.5rem 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.job h2,
.society h2 {
  margin: 0;
  font-family: "Noto Serif HK", "Songti SC", serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.when,
.note,
figcaption {
  color: var(--mute);
  font-size: 0.9375rem;
}

.when {
  margin: 0.2rem 0 0.7rem;
}

.job p,
.society p {
  margin: 0 0 0.7rem;
  max-width: 46ch;
}

.award {
  margin: 0 0 0.85rem;
  color: var(--mark);
  font-weight: 500;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 500;
}

figure {
  margin: 0;
}

.job figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: top;
  box-shadow: 8px 14px 24px rgba(19, 32, 51, 0.16);
}

.society {
  padding-top: 1.5rem;
}

.match {
  background: var(--paper);
  padding: 1.1rem 1.15rem 1.2rem;
}

.match h2,
.match h3 {
  margin: 0 0 0.85rem;
  font-family: "Noto Sans HK", "PingFang HK", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0;
}

.pair div {
  margin: 0;
}

.pair dt {
  margin: 0 0 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mark);
}

.pair dd {
  margin: 0;
}

.note {
  margin: 0.9rem 0 0;
}

.study {
  width: min(740px, calc(100% - 1.5rem));
  margin: 1.25rem auto 3rem;
  background: var(--sheet);
  padding: 1.5rem 1.75rem 3rem;
  box-shadow: 0 18px 40px rgba(19, 32, 51, 0.12);
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: 0.5rem;
  color: var(--mute);
}

.study h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.study .device {
  margin: 1.25rem 0 1.5rem;
}

.device img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  box-shadow: 8px 14px 24px rgba(19, 32, 51, 0.16);
}

.study h2 {
  margin: 2.25rem 0 0.45rem;
  font-family: "Noto Serif HK", "Songti SC", serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.study p {
  max-width: 65ch;
}

.study .lede {
  max-width: 58ch;
  margin-bottom: 0.5rem;
}

@media (max-width: 800px) {
  header,
  .job {
    grid-template-columns: 1fr;
  }

  .aside,
  .start,
  .actions {
    align-items: flex-start;
    text-align: left;
    justify-content: flex-start;
  }

  .sheet {
    padding: 1.2rem 1.1rem 2rem;
    margin-top: 0.75rem;
  }

  .job figure img {
    max-height: none;
  }

  .pair {
    grid-template-columns: 1fr;
  }
}
