:root {
  --bg: #08111f;
  --bg-2: #0f1d35;
  --surface: rgba(12, 22, 39, 0.72);
  --surface-strong: rgba(18, 31, 53, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --ink: #eef4ff;
  --muted: #9cb1d0;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #3dd9b1;
  --accent-2: #ff9f5a;
  --accent-3: #70a7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Sans", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(61, 217, 177, 0.18), transparent 22%),
    radial-gradient(circle at 85% 8%, rgba(112, 167, 255, 0.22), transparent 24%),
    radial-gradient(circle at 80% 82%, rgba(255, 159, 90, 0.16), transparent 24%),
    linear-gradient(180deg, #07101d 0%, #0b1527 45%, #09121f 100%);
}

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

a {
  color: inherit;
}

.brand,
.article-title-link,
.ghost-link {
  text-decoration: none;
}

.article-title-link:hover,
.ghost-link:hover {
  color: var(--accent);
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 18px auto 48px;
}

.hero,
.panel,
.dialog-card,
.site-footer {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 16px 22px 10px;
  transition: padding 0.3s ease, min-height 0.3s ease;
}

.hero.compact-header {
  padding-bottom: 16px;
  min-height: auto;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.hero-orb-a {
  top: -40px;
  right: -20px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(61, 217, 177, 0.22), transparent 68%);
}

.hero-orb-b {
  left: 40%;
  bottom: -120px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(112, 167, 255, 0.16), transparent 70%);
}

.topbar,
.hero-content,
.section-head,
.layout,
.two-up {
  display: grid;
  gap: 22px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.brand-separator {
  color: var(--muted);
  opacity: 0.6;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-switch-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-actions .ghost-link {
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 12px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.topbar-actions .ghost-link:hover {
  color: var(--accent);
}

.lang-switch {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
}

.lang-switch img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(0.8) opacity(0.5);
  transition: all 0.2s ease;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.lang-switch.active {
  border-color: var(--accent);
  background: rgba(61, 217, 177, 0.15);
}

.lang-switch.active img {
  filter: none;
  opacity: 1;
}

.brand strong,
h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #041019;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand small,
.hero-text,
.results-info,
.form-note,
.muted,
#footer-text {
  color: var(--muted);
}

.brand small {
  overflow-wrap: anywhere;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 20px 25px;
}

.hero-copy {
  width: min(100%, 1000px);
}

.hero-copy h1 {
  max-width: 15ch;
  margin-inline: auto;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.eyebrow,
.search-card-eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0 0 18px;
  max-width: 11ch;
  font-size: clamp(2.8rem, 5.4vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
}

h3 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.hero-text {
  max-width: 62ch;
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-stats,
.company-grid,
.articles-grid {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin-top: 26px;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card strong {
  display: block;
  font-size: 1.7rem;
}

.search-card,
.form-card,
.feature-panel {
  border-radius: var(--radius-lg);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(19, 33, 56, 0.92), rgba(12, 21, 37, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

label,
.company-meta,
.detail-grid,
.feature-list,
.site-footer {
  display: grid;
  gap: 14px;
}

label span {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
}

input,
textarea,
select,
button,
.button {
  border-radius: 16px;
  padding: 14px 16px;
}

input,
textarea,
select {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #16243d;
  color: var(--ink);
}

select option,
select optgroup {
  background-color: #16243d;
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #7f95b7;
}

button, .button {
  border: 0;
  font-weight: 700;
  cursor: pointer;
  color: #041019;
  background: linear-gradient(135deg, var(--accent), #8af7da);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(61, 217, 177, 0.25);
  color: #041019;
}

.ghost-button,
.chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line);
}

.section {
  padding-top: 56px;
}

.section-alt {
  padding-top: 64px;
}

.section-head {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 24px;
}

.catalog-status {
  display: flex;
  justify-content: flex-end;
}

.layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  border-radius: 30px;
  padding: 24px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filters .ghost-button {
  align-self: flex-end;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.content-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.company-grid,
.articles-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.company-grid.single-result {
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
}

.company-card,
.article-card,
.empty-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(22, 36, 61, 0.96), rgba(12, 22, 39, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.company-card::before,
.article-card::before,
.empty-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
}

.empty-card {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.company-card.top {
  box-shadow: 0 18px 42px rgba(255, 159, 90, 0.18);
  border-color: rgba(255, 159, 90, 0.24);
}

.company-card-top {
  box-shadow: 0 18px 42px rgba(255, 159, 90, 0.18);
  border-color: rgba(255, 159, 90, 0.24);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.83rem;
}

.chip.featured {
  background: rgba(255, 159, 90, 0.14);
  border-color: rgba(255, 159, 90, 0.24);
}

.company-card-header,
.company-header,
.detail-actions,
.company-card footer,
.article-card footer,
.site-footer,
.footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #041019;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), #ffd2a8);
}

.company-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #041019;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}

.company-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #06111e;
}

.company-name {
  margin-bottom: 0;
}

.company-intro {
  margin-top: 18px;
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
}

.company-card-footer {
  margin-top: 20px;
}

.company-card p,
.article-card p,
.dialog-card p {
  margin: 0;
  line-height: 1.7;
}

.article-card h3 {
  margin-bottom: 10px;
}

.article-hero {
  padding-bottom: 24px;
}

.article-detail-shell {
  padding-top: 42px;
}

.article-detail-card {
  width: min(920px, 100%);
  margin-inline: auto;
}

.article-detail-card h1 {
  max-width: 14ch;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.article-date {
  color: var(--muted);
  margin: 0 0 18px;
}

.article-lead {
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.75;
  margin-bottom: 24px;
}

.article-body {
  display: grid;
  gap: 18px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.85;
}

.banner-slot {
  min-height: 140px;
  display: grid;
  align-items: center;
}

.banner-card {
  border-radius: 26px;
  padding: 26px;
  color: #041019;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(135deg, #52f2ca, #77b7ff 58%, #ffb36f);
}

.banner-card small {
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.82;
}

.banner-card h3,
.banner-card p {
  margin: 0 0 12px;
}

.banner-card button {
  margin-top: 4px;
  color: var(--ink);
  background: rgba(4, 16, 25, 0.82);
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-list {
  padding-left: 18px;
  margin: 0;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(3, 7, 15, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-card {
  width: min(920px, calc(100vw - 24px));
  padding: 26px;
  border-radius: 28px;
}

.detail-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.detail-cover {
  min-height: 240px;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(135deg, #1ed7ae, #4e8ef7 55%, #ff9653);
  color: #041019;
  display: grid;
  align-content: end;
  gap: 10px;
}

.detail-side,
.gallery-grid {
  display: grid;
  gap: 14px;
}

.gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-item {
  min-height: 100px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 159, 90, 0.95), rgba(61, 217, 177, 0.75)),
    #122238;
}

.detail-section {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer {
  margin-top: 56px;
  padding: 24px 28px;
  border-radius: 30px;
  grid-template-columns: 1.2fr auto;
  align-items: center;
}

.footer-brand strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
}

.footer-brand p {
  margin: 0;
  max-width: 58ch;
  line-height: 1.7;
}

.footer-links {
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.92;
}

.footer-links a:hover {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-content,
  .layout,
  .two-up,
  .detail-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
  }

  .hero,
  .panel,
  .dialog-card,
  .site-footer {
    border-radius: 24px;
  }

  h1 {
    max-width: none;
  }

  .hero-copy h1 {
    max-width: 100%;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .company-card footer,
  .article-card footer,
  .detail-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Company Detail Styles */
.company-detail-shell {
  margin-top: 32px;
}

.detail-sidebar {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-logo-big {
  width: 100px;
  height: 100px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}

.detail-sidebar-info h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.detail-sidebar-info p {
  margin: 12px 0;
  font-size: 0.95rem;
}

.detail-sidebar-info a {
  color: var(--accent-3);
  text-decoration: none;
}

.detail-sidebar-info a:hover {
  text-decoration: underline;
}

.map-link {
  display: inline-flex;
  color: var(--accent);
  font-weight: 800;
}

.detail-main, .detail-references, .detail-ai {
  padding: 40px;
}

.detail-description .lead {
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 24px;
}

.services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.service-tag {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.9rem;
}

.qr-panel {
  display: grid;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.qr-panel h3 {
  margin-bottom: 8px;
}

.qr-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

#company-qr {
  width: 180px;
  height: 180px;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
}

.qr-url {
  max-width: 100%;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.references-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}

.reference-item {
  padding: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.reference-item h4 {
  margin: 0 0 12px 0;
  color: var(--accent);
}

.detail-ai {
  display: grid;
  gap: 20px;
}

.detail-ai-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.detail-ai-head h3,
.detail-ai-head p {
  margin-bottom: 0;
}

.ai-data-preview {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(3, 9, 18, 0.58);
  color: var(--muted);
  font: 0.9rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

@media (max-width: 640px) {
  .detail-ai-head {
    flex-direction: column;
  }
}
