:root {
  --font-ui: "Manrope", sans-serif;
  --font-scale: 1;
  --tile-min: 280px;
  --tile-gap: 1rem;

  --bg-page: #eef3f8;
  --bg-surface: #ffffff;
  --bg-soft: #f7f9fc;

  --text-strong: #12283c;
  --text-muted: #4f6478;

  --border-soft: #d2deea;
  --shadow-soft: 0 14px 30px rgba(7, 26, 43, 0.11);

  --accent-primary: #df7a24;
  --accent-primary-strong: #b95c17;
  --accent-warm: #1f3f61;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --navbar-height: 214px;
  --footer-height: 56px;
  --content-max-width: 1500px;

  --space-1: clamp(0.45rem, 0.7vw, 0.65rem);
  --space-2: clamp(0.7rem, 1vw, 0.95rem);
  --space-3: clamp(1rem, 1.3vw, 1.3rem);
  --space-4: clamp(1.2rem, 1.8vw, 1.8rem);

  --focus-ring: 0 0 0 3px rgba(223, 122, 36, 0.24);
}

* {
  box-sizing: border-box;
}

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

html {
  font-size: calc(16px * var(--font-scale));
}

body {
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 10% -8%, rgba(31, 63, 97, 0.19), transparent 40%),
    radial-gradient(circle at 96% 8%, rgba(223, 122, 36, 0.14), transparent 36%),
    radial-gradient(circle at 50% 120%, rgba(23, 58, 91, 0.1), transparent 46%),
    var(--bg-page);
  color: var(--text-strong);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

body.modal-open {
  overflow: hidden;
}

#ambientAudioOrbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#ambientAudioOrbs::before {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 112, 189, 0.3), transparent 48%),
    radial-gradient(circle at 86% 20%, rgba(44, 165, 146, 0.24), transparent 44%),
    radial-gradient(circle at 54% 85%, rgba(73, 149, 214, 0.2), transparent 46%);
  filter: blur(16px);
  opacity: 0.95;
}

#ambientAudioOrbs::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 32%, rgba(5, 16, 31, 0.07) 100%);
  opacity: 0.88;
}

.ambient-audio-orb {
  position: absolute;
  left: var(--orb-x, 50%);
  top: var(--orb-y, 50%);
  width: var(--orb-size, 220px);
  height: var(--orb-size, 220px);
  margin-left: calc(var(--orb-size, 220px) * -0.5);
  margin-top: calc(var(--orb-size, 220px) * -0.5);
  border-radius: 999px;
  opacity: 0.28;
  transform: translate3d(0, 0, 0) scale(0.96);
  will-change: transform, opacity;
  filter: blur(24px) saturate(132%);
  background:
    radial-gradient(
      circle at 32% 28%,
      hsla(calc(var(--orb-hue, 200) + 16), 95%, 74%, 0.68) 0%,
      hsla(var(--orb-hue, 200), 92%, 56%, 0.34) 36%,
      hsla(calc(var(--orb-hue, 200) - 28), 92%, 34%, 0.16) 64%,
      transparent 75%
    );
  box-shadow:
    0 0 76px hsla(var(--orb-hue, 200), 92%, 58%, 0.34),
    0 0 146px hsla(calc(var(--orb-hue, 200) - 15), 95%, 52%, 0.2);
}

#ambientAudioOrbs.reduced-motion .ambient-audio-orb {
  transition: opacity 180ms ease;
  filter: blur(22px) saturate(120%);
}

a {
  color: var(--accent-warm);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-strong);
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
  color: var(--text-muted);
}

.main-layout {
  position: relative;
  z-index: 2;
  width: min(100%, var(--content-max-width));
  margin: 0 auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: calc(var(--navbar-height) + var(--space-2)) var(--space-3) var(--space-3);
}

.main-content {
  flex: 1 1 auto;
  min-height: 0;
}

.main-content > * {
  width: 100%;
}

header {
  margin-bottom: var(--space-3);
}

header h1 {
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  letter-spacing: -0.02em;
}

header p {
  margin-top: 0.45rem;
  font-size: clamp(0.96rem, 1.5vw, 1.1rem);
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-strong);
}

input::placeholder,
textarea::placeholder {
  color: #6a7f92;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  flex: none;
  width: 100%;
  min-height: var(--footer-height);
  margin-top: 0;
  border-top: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 254, 0.95)),
    var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.84rem;
  width: min(100%, var(--content-max-width));
  margin: 0 auto;
  text-align: center;
  padding: 0.85rem 1rem;
}

/* ============================
   Index Page
   ============================ */
.index-page {
  display: grid;
  gap: var(--space-3);
}

.index-hero {
  display: grid;
  gap: var(--space-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 138, 214, 0.17), transparent 38%),
    radial-gradient(circle at 92% 96%, rgba(32, 184, 162, 0.16), transparent 40%),
    var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.2rem, 2vw, 2rem);
}

.index-kicker {
  display: inline-block;
  width: fit-content;
  margin-bottom: 0.25rem;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary-strong);
  font-weight: 800;
}

.index-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.index-subtitle {
  max-width: 68ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.index-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: var(--space-3);
}

.search-panel,
.value-panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 1.7vw, 1.4rem);
}

.search-panel h2,
.value-panel h2 {
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  margin-bottom: 0.35rem;
}

.search-panel p,
.value-panel p {
  margin-bottom: 1rem;
}

.search-form {
  display: grid;
  gap: 0.8rem;
}

.search-form .input-group {
  display: grid;
  gap: 0.35rem;
}

.search-form label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.search-form input,
.search-form select {
  height: 46px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-strong);
  border-radius: var(--radius-sm);
  padding: 0 0.8rem;
  font-size: 0.95rem;
}

.btn-submit {
  border: none;
  height: 46px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-primary-strong));
  box-shadow: 0 10px 22px rgba(31, 138, 214, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.value-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.value-list li {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 0.7rem 0.8rem;
}

.value-list h3 {
  font-size: 0.9rem;
  margin-bottom: 0.12rem;
}

.value-list p {
  font-size: 0.86rem;
  margin: 0;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(8, 19, 29, 0.64);
  z-index: 2500;
}

#loading-overlay .spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rithimos-spin 0.9s linear infinite;
}

#loading-overlay p {
  color: #fff;
  font-weight: 600;
}

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

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

@media (max-width: 768px) {
  :root {
    --navbar-height: 128px;
  }

  .main-layout {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 520px) {
  :root {
    --navbar-height: 144px;
  }
}
