/*
Theme Name: LSS Research v2
Theme URI: https://lssresearch.com
Author: LSS Research, LLC
Description: Term-sheet styled single-page theme for LSS Research, LLC.
Version: 2.1.0
Requires at least: 5.9
Requires PHP: 7.4
Text Domain: lss-research
*/

/* ------------------------------------------------------------
   Tokens
   Spectral for headings, Source Serif 4 for everything else you read,
   IBM Plex Mono for small labels and numbering.
   ------------------------------------------------------------ */
:root {
  --bg: #F6F6F2;
  --ink: #15171C;
  --ink-2: #454A53;
  --muted: #6C717A;
  --rule: #D6D7D0;
  --rule-strong: #15171C;
  --accent: #2B3FAE;
  --accent-ink: #FFFFFF;
  --marker: #1C2A85;                                /* section and clause numbers */
  --hl: #E6E9F5;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --display: "Spectral", "Source Serif 4", Georgia, "Times New Roman", serif;  /* headings only */
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Type scale: every size on the page comes from this list */
  --fs-label: 12px;                                   /* mono labels */
  --fs-small: 15px;                                   /* fine print, deliverables */
  --fs-body: 18px;                                    /* body, tables, forms */
  --fs-lead: clamp(19px, 17px + .5vw, 21px);          /* lede, recitals */
  --fs-h3: clamp(24px, 21px + .8vw, 28px);
  --fs-h2: clamp(32px, 26px + 1.6vw, 44px);
  --fs-h1: clamp(36px, 22px + 3.4vw, 64px);

  --rail: 188px;
  --gap: clamp(20px, 4vw, 56px);
  --measure: 680px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --ink: #ECEBE6;
    --ink-2: #C3C4C0;
    --muted: #8E929A;
    --rule: #2A2E36;
    --rule-strong: #ECEBE6;
    --accent: #9EABFF;
    --accent-ink: #0E1020;
    --marker: #B4BEFF;
    --hl: #1B2040;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216;
  --ink: #ECEBE6;
  --ink-2: #C3C4C0;
  --muted: #8E929A;
  --rule: #2A2E36;
  --rule-strong: #ECEBE6;
  --accent: #9EABFF;
  --accent-ink: #0E1020;
  --marker: #B4BEFF;
  --hl: #1B2040;
  color-scheme: dark;
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.lss {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:where(.lss) p { margin: 0 0 1em; }
:where(.lss) p:last-child { margin-bottom: 0; }
:where(.lss) a { color: inherit; }
:where(.lss) strong, :where(.lss) b { font-weight: 600; }
.lss :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lss ::selection { background: var(--hl); color: var(--ink); }

/* The one mono style. Everything in mono looks exactly like this. */
.mono, .label, .rail, .nav a, .btn, .textlink, .terms dt, .clause__num,
.reps li::before, .sched th, .field label, .foot__row, .skip {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--bg); padding: 8px 12px; }

.wrap { max-width: 1140px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 48px); }
.sc { text-transform: uppercase; font-size: .82em; letter-spacing: .08em; }
.term { font-weight: 600; }

/* Headings: one family, one weight, sizes from the scale */
.hero h1, .h2, .clause h3, .doc h1, .doc h2 { font-family: var(--display); font-weight: 500; text-wrap: balance; margin: 0; }

/* ------------------------------------------------------------
   Top bar
   ------------------------------------------------------------ */
.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand__name { font-family: var(--display); font-size: var(--fs-lead); font-weight: 600; letter-spacing: 0; line-height: 1; }
.brand__llc { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .08em; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--accent); }
.nav .nav__cta { color: var(--accent); border-bottom: 1px solid currentColor; padding-bottom: 2px; }
@media (max-width: 720px) {
  .nav a:not(.nav__cta) { display: none; }
  .brand__llc { display: none; }
}

/* ------------------------------------------------------------
   Section grid: margin rail + document column
   ------------------------------------------------------------ */
.sec {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--rule);
}
.sec--first { border-top: 0; padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 96px); }
.rail { position: sticky; top: 96px; align-self: start; color: var(--muted); }
.rail__num { display: block; color: var(--marker); font-weight: 600; font-size: 15px; letter-spacing: .06em; margin-bottom: 4px; }
.body { min-width: 0; max-width: var(--measure); }
.body--wide { max-width: 860px; }
@media (max-width: 800px) {
  .sec { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; margin-bottom: 22px; display: flex; gap: 12px; align-items: baseline; }
  .rail__num { display: inline; margin: 0; }
}

.h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -.008em; margin-bottom: 28px; }

/* ------------------------------------------------------------
   Preamble / hero
   ------------------------------------------------------------ */
.hero h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -.012em; }
.hero h1 .l2 { color: var(--muted); }
.lede { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-2); max-width: 36em; margin: 36px 0 0; }
.lede strong { color: var(--ink); }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 40px; }
.lss .btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 15px 22px; border-radius: 2px; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.lss .btn:hover { background: transparent; color: var(--accent); }
.lss .btn[disabled] { opacity: .6; cursor: progress; }
.lss .textlink { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px; }
.lss .textlink:hover { color: var(--accent); border-color: var(--accent); }

