/* ============================================================
   Canonic — landing page
   Design language: the scored script page.
   Palette: script paper + ink navy + Post-It yellow (signature)
   + grader red (failure marks only) + slate (utility).
   Type: mono display voice (sluglines/scripts), system sans body.
   ============================================================ */

:root {
  --paper: #F5F4EF;
  --paper-raise: #FDFCF8;
  --ink: #161D2B;
  --ink-soft: #3A4252;
  --slate: #6A7280;
  --postit: #FFD34D;
  --postit-deep: #B98F00;
  --grader: #C24A33;
  --pass: #3E7A4E;
  --rule: rgba(22, 29, 43, 0.14);

  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --w: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10141D;
    --paper-raise: #181E2B;
    --ink: #E9E8E1;
    --ink-soft: #C2C4C9;
    --slate: #8B93A1;
    --postit: #FFD34D;
    --postit-deep: #FFDf7a;
    --grader: #E06A50;
    --pass: #6FBF83;
    --rule: rgba(233, 232, 225, 0.16);
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--postit-deep);
  outline-offset: 3px;
}

main { display: block; }

/* ---------- nav ---------- */
.nav {
  max-width: var(--w);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.22em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.wordmark-note {
  width: 13px; height: 13px;
  background: var(--postit);
  display: inline-block;
  transform: rotate(-4deg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.18);
}

.nav-links {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.nav-links a { text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.nav-links a:hover { border-bottom-color: var(--ink); }
.nav-quiet { color: var(--slate); }

/* ---------- shared section rhythm ---------- */
section {
  max-width: var(--w);
  margin: 0 auto;
  padding: 88px 24px 0;
}

.slugline {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--slate);
  margin-bottom: 22px;
}
.slugline::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--postit);
  margin-top: 10px;
}

h1, h2 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.14;
}
h1 { font-size: clamp(30px, 5.2vw, 54px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); margin-bottom: 18px; }

h1 mark {
  background: linear-gradient(transparent 55%, var(--postit) 55%);
  color: inherit;
  padding: 0 2px;
}

.section-lede {
  max-width: 660px;
  color: var(--ink-soft);
  margin: 6px 0 34px;
}

/* ---------- hero ---------- */
.hero { padding-top: 72px; }
.hero-sub {
  max-width: 640px;
  margin: 26px 0 38px;
  color: var(--ink-soft);
  font-size: 18px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 13px 22px;
  display: inline-block;
  border: 1.5px solid var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--postit);
}
.btn-primary:hover { box-shadow: 6px 6px 0 var(--postit); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--paper-raise); }

/* ---------- demo: the scored script pages ---------- */
.demo-tabs { display: flex; gap: 10px; margin-bottom: 26px; }
.tab {
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 16px;
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--rule);
  cursor: pointer;
}
.tab.is-active {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-raise);
  box-shadow: 3px 3px 0 var(--postit);
}

.script-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}

.script-page {
  background: var(--paper-raise);
  border: 1px solid var(--rule);
  padding: 24px 26px 20px;
  position: relative;
  box-shadow: 0 2px 10px rgba(15, 20, 32, 0.05);
}
.script-fail { border-top: 4px solid var(--grader); }
.script-pass { border-top: 4px solid var(--postit); }

.script-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.script-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

.score-chip {
  font-family: var(--mono);
  font-size: 13px;
  padding: 3px 9px;
  white-space: nowrap;
}
.score-chip .score-val { font-size: 17px; font-weight: 700; }
.score-of { color: var(--slate); margin-left: 4px; font-size: 11px; }
.score-low  { background: color-mix(in srgb, var(--grader) 14%, transparent); color: var(--grader); }
.score-high { background: color-mix(in srgb, var(--postit) 40%, transparent); color: var(--ink); }
.score-high .score-of { color: var(--ink-soft); }

.script-body {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
}
.script-body p { margin-bottom: 14px; }
.script-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 12px;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent);
}
.script-scroll::-webkit-scrollbar { width: 8px; }
.script-scroll::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
.script-scroll strong { letter-spacing: 0.04em; }
.script-body .char { font-weight: 700; letter-spacing: 0.08em; }
.script-body .paren { color: var(--slate); font-style: italic; }
.script-meta { color: var(--slate); font-style: italic; }
.script-ellipsis {
  color: var(--slate);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.margin-marks {
  list-style: none;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
}
.margin-marks li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grader);
  padding-left: 20px;
  position: relative;
  margin-bottom: 5px;
}
.margin-marks li::before {
  content: "✗";
  position: absolute;
  left: 0;
  font-weight: 700;
}
.marks-pass li { color: var(--pass); }
.marks-pass li::before { content: "✓"; }

