:root {
  color-scheme: light;
  --paper: #efe3d1;
  --paper-strong: #fff7ec;
  --ink: #14182a;
  --ink-soft: #32416b;
  --accent: #ef5136;
  --accent-deep: #8e0f1d;
  --gold: #ffd166;
  --olive: #70644b;
  --chrome: #8fd4ff;
  --navy: #10163d;
  --navy-soft: #1c2f7a;
  --line: rgba(38, 56, 130, 0.16);
  --line-strong: rgba(38, 56, 130, 0.28);
  --mist: rgba(255, 247, 236, 0.84);
  --shadow: 0 34px 90px rgba(4, 8, 28, 0.34);
  --shadow-soft: 0 18px 42px rgba(8, 13, 35, 0.2);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: #050817;
  background-image:
    radial-gradient(circle at 50% 84%, rgba(239, 81, 54, 0.36), transparent 22%),
    linear-gradient(180deg, rgba(22, 56, 214, 0.28), rgba(8, 11, 28, 0.78) 46%, rgba(10, 6, 10, 0.9) 100%),
    url("./assets/backgrounds/errol-portfolio-template.jpg");
  background-position: center 86%, center top, center top;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 100% auto, 100% auto, 100% auto;
  background-attachment: fixed, fixed, fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(180deg, rgba(146, 201, 255, 0.24), transparent 28%),
    url("./assets/backgrounds/classic-motu-art.jpg");
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  background-size: min(520px, 54vw) auto, min(520px, 54vw) auto;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 74%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    repeating-conic-gradient(
      from -18deg at 50% 88%,
      rgba(255, 86, 51, 0.22) 0 4deg,
      transparent 4deg 11deg
    ),
    radial-gradient(circle at 50% 88%, rgba(255, 72, 44, 0.22), transparent 26%),
    linear-gradient(rgba(29, 47, 122, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 47, 122, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  mask-image: linear-gradient(180deg, transparent 16%, rgba(0, 0, 0, 0.76) 42%, rgba(0, 0, 0, 0.96) 100%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero,
.filters-panel,
.timeline-panel,
.results-panel,
.insight-strip,
.page-footer {
  position: relative;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 28px;
  padding: 42px;
  border-radius: calc(var(--radius-xl) + 4px);
  color: var(--paper-strong);
  background:
    radial-gradient(circle at 50% 115%, rgba(255, 77, 51, 0.88), transparent 28%),
    radial-gradient(circle at 16% 8%, rgba(143, 212, 255, 0.26), transparent 18rem),
    linear-gradient(180deg, #204fff 0%, #171b58 34%, #090c1e 66%, #26060f 100%);
  border: 1px solid rgba(143, 212, 255, 0.16);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -3% -1% -3%;
  height: 38%;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 72, 44, 0.76), transparent 54%),
    linear-gradient(180deg, rgba(255, 214, 120, 0.1), rgba(0, 0, 0, 0));
  clip-path: polygon(
    0 100%,
    0 76%,
    5% 64%,
    10% 82%,
    15% 48%,
    20% 92%,
    27% 32%,
    31% 84%,
    38% 58%,
    44% 95%,
    50% 24%,
    55% 88%,
    61% 52%,
    67% 78%,
    74% 40%,
    79% 92%,
    85% 66%,
    90% 81%,
    95% 56%,
    100% 72%,
    100% 100%
  );
  opacity: 0.5;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(143, 212, 255, 0.16), transparent 38%, transparent 66%, rgba(255, 99, 71, 0.08) 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-copy,
.hero-gallery {
  position: relative;
  z-index: 1;
}

.hero-copy {
  padding-right: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(222, 236, 255, 0.82);
}

.section-kicker {
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  max-width: none;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 24px rgba(14, 31, 88, 0.34),
    0 0 28px rgba(255, 87, 59, 0.14);
}

.hero-text,
.section-copy {
  max-width: 60ch;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(244, 247, 255, 0.86);
}

.hero-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 250px);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
}

.hero-story .hero-text {
  margin: 0;
}

.hero-memory {
  width: 100%;
  margin: 0;
  aspect-ratio: 15 / 13;
  justify-self: end;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(143, 212, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.hero-memory img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.section-copy {
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.ghost-button,
.link-button,
.placeholder-link,
.timeline-chip,
.filter-pill {
  border-radius: 999px;
}

.primary-link,
.ghost-button,
.link-button,
.placeholder-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.primary-link {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, #ffd976 0%, #fff5d7 34%, #96d8ff 100%);
  color: #101739;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(8, 14, 44, 0.32);
}

.ghost-button {
  background: rgba(16, 22, 61, 0.34);
  color: var(--paper-strong);
  border: 1px solid rgba(143, 212, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.primary-link:hover,
.ghost-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.hero-stats,
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats {
  margin-top: 26px;
}

.stat-pill {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(10, 16, 44, 0.34);
  border: 1px solid rgba(143, 212, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-pill strong,
.insight-card strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.1;
}

.stat-pill span,
.insight-card span {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  color: rgba(255, 248, 237, 0.76);
}

.hero-gallery {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  align-content: center;
  width: min(100%, 620px);
  justify-self: end;
}

.hero-feature-shell {
  position: relative;
  width: 100%;
}

.hero-feature {
  width: 100%;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(143, 212, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.hero-feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-badge {
  position: absolute;
  top: -22px;
  right: -14px;
  width: clamp(76px, 12vw, 98px);
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 14px 18px rgba(7, 12, 34, 0.34));
  transform: rotate(10deg);
}

.hero-random-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  justify-self: stretch;
}

.hero-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 34, 91, 0.56), rgba(91, 14, 20, 0.42));
  border: 1px solid rgba(143, 212, 255, 0.14);
  box-shadow: var(--shadow-soft);
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  padding: 0;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.insight-card {
  display: block;
  width: 100%;
  padding: 22px 22px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 125%, rgba(239, 81, 54, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(143, 212, 255, 0.16), transparent 16rem),
    linear-gradient(180deg, rgba(251, 246, 239, 0.95), rgba(233, 222, 211, 0.92));
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  appearance: none;
}

.insight-card strong {
  color: var(--navy-soft);
}

.insight-card span {
  color: var(--ink-soft);
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(8, 13, 35, 0.22);
}

.insight-card.active {
  border-color: rgba(239, 81, 54, 0.24);
  background:
    radial-gradient(circle at 50% 122%, rgba(239, 81, 54, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(143, 212, 255, 0.22), transparent 16rem),
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(238, 224, 206, 0.94));
  box-shadow: 0 24px 54px rgba(10, 15, 36, 0.24);
}

.filters-panel,
.timeline-panel,
.results-panel,
.page-footer {
  margin-top: 22px;
  padding: 30px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 122%, rgba(239, 81, 54, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(143, 212, 255, 0.14), transparent 18rem),
    linear-gradient(180deg, rgba(250, 246, 240, 0.95), rgba(232, 221, 210, 0.92));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.filters-panel::before,
.results-panel::before,
.page-footer::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #78cfff 0%, #fff7e2 42%, #ff6947 100%);
  opacity: 0.9;
}

.filters-panel {
  position: sticky;
  top: 12px;
  z-index: 4;
}

.section-heading h2,
.results-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1;
}

.section-heading.compact h2 {
  font-size: clamp(1.55rem, 2.2vw, 2rem);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 9px;
}

.field span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input,
.field select {
  min-height: 52px;
  width: 100%;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(38, 56, 130, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(74, 136, 255, 0.22);
  outline-offset: 2px;
  border-color: rgba(74, 136, 255, 0.55);
}

.active-filters {
  margin-top: 18px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(16, 22, 61, 0.08);
  border: 1px solid rgba(29, 47, 122, 0.12);
  color: var(--ink);
}

.filter-pill-button {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.filter-pill strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  cursor: pointer;
}

.timeline-chip.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: white;
  border-color: transparent;
}

.timeline-chip .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(16, 32, 49, 0.08);
}

.timeline-chip.active .count {
  background: rgba(255, 248, 237, 0.18);
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.results-meta {
  max-width: 36ch;
  margin: 0;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.archive-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(42, 62, 147, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 231, 214, 0.96));
  box-shadow: 0 22px 55px rgba(11, 16, 38, 0.16);
}

.archive-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #7ed0ff 0%, #fff7e0 44%, #ff6746 100%);
  opacity: 0.88;
  z-index: 1;
}

.card-media {
  position: relative;
  aspect-ratio: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 50% 115%, rgba(239, 81, 54, 0.28), transparent 38%),
    radial-gradient(circle at top center, rgba(143, 212, 255, 0.26), transparent 48%),
    linear-gradient(180deg, #1d2b76 0%, #171b43 48%, #651018 100%);
}

.card-media .main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card-media .origin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card-media .origin-thumb {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(26%, 54px);
  aspect-ratio: 1;
  border-radius: 14px;
  border: 3px solid rgba(255, 248, 237, 0.92);
  box-shadow: 0 10px 25px rgba(16, 32, 49, 0.24);
  overflow: hidden;
  background: rgba(255, 248, 237, 0.8);
}

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

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.18;
}

.card-wave {
  align-self: start;
  white-space: pre-line;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(239, 81, 54, 0.14);
  background: linear-gradient(135deg, rgba(143, 212, 255, 0.18), rgba(239, 81, 54, 0.18));
  color: #7a1223;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meta-tile {
  padding: 12px;
  border-radius: 16px;
  background: rgba(24, 35, 89, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.meta-tile span {
  display: block;
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.meta-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 0.94rem;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card-notes {
  display: grid;
  gap: 8px;
}

.card-notes strong {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-notes p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.link-button {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(143, 212, 255, 0.16);
  background: linear-gradient(135deg, #10163d 0%, #1c3f9b 100%);
  color: var(--paper-strong);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(10, 14, 38, 0.18);
}

.link-button.secondary {
  border-color: rgba(255, 123, 95, 0.18);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.link-button.amazon {
  border-color: rgba(116, 190, 118, 0.2);
  background: linear-gradient(135deg, #49a35e 0%, #216839 100%);
}

.placeholder-link {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  background: rgba(16, 32, 49, 0.08);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: default;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(19, 39, 54, 0.08);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.detail-trigger {
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font-weight: 700;
  cursor: pointer;
}

.empty-state {
  margin-top: 22px;
  padding: 28px;
  border-radius: 24px;
  border: 1px dashed var(--line-strong);
  text-align: center;
  background: rgba(255, 252, 248, 0.56);
}

.page-footer {
  display: grid;
  gap: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.page-footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.page-footer strong {
  color: var(--ink);
}

.page-footer-websites {
  display: grid;
  gap: 12px;
}

.page-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.page-footer-link {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.page-footer-link:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.page-footer-instagram {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(195, 62, 107, 0.18);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 10rem),
    linear-gradient(135deg, rgba(23, 27, 88, 0.92) 0%, rgba(90, 47, 138, 0.92) 38%, rgba(195, 62, 107, 0.9) 72%, rgba(255, 157, 75, 0.88) 100%);
  color: var(--paper-strong);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(10, 14, 38, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.page-footer-instagram:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(10, 14, 38, 0.18);
}

.page-footer-instagram-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.page-footer-instagram-label {
  color: var(--paper-strong);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-footer-disclaimer {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(38, 56, 130, 0.1);
  font-size: 0.83rem;
  line-height: 1.55;
  color: rgba(29, 47, 122, 0.78);
}

.detail-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 32px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 44px 120px rgba(5, 8, 24, 0.44);
}

.detail-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 82%, rgba(239, 81, 54, 0.22), transparent 26%),
    rgba(7, 10, 25, 0.72);
  backdrop-filter: blur(10px);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0;
  padding: 18px 18px 0;
  background:
    linear-gradient(180deg, rgba(248, 242, 234, 0.98), rgba(245, 237, 226, 0.96));
}

.close-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(38, 56, 130, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 0;
  background:
    radial-gradient(circle at 50% 120%, rgba(239, 81, 54, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(252, 246, 239, 0.98), rgba(238, 227, 214, 0.96));
}

.detail-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 18px 24px;
  background:
    radial-gradient(circle at 50% 116%, rgba(239, 81, 54, 0.18), transparent 30%),
    radial-gradient(circle at top left, rgba(143, 212, 255, 0.18), transparent 18rem),
    linear-gradient(180deg, rgba(16, 22, 61, 0.08), rgba(16, 22, 61, 0.03));
  align-items: start;
}

.detail-visuals figure,
.detail-visuals img {
  width: 100%;
  height: 100%;
}

.detail-visuals figure {
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(143, 212, 255, 0.12);
  background: rgba(255, 248, 237, 0.82);
  box-shadow: var(--shadow-soft);
}

.detail-visuals img {
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.detail-status-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(143, 212, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 249, 242, 0.94), rgba(240, 229, 215, 0.92));
  box-shadow: var(--shadow-soft);
}

.detail-status-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: center;
}

.detail-status-item.is-active {
  color: var(--ink);
}

.detail-status-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(38, 56, 130, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: transparent;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.detail-status-item.is-active .detail-status-box {
  border-color: rgba(239, 81, 54, 0.28);
  background: linear-gradient(135deg, #8fd4ff 0%, #fff7e2 42%, #ef5136 100%);
  color: #12204f;
  font-weight: 800;
}

.detail-status-label {
  line-height: 1.2;
}

.detail-copy {
  padding: 20px 22px 28px;
}

.detail-copy h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 0.98;
}

.detail-copy p {
  line-height: 1.7;
}

.detail-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.detail-data-grid .meta-tile {
  background: rgba(24, 35, 89, 0.07);
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-video {
  margin-top: 18px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(143, 212, 255, 0.16);
  background: rgba(13, 19, 52, 0.9);
  box-shadow: var(--shadow-soft);
}

.detail-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.detail-video-fallback {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(143, 212, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 249, 242, 0.94), rgba(240, 229, 215, 0.92));
  box-shadow: var(--shadow-soft);
}

.detail-video-fallback p {
  margin: 0;
}

.noscript-note {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  padding: 16px;
  border-radius: 18px;
  background: var(--navy);
  color: var(--paper-strong);
}

@media (max-width: 1150px) {
  .page-shell {
    width: min(100vw - 24px, 1300px);
  }

  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-right: 0;
  }

  .controls-grid,
  .insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-gallery {
    grid-template-columns: 1fr;
    justify-self: center;
  }

  .hero-badge {
    top: -18px;
    right: -10px;
    width: 88px;
  }

  .filters-panel {
    position: static;
  }

  .results-header {
    align-items: start;
    flex-direction: column;
  }

  .results-meta {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .detail-dialog {
    width: min(calc(100vw - 12px), 1120px);
    max-height: calc(100vh - 12px);
    border-radius: 24px;
  }

  .page-shell {
    width: min(100vw - 16px, 1300px);
    padding-top: 12px;
  }

  .hero,
  .filters-panel,
  .timeline-panel,
  .results-panel,
  .page-footer {
    padding: 22px;
    border-radius: 24px;
  }

  .controls-grid,
  .insight-strip,
  .detail-data-grid {
    grid-template-columns: 1fr;
  }

  .detail-visuals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-gallery {
    grid-template-columns: 1fr;
    width: 100%;
    justify-self: center;
  }

  .hero-random-strip {
    gap: 6px;
    width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-story {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 140px);
    gap: 12px;
  }

  .hero-memory {
    width: 100%;
  }

  .hero-badge {
    top: -14px;
    right: -8px;
    width: 72px;
  }

  .card-media .origin-thumb {
    width: min(24%, 52px);
  }

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

  .card-footer {
    align-items: start;
    flex-direction: column;
  }

  .detail-copy,
  .detail-visuals {
    padding: 18px;
  }
}
