/* Foundation */
body {
  background: #050506;
}
.post-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}
.post-card:nth-child(3n + 1) {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 69, 52, 0.37), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
}
.post-card:nth-child(3n + 2) {
  background:
    radial-gradient(circle at 70% 25%, rgba(14, 165, 233, 0.29), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
}

/* Composed surfaces */
.panel {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.65);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
}
.panel h1,
.panel h2 {
  margin-top: 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  /* color: #ff4534; */
}
.sub {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

/* Form layout and atomic controls */
.form-stack {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}
.field,
.field-legend {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.form-control {
  box-sizing: border-box;
  margin-top: 0.5rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  color: #fff;
  font: inherit;
  line-height: 1.25rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}
.form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.form-control:focus {
  outline: none;
  border-color: #ff7366;
  box-shadow: 0 0 0 2px rgba(255, 115, 102, 0.2);
}
.form-control:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.form-control[aria-invalid='true'] {
  border-color: #ef4444;
}
.input-control,
.select-control {
  height: 2.875rem;
}
.select-control {
  appearance: none;
  padding-right: 2.75rem;
  background-color: #151516;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
}
.textarea-control {
  min-height: 7rem;
  resize: vertical;
}
.input-group {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1rem;
  color: rgba(255, 255, 255, 0.5);
}
.input-group:focus-within {
  border-color: #ff7366;
  box-shadow: 0 0 0 2px rgba(255, 115, 102, 0.2);
}
.input-prefix {
  flex: none;
}
.input-group .form-control {
  margin: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.checkbox-group {
  margin: 0;
  padding: 0;
  border: 0;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}
.checkbox-option:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.checkbox-option:has(.checkbox-control:checked) {
  border-color: rgba(255, 69, 52, 0.55);
  background: rgba(255, 69, 52, 0.1);
  color: #fff;
}
.checkbox-option:has(.checkbox-control:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Route loading */
.route-loader {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #ff4534;
  border-radius: 50%;
  animation: route-loader-spin 700ms linear infinite;
}

@keyframes route-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-loader {
    animation-duration: 1.5s;
  }
}
.checkbox-control {
  width: 1rem;
  height: 1rem;
  flex: none;
  accent-color: #ff4534;
}
.checkbox-control:focus-visible {
  outline: 2px solid #ff7366;
  outline-offset: 2px;
}

/* Location Picker */
.location-picker {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.location-input-group {
  position: relative;
  /* margin-top: 0.5rem; */
}
.location-input-group .form-control {
  margin-top: 0;
}
.location-input-group .form-control:disabled {
  padding-right: 9.75rem;
}
.location-remove-button {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  transform: translateY(-50%);
  white-space: nowrap;
}
.location-results.hidden {
  display: none;
}
.location-results {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: #151516;
}
.location-result {
  display: flex;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.location-result:last-child {
  border-bottom: 0;
}
.location-result:hover,
.location-result:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}
.btn.hidden {
  display: none;
}
.btn:focus-visible {
  outline: 2px solid #ff7366;
  outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.55;
}
.btn-primary {
  background: #ff4534;
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #ff7366;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}
.btn-outline {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
}
.btn-outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.btn-link {
  background: transparent;
  color: #ff4534;
}
.btn-link:hover:not(:disabled) {
  color: #ff7366;
}
.btn-destructive {
  background: #dc2626;
  color: #fff;
}
.btn-destructive:hover:not(:disabled) {
  background: #ef4444;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-md {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}
.hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Avatar */
.avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 69, 52, 0.35), transparent 55%), rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
}
.avatar-lg {
  width: 5rem;
  height: 5rem;
}
.avatar-xl {
  width: 6rem;
  height: 6rem;
}
.avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  object-fit: cover;
}
.avatar-action {
  padding: 0;
  cursor: pointer;
}
.avatar-action:focus-visible {
  outline: 2px solid #ff7366;
  outline-offset: 3px;
}
.avatar-preview-action {
  padding: 0;
  cursor: zoom-in;
}
.avatar-preview-action:focus-visible {
  outline: 2px solid #ff7366;
  outline-offset: 3px;
}
.avatar-preview-action:disabled {
  cursor: default;
}
.avatar-badge {
  position: absolute;
  right: -0.125rem;
  bottom: -0.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 3px solid #050506;
  border-radius: 9999px;
  background: #ff4534;
  color: #fff;
}
.avatar-editor,
.profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar-editor {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

/* Media Viewer */
.modal-open {
  overflow: hidden;
}
.media-viewer {
  position: fixed;
  z-index: 20;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.96);
}
.media-viewer-close {
  position: absolute;
  z-index: 1;
  top: 1rem;
  right: 1rem;
}
.media-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.media-viewer-status {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
}

/* Search */
.search-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  width: 100%;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: #171719;
}
.bottom-sheet-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}
.bottom-sheet-backdrop.hidden {
  display: none;
}
.bottom-sheet {
  width: min(100%, 32rem);
  max-height: min(90vh, 46rem);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  background: #111113;
  box-shadow: 0 -1rem 3rem rgba(0, 0, 0, 0.45);
}
.bottom-sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
}

/* Gallery */
.gallery-tile {
  aspect-ratio: 1;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  transition: transform 0.2s ease;
}
.gallery-tile:hover {
  transform: scale(1.02);
}
.gallery-tile-one {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 69, 52, 0.5), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}
.gallery-tile-two {
  background:
    radial-gradient(circle at 70% 25%, rgba(14, 165, 233, 0.4), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}
.gallery-tile-three {
  background:
    radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.45), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}
