:root {
  --ink: #2d3047;
  --ink-soft: #6b6d7c;
  --paper: #fffdf8;
  --ground: #eee9de;
  --line: #d5cec0;
  --rust: #d96f4a;
  --rust-dark: #a94d35;
  --blue: #547b8d;
  --green: #587b6a;
  --gold: #d2a744;
  color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  font-synthesis: none;
  line-height: 1.7;
}

* {
  box-sizing: border-box;
}

html {
  background:
    linear-gradient(rgb(255 255 255 / 0.22), rgb(255 255 255 / 0.22)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgb(45 48 71 / 0.04) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgb(45 48 71 / 0.04) 31px 32px),
    var(--ground);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(217 111 74 / 0.38);
  outline-offset: 3px;
}

.skip-link {
  background: var(--ink);
  color: white;
  left: 1rem;
  padding: 0.6rem 0.9rem;
  position: fixed;
  top: -6rem;
  z-index: 50;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
body > footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1160px;
  padding: 1.35rem 1.5rem;
}

.site-header {
  min-height: 5.5rem;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 800;
  gap: 0.75rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  height: 2.35rem;
  position: relative;
  width: 2.7rem;
}

.brand-mark i,
.brand-mark b,
.brand-mark em {
  border: 1px solid var(--ink);
  border-radius: 2px;
  height: 1.65rem;
  position: absolute;
  transform: rotate(-7deg);
  width: 1.25rem;
}

.brand-mark i {
  background: #efd6c9;
  left: 0.05rem;
  top: 0.4rem;
}

.brand-mark b {
  background: #d8e4e7;
  left: 0.75rem;
  top: 0.15rem;
  transform: rotate(4deg);
}

.brand-mark em {
  background: #eee1ad;
  left: 1.4rem;
  top: 0.55rem;
  transform: rotate(10deg);
}

.site-header nav,
body > footer nav {
  align-items: center;
  display: flex;
  gap: 1.4rem;
}

