:root {
  --page-bg: #0b0b0d;
  --shade-1: #232328;
  --shade-2: #1d1d21;
  --shade-3: #28282e;
  --shade-4: #1a1a1e;
  --shade-5: #7b7b7b;
  --nav-shade-1: #030304;
  --nav-shade-2: #08080a;
  --nav-shade-3: #0d0d10;
  --nav-shade-4: #131316;
  --nav-text: #f3f0e6;
  --center-bg: #ff5b3d;
  --info-bg: #304c92;
  --accent: #ff5b3d;
  --center-text: #fffaf5;
  --text-color: #ece9df;

  --font-size-2xs: 0.8rem;
  --font-size-xs: 0.9rem;
  --font-size-sm: 0.95rem;
  --font-size-base: 1rem;
  --font-size-md: 1.15rem;
  --font-size-lg: 1.3rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-display: clamp(1.75rem, 5vw, 2.5rem);

  --font-weight-regular: 500;
  --font-weight-medium: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background: var(--page-bg);
  overflow: hidden;
}

a {
  color: var(--text-color);
  text-decoration: underline;
}

.grid {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page-bg);
}

.site-nav {
  display: block;
}

.tile {
  position: absolute;
  border-radius: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  will-change: transform;
}

.tile-content {
  cursor: default;
}

.tile-content:hover {
  transform: scale(0.965);
  filter: brightness(1.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

.tile-shade-1 { background-color: var(--shade-1); }
.tile-shade-2 { background-color: var(--shade-2); }
.tile-shade-3 { background-color: var(--shade-3); }
.tile-shade-4 { background-color: var(--shade-4); }

.tile-info-host {
  container-type: inline-size;
  display: flex;
  align-items: center;
  padding: 1.1rem;
  overflow: hidden;
  background-color: var(--info-bg);
}

body[data-route="about"],
body[data-route="photography"],
body[data-route="soapbox"] {
  overflow-y: auto;
  overflow-x: hidden;
}

body[data-route="about"] {
  --info-bg: #304c92;
}

body[data-route="photography"] {
  --info-bg: #4b2c82;
}

body[data-route="soapbox"] {
  --info-bg: #a3be8c;
}

.tile-info__heading {
  margin: 0 0 0.4em;
  font-weight: var(--font-weight-black);
  font-size: var(--font-size-lg);
}

.tile-info__body {
  margin: 0;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  line-height: 1.4;
  color: var(--text-color);
  opacity: 0.85;
}

.tile-link-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.1rem;
  text-align: center;
  text-decoration: none;
  color: var(--nav-text);
  background-color: var(--info-bg);
}

.tile-link-host__title {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.tile-link-host__subtitle {
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-md);
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.topic-nav-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  letter-spacing: 0.05em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--center-text);
  background-color: var(--accent);
  border-radius: 8px;
  border: solid 1px var(--shade-3);
  transition: background-color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

a.topic-nav-cell:hover {
  filter: brightness(1.1);
  text-decoration: underline;
}

span.topic-nav-cell[aria-disabled="true"] {
  opacity: 0.35;
}

.topic-nav-row {
  display: none;
  gap: 6px;
  padding: 0 3px;
}

@media (max-width: 700px) {
  .topic-nav-row {
    display: flex;
  }
}

.topic-nav-row .topic-nav-cell {
  flex: 1;
  min-height: 56px;
  color: var(--nav-text);
  background-color: var(--shade-2);
}

.nav-overlay {
  position: fixed;
  top: 9px;
  right: 9px;
  z-index: 20;
  display: flex;
  gap: 6px;
}

@media (max-width: 700px) {
  .nav-overlay {
    display: none;
  }
}

.nav-overlay .topic-nav-cell {
  height: 44px;
  min-width: 44px;
  padding: 0 1.1rem;
  color: var(--nav-text);
  background-color: var(--nav-shade-3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.nav-overlay a.topic-nav-cell:hover {
  background-color: var(--nav-shade-4);
  filter: brightness(1.6);
  text-decoration: none;
  transform: scale(0.97);
}

.nav-overlay span.topic-nav-cell[aria-disabled="true"] {
  color: var(--shade-5);
  background-color: var(--nav-shade-2);
  opacity: 1;
}

.tile-picture-host {
  padding: 0;
  overflow: hidden;
  border: none;
  background: var(--shade-2);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}

.tile-picture-host img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tile-picture-host__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  color: var(--nav-text);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-regular);
  line-height: 1.35;
  text-align: left;
}

.mobile-nav-bar {
  display: none;
  padding: 3px;
}

@media (max-width: 700px) {
  .mobile-nav-bar {
    display: block;
  }
}

.mobile-nav-bar .tile {
  position: static;
}

button.mobile-nav-bar__button {
  width: 100%;
  height: clamp(64px, calc(14vmin - 6px), 90px);
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0 1.25rem;
  background-color: var(--shade-4);
}

.mobile-nav-bar__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
}

