/* The Optimly AI Brand Index design layer (spec/13 item 7).
   Tokens and component styling ported from the marketing site
   (optimly-marketing-site/src/index.css + the Tailwind classes its
   Header/Footer/brand components use). One renderer, two audiences: this
   styles the server-rendered pages without restructuring their DOM — the
   H1→H2→H3 hierarchy, section lists, and first-byte text stay as they are.
   Visual language only: no measurement visuals (spec/13 §2). */

:root {
  --primary: hsl(186 63% 24%);        /* #175C64 */
  --primary-hover: #0f4b50;
  --primary-foreground: #ffffff;
  --accent: hsl(182 59% 56%);        /* #4DCDD1 */
  --accent-link: #267982;
  --accent-link-hover: #5ac2c4;
  --foreground: hsl(0 0% 11%);
  --muted: hsl(210 20% 98%);
  --muted-foreground: hsl(0 0% 37%);
  --border: hsl(0 0% 90%);
  --card: #ffffff;
  --ring: hsl(186 63% 24% / 0.35);
  --radius: 12px;
  --gray-100: #f3f4f6;
  --gray-200-half: rgba(229, 231, 235, 0.5);
  --gray-700: #374151;
  --footer-bg: #111111;
  --lavender-bg: #eeedfe;
  --lavender-border: #cecbf6;
  --lavender-heading: #3c3489;
  --lavender-body: #534ab7;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--foreground);
  background: var(--card);
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--foreground);
}
h1 { font-size: 2rem; font-weight: 700; margin: 0 0 1rem; }
h2 { font-size: 1.375rem; font-weight: 600; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }

a { color: var(--accent-link); text-decoration: none; }
a:hover { color: var(--accent-link-hover); }
a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted-foreground); }

/* --- layout ------------------------------------------------------------------ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Pages read as a content column (the marketing brand pages' measure). */
.site-main { padding-top: 64px; min-height: 60vh; }
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}
.page-wide { max-width: 1200px; }

/* --- site header (Header.tsx port) -------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  border-bottom: 1px solid var(--gray-200-half);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
/* The marketing header's subtle teal→cyan wash, as a paint-only overlay. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23, 92, 100, 0.05), transparent 45%, rgba(77, 205, 209, 0.08));
  pointer-events: none;
}
.site-header-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-logo img { height: 32px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: color 150ms ease;
}
.site-nav a:hover { color: var(--primary); }

.site-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.login-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}
.login-link:hover { color: var(--primary); }

.cta, .header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  transition: background 150ms ease, transform 150ms ease;
}
.cta:hover, .header-cta:hover {
  background: var(--primary-hover);
  color: var(--primary-foreground);
  transform: translateY(-2px);
}
.header-cta { height: 48px; padding: 0 1.25rem; }

/* --- brand hero (ClaimedBrandPage / UnclaimedHero port) ------------------------ */

.hero { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}
.brand-logo-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}
.hero h1 { margin: 0 0 0.5rem; }
.hero .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.9375rem;
}
.hero .meta > a:first-of-type { font-weight: 500; }

/* Claim-state badges — semantic colors, no measurement. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; }
.badge-verified { background: rgba(23, 92, 100, 0.08); color: var(--primary); }
.badge-verified::before { background: var(--primary); }
.badge-unclaimed { background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); }
.badge-unclaimed::before { background: var(--accent); }
.badge-sm { font-size: 0.75rem; padding: 0.05rem 0.55rem; }

.chip {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  padding: 0.12rem 0.7rem;
  margin: 0 0.35rem 0.35rem 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
a.chip:hover { color: var(--primary); border-color: var(--primary); }

/* --- sections ------------------------------------------------------------------ */

.section { margin: 0.75rem 0 1.25rem; }
.section h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.section h3 .chip { margin: 0; font-size: 0.75rem; padding: 0.05rem 0.6rem; }
ul.plain { list-style: none; padding: 0; margin: 0.5rem 0; }
ul.plain li {
  padding: 0.3rem 0 0.3rem 1.25rem;
  position: relative;
}
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.85rem;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}
dl.facts dt { font-weight: 600; margin-top: 0.5rem; }
dl.facts dd { margin: 0 0 0.5rem; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.panel.claim-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted);
}

/* The unclaimed page's closing CTA (UnclaimedFooterCTA port — lavender set). */
.lavender-cta {
  margin: 3rem 0 0;
  border: 1px solid var(--lavender-border);
  border-radius: var(--radius);
  background: var(--lavender-bg);
  padding: 1.75rem 1.5rem;
}
.lavender-cta h2 { margin: 0 0 0.5rem; color: var(--lavender-heading); }
.lavender-cta p { color: var(--lavender-body); margin: 0 0 0.75rem; }
.lavender-cta .cta { background: var(--lavender-body); }
.lavender-cta .cta:hover { background: var(--lavender-heading); }

/* --- search + directory (BrandDirectory port) --------------------------------- */

.search { position: relative; max-width: 640px; margin: 1.5rem 0 0.75rem; }
.search input[type="search"] {
  width: 100%;
  height: 48px;
  font: inherit;
  color: var(--foreground);
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.search input[type="search"]:focus {
  outline: 2px solid var(--ring);
  outline-offset: -1px;
  border-color: var(--primary);
}
.search-results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.5rem;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.search-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}
.search-card:last-child { border-bottom: 0; }
.search-card:hover { background: var(--muted); color: var(--foreground); }
.search-card img { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; object-fit: contain; }
.search-card .sub { color: var(--muted-foreground); font-size: 0.875rem; }

/* --- member card grid (category + disambiguation) ------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--foreground);
  background: var(--card);
  transition: border-color 150ms ease;
}
.card:hover { border-color: var(--primary); color: var(--foreground); }
.card img { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; object-fit: contain; }
.card .card-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.card .card-body strong { font-weight: 600; }
.card .card-body .muted { font-size: 0.875rem; }

/* --- site footer (Footer.tsx port) ---------------------------------------------- */

.site-footer {
  margin-top: 4rem;
  background: var(--footer-bg);
  color: #ffffff;
  padding: 3rem 0;
}
.site-footer h4 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  margin: 0 0 1rem;
}
.site-footer a { color: rgba(255, 255, 255, 0.6); }
.site-footer a:hover { color: var(--accent-link-hover); text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer-grid img { height: 32px; width: auto; margin-bottom: 1rem; display: block; }
.footer-grid p { color: rgba(255, 255, 255, 0.6); font-size: 0.875rem; line-height: 1.625; margin: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.75rem; font-size: 0.875rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.footer-utility { display: flex; gap: 1rem; font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }
.footer-social { display: flex; align-items: center; gap: 1rem; }
.footer-social a { color: rgba(255, 255, 255, 0.4); }
.footer-social a:hover { color: var(--accent-link-hover); text-decoration: none; }
.footer-social svg { width: 16px; height: 16px; }
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.footer-legal p { margin: 0; color: rgba(255, 255, 255, 0.6); }
.footer-legal .legal-links { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer-disclaimer {
  font-size: 0.75rem;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
}

/* --- responsive ------------------------------------------------------------------- */

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom, .footer-legal { flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1023px) {
  .site-nav, .login-link { display: none; }
}
@media (max-width: 767px) {
  .container, .site-header-inner { padding: 0 1rem; }
  .page { padding: 1.5rem 1rem 4rem; }
  .header-cta { height: 40px; padding: 0 0.9rem; font-size: 0.875rem; }
  .hero { flex-direction: row; }
  .brand-logo { width: 48px; height: 48px; border-radius: 12px; }
  h1 { font-size: 1.5rem; }
}