.site-header nav a,
body > footer a {
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-button {
  border: 1px solid var(--ink);
  padding: 0.58rem 0.82rem;
}

main {
  min-height: calc(100vh - 12rem);
}

.eyebrow {
  color: var(--rust);
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

h1 {
  font-size: clamp(1.55rem, 3.1vw, 2rem);
  line-height: 1.42;
}

h2 {
  font-size: 1.22rem;
  line-height: 1.5;
}

.clue-stage {
  height: 650px;
  margin: 0 auto;
  max-width: 1160px;
  overflow: hidden;
  position: relative;
}

.clue-stage::before {
  border: 1px dashed rgb(45 48 71 / 0.25);
  border-radius: 50%;
  content: "";
  height: 430px;
  left: 334px;
  position: absolute;
  top: 88px;
  transform: rotate(-8deg);
  width: 430px;
}

.stage-caption {
  position: absolute;
  z-index: 4;
}

.stage-caption small {
  display: block;
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  margin-bottom: 0.3rem;
}

.stage-caption strong {
  font-family: "Yu Mincho", serif;
  font-size: 0.95rem;
}

.stage-caption.left {
  bottom: 52px;
  left: 64px;
}

.stage-caption.right {
  bottom: 52px;
  right: 84px;
}

.memory-slips {
  height: 500px;
  left: 28px;
  position: absolute;
  top: 42px;
  width: 440px;
}

.memory-slip {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 14px 18px 0 rgb(45 48 71 / 0.07);
  display: flex;
  flex-direction: column;
  min-height: 126px;
  padding: 1.25rem;
  position: absolute;
  width: 220px;
}

.memory-slip::before {
  background: var(--rust);
  content: "";
  height: 5px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.memory-slip small,
.candidate-shelf > small {
  color: var(--ink-soft);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.memory-slip strong {
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
  margin-top: 0.65rem;
}

.memory-slip span {
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.slip-when {
  left: 12px;
  top: 48px;
  transform: rotate(-5deg);
}

.slip-where {
  left: 207px;
  top: 24px;
  transform: rotate(5deg);
}

.slip-cover {
  left: 43px;
  top: 220px;
  transform: rotate(3deg);
}

.slip-cover::before {
  background: var(--blue);
}

.slip-scene {
  left: 232px;
  top: 200px;
  transform: rotate(-4deg);
}

.slip-scene::before {
  background: var(--gold);
}

.search-lens {
  height: 172px;
  left: 488px;
  position: absolute;
  top: 214px;
  width: 172px;
  z-index: 5;
}

.search-lens i {
  background: rgb(255 253 248 / 0.65);
  border: 9px solid var(--ink);
  border-radius: 50%;
  display: block;
  height: 120px;
  width: 120px;
}

.search-lens b {
  align-items: center;
  color: var(--rust);
  display: flex;
  font-family: "Yu Mincho", serif;
  font-size: 2.4rem;
  height: 120px;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 0;
  width: 120px;
}

.search-lens em {
  background: var(--ink);
  border-radius: 8px;
  height: 74px;
  left: 112px;
  position: absolute;
  top: 103px;
  transform: rotate(-43deg);
  width: 17px;
}

.candidate-shelf {
  background: var(--ink);
  box-shadow: 20px 24px 0 rgb(45 48 71 / 0.12);
  color: var(--paper);
  padding: 2.1rem 2rem 1.6rem;
  position: absolute;
  right: 24px;
  top: 85px;
  transform: rotate(2deg);
  width: 410px;
}

.candidate-shelf > small {
  color: rgb(255 255 255 / 0.55);
}

.book-row {
  align-items: end;
  border-bottom: 10px solid #725342;
  display: flex;
  gap: 1.05rem;
  height: 290px;
  padding: 2rem 1rem 0;
}

.book {
  border: 1px solid rgb(255 255 255 / 0.28);
  display: flex;
  flex-direction: column;
  height: 214px;
  justify-content: space-between;
  padding: 1rem 0.7rem;
  position: relative;
  width: 92px;
}

.book i {
  background: rgb(255 255 255 / 0.16);
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 24px;
}

.book strong {
  font-family: "Yu Mincho", serif;
  font-size: 0.82rem;
  padding-top: 1.2rem;
  writing-mode: vertical-rl;
}

.book span {
  background: var(--paper);
  color: var(--ink);
  font-size: 0.5rem;
  font-weight: 800;
  padding: 0.22rem;
  text-align: center;
}

.book-a {
  background: var(--rust);
  height: 242px;
}

.book-b {
  background: var(--blue);
}

.book-c {
  background: var(--green);
  height: 190px;
}

.candidate-shelf > p {
  color: rgb(255 255 255 / 0.68);
  font-size: 0.62rem;
  margin: 1.1rem 0 0;
}

.candidate-shelf > p span {
  color: var(--gold);
  font-size: 0.9rem;
  margin-right: 0.4rem;
}

.maker-shell {
  background: var(--ink);
  color: var(--paper);
  display: grid;
  gap: 5rem;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  padding: 7rem max(1.5rem, calc((100vw - 1100px) / 2));
}

.maker-intro {
  align-self: center;
  max-width: 520px;
}

.maker-intro h1 {
  font-size: clamp(1.7rem, 3.2vw, 2rem);
  margin: 1.2rem 0;
}

.maker-intro > p {
  color: rgb(255 255 255 / 0.68);
  font-size: 0.84rem;
}

.maker-intro ol {
  border-top: 1px solid rgb(255 255 255 / 0.14);
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
}

.maker-intro li {
  border-bottom: 1px solid rgb(255 255 255 / 0.14);
  font-size: 0.72rem;
  padding: 1rem 0;
}

.maker-intro li span {
  color: var(--rust);
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 800;
  width: 2.4rem;
}

.maker {
  background: var(--paper);
  border-top: 8px solid var(--rust);
  color: var(--ink);
  padding: 2.3rem;
}

.maker header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.1rem;
  margin-bottom: 1.7rem;
  padding-bottom: 1.3rem;
}

.maker h2,
.install-card h2,
.manage-candidates h2 {
  margin: 0.2rem 0 0;
}

.clue-icon {
  height: 3rem;
  position: relative;
  width: 3.2rem;
}

.clue-icon i,
.clue-icon b,
.clue-icon em {
  background: #efd6c9;
  border: 1px solid var(--ink);
  height: 2rem;
  position: absolute;
  width: 1.4rem;
}

.clue-icon i {
  left: 0;
  top: 0.7rem;
  transform: rotate(-8deg);
}

.clue-icon b {
  background: #d8e4e7;
  left: 0.9rem;
  top: 0.15rem;
  transform: rotate(3deg);
}

.clue-icon em {
  background: #eee1ad;
  left: 1.7rem;
  top: 0.75rem;
  transform: rotate(10deg);
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field > span,
.install-card label {
  display: block;
  font-size: 0.67rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.field small {
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
.install-card textarea {
  background: #f8f4ea;
  border: 1px solid var(--line);
  border-radius: 0;
  display: block;
  padding: 0.72rem 0.8rem;
  resize: vertical;
  width: 100%;
}

.field textarea {
  line-height: 1.65;
}

.field-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr 1fr;
}

.form-note {
  color: var(--ink-soft);
  font-size: 0.61rem;
  margin: 0 0 1rem;
}

.ownership-check {
  align-items: flex-start;
  display: flex;
  font-size: 0.66rem;
  gap: 0.6rem;
  margin: 1rem 0;
}

.ownership-check input {
  margin-top: 0.35rem;
}

.honeypot {
  left: -10000px;
  position: absolute;
}

.button {
  background: transparent;
  border: 1px solid currentColor;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 800;
  gap: 0.7rem;
  justify-content: center;
  padding: 0.82rem 1.1rem;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
  width: 100%;
}

.button.accent {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.button.compact {
  padding: 0.62rem 0.85rem;
}

.button.danger {
  border-color: #ac5544;
  color: #8f3c2f;
}

.button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.action-status {
  font-size: 0.66rem;
  margin: 0.75rem 0 0;
  min-height: 1.4rem;
}

.action-status[data-state="success"] {
  color: var(--green);
}

.action-status[data-state="error"] {
  color: var(--rust-dark);
}

.boundary-strip {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

.boundary-strip span {
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  padding: 1rem 2.5rem;
}

.boundary-strip span:last-child {
  border-right: 1px solid var(--line);
}

.private-page {
  background-color: #f4f0e7;
}

.case-shell,
.manage-shell,
.guide-board,
.prose,
.not-found {
  margin: 0 auto;
  max-width: 1100px;
  padding: 3rem 1.5rem 5rem;
}

.case-heading,
.manage-heading {
  align-items: end;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.35rem;
}

.case-heading h1,
.manage-heading h1 {
  margin: 0.45rem 0 0.25rem;
}

.case-heading p,
.manage-heading p {
  color: var(--ink-soft);
  font-size: 0.68rem;
  margin: 0;
}

.status-badge {
  background: var(--rust);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
}

.status-badge[data-solved="true"] {
  background: var(--green);
}

.case-workspace {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
}

.clue-board,
.suggestion-panel,
.manage-clues,
.manage-candidates,
.install-card {
  background: var(--paper);
  border: 1px solid var(--line);
}

.clue-board {
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr 1fr;
}

.clue-board article {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  min-height: 120px;
  padding: 1.25rem;
}

.clue-board article:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.clue-board article.wide {
  border-right: 0;
  grid-column: 1 / -1;
  min-height: 154px;
}

.clue-board article.muted {
  background: #f4f0e8;
  min-height: 104px;
}

.clue-board small {
  color: var(--rust);
  display: block;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 0.65rem;
}

.clue-board strong {
  font-family: "Yu Mincho", serif;
  font-size: 0.92rem;
}

.clue-board p {
  font-size: 0.72rem;
  margin: 0;
  white-space: pre-wrap;
}

.suggestion-panel {
  padding: 1.5rem;
}

.suggestion-panel > header,
.manage-candidates > header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

.suggestion-panel > header h2 {
  margin: 0.25rem 0 0;
}

.suggestion-panel > header > strong,
.manage-candidates > header > strong {
  align-items: center;
  background: var(--ink);
  color: white;
  display: flex;
  font-family: "Yu Mincho", serif;
  font-size: 1.3rem;
  height: 2.7rem;
  justify-content: center;
  width: 2.7rem;
}

.suggestion-list,
.manage-suggestions {
  display: grid;
  gap: 0.8rem;
}

.suggestion-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  padding: 1rem;
}

.suggestion-card[data-verdict="correct"] {
  background: #eaf1eb;
  border-left-color: var(--green);
}

.suggestion-card[data-verdict="not_it"] {
  opacity: 0.58;
}

.suggestion-card header {
  align-items: start;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.suggestion-card h3 {
  font-family: "Yu Mincho", serif;
  font-size: 0.95rem;
  margin: 0;
}

.suggestion-card header span {
  color: var(--ink-soft);
  font-size: 0.6rem;
}

.suggestion-card p {
  font-size: 0.67rem;
  margin: 0.6rem 0 0;
  white-space: pre-wrap;
}

.suggestion-card a {
  color: var(--blue);
  display: inline-block;
  font-size: 0.62rem;
  margin-top: 0.6rem;
}

.suggestion-card .verdict {
  background: #ebe6dc;
  font-size: 0.53rem;
  font-weight: 800;
  padding: 0.28rem 0.42rem;
  white-space: nowrap;
}

.empty-shelf {
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 0.68rem;
  padding: 1.5rem;
  text-align: center;
}

.suggestion-form {
  border-top: 1px solid var(--line);
  margin-top: 1.3rem;
  padding-top: 1.3rem;
}

.report-link {
  background: none;
  border: 0;
  color: var(--ink-soft);
  display: block;
  font-size: 0.58rem;
  margin: 1.2rem auto 0;
  text-decoration: underline;
}

.manage-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
}

.manage-clues,
.manage-candidates,
.install-card {
  padding: 1.4rem;
}

.manage-clues > .clue-board {
  border: 0;
  margin-top: 1rem;
}

.manage-candidates {
  grid-row: span 2;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.manage-actions button {
  background: transparent;
  border: 1px solid var(--line);
  font-size: 0.56rem;
  font-weight: 800;
  padding: 0.38rem 0.48rem;
}

.manage-actions button[data-action="correct"] {
  border-color: var(--green);
  color: var(--green);
}

.manage-actions button[data-action="not_it"] {
  color: var(--rust-dark);
}

.install-card label {
  margin-top: 1rem;
}

.install-card > div {
  display: flex;
  gap: 0.5rem;
}

.danger-zone {
  align-items: center;
  border: 1px solid rgb(169 77 53 / 0.28);
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1rem 1.3rem;
}

.danger-zone strong {
  font-size: 0.68rem;
}

.danger-zone p {
  color: var(--ink-soft);
  font-size: 0.58rem;
  margin: 0.1rem 0 0;
}

.guide-board,
.prose {
  max-width: 900px;
}

.guide-board > header,
.prose > header {
  border-bottom: 1px solid var(--ink);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.guide-board > header h1,
.prose > header h1 {
  margin: 0.6rem 0;
}

.guide-board > header p,
.prose p {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-steps li {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 3rem 1fr;
  padding: 1.5rem 0;
}

.guide-steps li > span {
  color: var(--rust);
  font-family: "Yu Mincho", serif;
  font-size: 1.2rem;
}

.guide-steps strong {
  font-family: "Yu Mincho", serif;
  font-size: 0.98rem;
}

.guide-steps p,
.guide-note p {
  color: var(--ink-soft);
  font-size: 0.7rem;
  margin: 0.35rem 0 0;
}

.guide-note {
  background: var(--ink);
  color: white;
  margin-top: 2rem;
  padding: 1.4rem;
}

.guide-note p {
  color: rgb(255 255 255 / 0.66);
}

.prose section {
  border-bottom: 1px solid var(--line);
  padding: 1.2rem 0;
}

.prose section h2 {
  font-size: 1rem;
}

.not-found {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  text-align: center;
}

.not-found .search-lens {
  left: auto;
  margin: 4rem 0 2rem;
  position: relative;
  top: auto;
  transform: scale(0.72);
}

.not-found p {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

body > footer {
  border-top: 1px solid rgb(45 48 71 / 0.1);
  color: var(--ink-soft);
  font-size: 0.58rem;
  margin-top: 3rem;
}

@media (max-width: 900px) {
  .clue-stage {
    height: 590px;
  }

  .memory-slips {
    left: -30px;
    transform: scale(0.78);
    transform-origin: left top;
  }

  .search-lens {
    left: 42%;
    transform: scale(0.78);
  }

  .candidate-shelf {
    right: -78px;
    transform: rotate(2deg) scale(0.8);
    transform-origin: right top;
  }

  .maker-shell {
    gap: 3rem;
    grid-template-columns: 1fr;
  }

  .maker-intro {
    max-width: 620px;
  }

  .case-workspace,
  .manage-grid {
    grid-template-columns: 1fr;
  }

  .manage-candidates {
    grid-row: auto;
  }
}

@media (max-width: 620px) {
  .site-header,
  body > footer {
    padding-inline: 1rem;
  }

  .site-header nav a:first-child {
    display: none;
  }

  .clue-stage {
    height: 560px;
  }

  .memory-slips {
    left: 3%;
    top: 30px;
    transform: scale(0.62);
  }

  .search-lens {
    left: calc(50% - 60px);
    top: 212px;
    transform: scale(0.62);
  }

  .candidate-shelf {
    bottom: 42px;
    right: calc(50% - 205px);
    top: auto;
    transform: scale(0.65);
  }

  .stage-caption.left {
    display: none;
  }

  .stage-caption.right {
    bottom: 14px;
    right: 1rem;
  }

  .maker-shell {
    padding-block: 4rem;
  }

  .maker {
    padding: 1.35rem;
  }

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

  .boundary-strip {
    flex-wrap: wrap;
  }

  .boundary-strip span {
    border: 0;
    padding: 0.7rem;
  }

  .case-heading,
  .manage-heading {
    align-items: start;
    flex-direction: column;
    gap: 1rem;
  }

  .clue-board {
    grid-template-columns: 1fr;
  }

  .clue-board article,
  .clue-board article:nth-child(odd),
  .clue-board article.wide {
    border-right: 0;
    grid-column: auto;
  }

  .install-card > div,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  body > footer {
    align-items: start;
    flex-direction: column;
    gap: 1rem;
  }
}

@media print {
  .site-header,
  body > footer,
  .suggestion-form,
  .report-link,
  .install-card,
  .danger-zone {
    display: none !important;
  }

  html,
  body {
    background: white;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .memory-slip {
    animation: settle 700ms ease both;
  }

  .memory-slip:nth-child(2) {
    animation-delay: 80ms;
  }

  .memory-slip:nth-child(3) {
    animation-delay: 140ms;
  }

  .memory-slip:nth-child(4) {
    animation-delay: 210ms;
  }

  @keyframes settle {
    from {
      opacity: 0;
      translate: 0 -16px;
    }
  }
}
