/*
 * Taki Labs Website — Canonical Soft Studio (:root) & Dark Studio (.dark) Stylesheet
 * Synchronized with @takilabs/ui (studio.css) shared between Mahi and Tohu.
 *
 * Default Brand Accent: Kahurangi Pounamu (#0d7656)
 */

:root {
  --font-ui:
    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;

  --page: #f3f4f8;
  --bg: #f3f4f8;
  --paper: #ffffff;
  --paper-raised: #ffffff;
  --fg: #1c1d2b;
  --secondary: #575a6e;
  --secondary-ink: #575a6e;
  --tertiary: #65687a;
  --placeholder: #8b8ea0;

  --accent: #0d7656;
  --brand-accent: var(--accent);
  --accent-rgb: 13 118 86;
  --accent-hover: #0b6348;
  --accent-soft: #e4f0ec;
  --accent-soft-hover: #d3e6e1;
  --accent-softer: #eff6f4;
  --accent-ink: #0b6348;

  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #8a5300;
  --warning-soft: #fdf1d8;
  --danger: #b42318;
  --danger-soft: #fdebea;

  --surface: #f6f6fa;
  --surface-strong: #e6e7ee;
  --shell-surface: #ffffff;
  --shell-header: rgba(243, 244, 248, 0.86);
  --shell-wash: #f3f4f8;
  --canvas-wash: #e9eaf1;
  --border-subtle: #e6e7ee;
  --border-strong: #cfd0dc;
  --border-hover: #b4b6c6;
  --hover: rgba(28, 29, 43, 0.05);
  --pill-neutral-bg: #eeeff4;

  --shadow-xs: 0 1px 2px rgba(28, 29, 43, 0.05);
  --shadow-sm: 0 1px 3px rgba(28, 29, 43, 0.08);
  --shadow-card: 0 2px 6px rgba(28, 29, 43, 0.04);
  --shadow-lift: 0 10px 30px rgba(28, 29, 43, 0.08);
  --shadow-soft: 0 18px 40px rgba(28, 29, 43, 0.12);

  --radius: 0.75rem;
  color-scheme: light;
}

.dark {
  --page: #0f1016;
  --bg: #0f1016;
  --paper: #171821;
  --paper-raised: #1d1f2b;
  --fg: #f3f4f8;
  --secondary: #a2a5b8;
  --secondary-ink: #a2a5b8;
  --tertiary: #878a9f;
  --placeholder: #62657a;

  --accent: #0d7656;
  --brand-accent: var(--accent);
  --accent-rgb: 13 118 86;
  --accent-hover: #0b6348;
  --accent-soft: rgba(13, 118, 86, 0.18);
  --accent-soft-hover: rgba(13, 118, 86, 0.26);
  --accent-softer: rgba(13, 118, 86, 0.1);
  --accent-ink: #7ad3b8;

  --success: #4ade80;
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.16);

  --surface: #1e202c;
  --surface-strong: #272a3a;
  --shell-surface: #171821;
  --shell-header: rgba(15, 16, 22, 0.86);
  --shell-wash: #0f1016;
  --canvas-wash: #141620;
  --border-subtle: #262837;
  --border-strong: #34374b;
  --border-hover: #484c66;
  --hover: rgba(243, 244, 248, 0.06);
  --pill-neutral-bg: #252736;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

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

html {
  font-family: var(--font-ui);
  background: var(--page);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--fg);
  font-family: var(--font-ui);
  line-height: 1.55;
}

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

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Motion: Quiet Rise */
@keyframes quiet-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiet-rise {
  animation: quiet-rise 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .quiet-rise {
    animation: none;
  }
}

/* Shared Layout & Primitives */
.page-width {
  width: 100%;
  max-width: 58rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--shell-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.brand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  flex-shrink: 0;
  border-radius: 0.5625rem;
  background: var(--accent);
  box-shadow: var(--shadow-xs);
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.suite-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-subtle);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

.suite-switcher-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-ink);
  transition: background-color 150ms ease, color 150ms ease;
}

.suite-switcher-link:hover {
  background: var(--hover);
  color: var(--fg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-subtle);
  background: var(--paper);
  color: var(--secondary-ink);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.theme-toggle:hover {
  background: var(--hover);
  color: var(--fg);
  border-color: var(--border-strong);
}

.theme-toggle .icon-sun {
  display: none;
}

.dark .theme-toggle .icon-sun {
  display: block;
}

.dark .theme-toggle .icon-moon {
  display: none;
}

/* Main Holding Canvas */
.main-content {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 4.75rem);
}

.panel {
  position: relative;
  border-radius: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.hero-panel {
  padding: clamp(1.75rem, 5vw, 3.25rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 40rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  min-height: 1.625rem;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  padding: 0.125rem 0.6875rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pill-neutral {
  background: var(--pill-neutral-bg);
  color: var(--secondary-ink);
}

.status-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 999px;
  background: var(--accent);
}

.dark .status-dot {
  background: var(--accent-ink);
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.125rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.hero-lead {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.65;
  color: var(--secondary-ink);
}

/* Suite Product Wells */
.suite-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.section-eyebrow {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--tertiary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.well {
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.375rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.product-subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tertiary);
}

.product-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--secondary-ink);
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-subtle);
}

.product-domain {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tertiary);
}

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-ink);
}

.product-card:hover .product-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: 1.25rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--tertiary);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* 404 Helper */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 150ms ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

@media (max-width: 44rem) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .suite-switcher {
    display: none;
  }
}
