:root {
  color-scheme: dark;
  --bg: #11141b;
  --surface: #1b2029;
  --surface-2: #242a35;
  --line: #5e4b31;
  --gold: #d5aa55;
  --gold-bright: #f1cf7b;
  --text: #f6ecd4;
  --muted: #b9b3a4;
  --paper: #e9dcc0;
  --ink: #302820;
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(187, 137, 61, .16), transparent 36rem),
    linear-gradient(180deg, #171b24 0, var(--bg) 46rem);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

button, summary, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 10px;
  max-width: 1240px;
  margin: 0 auto;
  padding: max(15px, env(safe-area-inset-top)) 16px 15px;
  border-bottom: 1px solid rgba(213, 170, 85, .32);
}

.topbar h1 { margin: 1px 0 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(1.05rem, 4.7vw, 1.45rem); line-height: 1.3; letter-spacing: .02em; }
.eyebrow, .section-kicker { margin: 0; color: var(--gold-bright); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.back-link, .count { min-height: 44px; display: grid; place-items: center; border: 1px solid rgba(213, 170, 85, .38); border-radius: 8px; color: var(--text); text-decoration: none; font-size: .82rem; font-weight: 700; background: rgba(0,0,0,.18); }
.count { color: var(--gold-bright); }

main { width: min(100% - 28px, 1200px); margin: 0 auto; padding: 24px 0 48px; }

.intro { display: grid; gap: 10px; margin-bottom: 20px; }
.intro h2 { margin: 2px 0 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(1.5rem, 7vw, 2.35rem); line-height: 1.25; }
.intro > p { margin: 0; max-width: 47rem; color: var(--muted); font-size: .95rem; }

.proposal-grid, .reference-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.proposal-card, .reference-card {
  overflow: hidden;
  border: 1px solid rgba(213, 170, 85, .38);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(45,51,64,.96), rgba(24,28,37,.98));
  box-shadow: 0 15px 36px rgba(0,0,0,.28);
}

.proposal-card--recommended { border-color: rgba(241, 207, 123, .82); box-shadow: 0 0 0 1px rgba(241, 207, 123, .18), 0 18px 42px rgba(0,0,0,.34); }
.round-heading { display: flex; flex-direction: column; gap: 4px; margin: 24px 2px 12px; }
.round-heading--older { margin-top: 38px; }
.round-heading span { color: var(--gold-bright); font-size: .7rem; font-weight: 800; letter-spacing: .13em; }
.round-heading h2 { margin: 0; color: var(--paper); font-family: Georgia, "Yu Mincho", serif; font-size: 1.25rem; line-height: 1.35; }
.round-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.card-heading { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 12px; }
.proposal-label { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.45rem; font-weight: 800; }
.status { padding: 4px 9px; border: 1px solid #676d78; border-radius: 999px; color: #d3d6dc; font-size: .75rem; font-weight: 700; }
.status--recommended { border-color: var(--gold); color: #17130b; background: var(--gold-bright); }

.image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #efe4cc;
  cursor: zoom-in;
}

.image-button img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; background: #efe4cc; }
.zoom-hint { position: absolute; right: 9px; bottom: 9px; padding: 5px 9px; border-radius: 6px; color: #fff; background: rgba(17,20,27,.8); font-size: .75rem; font-weight: 700; }
.card-copy { padding: 16px; }
.card-copy h3, .reference-card h3 { margin: 0 0 6px; color: var(--paper); font-family: Georgia, "Yu Mincho", serif; font-size: 1.2rem; line-height: 1.35; }
.card-copy p, .reference-card p { margin: 0; color: var(--muted); }
.card-copy dl { margin: 15px 0 0; }
.card-copy dl div { display: grid; grid-template-columns: 6.8rem 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.08); }
.card-copy dt { color: var(--gold); font-size: .82rem; font-weight: 700; }
.card-copy dd { margin: 0; color: #ddd8cb; font-size: .86rem; line-height: 1.55; }

.reference-section { margin-top: 30px; border: 1px solid rgba(213,170,85,.25); border-radius: 12px; background: rgba(13,16,22,.48); }
.reference-section summary { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 8px 14px; cursor: pointer; color: var(--paper); font-weight: 800; list-style: none; }
.reference-section summary::-webkit-details-marker { display: none; }
.reference-section summary small { display: block; color: #8195ae; font-size: .66rem; letter-spacing: .12em; }
.reference-grid { padding: 0 12px 12px; }
.reference-card { border-color: rgba(129,149,174,.28); }
.reference-card .image-button img { aspect-ratio: 4 / 3; }
.reference-card > div { padding: 14px; }

footer { display: flex; flex-direction: column; gap: 3px; padding: 20px 16px var(--safe-bottom); border-top: 1px solid rgba(213,170,85,.22); color: #8f918f; text-align: center; font-size: .76rem; }

dialog { width: min(96vw, 1400px); max-width: none; max-height: 94vh; padding: 42px 8px 8px; overflow: auto; border: 1px solid var(--gold); border-radius: 12px; background: #10131a; box-shadow: 0 30px 90px #000; }
dialog::backdrop { background: rgba(2,4,8,.88); backdrop-filter: blur(3px); }
#dialog-image { display: block; max-width: 100%; height: auto; margin: auto; background: #efe4cc; }
.dialog-close { position: absolute; top: 3px; right: 6px; width: 42px; height: 42px; border: 0; color: #fff; background: transparent; font-size: 2rem; line-height: 1; cursor: pointer; }

@media (min-width: 700px) {
  .intro { grid-template-columns: 1fr 1fr; align-items: end; }
  .round-heading { flex-direction: row; align-items: end; justify-content: space-between; }
  .proposal-grid, .reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { flex-direction: row; justify-content: center; gap: 28px; }
}

@media (min-width: 1080px) {
  .proposal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proposal-card--wide { grid-column: span 2; }
  .reference-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  .proposal-card { transition: transform .18s ease, border-color .18s ease; }
  .proposal-card:hover { transform: translateY(-3px); border-color: var(--gold); }
}
