@font-face {
  font-family: "Print Study";
  src: url("./print-study.woff2?v=20260912") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f4ef;
  --ink: #26251f;
  --quiet: #69675d;
  --edge: #d5d3c9;
  background: var(--paper);
  color: var(--ink);
  font-family: "Print Study", "Songti SC", "Noto Serif CJK SC", serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.study {
  position: relative;
  min-height: 36rem;
  height: 100svh;
  isolation: isolate;
  overflow: hidden;
}
#field {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.masthead,
.footer {
  position: absolute;
  z-index: 1;
  left: clamp(1.25rem, 4vw, 4.5rem);
  right: clamp(1.25rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.masthead {
  top: max(1.5rem, env(safe-area-inset-top));
  font-size: 1rem;
  letter-spacing: 0.16em;
  pointer-events: none;
}
.edition {
  color: var(--quiet);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}
.title {
  position: absolute;
  z-index: 1;
  top: 24%;
  right: 9%;
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 1.6rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--quiet);
}
h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(4.75rem, 7vw, 7rem);
  line-height: 1.16;
  letter-spacing: 0.05em;
}
h1 span {
  display: block;
  padding-left: 0.7em;
}
.footer {
  bottom: max(1.3rem, env(safe-area-inset-bottom));
  font-size: 0.875rem;
}
.hint {
  color: var(--quiet);
  margin: 0;
  letter-spacing: 0.08em;
}
.touch-hint {
  display: none;
}
.actions {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}
button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-underline-offset: 0.4em;
}
button:hover:not(:disabled) {
  text-decoration: underline;
}
button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
.time-track {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--edge);
  pointer-events: none;
}
#time-fill {
  width: 100%;
  height: 100%;
  background: #8d5044;
  transform: scaleX(0);
  transform-origin: left;
}
.fallback {
  position: absolute;
  z-index: 1;
  left: 8%;
  bottom: 30%;
  max-width: 70%;
  line-height: 1.8;
  font-size: 1rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 650px) {
  .study {
    min-height: 32rem;
  }
  .masthead {
    top: max(1.25rem, env(safe-area-inset-top));
    font-size: 0.9rem;
  }
  .edition {
    font-size: 0.8rem;
  }
  .title {
    top: 16%;
    right: 12%;
  }
  h1 {
    font-size: 4.4rem;
  }
  .eyebrow {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  .footer {
    gap: 0.65rem;
  }
  .hint {
    font-size: 0.8rem;
    letter-spacing: 0;
  }
  .actions {
    gap: 0.75rem;
  }
}

@media (pointer: coarse) {
  .mouse-hint {
    display: none;
  }
  .touch-hint {
    display: inline;
  }
}

@media (max-height: 480px) and (min-width: 651px) {
  .study {
    min-height: 24rem;
  }
  .title {
    top: 22%;
    right: 8%;
  }
  h1 {
    font-size: 3.5rem;
  }
  .eyebrow {
    margin-bottom: 0.6rem;
  }
}

.back-link {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}
.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}
.back-link:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