/* slope chart */
.slope { margin-top: 40px; }
.slope svg { width: 100%; max-width: 560px; height: auto; display: block; }
figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  margin-top: 10px;
  max-width: 560px;
}

/* ---------- how it works ---------- */
.how-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.step {
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  padding-left: 30px;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-mark {
  position: absolute;
  left: 0; top: 28px;
  width: 12px; height: 12px;
  background: var(--postit);
  transform: rotate(-4deg);
}
.step h3 {
  font-family: var(--mono);
  font-size: 16px;
  margin-bottom: 6px;
}
.step p { color: var(--ink-soft); font-size: 15.5px; }

.radar svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }

/* ---------- pillars ---------- */
.pillar-cols {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 44px;
  align-items: start;
  margin-bottom: 34px;
}

.feature-list { list-style: none; }
.feature-list li {
  padding: 14px 0 14px 26px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15.5px;
  position: relative;
}
.feature-list li:last-child { border-bottom: 1px solid var(--rule); }
.feature-list li::before {
  content: "✓";
  font-family: var(--mono);
  font-weight: 700;
  color: var(--postit-deep);
  position: absolute;
  left: 2px;
}
.feature-list strong { color: var(--ink); }

.minicharts svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  background: var(--paper-raise);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
}

.domains { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.domain {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 13px;
  border: 1px solid var(--rule);
  color: var(--slate);
}
.domain.is-live {
  border-color: var(--postit-deep);
  color: var(--ink);
  background: color-mix(in srgb, var(--postit) 22%, transparent);
}
.domain em { font-style: normal; color: var(--postit-deep); font-weight: 700; }

/* ---------- Mangalore contrast ---------- */
.contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-bottom: 14px;
}
.loc-card {
  background: var(--paper-raise);
  border: 1px solid var(--rule);
  padding: 24px 26px 18px;
}
.loc-fail { border-top: 4px solid var(--grader); }
.loc-pass { border-top: 4px solid var(--postit); }
.loc-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}
.loc-card p {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.loc-pass p { color: var(--ink); }
.loc-prompt {
  font-family: var(--mono);
  font-size: 13px !important;
  line-height: 1.65 !important;
  background: color-mix(in srgb, var(--postit) 12%, transparent);
  border-left: 3px solid var(--postit);
  padding: 10px 12px;
}
.loc-fail .loc-prompt {
  background: color-mix(in srgb, var(--grader) 8%, transparent);
  border-left-color: var(--grader);
}
.loc-more { color: var(--slate); font-style: italic; }
.loc-note { font-size: 14px !important; color: var(--slate) !important; }

.output-frame {
  margin: 16px 0 4px;
  border: 1px solid var(--rule);
  background: var(--paper);
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.output-frame img,
.output-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-placeholder {
  display: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--slate);
  text-align: center;
  padding: 12px;
}
.output-frame.is-empty { background: repeating-linear-gradient(-45deg, transparent, transparent 10px, var(--rule) 10px, var(--rule) 11px); }
.output-frame.is-empty .frame-placeholder { display: block; background: var(--paper-raise); border: 1px dashed var(--rule); }
.contrast-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 30px;
}

/* ---------- credibility strip ---------- */
.cred {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 40px 24px;
  margin-top: 100px;
}
.cred-item { display: flex; flex-direction: column; gap: 6px; }
.cred-num {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.cred-label { font-size: 13.5px; color: var(--slate); max-width: 190px; }

/* ---------- investors ---------- */
.investors { padding-bottom: 20px; }
.investors p { max-width: 620px; color: var(--ink-soft); margin-bottom: 28px; }

/* ---------- footer ---------- */
.footer {
  max-width: var(--w);
  margin: 90px auto 0;
  padding: 36px 24px 48px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wordmark-sm { font-size: 14px; }
.footer-line { font-size: 13.5px; color: var(--slate); }
.footer-line a { color: var(--ink-soft); }
.footer-attr { font-family: var(--mono); font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .script-pair, .contrast, .how-grid, .pillar-cols { grid-template-columns: 1fr; }
  .cred { grid-template-columns: repeat(2, 1fr); }
  section { padding-top: 64px; }
  .hero { padding-top: 44px; }
}

@media (max-width: 480px) {
  .nav { flex-direction: column; gap: 14px; }
  .cred { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; text-align: center; }
}
