/* core/ui.css */
:root {
  --container-width: 1200px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 8px;
}

.nav,
.nav-links {
  display: flex;
  gap: 2.4rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.nav a,
.nav-links a,
.nav-links .nav-link-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}

.nav a:hover,
.nav a:focus,
.nav-links a:hover,
.nav-links a:focus,
.nav-links .nav-link-btn:hover,
.nav-links .nav-link-btn:focus {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;

  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;

  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}


.theme-toggle .toggle-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.theme-toggle:active {
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(3px);
}

.global-loading-overlay[hidden] {
  display: none !important;
}

.global-loading-card {
  display: grid;
  gap: 0.55rem;
  min-width: 220px;
  max-width: 86vw;
  padding: 1rem 1.2rem;
  text-align: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.global-spinner {
  width: 20px;
  height: 20px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: wu-spin 0.9s linear infinite;
}

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

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.6rem 0;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
}

h3 {
  font-size: 1.2rem;
}

.section-head {
  max-width: 700px;
  margin: 0 auto 2.2rem;
  text-align: center;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.section.accent {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.hero {
  background: var(--hero-grad);
  padding: 4.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(280px, 1.1fr) minmax(240px, 0.9fr);
  align-items: center;
}

.hero-copy {
  max-width: 60ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--primary);
  margin: 0 0 0.6rem 0;
  font-weight: 700;
}

.hero-copy .lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.4rem 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.4rem 0 1.2rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-art {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(49, 208, 198, 0.9), rgba(11, 187, 207, 0.45));
  opacity: 0.35;
  filter: blur(0.4px);
}

.b1 { width: 140px; height: 140px; top: -10px; right: 10px; }
.b2 { width: 90px; height: 90px; bottom: 30px; left: 10px; }
.b3 { width: 58px; height: 58px; bottom: 0; right: 80px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  font-weight: 700;
  cursor: pointer;
  min-width: 170px;
}

.btn.primary {
  background: #0e9a9d;
  color: #e2f7f1;
}

[data-theme="dark"] .btn.primary {
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
}

.btn:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: color-mix(in srgb, var(--surface-muted) 78%, var(--surface));
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
}

.field-control,
select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  color: var(--text);
}

.field-control::placeholder,
input[type="text"]::placeholder,
input[type="search"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder,
input[type="tel"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, var(--surface));
}

.field-control:focus-visible,
select:focus-visible,
input[type="text"]:focus-visible,
input[type="search"]:focus-visible,
input[type="email"]:focus-visible,
input[type="url"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="number"]:focus-visible,
input[type="password"]:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.field-control:disabled,
select:disabled,
input[type="text"]:disabled,
input[type="search"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled,
input[type="tel"]:disabled,
input[type="number"]:disabled,
input[type="password"]:disabled,
textarea:disabled {
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
  color: var(--muted);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  cursor: not-allowed;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
  margin-top: auto;
}

.text-link:hover {
  text-decoration: underline;
}


.grid {
  display: grid;
  gap: 1.2rem;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.features {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.feature {
  padding: 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 210px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.centered-card {
  text-align: center;
  max-width: 72ch;
  margin: 0 auto;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent));
}

.centered-card ul {
  list-style: none;
  padding: 0;
  margin: 0.8rem auto;
  display: grid;
  gap: 0.5rem;
  max-width: 40ch;
}

.centered-card li::before {
  content: "•";
  color: var(--primary);
  margin-right: 0.4rem;
}

.card.outline {
  box-shadow: none;
  background: var(--surface);
}

.card:hover,
.feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.card-row {
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border);
  font-weight: 600;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ad-section {
  padding-top: 2.5rem;
}

body:not([data-ads="true"]) .ad-slot,
body:not([data-ads="true"]) .ad-label {
  display: none;
}

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.ad-slot {
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--surface-muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 0.4rem;
  justify-content: center;
}

.footer-links a {
  padding: 0.2rem 0.35rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

.footer .brand {
  gap: 0.6rem;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 220px;
  }
}

@media (max-width: 720px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav";
    align-items: center;
    gap: 0.6rem 0.8rem;
    padding: 0.6rem 0;
  }

  .brand {
    grid-area: brand;
  }

  .theme-toggle {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }

  .back-to-top {
    left: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }

  .nav {
    grid-area: nav;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-links {
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  .nav-links a {
    padding: 0.32rem 0.58rem;
    font-size: 0.88rem;
  }

  .btn {
    width: 100%;
  }

  .brand-logo {
    height: 30px;
  }

  .brand .badge[data-site-tagline] {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 1.05rem;
  }

  .nav-links {
    gap: 0.38rem;
  }

  .nav-links a {
    padding: 0.28rem 0.48rem;
    font-size: 0.82rem;
  }
}
