/* ==========================================================================
   Caelbay Labs LLC — Editorial Corporate Stylesheet
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
}

.skip-link:focus {
  top: 12px;
}

/* Theme-Aware Marks */
.mark-dark {
  display: none;
}

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

[data-theme="dark"] .mark-dark {
  display: block;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

.prose-container {
  width: 100%;
  max-width: var(--prose);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.96875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  transition: color 140ms ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
  transition: color 140ms ease;
}

.lang-toggle:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--ink-secondary);
  transition: color 140ms ease;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-icon {
  width: 16px;
  height: 16px;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-block: clamp(72px, 11vw, 132px) clamp(64px, 9vw, 112px);
}

.hero-title {
  margin: 0 0 24px;
  max-width: 22ch;
  font-size: clamp(2.25rem, 4.8vw, 3.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 36px;
  max-width: 62ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  background-color: var(--btn-bg);
  color: var(--btn-ink);
  border-radius: 6px;
  transition: background-color 140ms ease;
}

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--link);
  transition: color 140ms ease;
}

.text-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.quiet-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color 140ms ease;
}

.quiet-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   Editorial Sections
   ========================================================================== */

.band {
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--border);
}

.band--tinted {
  background-color: var(--bg-subtle);
}

.band-label {
  margin: 0 0 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Section 1: Flagship Product */
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.product-identity {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-top: 2px;
}

.product-name {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

.product-tagline {
  margin: 0;
  font-size: 0.96875rem;
  color: var(--ink-secondary);
}

.product-copy p {
  margin: 0 0 22px;
  max-width: 62ch;
  font-size: 1.03125rem;
  line-height: 1.7;
  color: var(--ink-secondary);
}

/* Section 2: What We Build */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4.5vw, 48px);
}

.focus-item {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.focus-num {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.focus-title {
  margin: 0 0 10px;
  font-size: 1.09375rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.3;
  color: var(--ink);
}

.focus-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-secondary);
}

/* Section 3: Company & Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.company-heading {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.company-text {
  margin: 0 0 16px;
  max-width: 54ch;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink-secondary);
}

.company-text:last-child {
  margin-bottom: 0;
}

.contact-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.contact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  border-bottom: 1px solid var(--border);
}

.contact-row dt {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.contact-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.contact-row a {
  color: var(--ink);
  transition: color 140ms ease;
}

.contact-row a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer-links a {
  color: var(--ink-secondary);
  transition: color 140ms ease;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Editorial Legal Pages (privacy.html & terms.html)
   ========================================================================== */

.legal-main {
  padding-block: clamp(56px, 8vw, 96px) clamp(72px, 10vw, 112px);
}

.legal-back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.legal-back:hover {
  color: var(--ink);
}

.legal-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.625rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
}

.legal-meta {
  margin: 0 0 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.legal-lead {
  margin: 0 0 40px;
  font-size: 1.03125rem;
  line-height: 1.7;
  color: var(--ink);
}

.legal-section {
  margin-bottom: 36px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.legal-section h3 {
  margin: 22px 0 8px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.legal-section p {
  margin: 0 0 14px;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-secondary);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink-secondary);
}

.legal-section li {
  margin-bottom: 8px;
  font-size: 0.96875rem;
  line-height: 1.7;
}

.legal-emails {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.legal-emails a {
  color: var(--link);
}

.legal-emails a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.notfound-main {
  min-height: calc(100vh - var(--header-h) - 82px);
  display: flex;
  align-items: center;
  padding-block: 64px;
}

.notfound-num {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.notfound-title {
  margin: 0 0 16px;
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.notfound-desc {
  margin: 0 0 32px;
  max-width: 52ch;
  font-size: 1.03125rem;
  line-height: 1.65;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 780px) {
  .product-grid,
  .focus-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-right {
    gap: 14px;
  }

  .nav {
    gap: 14px;
  }

  .controls {
    padding-left: 12px;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .nav {
    display: none;
  }

  .controls {
    padding-left: 0;
    border-left: none;
  }

  .contact-row {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}