.mobile-nav-bar__label {
  flex: 1;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 3px 3px;
}

.mobile-stack .tile {
  position: static;
  width: 100%;
}

.mobile-stack button.tile-picture-host {
  position: relative;
}

.mobile-stack .topic-nav-row {
  margin: 0 -3px;
}

.mobile-stack .tile-picture-host img {
  height: auto;
}

.mobile-stack .tile-info-host,
.mobile-stack .tile-link-host {
  min-height: 200px;
}


.tile-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.08em;
  font-size: var(--font-size-lg);
  text-align: center;
  padding: 0.5rem;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}

.tile-nav:hover {
  filter: brightness(1.6);
  transform: scale(0.97);
}

.nav-shade-1 { background-color: var(--nav-shade-1); }
.nav-shade-2 { background-color: var(--nav-shade-2); }
.nav-shade-3 { background-color: var(--nav-shade-3); }
.nav-shade-4 { background-color: var(--nav-shade-4); }

.tile-nav:focus-visible {
  outline: 2px solid var(--center-bg);
  outline-offset: -4px;
}

.hamburger-tile {
  border: 2px solid var(--shade-5);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--nav-shade-1);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu__close {
  align-self: flex-end;
  border: none;
  background: none;
  color: var(--nav-text);
  font-family: inherit;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.mobile-menu__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--nav-text);
  text-decoration: none;
  text-transform: capitalize;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  font-size: var(--font-size-xl);
  transition: filter 0.2s ease;
}

body[data-route] .mobile-menu__link {
  background-color: var(--shade-4);
}

.mobile-menu__link:hover,
.mobile-menu__link:active {
  filter: brightness(1.5);
}

.tile-center {
  container-type: inline-size;
  background-color: var(--center-bg);
  color: var(--center-text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6em;
  padding: 1.4rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 91, 61, 0.35);
}

.center-tile__name {
  margin: 0;
  font-weight: var(--font-weight-black);
  font-size: var(--font-size-xl);
  line-height: 1;
}

.center-tile__line {
  margin: 0;
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-xs);
  line-height: 1.45;
  max-width: 34ch;
}

.subpage-back {
  display: inline-block;
  margin-top: 2rem;
  color: var(--nav-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}

.subpage-back:hover {
  opacity: 0.7;
}

.error-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--shade-4);
}

.error-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.error-icon {
  flex-shrink: 0;
  width: clamp(5rem, 16vw, 9rem);
  height: clamp(5rem, 16vw, 9rem);
  object-fit: contain;
}

.error-text {
  margin: 0;
  font-weight: var(--font-weight-black);
  font-size: var(--font-size-display);
  letter-spacing: 0.02em;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 3rem 2rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  border: none;
  background: none;
  color: var(--nav-text);
  font-family: inherit;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  z-index: 41;
}

.soapbox-filter-tile {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 3px 3px 6px;
  padding: 1rem 1.25rem;
}

.soapbox__tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.soapbox-posts {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 3px 3px;
}

.soapbox-posts .tile {
  position: static;
}

.post-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.post-card[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .post-card {
    min-height: 160px;
    padding: 0.9rem 1.25rem;
  }

  .soapbox__title {
    display: none;
  }
}

.soapbox__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  padding: 5px;
}

.soapbox__search {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--shade-1);
  color: var(--text-color);
  font-family: inherit;
  font-size: var(--font-size-base);
}

.soapbox__search:focus {
  outline: 2px solid var(--info-bg);
  outline-offset: 2px;
}

.tag-pill {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: var(--shade-2);
  color: var(--text-color);
  font-family: inherit;
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-medium);
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-pill[aria-pressed="true"] {
  background: var(--info-bg);
  color: var(--center-text);
}

.post-card__title {
  margin: 0 0 0.4rem;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
}

.post-card__excerpt {
  margin: 0 0 0.75rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: var(--font-size-2xs);
  text-transform: lowercase;
  color: var(--text-color);
  opacity: 0.6;
}

.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.post__title {
  margin: 0 0 0.5rem;
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-black);
}

.post__meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-size: var(--font-size-2xs);
  text-transform: lowercase;
  opacity: 0.6;
}

.post__content {
  line-height: 1.7;
  color: var(--text-color);
}

.post__content p {
  margin: 0 0 1.25rem;
}

.post__content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.5rem 0 1.25rem;
}

.post__content h3 {
  margin: 2rem 0 0.75rem;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
}

.post__content h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

.post__content ul {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.post__content li {
  margin-bottom: 0.4rem;
}

.post__content code {
  background: var(--shade-1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post__content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 2rem 0;
}

.post__content a {
  color: var(--info-bg);
}

