:root {
  color-scheme: light;
  --paper: #f6eedf;
  --paper-strong: #fff8ed;
  --ink: #102031;
  --ink-soft: #254058;
  --accent: #d45b2d;
  --accent-deep: #983518;
  --gold: #cf9b45;
  --olive: #6a7252;
  --navy: #132736;
  --navy-soft: #203b51;
  --line: rgba(16, 32, 49, 0.14);
  --line-strong: rgba(16, 32, 49, 0.24);
  --mist: rgba(255, 248, 237, 0.82);
  --shadow: 0 30px 80px rgba(17, 31, 48, 0.15);
  --shadow-soft: 0 16px 35px rgba(17, 31, 48, 0.1);
  --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: #070e18;
  background-image:
    linear-gradient(rgba(6, 12, 22, 0.62), rgba(6, 12, 22, 0.76)),
    url("./assets/backgrounds/errol-portfolio-template.jpg");
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% auto, 100% auto;
  background-attachment: fixed, fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(16, 32, 49, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 49, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 75%);
}

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 top right, rgba(207, 155, 69, 0.3), transparent 16rem),
    radial-gradient(circle at bottom left, rgba(212, 91, 45, 0.32), transparent 18rem),
    linear-gradient(135deg, #102031 0%, #173145 46%, #1d4056 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.08), transparent 45%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 14px
    );
  pointer-events: none;
}

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

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

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

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(3rem, 6vw, 5.3rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

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

.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 {
  background: linear-gradient(135deg, #f4b24b 0%, #f6cf7a 100%);
  color: #24150b;
  font-weight: 700;
  box-shadow: 0 18px 35px rgba(18, 32, 49, 0.22);
}

.ghost-button {
  background: rgba(255, 248, 237, 0.12);
  color: var(--paper-strong);
  border: 1px solid rgba(255, 248, 237, 0.18);
  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(255, 248, 237, 0.1);
  border: 1px solid rgba(255, 248, 237, 0.12);
  backdrop-filter: blur(14px);
}

.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 {
  width: 100%;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 237, 0.14);
  box-shadow: var(--shadow-soft);
}

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

.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: rgba(255, 248, 237, 0.08);
  border: 1px solid rgba(255, 248, 237, 0.12);
  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 {
  padding: 22px 22px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 248, 237, 0.84);
  box-shadow: var(--shadow-soft);
}

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

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

.filters-panel,
.timeline-panel,
.results-panel,
.page-footer {
  margin-top: 22px;
  padding: 30px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 248, 237, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.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.7rem, 2.5vw, 2.25rem);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 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 var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(212, 91, 45, 0.2);
  outline-offset: 2px;
  border-color: rgba(212, 91, 45, 0.55);
}

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

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(19, 39, 54, 0.08);
  border: 1px solid rgba(19, 39, 54, 0.12);
  color: var(--ink);
}

.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 {
  display: grid;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(19, 39, 54, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 239, 225, 0.95));
  box-shadow: 0 22px 55px rgba(19, 39, 54, 0.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 top left, rgba(207, 155, 69, 0.34), transparent 55%),
    linear-gradient(180deg, #f5efe4 0%, #ead9bf 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: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 91, 45, 0.12);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

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

.meta-tile {
  padding: 12px;
  border-radius: 16px;
  background: rgba(19, 39, 54, 0.06);
}

.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;
  background: var(--navy);
  color: var(--paper-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.link-button.secondary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 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, 255, 255, 0.45);
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
}

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

.detail-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(16, 32, 49, 0.28);
}

.detail-dialog::backdrop {
  background: rgba(12, 23, 36, 0.58);
  backdrop-filter: blur(8px);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 18px 18px 0;
  background: rgba(255, 248, 237, 0.96);
}

.close-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 0;
  background: rgba(255, 248, 237, 0.96);
}

.detail-visuals {
  display: grid;
  grid-template-columns: 1fr 0.55fr;
  gap: 12px;
  padding: 18px 18px 24px;
  background: linear-gradient(180deg, rgba(19, 39, 54, 0.05), rgba(19, 39, 54, 0.02));
}

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

.detail-visuals figure {
  margin: 0;
}

.detail-visuals img {
  object-fit: cover;
  border-radius: 22px;
}

.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(19, 39, 54, 0.07);
}

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

.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;
  }

  .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;
  }

  .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) {
  .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,
  .detail-visuals {
    grid-template-columns: 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));
  }

  .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;
  }
}
