:root {
  --ink: #1a1a2e;
  --muted: #6b7280;
  --body: #374151;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: inherit; }

/* NAV */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 32px; height: 32px; }
.brand span {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
}
nav.primary { display: flex; gap: 1.75rem; }
nav.primary a {
  color: var(--body);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
nav.primary a:hover { color: var(--ink); }
nav.primary a[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .nav-inner { padding: 0.6rem 1rem; }
  .brand img { width: 28px; height: 28px; }
  .brand span { font-size: 0.78rem; letter-spacing: 0.04em; }
  nav.primary { gap: 1rem; }
  nav.primary a { font-size: 0.82rem; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
}

section {
  padding: 4.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
section:last-of-type { border-bottom: none; }
section.alt { background: var(--bg-alt); }
.wrap { max-width: 1080px; margin: 0 auto; }
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
h1, h2, h3 { color: var(--ink); }
h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 2rem; letter-spacing: -0.01em; }
p { color: var(--body); }
.lead { font-size: 1.1rem; color: var(--body); max-width: 640px; }
.lead.center { margin: 0 auto; text-align: center; }
.lead.wide { max-width: none; }

/* HERO */
.hero { padding-top: 6rem; padding-bottom: 6rem; text-align: center; }
.hero img.logo { width: 180px; height: auto; margin: 0 auto 1.5rem; display: block; }
@media (max-width: 640px) {
  .hero { padding-top: 3rem; padding-bottom: 3rem; }
  .hero img.logo { width: 140px; }
  h1 { font-size: 1.75rem; }
}

.cta-row { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.15s, color 0.15s;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }

/* ABOUT / PROFILES */
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 720px) { .profiles { grid-template-columns: 1fr; gap: 2.5rem; } }
.profile { display: flex; flex-direction: column; gap: 1rem; }
.profile .photo {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; background: var(--bg-alt);
}
.profile .photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 2rem; font-weight: 600;
  border: 1px dashed var(--line);
}
.profile h3 { font-size: 1.25rem; font-weight: 700; margin-top: 0.5rem; }
.profile p { font-size: 0.98rem; }
.profile p + p { margin-top: 0.85rem; }

/* PRODUCTS */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .products { grid-template-columns: 1fr; } }
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 2rem;
  display: flex; flex-direction: column;
}
.card .brand {
  display: flex; align-items: center; gap: 0.85rem;
  margin-bottom: 0.75rem; min-height: 72px;
}
.card .brand img { display: block; height: 64px; width: auto; }
.card .brand .brand-name {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.9rem; font-weight: 700; color: #1a1a1a; letter-spacing: -0.01em;
  line-height: 1;
}
.card .brand.wordmark img { height: 48px; max-width: 100%; }
@media (max-width: 720px) {
  .card .brand.wordmark img { height: 40px; }
}
.card .brand .psycleback-wordmark .cap {
  font-size: 1.25em; line-height: 1; vertical-align: baseline;
}
.card .brand.wordmark .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.card h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.25rem; }
.card .stage {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a5a00; background: #fef3c7;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  margin-bottom: 1rem; align-self: flex-start;
}
.card p { margin-bottom: 1rem; font-size: 0.96rem; }
.card a.more {
  color: var(--ink); font-weight: 600; text-decoration: none;
  font-size: 0.92rem; margin-top: auto;
}
.card a.more:hover { text-decoration: underline; }
.card a.more::after { content: " →"; }

/* COMPANY / CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }
address { font-style: normal; color: var(--body); line-height: 2; }
address a { color: var(--body); text-decoration: none; }
address a:hover { color: var(--ink); text-decoration: underline; }
dl.company-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; font-size: 0.95rem; }
dl.company-facts dt { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; align-self: center; }
dl.company-facts dd { color: var(--body); }

footer.site {
  text-align: center; padding: 2rem 1.5rem;
  font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em;
  border-top: 1px solid var(--line);
}
footer.site a { color: var(--muted); text-decoration: none; margin: 0 0.5rem; }
footer.site a:hover { color: var(--ink); }

/* -----------------------------------------------------------------------
 * DARK MODE
 * ---------------------------------------------------------------------
 * All theming flows through the CSS vars in :root. To go dark we simply
 * override those vars on :root.dark (the class the theme.js head-boot
 * snippet toggles before first paint).
 * ------------------------------------------------------------------- */
