:root {
  --bg: #fffcfa;
  --bg-accent: #fffcfa;
  --ink: rgba(27, 27, 27, 0.72);
  --ink-strong: rgba(27, 27, 27, 0.82);
  --muted: rgba(27, 27, 27, 0.55);
  --accent: #c3522b;
  --card: rgba(255, 255, 255, 0.4);
  --border: rgba(27, 27, 27, 0.08);
  --shadow: rgba(27, 27, 27, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

#v3-ambient-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 48px 20px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.top-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.5);
}

.top-nav a {
  color: rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

.brand {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-top {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hero-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}

/* Larger logo for detail page */
.hero-logo-large {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px var(--shadow);
}

.hero-title {
  margin: 14px 0 12px;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.hero-subtitle {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
  max-width: 800px;
}

.hero-subtitle a {
  color: var(--accent);
  font-weight: 800;
}

.hero-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.hero-meta span {
  background: rgba(27, 27, 27, 0.06);
  padding: 6px 10px;
  border-radius: 999px;
}

/* Category Tokens */
.category-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.category-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}

.category-token:hover {
  background: rgba(27, 27, 27, 0.06);
  border-color: rgba(27, 27, 27, 0.15);
  transform: translateY(-1px);
}

.category-token.active {
  background: #1b1b1b;
  color: #fff;
  border-color: #1b1b1b;
}

.category-token-count {
  font-size: 11px;
  font-weight: 800;
  background: rgba(27, 27, 27, 0.08);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
}

.category-token.active .category-token-count {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

/* Sections */
.section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 36px;
}

.section-title {
  font-size: 26px;
  margin: 0 0 10px;
  color: var(--ink-strong);
}

.section-text {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 900px;
}

/* Search */
.search-bar {
  margin: 16px 0 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}

.search-count {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}

/* Company Category Sections (index) */
.company-category-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.company-category-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--ink-strong);
}

/* Company Card Grid */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.company-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(27, 27, 27, 0.12);
}

.company-card-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--shadow);
}

.company-card-logo-wrap .company-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.company-logo-placeholder {
  font-size: 28px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.company-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.company-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-strong);
}

.company-category {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.company-tagline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta list (detail page) */
.meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: rgba(27, 27, 27, 0.6);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(27, 27, 27, 0.06);
  border-radius: 16px;
  padding: 14px 18px;
}

.meta-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  column-gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(27, 27, 27, 0.05);
  justify-items: start;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(27, 27, 27, 0.45);
  background: rgba(27, 27, 27, 0.08);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  justify-self: start;
}

.meta-row strong,
.meta-row a {
  text-align: left;
  font-weight: 600;
  color: rgba(27, 27, 27, 0.7);
  word-break: break-word;
  justify-self: start;
}

.meta-row a {
  color: rgba(195, 82, 43, 0.8);
}

.description-card {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 26px var(--shadow);
}

.description-card h3 {
  margin: 0 0 8px;
}

.description-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(27, 27, 27, 0.7);
}

/* Screenshots scroll strip (detail page) */
.screens-scroll {
  position: relative;
  overflow-x: auto;
  padding: 10px 0 16px;
  -webkit-overflow-scrolling: touch;
}

.screens-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 8px;
}

.screen-card {
  flex: 0 0 auto;
  width: 160px;
  height: 284px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 24px var(--shadow);
}

.screen-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fffcfa;
}

.screen-card.blurred img {
  filter: blur(12px);
  transform: scale(1.02);
}

.screen-card.blurred::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 252, 250, 0.05) 0%, rgba(255, 252, 250, 0.45) 100%);
}

.empty-state {
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

/* Sticky download */
.sticky-download {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1b1b1b;
  color: #fff;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sticky-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.sticky-download svg {
  flex-shrink: 0;
}

/* CTA */
.cta {
  margin: 50px auto 70px;
  max-width: 900px;
  padding: 28px 28px 32px;
  border-radius: 20px;
  background: #1b1b1b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cta h3 {
  margin: 0;
  font-size: 24px;
}

.cta p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.cta a {
  background: #fff;
  color: #1b1b1b;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
}

/* Footer */
.footer {
  padding: 30px 20px 50px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 720px) {
  .hero-title {
    font-size: 32px;
  }

  .hero-top {
    align-items: flex-start;
  }

  .hero-logo-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .company-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .company-card {
    padding: 14px;
  }

  .company-card-logo-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .category-tokens {
    gap: 6px;
  }

  .category-token {
    padding: 6px 10px;
    font-size: 12px;
  }

  .screen-card {
    width: 130px;
    height: 230px;
  }
}
