/* Mental Faculty — shared site styles
   Used by all studio sites: mentalfaculty, keytakes, studies, glisten. */

:root {
  --bg: #fbfaf7;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --rule: #e8e4dc;
  --card: #ffffff;
  --accent: #3a6b48;
  --accent-fg: #ffffff;

  --font-display: Charter, 'Iowan Old Style', 'Source Serif Pro', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --container: 1000px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #ececec;
    --muted: #9a9a9a;
    --rule: #2a2825;
    --card: #1f1d1a;
    --accent: #7fb88a;
    --accent-fg: #161513;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--fg);
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; margin-bottom: 0.6em; }
h3 { font-size: 1.35rem; margin-bottom: 0.5em; }

p { color: var(--fg); }
p.muted, .muted { color: var(--muted); }

/* Site header — used across all sites */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.site-header .wordmark:hover { text-decoration: none; }
.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}
.site-header nav a {
  color: var(--fg);
}
.site-header nav a.is-current { color: var(--accent); }

/* Site footer — used across all sites */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  margin-top: 96px;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* Hero (studio app pages) */
.hero {
  padding: 88px 0 56px;
}
.hero .icon {
  width: 120px;
  height: 120px;
  border-radius: 26px;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: 4.4rem;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--accent);
  line-height: 1;
}
.hero .punchline {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  max-width: 30ch;
  margin: 6px 0 32px;
  color: var(--fg);
}
.hero .tagline {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 36px;
  line-height: 1.55;
}
.hero .badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero .badges img {
  height: 48px;
  width: auto;
}
.hero .screenshot-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.hero .screenshot-strip img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.10);
  display: block;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-ghost { border: 1px solid var(--fg); color: var(--fg); }

/* Feature cards (used by app pages) */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.features h2 { margin-bottom: 40px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
}
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); }

/* Product grid (parent index) */
.products {
  padding: 64px 0 24px;
}
.products h2 { margin-bottom: 32px; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.product-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px;
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.product-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}
.product-tile .icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 14px;
  display: block;
  object-fit: cover;
}
.product-tile .icon-letter {
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
}
.product-tile .name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.product-tile .desc { color: var(--muted); font-size: 0.95rem; }
.product-tile .out-arrow {
  font-size: 0.85rem;
  color: var(--accent);
  margin-left: 4px;
}

/* Open source list (parent home preview) */
.os-list {
  padding: 16px 0 48px;
}
.os-list h2 { margin-bottom: 16px; }
.os-list ul { list-style: none; }
.os-list li {
  padding: 8px 0;
}
.os-list .repo-name,
.repo-listing .repo-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-right: 8px;
}
.os-list .repo-desc,
.repo-listing .repo-desc { color: var(--muted); }

/* Repo list within prose pages */
.repo-listing {
  list-style: none;
  margin: 16px 0 32px;
  padding: 0;
}
.repo-listing li { padding: 6px 0; }

/* Page lede (parent home + about + ensembles) */
.lede {
  padding: 96px 0 32px;
}
.lede h1 {
  font-size: 3.2rem;
  max-width: 18ch;
  margin-bottom: 16px;
}
.lede .sub {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
}

/* Prose (about, privacy) */
.prose {
  padding: 64px 0;
}
.prose .container { max-width: 65ch; }
.prose h1 { margin-bottom: 24px; }
.prose h2 { margin-top: 36px; margin-bottom: 12px; font-size: 1.4rem; }
.prose p { margin-bottom: 1em; color: var(--fg); }
.prose ul { margin: 0 0 1em 1.4em; }
.prose li { margin-bottom: 0.4em; }

/* Closing CTA on app pages */
.closing-cta {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.closing-cta h2 { margin-bottom: 20px; }
.closing-cta .badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.closing-cta .badges img { height: 48px; width: auto; }

/* Larger screenshot row (app pages) */
.screenshots-row {
  padding: 64px 0;
}
.screenshots-row h2 { margin-bottom: 32px; }
.screenshots-row .scroller {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}
.screenshots-row .scroller img {
  flex: 0 0 600px;
  max-width: 600px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  scroll-snap-align: center;
  cursor: zoom-in;
}

/* Lightbox modal */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
}
.lightbox .close {
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero { padding: 56px 0 32px; }
  .hero h1 { font-size: 3rem; }
  .hero .punchline { font-size: 1.3rem; }
  .hero .screenshot-strip { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .lede { padding: 56px 0 24px; }
  .lede h1 { font-size: 2.2rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .site-header nav { flex-wrap: wrap; gap: 14px; }
}
