/*
 * site.css: the shared stylesheet for every static .html page on wavelengthflow.com.
 * Built from the app theme in src/index.css (light theme) and the Landing page styles.
 * Linked by every file that scripts/gen-static.mjs writes. Page-specific rules stay in
 * each page's own <style> block, which loads after this file.
 */

:root {
  /* App theme tokens (src/index.css, light) */
  --background: #F7F7FC;      /* hsl(240 25% 98%) */
  --foreground: #1C1C22;      /* hsl(240 10% 12%) */
  --card: #FFFFFF;
  --primary: #7047EB;         /* hsl(255 80% 60%) */
  --muted-bg: #F2F2F8;        /* hsl(240 20% 96%) */
  --muted-foreground: #6D6D79;/* hsl(240 5% 45%) */
  --border: #E9E9ED;          /* hsl(240 10% 92%) */
  --radius: 0.75rem;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --brand-gradient: linear-gradient(135deg, #7C5CFC 0%, #E85D9A 42%, #FF8A5B 72%, #3B82F6 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");

  /* Legacy page tokens, mapped to the app theme so page-specific rules match */
  --ink: var(--foreground);
  --body: #46464F;
  --muted: var(--muted-foreground);
  --line: var(--border);
  --paper: var(--background);
  --violet: var(--primary);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

/* ---------- Content column ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 36px; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1 { font-size: clamp(36px, 5.4vw, 56px); line-height: 1.05; margin: 28px 0 20px; color: var(--foreground); }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; margin: 56px 0 14px; color: var(--foreground); }
h3 { font-size: 18px; line-height: 1.35; margin: 32px 0 8px; font-weight: 600; color: var(--foreground); }
p { color: var(--body); margin-bottom: 16px; }
.lede { font-size: 19px; line-height: 1.6; color: var(--body); }
ul, ol { color: var(--body); margin: 0 0 16px 22px; }
li { margin-bottom: 7px; }
ul.plain, ol.plain { margin: 0 0 16px 22px; color: var(--body); }
ul.plain li, ol.plain li { margin-bottom: 6px; }
.fineprint { font-size: 13.5px; color: var(--muted-foreground); margin-bottom: 0; }
strong { color: var(--foreground); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* ---------- Buttons (Landing GradientButton / WhiteButton) ---------- */
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.4;
  padding: 10px 20px; border-radius: 999px;
  transition: opacity .15s ease, background-color .15s ease;
}
.btn-primary, .wl-btn-primary {
  color: #fff;
  background-color: #7C5CFC;
  background-image: var(--grain), var(--brand-gradient);
  background-blend-mode: overlay, normal;
  background-size: 160px 160px, 100% 100%;
  background-repeat: repeat, no-repeat;
}
.btn-primary:hover, .wl-btn-primary:hover { opacity: .9; }
.btn-ghost, .wl-btn-ghost { color: var(--foreground); background: #fff; border: 1px solid var(--border); }
.btn-ghost:hover, .wl-btn-ghost:hover { background: var(--muted-bg); }

/* ---------- Cards, callouts, tables ---------- */
.callout {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; margin: 28px 0; box-shadow: 0 1px 2px rgba(28, 28, 34, .04);
}
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted-foreground); font-weight: 600; background: var(--muted-bg); }
td:first-child { font-weight: 500; width: 31%; color: var(--foreground); }

