/* =========================================================
   LukeRalph.ca Photo Library
   Standalone page stylesheet
   ========================================================= */

:root {
  color-scheme: dark;

  --photos-bg: #080b10;
  --photos-panel: #131821;
  --photos-panel-strong: #182030;
  --photos-input: #20293a;
  --photos-text: #f1f4f8;
  --photos-muted: #9da8b5;
  --photos-line: rgba(255, 255, 255, 0.13);
  --photos-accent: #4da3ff;
  --photos-radius: 22px;
  --photos-shadow: 0 18px 60px rgba(0, 0, 0, 0.46);

  --photos-sans:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  --photos-mono:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  background: var(--photos-bg);
  color-scheme: dark;
}

body {
  min-height: 100%;
  max-width: 100%;
}

body.photos-library-page {
  position: relative;
  margin: 0;
  overflow-x: hidden;
  color: var(--photos-text);
  font-family: var(--photos-sans);
  line-height: 1.45;
  background: var(--photos-bg);
}

body.photos-library-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      900px 520px at 16% 0%,
      rgba(77, 163, 255, 0.16),
      transparent 62%
    ),
    radial-gradient(
      780px 520px at 88% 18%,
      rgba(122, 96, 255, 0.11),
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(12, 17, 26, 0.36),
      rgba(8, 11, 16, 0.58)
    );
}

body.photos-library-page a {
  color: inherit;
  text-decoration: none;
}

body.photos-library-page button,
body.photos-library-page input {
  font: inherit;
}

/* Starfield */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Page shell */

.photos-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 28px auto 44px;
}

.photos-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--photos-line);
  border-radius: var(--photos-radius);
  background: var(--photos-panel);
  box-shadow:
    var(--photos-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Hero */

.photos-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--photos-line);
  border-radius: var(--photos-radius);
  background: var(--photos-panel-strong);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

.photos-hero-copy {
  min-width: 0;
}

.photos-eyebrow {
  margin: 0 0 6px;
  color: var(--photos-text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photos-title {
  margin: 0;
  color: var(--photos-text);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.photos-subtitle {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--photos-muted);
  font-family: var(--photos-mono);
  font-size: 14px;
  line-height: 1.55;
}

.photos-backlink {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid var(--photos-line);
  border-radius: 999px;
  color: var(--photos-muted);
  background: var(--photos-input);
  font-family: var(--photos-mono);
  font-size: 13px;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.photos-backlink:hover,
.photos-backlink:focus-visible {
  color: var(--photos-text);
  border-color: var(--photos-accent);
  background: #243653;
  transform: translateY(-1px);
}

/* Search and filters */

.photos-tools {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--photos-line);
  border-radius: var(--photos-radius);
  background: #111722;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.photos-search {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.photos-search label {
  color: var(--photos-muted);
  font-family: var(--photos-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photos-search input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--photos-line);
  border-radius: 12px;
  color: var(--photos-text);
  background: var(--photos-input);
  outline: none;
  appearance: none;
}

.photos-search input::placeholder {
  color: #7f8995;
}

.photos-search input:focus {
  border-color: var(--photos-accent);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.14);
}

.photos-search input::-webkit-search-cancel-button {
  filter: invert(1);
}

.photos-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.photos-filter {
  width: auto;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--photos-line);
  border-radius: 999px;
  color: var(--photos-text);
  background: var(--photos-input);
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.photos-filter span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--photos-muted);
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.photos-filter:hover,
.photos-filter:focus-visible,
.photos-filter.is-active {
  border-color: rgba(77, 163, 255, 0.8);
  background: #243653;
  transform: translateY(-1px);
}

.photos-filter.is-active span {
  color: var(--photos-text);
  background: rgba(77, 163, 255, 0.3);
}

/* Gallery */

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photos-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--photos-line);
  border-radius: var(--photos-radius);
  background: var(--photos-panel);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.photos-card:hover,
.photos-card:focus-within {
  border-color: rgba(77, 163, 255, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

.photos-card[hidden] {
  display: none !important;
}

.photos-open {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  background: #000;
  cursor: zoom-in;
}

.photos-open img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  transition: transform 180ms ease;
}

.photos-card:hover .photos-open img {
  transform: scale(1.015);
}

.photos-info {
  display: grid;
  gap: 5px;
  padding: 14px 15px 16px;
  background: var(--photos-panel);
}

.photos-info h2 {
  margin: 0;
  color: var(--photos-text);
  font-size: 16px;
  line-height: 1.25;
}

.photos-info p {
  margin: 0;
  color: var(--photos-muted);
  font-family: var(--photos-mono);
  font-size: 12px;
}

.photos-category {
  width: fit-content;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--photos-muted);
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--photos-mono);
  font-size: 11px;
}

/* Empty and footer */

.photos-empty {
  margin: 18px 0;
  padding: 18px;
  border: 1px dashed var(--photos-line);
  border-radius: 18px;
  color: var(--photos-muted);
  background: #111722;
}

.photos-empty code {
  color: var(--photos-text);
  font-family: var(--photos-mono);
}

.photos-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--photos-line);
  color: var(--photos-muted);
  font-family: var(--photos-mono);
  font-size: 12px;
}

/* Tablet */

@media (max-width: 980px) {
  .photos-tools {
    grid-template-columns: 1fr;
  }

  .photos-filters {
    justify-content: flex-start;
  }

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

/* Mobile */

@media (max-width: 680px) {
  .photos-shell {
    width: calc(100% - 20px);
    margin: 12px auto 30px;
  }

  .photos-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .photos-hero {
    display: grid;
    gap: 20px;
    padding: 22px;
    border-radius: 20px;
  }

  .photos-title {
    font-size: 44px;
  }

  .photos-subtitle {
    font-size: 13px;
  }

  .photos-backlink {
    width: fit-content;
  }

  .photos-tools {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    width: 100%;
    min-height: auto;
    padding: 14px;
    border-radius: 18px;
  }

  .photos-search {
    display: grid;
    width: 100%;
  }

  .photos-search input {
    display: block;
    width: 100%;
  }

  .photos-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .photos-filter {
    width: 100%;
    min-width: 0;
  }

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

@media (max-width: 430px) {
  .photos-filters {
    grid-template-columns: 1fr;
  }

  .photos-title {
    font-size: 40px;
  }
}