@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/instrument-serif-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/instrument-serif-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #fffaf0;
  --accent: #ffd09d;
  --edge: clamp(22px, 5.5vw, 108px);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #172838; color: var(--ink); }
[hidden] { display: none !important; }
.stage { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.stage img, .stage canvas, .shade {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.stage img { object-fit: cover; object-position: 50% 50%; }
.shade {
  background:
    linear-gradient(0deg, rgb(4 13 20 / .68), transparent 24%, transparent 86%, rgb(6 20 31 / .26)),
    linear-gradient(90deg, rgb(4 15 26 / .42), rgb(5 15 27 / .10) 52%, transparent 85%);
}
.page {
  position: relative; isolation: isolate; display: grid;
  grid-template-rows: auto minmax(250px, 1fr) auto;
  min-height: 100vh; min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) var(--edge) max(24px, env(safe-area-inset-bottom));
}
header, footer, .place, .local-time, .status, .playback, .phases {
  display: flex; align-items: center;
}
header { justify-content: space-between; gap: 18px; min-height: 40px; }
.place { gap: 13px; font-size: 15px; letter-spacing: .13em; font-weight: 550; }
.place-en {
  padding-left: 13px; border-left: 1px solid rgb(255 255 255 / .46);
  font: italic 21px/1 'Instrument Serif', Georgia, serif; letter-spacing: .01em;
}
.bay-mark { position: relative; width: 28px; height: 26px; color: var(--accent); }
.bay-mark i { position: absolute; display: block; background: currentColor; }
.bay-mark i:nth-child(1) {
  width: 15px; height: 8px; border-radius: 100px 100px 0 0; top: 2px; left: 6px;
}
.bay-mark i:nth-child(2) { height: 2px; width: 27px; top: 13px; left: 0; }
.bay-mark i:nth-child(3) { height: 2px; width: 16px; top: 18px; left: 6px; }
.local-time { gap: 11px; font-size: 13px; letter-spacing: .03em; color: #f6f3ed; }
#clock { font: 14px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
main { display: flex; align-items: center; }
.title-block { padding: 5vh 0 0; }
h1 {
  margin: 0 0 25px -.027em; font: 400 clamp(84px, 12vw, 222px)/.88 'Instrument Serif', Georgia, serif;
  letter-spacing: -.045em; white-space: nowrap;
  text-shadow: 0 4px 35px rgb(5 15 22 / .15);
}
h1 em { font-weight: 400; }
.period { color: var(--accent); }
.status { margin: 0; gap: 14px; font-size: clamp(16px, 1.35vw, 22px); font-weight: 450; letter-spacing: .17em; }
.status span { width: 28px; height: 1.5px; background: var(--accent); }
footer {
  flex-wrap: wrap; justify-content: space-between; gap: 16px 26px;
  border-top: 1px solid rgb(255 255 255 / .3); padding-top: 18px;
}
.playback { gap: 8px; }
.phases, #motion {
  border: 1px solid rgb(255 255 255 / .34);
  background: rgb(13 27 37 / .69); border-radius: 100px;
}
.phases { padding: 3px; }
button {
  appearance: none; border: none; cursor: pointer; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 450; line-height: 1; color: var(--ink);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.phases button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 100px;
}
.phases button[aria-pressed="true"] { background: #f8ecdb; color: #222b31; }
.phases button[aria-pressed="false"]:hover, #motion:hover { background: #43515b; }
.phases button span { font: 19px/1 Georgia, serif; }
#motion { width: 46px; height: 46px; display: grid; place-items: center; }
.transport-icon { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
#motion[aria-pressed="true"] .transport-icon {
  width: 0; height: 0; margin-left: 2px; border: 0;
  border-block: 6px solid transparent; border-left: 9px solid currentColor;
}
.registration { color: #f4eee7; font-size: 13px; text-decoration: none; letter-spacing: .025em; }
.registration:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid #ffdb96; outline-offset: 4px; }
@media (min-width: 1500px) {
  .page { padding-block: 36px; }
}
@media (max-width: 640px) {
  :root { --edge: max(22px, env(safe-area-inset-left)); }
  .page { padding-top: max(18px, env(safe-area-inset-top)); }
  .place { gap: 8px; font-size: 14px; }
  .place-en { display: none; }
  .local-time { gap: 7px; font-size: 12px; }
  #clock { font-size: 13px; }
  .title-block { padding-top: 10vh; }
  h1 { font-size: clamp(77px, 21vw, 125px); margin-bottom: 20px; }
  .status { font-size: 16px; gap: 10px; }
  .status span { width: 21px; }
  footer { align-items: flex-start; flex-direction: column; gap: 15px; padding-top: 15px; }
  .phases button { min-height: 40px; padding-inline: 9px; gap: 4px; }
  .phases button span { font-size: 16px; }
  #motion { width: 48px; height: 48px; }
}
@media (max-width: 375px) {
  .phases button { min-width: 47px; }
  .phases button span { display: none; }
}
@media (orientation: portrait) {
  .stage img { object-position: 77% 50%; }
}
@media (max-height: 500px) and (min-width: 520px) {
  .page { padding-block: 12px; grid-template-rows: auto minmax(120px, 1fr) auto; }
  .title-block { padding-top: 0; }
  h1 { font-size: clamp(74px, 12vw, 104px); margin-bottom: 13px; }
  footer { padding-top: 8px; }
}
