:root {
  --night: #07101a;
  --ridge: #162235;
  --mist: #b5bed8;
  --ink: #f8f3ff;
  --muted: rgba(238, 232, 255, 0.74);
  --glass: rgba(18, 18, 31, 0.46);
  --glass-strong: rgba(42, 39, 58, 0.58);
  --line: rgba(255, 180, 119, 0.24);
  --ember: #ff7a2f;
  --solar: #ffc14f;
  --violet: #a76cff;
  --magenta: #f14f9d;
  --cyan: #8fc7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--night);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(180deg, rgba(5, 11, 19, 0), rgba(5, 8, 15, 0.32) 86%),
    url("assets/mountain-archive-bg-pop.png") center / cover no-repeat;
  content: "";
  transform: scale(1.02);
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 14% 72%, rgba(255, 105, 44, 0.2), transparent 33%),
    radial-gradient(circle at 76% 37%, rgba(156, 93, 255, 0.2), transparent 32%),
    linear-gradient(180deg, transparent 38%, rgba(255, 105, 44, 0.11) 86%);
  opacity: 0.82;
  pointer-events: none;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
}

.brand,
.nav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand::before {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 194, 116, 0.86);
  background: linear-gradient(135deg, var(--ember), var(--violet));
  box-shadow: 0 0 28px rgba(255, 121, 56, 0.9);
  content: "";
  transform: rotate(45deg);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.34);
  color: rgba(248, 243, 255, 0.84);
  font-size: 0.9rem;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: rgba(255, 186, 116, 0.52);
  background: rgba(52, 45, 74, 0.64);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  align-content: end;
  max-width: 780px;
  min-height: clamp(420px, 64svh, 740px);
  padding: 74px 0 54px;
}

.kicker {
  margin: 0 0 14px;
  color: rgba(255, 197, 132, 0.88);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 22px;
  font-size: clamp(3rem, 8vw, 6.65rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.48);
}

.intro {
  max-width: 660px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.42);
  color: rgba(248, 243, 255, 0.82);
  font-size: 0.88rem;
  backdrop-filter: blur(18px);
}

.status-strip strong {
  color: #fff;
  margin-right: 5px;
}

.projects {
  padding: 52px 0 8px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 14px;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent 34%),
    var(--glass);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  transition:
    border-color 170ms ease,
    background 170ms ease,
    transform 170ms ease;
}

.project-card::before {
  position: absolute;
  inset: 0;
  opacity: 0.58;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent),
    linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 54%), transparent 34%);
  content: "";
  pointer-events: none;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  border-color: color-mix(in srgb, var(--accent), white 42%);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.14), transparent 34%),
    var(--glass-strong);
  transform: translateY(-4px);
}

.accent-ember {
  --accent: var(--ember);
}

.accent-violet {
  --accent: var(--violet);
}

.accent-magenta {
  --accent: var(--magenta);
}

.accent-solar {
  --accent: var(--solar);
}

.project-meta,
.project-footer {
  position: relative;
  z-index: 1;
  color: rgba(248, 243, 255, 0.68);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-title {
  position: relative;
  z-index: 1;
  max-width: 12ch;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 850;
  line-height: 1.02;
  text-wrap: balance;
}

.project-description {
  position: relative;
  z-index: 1;
  color: rgba(238, 232, 255, 0.74);
  font-size: 0.96rem;
  line-height: 1.55;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

@media (max-width: 980px) {
  .hero {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 520px;
    padding-top: 52px;
  }

  h1 {
    max-width: 12ch;
  }

  .project-card {
    min-height: 220px;
  }
}

/* Nav button ---------------------------------------------------------- */
.nav-button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.34);
  color: rgba(248, 243, 255, 0.84);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: rgba(255, 186, 116, 0.52);
  background: rgba(52, 45, 74, 0.64);
  transform: translateY(-1px);
}

/* Buttons ------------------------------------------------------------- */
.ghost-button,
.solid-button {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.42);
  color: rgba(248, 243, 255, 0.86);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: rgba(255, 186, 116, 0.52);
  background: rgba(52, 45, 74, 0.64);
  transform: translateY(-1px);
}

.ghost-button.danger:hover,
.ghost-button.danger:focus-visible {
  border-color: rgba(241, 79, 157, 0.6);
  background: rgba(241, 79, 157, 0.18);
}

.solid-button {
  border-color: rgba(255, 194, 116, 0.5);
  background: linear-gradient(135deg, var(--ember), var(--violet));
  color: #fff;
  box-shadow: 0 12px 34px rgba(255, 121, 56, 0.24);
}

.solid-button:hover,
.solid-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(255, 121, 56, 0.34);
}

/* Card link overlay and tools ----------------------------------------- */
.project-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.card-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.project-card:hover .card-tools,
.project-card:focus-within .card-tools {
  opacity: 1;
}

