/* RMTM public site — typography-first, portorocha-inspired minimalism */
* { box-sizing: border-box; }
:root {
  --ink: #111111;
  --body: #333333;
  --muted: #757575;
  --line: #e6e6e6;
  --focus: #315cf5;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header, .site-main, .site-footer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left));
  min-width: 0;
}

/* Header */
.site-header {
  padding-top: clamp(20px, 4vw, 44px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
}
.wordmark {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}
.tagline { margin: 0; color: var(--muted); font-size: 14px; }

/* Filters */
.filters { margin-top: clamp(24px, 4vw, 44px); display: grid; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  min-width: 40px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.chip:hover { border-color: #b5b5b5; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Case list */
.count {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: clamp(22px, 3.5vw, 36px) 0 8px;
}
.case-list { list-style: none; margin: 0; padding: 0; }
.case-item { border-top: 1px solid var(--line); }
.case-item:last-child { border-bottom: 1px solid var(--line); }
.case-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: clamp(14px, 3vw, 28px);
  padding: clamp(18px, 3vw, 30px) 0;
  text-decoration: none;
  align-items: start;
}
.case-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #f2f2f2;
  border-radius: 2px;
}
.case-thumb-empty { display: block; }
.case-text { display: block; min-width: 0; }
.case-title {
  display: block;
  font-size: clamp(24px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.case-row:hover .case-title { text-decoration: underline; text-decoration-thickness: 2px; }
.case-meta {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.case-summary { display: block; margin-top: 6px; color: var(--body); font-size: 15px; max-width: 640px; }

.empty { padding: 56px 0; }
.empty p { margin: 0 0 16px; }

/* Case detail */
.draft-note {
  margin-top: 20px;
  background: #fff5df;
  color: #9b6411;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 6px;
}
.case-h1 {
  font-size: clamp(34px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: clamp(24px, 5vw, 56px) 0 0;
  overflow-wrap: anywhere;
}
.case-meta-line {
  margin: 14px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.case-meta-line a { color: inherit; text-underline-offset: 3px; }
.lead {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.55;
  color: var(--body);
  max-width: 760px;
  margin: 14px 0 0;
}

/* Before/after slider */
.ba { margin-top: clamp(26px, 4vw, 44px); }
.ba-frame {
  --pos: 50%;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #f2f2f2;
}
.ba-frame:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.ba-divider::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 1px;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.ba-tag {
  position: absolute;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.ba-tag-then { left: 10px; }
.ba-tag-now { right: 10px; }
.photo-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* Periods */
.period { margin-top: clamp(40px, 7vw, 72px); }
.period-label {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin: 0 0 18px;
}
.photo { margin: 0 0 14px; }
.photo img { width: 100%; border-radius: 4px; background: #f2f2f2; }
.photo figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.period-body { max-width: 760px; font-size: 16px; color: #222; }

.refs ul { padding-left: 18px; font-size: 14px; color: var(--body); }
.refs li { margin-bottom: 4px; overflow-wrap: anywhere; }

.case-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: clamp(40px, 7vw, 72px);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 14px;
}
.case-nav-link { text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.case-nav-link:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0 0 6px; max-width: 560px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
