:root {
  color-scheme: light;
  --ink: #1c1d20;
  --muted: #61656d;
  --line: #d8dce2;
  --paper: #f7f6f1;
  --panel: #ffffff;
  --accent: #0b6f68;
  --accent-2: #c9502f;
  --accent-3: #2f5f9f;
  --shadow: 0 18px 42px rgba(28, 29, 32, 0.12);
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(247, 246, 241, 0.92);
  border-bottom: 1px solid rgba(28, 29, 32, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.result-meta button,
.close-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
}

.icon-button {
  min-width: 50px;
  min-height: 42px;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(74vh, 760px);
  border-bottom: 1px solid rgba(28, 29, 32, 0.12);
}

.hero-visual {
  position: relative;
  grid-area: 1 / 1;
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: min(74vh, 760px);
  object-fit: cover;
  filter: saturate(0.92) contrast(0.95);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(247, 246, 241, 0.98) 0%, rgba(247, 246, 241, 0.94) 32%, rgba(247, 246, 241, 0.46) 58%, rgba(247, 246, 241, 0.08) 82%);
  pointer-events: none;
}

.hero-copy {
  grid-area: 1 / 1;
  position: relative;
  max-width: 720px;
  align-self: end;
  padding: 0 clamp(22px, 5vw, 64px) clamp(40px, 8vw, 88px);
}

.hero-copy p:first-child,
.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 620px;
  margin: 22px 0 0;
  color: #3e4249;
  font-size: 18px;
  line-height: 1.8;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(150px, 0.55fr));
  gap: 12px;
  padding: 24px clamp(18px, 4vw, 48px) 10px;
}

.toolbar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(18px, 4vw, 48px) 18px;
  color: var(--muted);
}

.result-meta button {
  min-height: 38px;
  padding: 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 48px) 64px;
}

.card {
  overflow: hidden;
  min-height: 420px;
  padding: 0;
  border: 1px solid rgba(28, 29, 32, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 2px 0 rgba(28, 29, 32, 0.04);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  outline: none;
}

.thumb {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  background: #d9ddd9;
}

.thumb img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.thumb-fallback {
  display: grid;
  align-content: end;
  min-height: 190px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
}

.thumb-fallback strong {
  max-width: 10ch;
  font-size: 44px;
  line-height: 0.96;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f8;
}

.card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

dialog {
  width: min(1760px, calc(100vw - 24px));
  height: min(980px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 17, 20, 0.52);
}

.detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.55fr);
  height: 100%;
  overflow: auto;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 46px;
  height: 46px;
  font-size: 26px;
}

.detail-media {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: clamp(18px, 3vw, 40px);
  background: #ececea;
}

.detail-media img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  box-shadow: 0 12px 36px rgba(28, 29, 32, 0.16);
}

.detail-media .thumb-fallback {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.detail-body {
  align-self: stretch;
  overflow: auto;
  padding: clamp(42px, 5vw, 72px) clamp(26px, 4vw, 48px);
}

.detail-body h2 {
  margin: 0 0 14px;
  font-size: 36px;
  line-height: 1.08;
}

.detail-body > p {
  color: var(--muted);
  line-height: 1.75;
}

.detail-sections {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.detail-sections h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: var(--accent);
  text-transform: uppercase;
}

.detail-sections p {
  margin: 0;
  line-height: 1.75;
}

.empty {
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 860px) {
  .toolbar,
  .detail {
    grid-template-columns: 1fr;
  }

  dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .hero {
    min-height: 640px;
  }

  .hero-visual::after {
    background: linear-gradient(180deg, rgba(247, 246, 241, 0.9), rgba(247, 246, 241, 0.78));
  }

  .detail-media,
  .detail-media img,
  .detail-media .thumb-fallback {
    min-height: 300px;
    max-height: none;
  }
}
