:root {
  --ink: #16130f;
  --paper: #f4efe6;
  --paper-2: #e7e0d4;
  --red: #c23b2e;
  --gold: #e7c47a;
  --muted: #3e3934;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --line: rgba(22, 19, 15, 0.14);
  --serif: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
:focus { scroll-margin-top: 80px; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  z-index: 2;
}
.mark {
  font-family: var(--serif);
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 18px;
}
.mark span { color: var(--red); margin-left: 6px; font-size: 13px; letter-spacing: 0.18em; }
.mast nav { display: flex; gap: 16px; }
.mast nav a { text-decoration: none; font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

main { padding: 28px 20px 88px; max-width: 1080px; margin: 0 auto; }
body:has(.ring) main { padding-bottom: 150px; }
h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.3;
  margin: 8px 0 16px;
  letter-spacing: 0;
}
.kicker {
  margin: 0;
  color: var(--red);
  letter-spacing: 0.04em;
  font-size: 13px;
}
.deck { font-size: 18px; max-width: 38em; }
.search { margin: 28px 0 8px; }

.feature-card a, .card a {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
}
.feature-card a > div { order: 1; }
.feature-card a > .media { order: 2; }
.feature-card img, .card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 28%;
  background: var(--paper-2);
}
.feature-card img { max-height: 46vh; aspect-ratio: 4 / 5; }
.card time, .feature-card time, .reader figcaption {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.card h2, .feature-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.35;
  margin: 4px 0;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.tags li {
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.archive { list-style: none; padding: 0; display: grid; gap: 28px; }
.empty { color: var(--muted); }

.reader { display: grid; gap: 28px; margin-top: 12px; }
.reader figure { margin: 0; }
.reader img {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 18px 40px rgba(22, 19, 15, 0.12);
}
.reader figcaption {
  max-width: 520px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.progress {
  position: sticky;
  top: 61px;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 3;
}
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row a, .share-row button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
}
.share-row a:hover, .share-row button:hover { background: var(--ink); color: var(--paper); }
.sources ol { padding-left: 1.2em; }
.sources li { margin: 10px 0; }
.sources span { display: block; color: var(--muted); font-size: 13px; }
.fine { color: var(--muted); font-size: 13px; }
.colophon {
  border-top: 1px solid var(--line);
  padding: 24px 20px 48px;
  color: var(--muted);
  font-size: 13px;
  max-width: 1080px;
  margin: 0 auto;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.float-field { position: relative; margin: 18px 0 8px; }
.float-field input {
  width: min(100%, 420px);
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font: inherit;
  padding: 16px 0 8px;
  border-radius: 0;
}
.float-field label {
  position: absolute;
  left: 0;
  top: 16px;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left center;
  transition: transform 180ms ease, color 180ms ease;
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  transform: translateY(-20px) scale(0.78);
  color: var(--red);
}
.float-field.is-shake { animation: shake 320ms ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
}

.filters { display: flex; gap: 8px; margin: 8px 0 22px; }
.chip, .btn, .heart {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
}
.chip, .btn { min-height: 44px; padding: 8px 16px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.chip.is-on, .btn { background: var(--ink); color: var(--paper); }
.card-top { display: flex; align-items: center; gap: 8px; }
.heart {
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 50%;
  padding: 0;
}
.heart svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; transform: translateY(1px); }
.heart.is-on svg { fill: var(--red); stroke: var(--red); }
.heart.is-pop { animation: pop 280ms cubic-bezier(.2, .8, .2, 1); }
.particle {
  position: fixed;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
  z-index: 25;
  opacity: 1;
}

.badge-new {
  background: var(--red);
  color: white;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 99px;
}
.badge-new.is-in { animation: pop 280ms cubic-bezier(.2, .8, .2, 1); }
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.press { position: relative; overflow: hidden; transition: transform 150ms var(--ease-out); }
.press:active { transform: scale(0.97); }
.ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(231, 196, 122, 0.55);
  transform: scale(0);
  opacity: 0.8;
  pointer-events: none;
  animation: ripple 350ms ease-out forwards;
}
@keyframes ripple { to { transform: scale(16); opacity: 0; } }

.media { position: relative; display: block; overflow: hidden; background: #e6dfd2; }
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.15s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.media img { opacity: 0; transition: opacity 280ms ease; }
.media.is-ready img { opacity: 1; }
.media.is-ready::after { animation: none; opacity: 0; transition: opacity 280ms ease; }
.media.is-error::before {
  content: "画像を読み込めません";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 1;
}

.title-row { display: flex; align-items: flex-start; gap: 12px; }
.title-row h1 { flex: 1; }
.title-row .heart { flex: none; margin-top: 12px; }

.progress {
  position: sticky;
  top: 61px;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 4;
}
.ring {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  z-index: 5;
  display: grid;
  place-items: center;
}
.ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 2.5; }
.ring-track { stroke: rgba(22, 19, 15, 0.15); }
.ring-value { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 94.2; stroke-dashoffset: 94.2; }
.ring-check {
  position: absolute;
  font-size: 18px;
  color: var(--red);
  opacity: 0;
  transform: scale(0.6);
}
.ring.is-done .ring-check { animation: pop 280ms cubic-bezier(.2, .8, .2, 1) forwards; }

.done {
  position: fixed;
  left: 16px;
  right: 76px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 5;
  margin: 0;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
.done p { margin: 0 0 8px; font-family: var(--serif); }
.done.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 280ms ease, transform 280ms cubic-bezier(.2, .8, .2, 1);
}

.sheet-root { position: fixed; inset: 0; z-index: 30; }
.sheet-dim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(22, 19, 15, 0.46);
  opacity: 0;
  transition: opacity 280ms ease;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 10px;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform 320ms var(--ease-drawer);
}
.sheet h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; }
.sheet-root.is-in .sheet-dim { opacity: 1; }
.sheet-root.is-in .sheet { transform: translateY(0); }

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  white-space: nowrap;
  transform: translate(-50%, -180%);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(.22, .8, .2, 1), opacity 280ms ease;
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float-field.is-shake,
  .badge-new.is-in,
  .heart.is-pop,
  .ripple,
  .media::after { animation: none; }
  .media img { opacity: 1; transition: none; }
  .sheet, .toast, .done, .press, .float-field label { transition: none; }
}

@media (min-width: 800px) {
  .feature-card a { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; align-items: end; gap: 36px; }
  .feature-card .media, .feature-card a > div { order: 0; }
  .archive { grid-template-columns: 1fr 1fr; }
  main { padding-top: 48px; }
}