.card-tool {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(12, 13, 24, 0.72);
  color: rgba(248, 243, 255, 0.86);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.card-tool:hover,
.card-tool:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  border-color: color-mix(in srgb, var(--accent), white 42%);
  background: rgba(52, 45, 74, 0.86);
}

.project-flag {
  color: rgba(255, 197, 132, 0.86);
}

/* Add block tile ------------------------------------------------------ */
.add-card {
  align-content: center;
  justify-items: center;
  grid-template-rows: auto auto auto;
  gap: 10px;
  border-style: dashed;
  border-color: rgba(255, 194, 116, 0.34);
  background: rgba(16, 17, 29, 0.28);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}

.add-card::before {
  opacity: 0.3;
}

.add-card:hover,
.add-card:focus-visible {
  border-color: rgba(255, 194, 116, 0.7);
  background: rgba(52, 45, 74, 0.5);
  transform: translateY(-4px);
}

.add-card-plus {
  position: relative;
  z-index: 1;
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(255, 197, 132, 0.9);
}

.add-card-title {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.add-card-hint {
  position: relative;
  z-index: 1;
  max-width: 22ch;
  color: rgba(238, 232, 255, 0.6);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Panes --------------------------------------------------------------- */
.pane-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 7, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.pane {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  max-height: min(86vh, 760px);
  max-height: min(86dvh, 760px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(255, 194, 116, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.1), transparent 36%),
    rgba(18, 18, 31, 0.86);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  transform: translate(-50%, -50%);
}

.pane[hidden] {
  display: none;
}

#contactPane {
  width: min(400px, calc(100% - 32px));
}

.pane-head {
  position: relative;
  margin-bottom: 18px;
  padding-right: 40px;
}

.pane-head .kicker {
  margin-bottom: 8px;
}

.pane-head h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1;
}

.pane-close {
  position: absolute;
  top: -4px;
  right: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.5);
  color: rgba(248, 243, 255, 0.8);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.pane-close:hover,
.pane-close:focus-visible {
  border-color: rgba(255, 186, 116, 0.52);
  background: rgba(52, 45, 74, 0.64);
}

.contact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.42);
}

