*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  position: relative;
}

.page-home,
.page-enterprise {
  isolation: isolate;
}

/* Ambient background (brand guidelines + v2 blobs) */
.page-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.page-atmosphere__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.55;
  background: var(--blob-1);
}

.page-atmosphere__blob--1 {
  width: min(55vw, 720px);
  height: min(55vw, 720px);
  top: -18%;
  left: -12%;
  background: var(--blob-1);
}

.page-atmosphere__blob--2 {
  width: min(48vw, 620px);
  height: min(48vw, 620px);
  top: 8%;
  right: -16%;
  background: var(--blob-2);
  opacity: 0.5;
}

.page-atmosphere__blob--3 {
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  bottom: -14%;
  left: 22%;
  background: var(--blob-3);
  opacity: 0.45;
}

html[data-theme="browsergpt"] .page-atmosphere__blob {
  opacity: 0.35;
  filter: blur(88px);
}

.site-header,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--teal-hover);
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--bg-modal);
  color: var(--text);
}

.skip-link:focus {
  left: var(--page-gutter);
  top: var(--page-gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--page-gutter);
  padding-top: var(--safe-area-inset-top);
  background: color-mix(in srgb, var(--bg-nav) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divide);
}

.site-header__brand {
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.site-header__brand:hover {
  text-decoration: none;
  opacity: 0.92;
}

.site-header__logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(150px, 42vw);
  object-fit: contain;
}

.site-header__logo--light {
  display: none;
}

html[data-theme="light"] .site-header__logo--dark {
  display: none;
}

html[data-theme="light"] .site-header__logo--light {
  display: block;
}

@media (min-width: 768px) {
  .site-header__logo {
    height: 32px;
  }
}

.site-header__nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9375rem;
}

.site-header__nav .btn--ghost {
  color: var(--text-muted);
}

.site-header__nav a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
}

.site-header__nav a:not(.btn):hover {
  color: var(--text);
  text-decoration: none;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 768px) {
  .site-header__nav {
    display: flex;
    margin-left: auto;
    margin-right: 0;
  }

  .site-header__actions {
    margin-left: 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-min-height);
  min-width: var(--btn-min-height);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn:active:not(.is-loading) {
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

.btn--primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.btn--primary:hover {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
  color: #fff;
  text-decoration: none;
}

.btn--secondary {
  background: var(--bg-choice);
  color: var(--text);
  border-color: var(--divide);
}

html[data-theme="light"] .btn--secondary {
  box-shadow: var(--shadow-elevated);
}

.btn--secondary:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}

html[data-theme="light"] .btn--ghost:hover {
  background: var(--bg-hover);
  box-shadow: none;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  cursor: wait;
  color: transparent;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, var(--text) 30%, transparent);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
}

.btn--primary.is-loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}

.theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--divide);
  border-radius: var(--btn-radius);
  background: var(--bg-choice);
  color: var(--text);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
}

html[data-theme="light"] .theme-toggle {
  box-shadow: var(--shadow-elevated);
}

.theme-toggle__icon--moon {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--moon {
  display: inline;
}

/* Home — viewport locked */
.page-home {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-home .site-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem var(--page-gutter);
  padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom));
  position: relative;
}

.page-home .site-main::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(90vw, 640px);
  height: min(70vh, 480px);
  background: radial-gradient(ellipse at center, var(--hero-glow) 0%, transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.hero {
  text-align: center;
  max-width: 42rem;
  width: 100%;
  margin: 0 auto;
}

.hero__title {
  margin: 0 0 1rem;
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  letter-spacing: var(--h1-tracking);
  line-height: var(--h1-leading);
  color: var(--text);
}

.hero__lead {
  margin: 0 auto 2rem;
  max-width: 35ch;
  color: var(--text-muted);
  font-size: var(--body-size);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 20rem;
  margin: 0 auto 1.5rem;
}

@media (min-width: 480px) {
  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    align-items: center;
  }

  .hero__actions .btn {
    width: auto;
  }
}

