:root {
  --bg-main: #f1f4fa;
  --bg-card: #ffffff;
  --bg-soft: #ebf1ff;
  --text-main: #0f172a;
  --text-strong: #111827;
  --text-muted: #3d4a61;
  --text-soft: #4b5b75;
  --line: #d2dbea;
  --line-strong: #c0ccdf;
  --primary: #0f56cd;
  --primary-hover: #0b45a6;
  --primary-soft: #dbe9ff;
  --shadow-soft: 0 14px 34px rgba(16, 28, 52, 0.09);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1200px;
}

/* BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 8% 0%, #e4ecff 0, transparent 36%), var(--bg-main);
  color: var(--text-main);
  font-family: "Manrope", "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.07;
}

h2 {
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.15;
}

h3 {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.25;
}

main {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 22px;
}

.page-main {
  flex: 1;
}

footer {
  margin-top: auto;
  padding: 24px 20px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ACCESSIBILITY */
.skip-link {
  position: absolute;
  left: 16px;
  top: -52px;
  z-index: 100;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--text-main);
  color: #ffffff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid #88b4ff;
  outline-offset: 2px;
}

/* NAV */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(198, 209, 229, 0.72);
  backdrop-filter: blur(10px);
  background: rgba(241, 244, 250, 0.86);
  flex-wrap: wrap;
}

.nav-logo {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  color: #2b3b56;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
}

.nav-links a:hover {
  background: #e5ecfa;
  color: #15233b;
}

/* BUTTONS */
.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn-primary,
button {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(15, 86, 205, 0.24);
}

.btn-primary:hover,
button:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  color: #18263d;
  background: #e6edf9;
}

.btn-secondary:hover {
  background: #d8e3f3;
}

/* HERO */
.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
  padding: 30px;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 1px solid #c8d4ea;
  background: linear-gradient(140deg, #f8fbff 0%, #eaf1ff 50%, #f8faff 100%);
  box-shadow: 0 18px 40px rgba(21, 40, 79, 0.12);
}

.landing-hero-content {
  padding-right: 4px;
}

.landing-hero h1 {
  text-wrap: balance;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e3ecff;
  color: #1f3f77;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-description {
  margin-top: 16px;
  max-width: 640px;
  color: #20324d;
  font-size: 22px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-stats {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.stat-value {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.hero-visual {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 130, 246, 0.35) 0, rgba(77, 130, 246, 0) 72%);
  filter: blur(8px);
}

.preview-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  border-radius: var(--radius-lg);
  border: 1px solid #c9d6ee;
  background: linear-gradient(165deg, #ffffff 0%, #edf3ff 100%);
  padding: 24px;
  box-shadow: 0 20px 46px rgba(35, 63, 120, 0.2);
}

.preview-status {
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-card h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.4vw, 30px);
}