blockquote {
  border-left: 3px solid var(--primary); padding: 4px 0 4px 18px; margin: 24px 0;
  font-family: var(--font-display); font-size: 22px; line-height: 1.4; color: var(--body);
}
pre {
  background: #16141c; color: #e9e6f2; border-radius: 12px; padding: 16px 18px;
  overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 16px 0 24px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.grid a {
  display: block; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; text-decoration: none; color: var(--foreground); font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.grid a:hover { border-color: rgba(112, 71, 235, .35); box-shadow: 0 4px 14px rgba(112, 71, 235, .08); }
.grid a span { display: block; color: var(--muted-foreground); font-weight: 400; font-size: 13.5px; margin-top: 4px; }

.diagram { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin: 24px 0 8px; overflow-x: auto; }
.diagram svg { width: 100%; height: auto; display: block; }
figcaption { font-size: 13.5px; color: var(--muted-foreground); margin-bottom: 24px; }

/* ---------- Site header (mirrors the Landing nav) ---------- */
header.wl-header { position: sticky; top: 12px; z-index: 50; padding: 0 16px; margin-top: 12px; }
.wl-header .wl-bar {
  max-width: 1024px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(233, 233, 237, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(28, 28, 34, .05);
}
.wl-header .wl-logo { display: inline-flex; align-items: center; }
.wl-header .wl-logo img { height: 24px; width: auto; display: block; }
.wl-header nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.wl-header nav a { color: var(--muted-foreground); text-decoration: none; }
.wl-header nav a:hover { color: var(--foreground); }
.wl-header .wl-actions { display: flex; align-items: center; gap: 8px; }
.wl-header .wl-btn-primary, .wl-header .wl-btn-ghost {
  display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 9px 18px; border-radius: 999px; line-height: 1.3; white-space: nowrap;
}

/* Language menu */
.langdrop { position: relative; display: inline-block; }
.langdrop summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--muted-foreground);
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, .8);
}
.langdrop summary::-webkit-details-marker { display: none; }
.langdrop summary b { color: var(--foreground); font-weight: 600; }
.langdrop[open] summary { color: var(--foreground); }
.langdrop .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 30px rgba(28, 28, 34, .12);
}
.langdrop .menu a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--foreground); text-decoration: none; }
.langdrop .menu a:hover { background: var(--muted-bg); }
.langdrop .menu a.cur { color: var(--primary); font-weight: 600; }

@media (max-width: 860px) {
  .wl-header nav { display: none; }
}
@media (max-width: 560px) {
  .wl-header .wl-btn-ghost, .wl-header .langdrop { display: none; }
  .wl-header .wl-bar { padding-left: 14px; }
}

/* ---------- Site footer (mirrors the Landing footer) ---------- */
footer.wl-footer { border-top: 1px solid var(--border); margin-top: 72px; background: var(--background); }
.wl-footer .wl-foot { max-width: 1152px; margin: 0 auto; padding: 56px 24px 32px; }
.wl-footer .wl-cols { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 32px; }
.wl-footer .wl-brand img { height: 24px; width: auto; display: block; }
.wl-footer .wl-brand p { margin: 16px 0 20px; font-size: 14px; line-height: 1.6; color: var(--muted-foreground); max-width: 260px; }
.wl-footer h3 {
  margin: 0 0 14px; font-family: var(--font-body); font-size: 12px; font-weight: 600; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .12em; color: rgba(28, 28, 34, .6);
}
.wl-footer h3.wl-connect { margin-top: 28px; }
.wl-footer ul { list-style: none; margin: 0; padding: 0; }
.wl-footer li { margin: 0 0 9px; font-size: 14px; line-height: 1.45; }
.wl-footer a { color: var(--muted-foreground); text-decoration: none; }
.wl-footer a:hover { color: var(--foreground); }
.wl-footer .wl-social { display: flex; gap: 16px; }
.wl-footer .wl-social svg { width: 16px; height: 16px; display: block; }
.wl-footer .wl-pref {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--background); font-size: 12px; font-weight: 500;
}
.wl-footer .wl-pref svg { flex: none; width: 13px; height: 13px; }
.wl-footer .wl-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.wl-footer .wl-bottom p { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.wl-footer .wl-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.wl-footer .wl-badges img { height: 32px; width: auto; display: block; }
.wl-footer .wl-badges .wl-featured { font-size: 12px; font-weight: 500; }

@media (max-width: 1024px) {
  .wl-footer .wl-cols { grid-template-columns: repeat(3, 1fr); }
  .wl-footer .wl-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wl-footer .wl-foot { padding-top: 32px; }
  .wl-footer .wl-cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .wl-footer .wl-badges { display: none; }
  .wl-footer .wl-bottom { justify-content: center; margin-top: 32px; }
}