.hero__compat {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* Enterprise page */
.page-enterprise {
  min-height: 100dvh;
}

.page-enterprise .site-main {
  padding: 0 var(--page-gutter) 4rem;
}

.page-enterprise .enterprise-hero {
  position: relative;
}

.page-enterprise .enterprise-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  width: min(95vw, 720px);
  height: min(50vh, 420px);
  background: radial-gradient(ellipse at center, var(--hero-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.enterprise-hero {
  padding: 3rem 0 var(--section-gap);
  max-width: var(--max-content);
  margin: 0 auto;
  text-align: center;
}

.enterprise-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--h1-weight);
  letter-spacing: var(--h1-tracking);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.enterprise-hero__lead {
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 auto 2rem;
}

.enterprise-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.section {
  max-width: var(--max-content);
  margin: 0 auto var(--section-gap);
}

.section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--h1-weight);
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-align: center;
}

.section__lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 65ch;
  margin: -0.5rem auto 2rem;
}

.cards-3 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cards-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cards-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--divide);
  background: var(--bg-elevated);
}

html[data-theme="light"] .card {
  box-shadow: var(--shadow-elevated);
}

.card__title {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.card__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.contact-block {
  padding: 3rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--divide);
  background: var(--bg-soft);
  text-align: center;
}

.contact-block ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--divide);
  padding: 2rem var(--page-gutter);
  padding-bottom: calc(2rem + var(--safe-area-inset-bottom));
  background: var(--bg-nav);
}

.site-footer__grid {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.site-footer a:hover {
  color: var(--text);
}

/* Dialog */
.mcp-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 36rem;
  width: calc(100% - 2rem);
  background: var(--bg-modal);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .mcp-dialog {
  box-shadow: var(--shadow-elevated);
}

.mcp-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 640px) {
  .mcp-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    inset: 0;
  }
}

.mcp-dialog__inner {
  padding: 1.5rem;
  max-height: min(85dvh, 100%);
  overflow-y: auto;
}

@media (max-width: 640px) {
  .mcp-dialog__inner {
    max-height: 100dvh;
    padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom));
  }
}

.mcp-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.mcp-dialog__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.mcp-dialog__subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.mcp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  border-radius: var(--btn-radius);
  background: var(--bg-soft);
  border: 1px solid var(--divide);
}

html[data-theme="light"] .mcp-tabs {
  background: var(--bg-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.mcp-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mcp-tab:hover:not([aria-selected="true"]) {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-hover) 70%, transparent);
}

.mcp-tab[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: color-mix(in srgb, var(--teal) 35%, var(--divide));
  font-weight: var(--btn-font-weight);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .mcp-tab[aria-selected="true"] {
  background: #fff;
  border-color: color-mix(in srgb, var(--teal) 40%, var(--divide));
  box-shadow: var(--shadow-elevated);
}

html[data-theme="browsergpt"] .mcp-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--teal) 14%, var(--bg-modal));
  border-color: color-mix(in srgb, var(--teal) 55%, var(--divide));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.mcp-tab[aria-selected="true"]:hover {
  background: var(--bg-elevated);
}

html[data-theme="browsergpt"] .mcp-tab[aria-selected="true"]:hover {
  background: color-mix(in srgb, var(--teal) 14%, var(--bg-modal));
}

.mcp-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.mcp-steps li {
  margin-bottom: 0.5rem;
}

.mcp-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--divide);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 1rem;
}

.mcp-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mcp-panel[hidden] {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sales-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 1rem;
}

.sales-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.sales-form input,
.sales-form textarea {
  font: inherit;
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--divide);
  background: var(--bg-soft);
  color: var(--text);
  min-height: 44px;
}

.sales-form textarea {
  min-height: 120px;
  resize: vertical;
}

html[data-theme="light"] .sales-form input,
html[data-theme="light"] .sales-form textarea {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-subtle, 0 1px 2px rgba(0, 0, 0, 0.04));
}

.sales-form input:focus-visible,
.sales-form textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.form-status {
  font-size: 0.9375rem;
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
}

.form-status--error {
  color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.08);
}

.form-status--success {
  color: var(--teal);
  background: rgba(1, 164, 146, 0.1);
}