.preview-text {
  color: #2f405f;
  line-height: 1.56;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.preview-tags span {
  border-radius: 999px;
  border: 1px solid #ced8ec;
  background: #ffffffd9;
  padding: 6px 10px;
  color: #3a4f74;
  font-size: 12px;
}

.preview-card a {
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
}

/* CONTENT SECTIONS */
.section-block {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 30px;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

.section-soft {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.section-clean {
  border-style: dashed;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.section-flow {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
}

.section-head p {
  margin-top: 12px;
  max-width: 700px;
  color: var(--text-soft);
  line-height: 1.65;
}

.feature-grid,
.sample-grid {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card,
.sample-card,
.step-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.feature-card,
.sample-card,
.step-card {
  padding: 18px;
}

.feature-card h3,
.sample-card h3,
.step-card h3 {
  margin-bottom: 8px;
}

.feature-card p,
.sample-card p,
.step-card p {
  color: var(--text-soft);
  line-height: 1.56;
}

.sample-card {
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sample-card:hover {
  transform: translateY(-2px);
  border-color: #b7c7e5;
  box-shadow: 0 16px 30px rgba(18, 42, 93, 0.12);
}

/* FLOW */
.steps {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.flow-steps {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.step-card {
  background: #f8fbff;
}

.step-card span {
  display: inline-flex;
  margin-bottom: 9px;
  color: #1f3b72;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.step-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2857c8;
  font-size: 32px;
  line-height: 1;
  opacity: 0.7;
  user-select: none;
}

/* CTA */
.cta-block {
  text-align: center;
}

.cta-block p {
  margin: 10px auto 18px;
  max-width: 620px;
  color: var(--text-soft);
  line-height: 1.58;
}

/* SEARCH PAGE */
.search-page-main {
  width: min(980px, calc(100% - 24px));
  padding-top: 42px;
}

.search-intro {
  margin-bottom: 18px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid #c7d6f1;
  background: linear-gradient(160deg, #ffffff 0%, #edf4ff 100%);
  box-shadow: var(--shadow-soft);
}

.search-page-main h1 {
  text-align: center;
}

.search-hint {
  margin: 14px auto 0;
  max-width: 760px;
  text-align: center;
  color: #243955;
  font-size: 20px;
  line-height: 1.58;
}

.search-example {
  color: #153d86;
  font-weight: 600;
}

.search-box {
  display: flex;
  gap: 10px;
  margin: 0 auto;
}

.search-status {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #c7d8f9;
  border-radius: 999px;
  background: #ecf3ff;
  color: #1e3764;
  font-size: 14px;
  font-weight: 500;
}

.search-status strong {
  color: #102f61;
  font-weight: 700;
}

.search-count {
  color: #0f56cd;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
}

input::placeholder,
textarea::placeholder {
  color: #70809b;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #8caef3;
  outline: 2px solid #b9cdfa;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

#results {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.case {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.case:hover {
  transform: translateY(-2px);
  border-color: #bccbe6;
  box-shadow: 0 12px 24px rgba(15, 36, 74, 0.11);
}

.case h3 {
  margin-bottom: 8px;
}

.case p {
  color: var(--text-soft);
  line-height: 1.52;
}

.search-highlight {
  border-radius: 4px;
  background: #ffe59d;
  color: #10213f;
  padding: 0 2px;
}

.no-results {
  grid-column: 1 / -1;
  padding: 16px 0;
  text-align: center;
  color: var(--text-muted);
}

/* CASE PAGE */
.case-page {
  width: min(900px, 100%);
  margin: 26px auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.case-page h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  margin-bottom: 16px;
}

.case-page h2 {
  margin: 24px 0 10px;
  font-size: clamp(21px, 2.5vw, 28px);
}

.case-page p,
.case-page li {
  color: #34445f;
  font-size: 17px;
  line-height: 1.68;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.case-meta span {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faff;
  padding: 7px 11px;
  color: #40506a;
  font-size: 13px;
}

.case-section {
  margin-top: 10px;
}

.case-list {
  margin: 0;
  padding-left: 20px;
}

.case-list li + li {
  margin-top: 8px;
}

.contact-card {
  margin-top: 24px;
  border-radius: var(--radius-md);
  border: 1px solid #c8d6f1;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  padding: 16px;
}

.contact-title {
  margin-bottom: 10px;
  color: #1f3e7c;
  font-size: 16px;
}

.contact-list {
  display: grid;
  gap: 8px;
}

.contact-item {
  color: #22324d;
  font-size: 15px;
}

/* ADD PAGE */
.add-intro h1 {
  text-align: center;
}

.form-hint {
  margin: 10px auto 0;
  max-width: 820px;
  text-align: center;
  color: #2b4060;
  line-height: 1.58;
}

form {
  width: min(820px, 100%);
  margin: 24px auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

label {
  display: inline-block;
  margin: 14px 0 8px;
  color: #223450;
  font-size: 14px;
}

form button {
  width: 100%;
  margin-top: 16px;
}

#search-form button {
  width: auto;
  min-width: 124px;
  margin-top: 0;
  position: relative;
}

#search-form .btn-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  display: none;
  animation: spin 0.7s linear infinite;
}

#search-form button.is-loading .btn-label {
  opacity: 0.15;
}

#search-form button.is-loading .btn-spinner {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#search-form button.is-loading {
  cursor: wait;
}

.form-status {
  min-height: 22px;
  margin-top: 10px;
  color: #1d3f80;
  font-size: 14px;
  text-align: center;
}

/* TAG/CATEGORY VISIBILITY OFF */
.case-category,
.sample-meta,
.case-tags {
  display: none !important;
}

/* SKELETON */
.loading-card {
  min-height: 130px;
  display: grid;
  gap: 10px;
  align-content: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f4;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.35s infinite;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-line-lg {
  height: 16px;
  width: 84%;
}

.skeleton-line-xl {
  height: 22px;
  width: 88%;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.fade-in {
  animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-visual {
    min-height: 310px;
  }

  .flow-steps {
    grid-template-columns: 1fr;
  }

  .step-arrow {
    display: none;
  }
}

@media (max-width: 720px) {
  main {
    width: calc(100% - 20px);
    padding-top: 26px;
  }

  .navbar {
    align-items: center;
    justify-content: space-between;
  }

  .nav-logo {
    font-size: 22px;
  }

  .nav-links {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }

  .hero-description {
    font-size: 18px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section-block {
    padding: 20px;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .search-hint {
    font-size: 17px;
    line-height: 1.6;
  }

  #results {
    grid-template-columns: 1fr;
  }

  .case-page {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .landing-hero {
    gap: 18px;
    padding: 16px;
  }

  .section-block {
    padding: 16px;
  }

  .preview-card {
    padding: 20px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  form {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
