:root {
  --bar-height: 56px;
  --pad-x: 24px;
  --max-w: 1200px;

  --text-muted: rgba(0, 0, 0, 0.55);
  --text-strong: rgba(0, 0, 0, 0.82);

  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: 14px;
}

.creatorbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-height);
  z-index: 1000;

  /* Default state (top): solid white like screenshot */
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.creatorbar__inner {
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);

  display: flex;
  align-items: center;
  justify-content: flex-end; /* right aligned */
  gap: 6px;

  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.creatorbar__label {
  color: var(--text-muted);
}

.creatorbar__link {
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.creatorbar__link:hover {
  opacity: 0.85;
}

/* Scrolled state: frosted glass */
.creatorbar.is-glass {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* Push content below fixed bar */
.page {
  padding-top: var(--bar-height);
}

/* Mobile spacing */
@media (max-width: 560px) {
  :root { --pad-x: 16px; }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background: #fff;
  color: #333;
  display: flex;
  flex-direction: column;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Dashed grid lines */
  background-image: 
    linear-gradient(to right, #f3f4f6 1px, transparent 1px),
    linear-gradient(to bottom, #f3f4f6 1px, transparent 1px);
  background-size: 400px 400px;
  background-position: center center;
  
  /* Mask to fade to white in the middle */
  mask-image: radial-gradient(circle at center, transparent 20%, black 80%);
  -webkit-mask-image: radial-gradient(circle at center, transparent 20%, black 80%);
  
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

footer {
  margin-top: auto;
}

/* Logo */
.logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  -webkit-text-stroke: 2px #111;
  text-stroke: 2px #111;
  paint-order: stroke fill;
  margin-bottom: 0.5rem;
  text-align: center;
  transition: font-size 0.3s ease;
}
.logo.shrunk {
  font-size: 3rem;
  -webkit-text-stroke: 1.5px #111;
  text-stroke: 1.5px #111;
}

/* Main Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Page Subtitle */
.page-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 2rem;
}

/* URL Input Section */
.url-input-section {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
#url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #111;
  border-radius: 6px;
  outline: none;
}
#url-input:focus {
  border-color: #111;
}
#scan-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: #111;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#scan-btn:hover {
  background: #333;
}
#scan-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Summary Row - 2 columns */
.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 1.5rem;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.card-title svg {
  width: 14px;
  height: 14px;
  stroke: #111;
  flex-shrink: 0;
}
.card-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
}
.card-content-small {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Company Header Info */
.company-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.company-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.company-info {
  display: flex;
  flex-direction: column;
}
.company-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111;
}
.company-url {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Tags and Pills */
.industry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.industry-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  background: #f3f4f6;
  color: #374151;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
}

/* Dad Explanation */
.dad-explanation {
  font-size: 1rem;
  line-height: 1.6;
  color: #111;
  font-family: 'Georgia', serif;
}
.card-full-width {
  grid-column: 1 / -1;
  margin-bottom: 1.5rem;
}

/* Products */
.primary-product {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.primary-product-name {
  font-weight: 600;
  font-size: 1rem;
  color: #111;
}
.primary-product-desc {
  font-size: 0.875rem;
  color: #4b5563;
}
.product-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.product-item:last-child {
  margin-bottom: 0;
}
.product-item strong {
  font-size: 0.875rem;
  color: #111;
}
.product-item span {
  font-size: 0.875rem;
  color: #4b5563;
}

/* Demo Link */
.demo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem;
  background: #111;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}
.demo-link:hover {
  background: #333;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

/* Responsive Grid Adjustments */
@media (max-width: 768px) {
  .summary-row {
    grid-template-columns: 1fr;
  }
}

/* Valuation & Acquisition row */
.valuation-acquisition-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}
@media (max-width: 640px) {
  .valuation-acquisition-row {
    grid-template-columns: 1fr;
  }
}

.card-valuation {
  display: flex;
  flex-direction: column;
}
.valuation-value {
  font-size: 2rem;
  font-weight: 800;
  color: #111;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}
.valuation-confidence {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 1rem;
}
.confidence-low { background: #fee2e2; color: #991b1b; }
.confidence-medium { background: #fef3c7; color: #92400e; }
.confidence-high { background: #dcfce7; color: #166534; }

.valuation-basis {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #4b5563;
}

.funding-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}
.funding-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #111;
  padding: 0.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.funding-link:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.funding-source {
  font-size: 0.625rem;
  color: #6b7280;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.card-acquisition {
  display: flex;
  flex-direction: column;
}
.acquisition-summary {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #111;
  margin-bottom: 1rem;
}
.acquisition-candidates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.acquisition-candidate {
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.acquisition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.acquisition-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111;
}
.acquisition-confidence {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.125rem 0.375rem;
  background: #e5e7eb;
  color: #4b5563;
  border-radius: 3px;
}
.acquisition-rationale {
  font-size: 0.75rem;
  color: #4b5563;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.acquisition-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.acquisition-signal {
  font-size: 0.625rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

/* Loading state */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #111;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading span {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 0.75rem;
}
.loading-quote {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  max-width: 400px;
  height: 3em;
  display: flex;
  align-items: center;
}

/* Error state */
.error-message {
  padding: 1rem;
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  color: #9ca3af;
  margin-bottom: 1rem;
}
.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 0.5rem;
}
.empty-state-text {
  font-size: 0.875rem;
  color: #6b7280;
  max-width: 300px;
}

/* Crawl status & Refresh */
.crawl-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
}
.crawl-timestamp {
  font-size: 0.75rem;
  color: #6b7280;
}
.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
}
.refresh-btn:hover:not(:disabled) {
  background: #f3f4f6;
  color: #111;
  border-color: #9ca3af;
}
.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.refresh-btn svg {
  width: 14px;
  height: 14px;
}
.refresh-btn.spinning svg {
  animation: spin 1s linear infinite;
}
.refresh-status {
  font-size: 0.75rem;
  color: #2563eb;
  font-weight: 500;
}
.refresh-error {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 500;
}

.hidden {
  display: none;
}

/* Fade-in Animation for Results */
.fade-in {
  opacity: 0;
  animation: fadeIn 280ms ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    animation: none;
    transform: none;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.6;
}
.footer-link {
  color: inherit;
  text-decoration: underline;
}
.footer-external-icon {
  margin-left: 2px;
  vertical-align: middle;
}

/* Mobile portrait logo size */
@media (max-width: 600px) and (orientation: portrait) {
  .logo {
    font-size: 3rem;
  }
}