:root.dark {
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --body: #d1d5db;
  --line: #262f3d;
  --bg: #0b0f17;
  --bg-alt: #111827;
}
:root.dark header.site {
  background: rgba(11, 15, 23, 0.85);
}
:root.dark .btn.primary { background: var(--ink); color: #0b0f17; }
:root.dark .btn.primary:hover { background: #ffffff; }
:root.dark .btn.ghost { color: var(--ink); border-color: var(--ink); }
:root.dark .btn.ghost:hover { background: var(--ink); color: #0b0f17; }
:root.dark .card { background: var(--bg-alt); }
:root.dark .card .brand .brand-name { color: var(--ink); }
:root.dark .card .brand.wordmark img,
:root.dark .brand img,
:root.dark .hero img.logo {
  /* logos are dark-on-light; lift them for readability on dark bg */
  filter: brightness(0) invert(1);
}
:root.dark .card .stage { color: #fde68a; background: #3b2f04; }

/* -----------------------------------------------------------------------
 * THEME TOGGLE (floating, upper-right)
 * ------------------------------------------------------------------- */
.sa-theme-toggle {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 50;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}
.sa-theme-toggle svg { width: 1rem; height: 1rem; display: block; }
.sa-theme-toggle:hover { background: var(--bg-alt); }
.sa-theme-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .sa-theme-toggle { top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem; }
  .sa-theme-toggle svg { width: 0.9rem; height: 0.9rem; }
}

/* -----------------------------------------------------------------------
 * COOKIE NOTICE
 * ------------------------------------------------------------------- */
.sa-cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 0.85rem 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.sa-cookie-notice-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.sa-cookie-notice-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--body);
  max-width: 720px;
}
.sa-cookie-notice-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.sa-cookie-notice-btn:hover { opacity: 0.9; }

/* -----------------------------------------------------------------------
 * Wordmark light/dark swap
 * ---------------------------------------------------------------------
 * PsycleBack has separate light + dark artwork; Yachtly's single wordmark
 * works in both modes. Show the light variant by default; swap on .dark.
 * These override the earlier `filter: invert` rule for .card wordmarks.
 * ------------------------------------------------------------------- */
.card .brand.wordmark .wm-dark { display: none; }
:root.dark .card .brand.wordmark .wm-light { display: none; }
:root.dark .card .brand.wordmark .wm-dark { display: block; }
/* Yachtly wordmark is a single asset used for both modes — no invert. */
:root.dark .card .brand.wordmark img { filter: none; }

/* -----------------------------------------------------------------------
 * Nav spacing: keep primary nav links clear of the floating theme toggle
 * ------------------------------------------------------------------- */
header.site .nav-inner { padding-right: 4rem; }
@media (max-width: 640px) {
  header.site .nav-inner { padding-right: 3.25rem; }
}

/* -----------------------------------------------------------------------
 * Footer legal links (Privacy · Cookie settings)
 * ------------------------------------------------------------------- */
footer.site .footer-links {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.85;
}
footer.site .footer-links a {
  color: inherit;
  text-decoration: underline;
}
footer.site .footer-links a:hover { opacity: 0.7; }
footer.site .footer-links span { margin: 0 0.4rem; opacity: 0.5; }

/* -----------------------------------------------------------------------
 * Legal pages (privacy, terms) — comfortable heading rhythm
 * ------------------------------------------------------------------- */
.legal-body h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  line-height: 1.3;
}
.legal-body h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  line-height: 1.3;
}
.legal-body h2:first-child,
.legal-body h3:first-child { margin-top: 0.5rem; }
.legal-body p { margin: 0 0 1rem; }
.legal-body ul {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
  list-style-position: outside;
  text-align: left;
}
.legal-body ul li {
  margin-bottom: 0.35rem;
  padding-left: 0.25rem;
}
.legal-body a { color: inherit; text-decoration: underline; }
.legal-body a:hover { opacity: 0.75; }

/* -----------------------------------------------------------------------
 * Profile role/title line (Managing Founder, Technical Founder, etc.)
 * ------------------------------------------------------------------- */
.profile .role {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
  line-height: 1.2;
}
