/* ===== Meraki Softworks — shared design tokens ===== */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100,400;100,500;100,600;100,700;125,800;125,900&display=swap");

:root {
  --bg-page: #0c0c0c;
  --bg-surface: #141414;
  --bg-elevated: #1a1a1a;
  --text: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.72);
  --text-subtle: rgba(245, 245, 245, 0.5);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --accent-fg: #0a0a0a;
  --grid-line: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(12, 12, 12, 0.88);
  --header-border: rgba(255, 255, 255, 0.08);
  --hero-bg-surface: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 82%, var(--bg-surface)) 0%,
    color-mix(in srgb, var(--bg-page) 94%, var(--bg-surface)) 38%,
    color-mix(in srgb, var(--bg-page) 98%, transparent) 72%,
    transparent 100%
  );
  --ring-focus: rgba(34, 211, 238, 0.5);
  --footer-bg: #0c0c0c;
  --footer-text: #f5f5f5;
  --footer-muted: rgba(245, 245, 245, 0.62);
  --footer-border: rgba(255, 255, 255, 0.1);
  --container-max: 1200px;
  --gutter: 24px;
  --site-header-h: 4.5rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-squircle: 28px;
  --radius-pill: 999px;
}

[data-theme="light"] {
  --bg-page: #fafaf9;
  --bg-surface: #ffffff;
  --bg-elevated: #f4f4f5;
  --text: #111111;
  --text-muted: rgba(17, 17, 17, 0.68);
  --text-subtle: rgba(17, 17, 17, 0.48);
  --border: rgba(17, 17, 17, 0.1);
  --border-strong: rgba(17, 17, 17, 0.16);
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-fg: #0a0a0a;
  --grid-line: rgba(17, 17, 17, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --header-bg: rgba(250, 250, 249, 0.88);
  --header-border: rgba(17, 17, 17, 0.08);
  --hero-bg-surface: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 82%, var(--bg-elevated)) 0%,
    color-mix(in srgb, var(--bg-page) 94%, var(--bg-elevated)) 38%,
    color-mix(in srgb, var(--bg-page) 98%, transparent) 72%,
    transparent 100%
  );
  --ring-focus: rgba(6, 182, 212, 0.45);
}

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

html {
  font-size: 17px;
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-h) + 12px);
  overflow-x: clip;
}

html[data-theme="light"] {
  color-scheme: light;
}

@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-page);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ring-focus);
  outline-offset: 2px;
}

/* ===== Layout ===== */
.container {
  width: min(var(--container-max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.section {
  padding: 88px 0;
}

.section--slim {
  padding: 56px 0;
}

/* ===== Typography helpers ===== */
.text-muted {
  color: var(--text-muted);
}

.text-subtle {
  color: var(--text-subtle);
}

.serif-tagline {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-style: italic;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn--lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

/* ===== Cards ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-squircle);
  corner-shape: squircle;
  box-shadow: var(--shadow-sm);
}

.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ===== Site header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(0);
  transition:
    transform 0.3s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    backdrop-filter 0.25s ease;
}

.site-header:not(.is-ready) {
  transition: none;
}

.site-header.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--site-header-h);
}

.site-header__brand img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

[data-theme="light"] .site-header__brand img {
  filter: brightness(0);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header__nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.site-header__nav a:hover,
.site-header__nav a:focus {
  color: var(--text);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header__cta {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-color: var(--border);
}

.site-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
}

.site-header__toggle .site-header__icon-close {
  display: none;
}

.site-header__toggle[aria-expanded="true"] .site-header__icon-open {
  display: none;
}

.site-header__toggle[aria-expanded="true"] .site-header__icon-close {
  display: block;
}

.site-header__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* ===== Theme toggle ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 4%, var(--bg-surface));
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--text) 16%, transparent);
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.theme-toggle__sun,
.theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__sun,
:root:not([data-theme="light"]) .theme-toggle__sun {
  display: block;
}

[data-theme="light"] .theme-toggle__moon {
  display: block;
}

/* ===== Site footer (always dark) ===== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 32px;
  margin-top: auto;
}

.site-footer a {
  color: var(--footer-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.site-footer__grid--nav-row {
  display: flex;
  justify-content: center;
}

.site-footer__grid--nav-row .site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.site-footer__grid--nav-row .site-footer__links li {
  margin-bottom: 0;
}

.site-footer__heading {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--footer-text);
}

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

.site-footer__links li {
  margin-bottom: 8px;
}

.site-footer__links a {
  font-size: 0.875rem;
}

.site-footer__link-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  color: var(--footer-muted);
  cursor: pointer;
  text-align: inherit;
  transition: color 0.15s ease;
}

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

.site-footer__brand p {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--footer-muted);
  max-width: 28ch;
  line-height: 1.55;
}

.site-footer__divider {
  border: 0;
  border-top: 1px solid var(--footer-border);
  margin: 32px 0 20px;
}

.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
}

.site-footer__legal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--footer-text);
}

.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-footer__legal-links a {
  font-size: 0.8125rem;
  color: var(--footer-muted);
}

.site-footer__legal-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--footer-muted);
  max-width: 72ch;
  line-height: 1.55;
}

/* ===== Legal prose ===== */
.legal {
  max-width: 720px;
  padding: 48px 0 64px;
}

.legal h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.legal h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

.legal p,
.legal li {
  color: var(--text-muted);
  line-height: 1.65;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal .back-link {
  margin-bottom: 24px;
}

.legal .back-link a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.legal .back-link a:hover {
  color: var(--text);
}

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

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal--d1 {
  transition-delay: 80ms;
}

.reveal--d2 {
  transition-delay: 160ms;
}

.reveal--d3 {
  transition-delay: 240ms;
}

/* Desktop: logo | centered nav | actions */
@media (min-width: 901px) {
  .site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .site-header__menu {
    display: contents;
  }

  .site-header__actions {
    justify-self: end;
  }
}

/* ===== Responsive header ===== */
@media (max-width: 900px) {
  .site-header__toggle {
    display: inline-flex;
  }

  .site-header:has(.site-header__menu.is-open) {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .site-header__menu {
    position: fixed;
    top: var(--site-header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .site-header__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .site-header__nav a {
    display: block;
    padding: 12px 8px;
  }

  .site-header__actions {
    width: 100%;
    flex-direction: column;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .site-header__actions .btn {
    width: 100%;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer__brand p {
    max-width: none;
  }

  .site-footer__legal-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer__legal-links {
    justify-content: center;
  }

  .site-footer__legal-note {
    max-width: none;
    text-align: center;
  }

  .section {
    padding: 56px 0;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .site-header,
  .site-header__menu {
    transition: none;
  }
}