/* Summary of principal terms */
.sheet { margin-top: clamp(56px, 8vw, 88px); max-width: 860px; }
.sheet__title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--rule-strong); }
.sheet__title span:first-child { color: var(--ink); font-weight: 500; }
.sheet__title span:last-child { color: var(--muted); }
.terms { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); margin: 0; }
.terms dt, .terms dd { margin: 0; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.terms dt { color: var(--muted); padding-top: 19px; padding-right: 20px; }
.terms dd { font-size: var(--fs-body); line-height: 1.55; }
.terms dd .xref { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); text-decoration: none; white-space: nowrap; margin-left: 8px; }
.terms dd .xref:hover { text-decoration: underline; }
.terms dt:last-of-type, .terms dd:last-of-type { border-bottom: 2px solid var(--rule-strong); }
@media (max-width: 600px) {
  .terms { grid-template-columns: minmax(0, 1fr); }
  .terms dt { border-bottom: 0; padding: 16px 0 2px; }
  .terms dd { padding-top: 0; }
  .terms dt:last-of-type { border-bottom: 0; }
}

/* ------------------------------------------------------------
   Recitals
   ------------------------------------------------------------ */
.recitals p { font-size: var(--fs-lead); line-height: 1.6; margin-bottom: 1.1em; }
.recitals .sc { color: var(--ink); font-weight: 600; }
.recitals .therefore { margin-top: 1.6em; padding-top: 1.2em; border-top: 1px solid var(--rule); }

/* ------------------------------------------------------------
   Numbered clauses (scope, terms)
   ------------------------------------------------------------ */
.clauses { list-style: none; margin: 0; padding: 0; }
.clause { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); column-gap: 14px; padding-block: 30px; border-top: 1px solid var(--rule); }
.clause:first-child { border-top: 0; padding-top: 4px; }
.clause__num { font-weight: 600; font-size: 15px; letter-spacing: .04em; color: var(--marker); padding-top: 7px; }
.clause h3 { font-size: var(--fs-h3); line-height: 1.22; letter-spacing: -.005em; margin-bottom: 12px; }
.clause p { color: var(--ink-2); }
.vocab { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.vocab li { font-size: var(--fs-small); color: var(--ink-2); border: 1px solid var(--rule); padding: 3px 10px; border-radius: 2px; }
.deliv { margin-top: 18px !important; font-size: var(--fs-small); color: var(--ink-2); }
.deliv .mono { color: var(--muted); margin-right: 8px; }
.clause--run p { color: var(--ink); }
.clause--run .clause__num { padding-top: 4px; }
.runin { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (max-width: 480px) {
  .clause { grid-template-columns: minmax(0, 1fr); }
  .clause__num, .clause--run .clause__num { padding-top: 0; margin-bottom: 6px; }
}

/* ------------------------------------------------------------
   Representations
   ------------------------------------------------------------ */
.reps { list-style: none; margin: 0; padding: 0; counter-reset: rep; }
.reps li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); column-gap: 10px; padding-block: 14px; border-top: 1px solid var(--rule); }
.reps li:first-child { border-top: 0; }
.reps li::before { counter-increment: rep; content: "(" counter(rep, lower-alpha) ")"; text-transform: none; font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--marker); padding-top: 4px; }
.intro { color: var(--ink-2); margin-bottom: 14px !important; }

/* ------------------------------------------------------------
   Schedule table
   ------------------------------------------------------------ */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 2px solid var(--rule-strong); }
.sched { width: 100%; border-collapse: collapse; min-width: 560px; }
.sched th { color: var(--muted); text-align: left; padding: 14px 16px 10px 0; border-bottom: 1px solid var(--rule); }
.sched td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; color: var(--ink-2); font-size: var(--fs-body); line-height: 1.45; }
.sched td:first-child { color: var(--ink); font-weight: 600; width: 30%; }
.sched tr:last-child td { border-bottom: 2px solid var(--rule-strong); }
.sched tbody tr { transition: background-color .15s ease; }
.sched tbody tr:hover { background: var(--hl); }
.co { display: flex; align-items: center; min-height: 28px; }
.co__logo { display: block; height: 24px; width: auto; max-width: 150px; object-fit: contain; object-position: left center; }
.note { margin-top: 14px !important; font-size: var(--fs-small); color: var(--muted); }

/* ------------------------------------------------------------
   Notices / form
   ------------------------------------------------------------ */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 28px; margin-top: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { color: var(--muted); }
.field input, .field textarea {
  font-family: var(--serif); font-size: var(--fs-body); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  padding: 8px 0; width: 100%; -webkit-appearance: none; appearance: none;
}
.field textarea {
  resize: vertical; min-height: 160px; line-height: 32px; padding: 0;
  border-bottom: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule-strong) 31px, var(--rule-strong) 32px);
  background-attachment: local;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .75; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
.field textarea:focus { box-shadow: none; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--accent) 31px, var(--accent) 32px); }
.form__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.form__fine { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.status { grid-column: 1 / -1; font-size: var(--fs-body); margin: 0; }
.status:empty { display: none; }
.status[data-state="ok"] { color: var(--accent); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.foot { border-top: 1px solid var(--rule); padding-block: 28px 44px; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; color: var(--muted); }
.foot__row nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot__row a { text-decoration: none; color: var(--ink-2); }
.foot__row a:hover { color: var(--accent); }
.foot__fine { margin-top: 18px !important; font-size: var(--fs-small); color: var(--muted); max-width: 60em; line-height: 1.55; }

/* ------------------------------------------------------------
   Generic pages (privacy policy, blog posts)
   ------------------------------------------------------------ */
.doc h1 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -.012em; margin-bottom: 28px; }
.doc h2 { font-size: var(--fs-h3); line-height: 1.2; margin: 1.6em 0 .5em; }
.doc h3 { font-size: var(--fs-body); font-weight: 600; margin: 1.4em 0 .4em; }
.doc a { color: var(--accent); }
.doc img { max-width: 100%; height: auto; }
.doc .meta { margin-bottom: 14px; }
.doc article + article { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--rule); }