.contact-label {
  color: rgba(248, 243, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.contact-list a {
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: rgba(255, 197, 132, 0.96);
  text-decoration: underline;
}

/* Block form ---------------------------------------------------------- */
.block-form {
  display: grid;
  gap: 14px;
}

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

.field > span {
  color: rgba(248, 243, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 11, 20, 0.62);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  resize: vertical;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(238, 232, 255, 0.36);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(255, 186, 116, 0.66);
  background: rgba(20, 18, 34, 0.78);
}

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

.form-error {
  margin: 0;
  color: rgba(241, 79, 157, 0.94);
  font-size: 0.86rem;
}

.pane-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.pane-actions-spacer {
  flex: 1;
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .card-tools {
    opacity: 1;
  }

  .pane-actions .ghost-button,
  .pane-actions .solid-button {
    flex: 1;
  }
}

/* Admin + form extras -------------------------------------------------- */
.pane-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 11, 20, 0.62);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 197, 132, 0.9) 50%),
    linear-gradient(135deg, rgba(255, 197, 132, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.field select:focus {
  outline: none;
  border-color: rgba(255, 186, 116, 0.66);
  background-color: rgba(20, 18, 34, 0.78);
}

.field select option {
  background: #14121f;
  color: var(--ink);
}

/* Archive notice ------------------------------------------------------ */
.archive-notice {
  display: block;
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.42);
  color: rgba(238, 232, 255, 0.78);
  font-size: 0.88rem;
  backdrop-filter: blur(18px);
}

.archive-notice[hidden] {
  display: none;
}

.archive-notice.is-ok {
  border-color: rgba(143, 199, 255, 0.44);
  color: rgba(226, 240, 255, 0.9);
}

.archive-notice.is-error {
  border-color: rgba(241, 79, 157, 0.52);
  color: rgba(255, 216, 235, 0.94);
}

.archive-notice.is-local {
  border-color: rgba(255, 194, 116, 0.42);
  color: rgba(255, 224, 186, 0.92);
}

/* ---------------------------------------------------------------------
   Compatibility and window-size handling
   ------------------------------------------------------------------ */

/* The hidden attribute must beat layout rules like `display: grid`,
   otherwise panes and toggled sections stay on screen. */
[hidden] {
  display: none !important;
}

/* Long titles, URLs and emails must never push a card or pane sideways. */
.project-title,
.project-description,
.add-card-hint,
.contact-list a,
.archive-notice {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-title {
  max-width: 100%;
}

/* Keyboard focus stays visible even where we restyle the control. */
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible,
.nav a:focus-visible,
.nav-button:focus-visible,
.ghost-button:focus-visible,
.solid-button:focus-visible,
.card-tool:focus-visible,
.pane-close:focus-visible,
.add-card:focus-visible {
  outline: 2px solid rgba(255, 197, 132, 0.9);
  outline-offset: 2px;
}

/* Touch devices have no hover, so edit controls must be permanently visible. */
@media (hover: none) {
  .card-tools {
    opacity: 1;
  }

  .project-card:hover,
  .add-card:hover {
    transform: none;
  }
}

/* Short windows — a landscape phone, or a desktop window dragged flat.
   The hero must not eat the whole screen before the projects appear. */
@media (max-height: 640px) {
  .hero {
    min-height: 0;
    padding: 34px 0 30px;
  }

  h1 {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    margin-bottom: 16px;
  }

  .intro {
    margin-bottom: 18px;
  }

  .pane {
    max-height: min(94vh, 760px);
    max-height: min(94dvh, 760px);
    padding: 18px;
  }
}

/* Narrow windows that are not phones: a resized desktop window, a split
   screen, or a tablet in portrait. */
@media (max-width: 560px) {
  .shell {
    padding-bottom: 44px;
  }

  .status-strip span,
  .nav a,
  .nav-button {
    font-size: 0.84rem;
  }

  .pane {
    width: calc(100% - 24px);
    padding: 20px 18px;
  }

  .pane-head h2 {
    font-size: 1.45rem;
  }

  .contact-list a {
    font-size: 0.94rem;
  }
}

/* Very narrow — small phones and heavily shrunken windows. */
@media (max-width: 380px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .project-card {
    padding: 18px;
    min-height: 200px;
  }

  .pane-actions .ghost-button,
  .pane-actions .solid-button {
    width: 100%;
    flex: none;
  }

  .pane-actions-spacer {
    display: none;
  }
}

/* Wide windows: keep the grid from stretching cards into billboards. */
@media (min-width: 1500px) {
  .shell {
    width: min(1320px, calc(100% - 60px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .project-card:hover,
  .nav a:hover,
  .nav-button:hover,
  .ghost-button:hover,
  .solid-button:hover,
  .add-card:hover {
    transform: none;
  }
}

/* Backdrop blur is expensive and unsupported in a few engines; without it the
   translucent panels need more solid backgrounds to stay readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pane {
    background: rgba(14, 14, 26, 0.97);
  }

  .pane-backdrop {
    background: rgba(4, 7, 14, 0.86);
  }

  .project-card,
  .nav a,
  .nav-button,
  .ghost-button,
  .status-strip span,
  .archive-notice {
    background: rgba(14, 15, 26, 0.9);
  }
}

/* Brand reads as a tag alongside the nav tags, tinted violet, diamond kept. */
.brand {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(167, 108, 255, 0.52);
  border-radius: 8px;
  background: rgba(84, 52, 138, 0.42);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.brand:hover,
.brand:focus-visible {
  border-color: rgba(191, 148, 255, 0.86);
  background: rgba(104, 66, 168, 0.6);
  transform: translateY(-1px);
}

/* Reorder controls sit with the edit control on each card. */
.card-tool[disabled] {
  opacity: 0.32;
  cursor: not-allowed;
}

.card-tool[disabled]:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(12, 13, 24, 0.72);
}

.card-tools .card-tool:not(:last-child) {
  padding: 6px 9px;
  font-size: 0.72rem;
  line-height: 1;
}

/* Search ---------------------------------------------------------------- */
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 460px;
}

.search-icon {
  position: absolute;
  z-index: 2; /* the input's backdrop-filter would otherwise paint over it */
  left: 12px;
  width: 18px;
  height: 18px;
  color: rgba(255, 197, 132, 0.82);
  pointer-events: none;
}

.search-field input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 44px;
  padding: 11px 40px 11px 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.42);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

/* Suppress the engine's own clear affordance; the page provides one. */
.search-field input::-webkit-search-decoration,
.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-results-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-field input::placeholder {
  color: rgba(238, 232, 255, 0.42);
}

.search-field input:focus {
  outline: none;
  border-color: rgba(255, 186, 116, 0.6);
  background: rgba(34, 30, 52, 0.6);
}

.search-clear {
  position: absolute;
  z-index: 2;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(12, 13, 24, 0.7);
  color: rgba(248, 243, 255, 0.82);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover,
.search-clear:focus-visible {
  border-color: rgba(255, 186, 116, 0.52);
  background: rgba(52, 45, 74, 0.8);
}

.search-count {
  flex-shrink: 0;
  color: rgba(238, 232, 255, 0.62);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.empty-state {
  margin: 18px 0 0;
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 17, 29, 0.34);
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

@media (max-width: 560px) {
  .search-field {
    max-width: none;
  }

  .search-count {
    font-size: 0.72rem;
  }
}
