/* ============================================================
   Lai Lab — global styles
   Palette: deep navy + purple accent, cool gray, warm cream
   Type: Bricolage Grotesque (display) + Schibsted Grotesk (body)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700&family=Schibsted+Grotesk:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --bg: #f4f1ec;
  --paper: #fbfaf6;
  --ink: #0f2b3d;
  --ink-soft: #2a3f50;
  --ink-mute: #5b6e7c;
  --accent: #7c5cd9;
  --accent-deep: #5a3fb8;
  --cool: #d4dfe6;
  --cool-deep: #b6c4cf;
  --hairline: rgba(15, 43, 61, 0.14);
  --hairline-strong: rgba(15, 43, 61, 0.28);
  --shadow-sm: 0 1px 2px rgba(15, 43, 61, 0.04), 0 2px 8px rgba(15, 43, 61, 0.04);
  --shadow-md: 0 4px 20px rgba(15, 43, 61, 0.08);

  --max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

::selection {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 236, 0.85);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 24;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: auto -4px -4px auto;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
}

.brand-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-mute);
  margin-left: 2px;
  letter-spacing: 0.01em;
}

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

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(15, 43, 61, 0.05);
}

.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-cta {
  margin-left: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  transition: background 0.18s ease;
}

.nav-cta:hover {
  background: var(--accent-deep);
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: clamp(40px, 6.2vw, 88px);
  line-height: 0.98;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  font-variation-settings: "opsz" 28;
}

h4 {
  font-size: 18px;
  line-height: 1.25;
  font-variation-settings: "opsz" 20;
}

p {
  margin: 0;
  text-wrap: pretty;
  color: var(--ink-soft);
}

.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
}

section {
  padding: clamp(72px, 10vw, 140px) 0;
}

section + section {
  border-top: 1px solid var(--hairline);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head .label {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-head .label .idx {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

@media (max-width: 800px) {
  .section-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ============================================================
   BUTTONS / TAGS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.15s ease, background 0.18s ease;
  border: 1px solid var(--ink);
}

.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}

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

.btn .arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--cool);
  color: var(--ink);
  border-radius: 999px;
}

.tag--accent {
  background: rgba(124, 92, 217, 0.14);
  color: var(--accent-deep);
}

.tag--corr {
  background: var(--ink);
  color: var(--bg);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--ink);
  color: rgba(244, 241, 236, 0.75);
  padding: 80px 0 32px;
  margin-top: 0;
}

.footer .container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer h4 {
  color: var(--bg);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--bg);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.footer-tag {
  font-size: 14px;
  line-height: 1.5;
  max-width: 30ch;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

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

.footer-bottom {
  max-width: var(--max);
  margin: 64px auto 0;
  padding: 28px var(--gutter) 0;
  border-top: 1px solid rgba(244, 241, 236, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.55);
}

.affil-strip {
  background: var(--paper);
  padding: 40px 0;
  border-top: 1px solid var(--hairline);
}

.affil-strip-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.affil-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  max-width: 18ch;
}

.affil-strip img {
  height: 64px;
  width: auto;
  opacity: 0.92;
}

@media (max-width: 900px) {
  .footer .container {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.hr-dot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hr-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.kbd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: var(--ink-mute);
}

/* page-level visual rhythm: alternate panel bg */
.panel--paper {
  background: var(--paper);
}

.panel--ink {
  background: var(--ink);
  color: var(--bg);
}

.panel--ink h1,
.panel--ink h2,
.panel--ink h3,
.panel--ink h4 {
  color: var(--bg);
}

.panel--ink p {
  color: rgba(244, 241, 236, 0.78);
}

.panel--ink .eyebrow {
  color: #b8a5f0;
}

.panel--ink .eyebrow::before {
  background: #b8a5f0;
}
