/*
 * Norvale marketing site.
 * Brand tokens mirror the Norvale application (operation 5k: src/app/globals.css, docs/BRAND.md).
 * Light scheme only, matching the product.
 */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand (from the app) */
  --brand-50: #f0f3f8;
  --brand-100: #dde4ee;
  --brand-200: #b9c6d8;
  --brand-500: #4b6688;
  --brand-600: #2f4a6d;
  --brand-700: #1c3152;
  --brand-800: #13233d;

  /* Neutrals (from the app) */
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --subtle: #edf0f4;
  --line: #dfe3e9;
  --line-strong: #c9d0da;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-muted: #5a6a80; /* slightly deeper than the app's #64748b so small text passes AA on canvas */
  --ink-faint: #94a3b8;

  /* Site-only */
  --navy-line: rgb(255 255 255 / 0.12);
  --on-navy: #ffffff;
  --on-navy-soft: #c3cedd;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-pop: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px -6px rgb(15 23 42 / 0.14);
  --shadow-window: 0 1px 2px rgb(15 23 42 / 0.05), 0 2px 6px rgb(15 23 42 / 0.04), 0 28px 64px -24px rgb(15 23 42 / 0.28);

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(80px, 10vw, 136px);
  --header-h: 68px;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

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

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

strong, b {
  font-weight: 600;
}

::selection {
  background: var(--brand-100);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--brand-800);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: calc(720px + 2 * var(--gutter));
}

/* ---------- Type ---------- */

.kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-500);
}

/* The split stroke of the Norvale N, used as a small section marker. */
.kicker::before,
.eyebrow-mark {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(currentColor, currentColor) left / 3px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 3px 100% no-repeat;
  opacity: 0.9;
}

.eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-soft);
}

.eyebrow-mark {
  color: var(--brand-700);
}

.h2 {
  margin-top: 18px;
  font-size: clamp(2rem, 1.35rem + 2.5vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}

.h3 {
  margin-top: 14px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

.body,
.body-lg {
  color: var(--ink-soft);
  text-wrap: pretty;
}

.body {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.65;
}

.body-lg {
  margin-top: 20px;
  font-size: clamp(17px, 0.95rem + 0.3vw, 19px);
  line-height: 1.6;
}

.fineprint {
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.08);
}

.btn-primary:hover {
  background: var(--brand-800);
}

.btn-light {
  background: #fff;
  color: var(--brand-800);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}

.btn-light:hover {
  background: var(--brand-50);
}

.btn-light:focus-visible {
  outline-color: #fff;
}

.btn-text {
  padding-inline: 6px;
  color: var(--brand-700);
}

.btn-text:hover {
  color: var(--brand-800);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.btn:hover .icon-arrow {
  transform: translateX(2px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(243 245 248 / 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header[data-scrolled="true"],
.site-header[data-open="true"] {
  background: rgb(255 255 255 / 0.92);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
}

.mark {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgb(15 23 42 / 0.04);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
  margin: 0 auto;
}

.menu-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}

.menu-icon span:first-child { top: 1px; }
.menu-icon span:last-child { top: 7.4px; }

.menu-toggle[aria-expanded="true"] .menu-icon span:first-child {
  top: 4.2px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon span:last-child {
  top: 4.2px;
  transform: rotate(-45deg);
}

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.mobile-menu nav {
  padding-block: 12px 24px;
}

.mobile-menu ul {
  margin-bottom: 16px;
}

.mobile-menu li + li {
  border-top: 1px solid var(--line);
}

.mobile-menu ul a {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .menu-toggle {
    display: block;
  }
}

@media (min-width: 861px) {
  .mobile-menu {
    display: none;
  }
}

@media (max-width: 359px) {
  .header-cta {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: clamp(40px, 5vw, 72px);
  background: var(--canvas);
  overflow: hidden;
}

/* The lower part of the hero is white, so the product window sits across the seam. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: clamp(120px, 16vw, 220px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "title side";
  column-gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.hero .eyebrow {
  grid-area: eyebrow;
  margin-bottom: 28px;
}

.hero-title {
  grid-area: title;
  font-size: clamp(3rem, 1.6rem + 5.6vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 600;
  color: var(--brand-800);
}

.hero-side {
  grid-area: side;
  padding-bottom: 8px;
}

.lede {
  font-size: clamp(17px, 0.95rem + 0.35vw, 19px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 8px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

.hero-visual {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

@media (max-width: 900px) {
  .hero-copy {
    grid-template-columns: 1fr;
    grid-template-areas: "eyebrow" "title" "side";
  }

  .hero-side {
    margin-top: 24px;
    max-width: 560px;
  }
}

@media (max-width: 520px) {
  .hero .eyebrow {
    align-items: flex-start;
    font-size: 13px;
  }

  .hero .eyebrow-mark {
    margin-top: 5px;
  }

  .hero-actions .btn-primary {
    width: 100%;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-y);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(48px, 6vw, 80px);
}

/* ---------- Problem ---------- */

.problem-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.problem-intro {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}

.ledger {
  border-top: 1px solid var(--line);
}

.ledger-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.ledger-num {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand-500);
}

.ledger-item h3 {
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.ledger-item p {
  margin-top: 6px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.answer {
  margin-top: clamp(64px, 8vw, 112px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--ink);
}

.answer-text {
  max-width: 980px;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.375rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--ink-soft);
  text-wrap: balance;
}

.answer-text strong {
  color: var(--brand-800);
  font-weight: 600;
}

@media (max-width: 900px) {
  .problem-grid {
    grid-template-columns: 1fr;
  }

  .problem-intro {
    position: static;
  }
}

/* ---------- Product ---------- */

.product {
  background: var(--canvas);
  border-top: 1px solid var(--line);
}

.features {
  display: grid;
  gap: clamp(80px, 10vw, 136px);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.feature--flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.feature--flip .feature-copy {
  order: 2;
}

.feature-copy {
  max-width: 480px;
}

.checklist {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.checklist li {
  display: flex;
  gap: 12px;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.icon-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 2px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
}

.duo {
  margin-top: clamp(96px, 12vw, 160px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: clamp(32px, 4vw, 56px);
}

.duo-item {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 32px;
}

.duo-copy {
  max-width: 500px;
}

.duo-item .preview {
  display: flex;
  flex-direction: column;
}

.duo-item .ui-window {
  flex: 1;
}

.setup {
  margin-top: clamp(80px, 10vw, 128px);
  padding-top: 40px;
  border-top: 1px solid var(--line-strong);
}

.setup-title {
  font-size: 19px;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.setup-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.setup-grid dt {
  font-weight: 600;
  font-size: 15px;
}

.setup-grid dd {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-soft);
}

@media (max-width: 960px) {
  .feature {
    grid-template-columns: 1fr;
  }

  .feature--flip {
    grid-template-columns: 1fr;
  }

  .feature--flip .feature-copy {
    order: 0;
  }

  .feature-copy {
    max-width: 640px;
  }

  .duo {
    grid-template-columns: 1fr;
    gap: clamp(80px, 10vw, 112px);
  }

  .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .setup-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ---------- How it works ---------- */

.how {
  background: var(--brand-800);
  color: var(--on-navy);
}

.how .kicker {
  color: var(--brand-200);
}

.how .h2 {
  color: var(--on-navy);
}

.how :focus-visible {
  outline-color: #fff;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--navy-line);
}

.step {
  position: relative;
  padding: 32px 28px 8px 0;
}

.step + .step {
  padding-left: 28px;
  border-left: 1px solid var(--navy-line);
}

.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--brand-200);
}

.step + .step::before {
  left: 28px;
}

.step-index {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-navy-soft);
}

.step-index b {
  font-weight: 500;
  color: #fff;
}

.step h3 {
  text-wrap: balance;
  margin-top: 20px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.step p {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--on-navy-soft);
  text-wrap: pretty;
}

.principles {
  margin-top: clamp(56px, 7vw, 88px);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.03);
}

.principles li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  color: var(--on-navy-soft);
}

.principles strong {
  display: block;
  color: #fff;
}

.principles .icon-check {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
    border-top: 0;
  }

  .step,
  .step + .step {
    padding: 28px 24px 0 0;
    border-left: 0;
    border-top: 1px solid var(--navy-line);
  }

  .step + .step::before {
    left: 0;
  }

  .principles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .principles {
    padding: 24px;
  }
}

/* ---------- Industries ---------- */

.industry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.industry {
  padding: 28px 24px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.industry h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--brand-800);
}

.industry-example {
  margin-block: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--brand-200);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.industry p:not(.industry-example) {
  font-size: 15px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

@media (max-width: 1060px) {
  .industry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .industry-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Demo CTA ---------- */

.demo {
  padding-top: 0;
}

.demo-panel {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  padding: clamp(32px, 6vw, 72px);
  border-radius: 16px;
  background: var(--brand-800);
  color: var(--on-navy);
}

.demo-panel .kicker {
  color: var(--brand-200);
}

.demo-panel .h2 {
  color: #fff;
}

.demo-panel .body-lg {
  color: var(--on-navy-soft);
}

.demo-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.demo-url {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-navy-soft);
}

.demo-facts {
  border-top: 1px solid var(--navy-line);
}

.demo-facts li {
  padding-block: 20px;
  border-bottom: 1px solid var(--navy-line);
}

.demo-facts h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.demo-facts p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--on-navy-soft);
}

.stage-note {
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .demo-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .demo-panel {
    margin-inline: calc(-1 * var(--gutter) + 8px);
    border-radius: var(--radius-lg);
  }

  .demo-actions .btn {
    width: 100%;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 56px 40px;
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand {
  max-width: 340px;
}

.footer-brand p {
  margin-top: 16px;
  color: var(--ink-soft);
}

.footer-nav {
  display: flex;
  gap: clamp(40px, 8vw, 96px);
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.footer-nav ul {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.footer-nav a {
  color: var(--ink-soft);
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-base {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- 404 ---------- */

.not-found {
  min-height: calc(100vh - var(--header-h) - 240px);
  background: var(--canvas);
}

.not-found .h2 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
}

/* ---------- Reveal on scroll (enhancement only) ---------- */

[data-reveal].is-pending {
  opacity: 0;
  transform: translateY(14px);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal].is-pending {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Interface previews (faithful to the Norvale application)
   ========================================================= */

.preview figcaption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.preview--hero figcaption {
  text-align: center;
}

.ui-window {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-window);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  user-select: none;
}

.ui-chrome {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.ui-dots {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 6px;
}

.ui-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.ui-url {
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--subtle);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ui-body {
  background: var(--canvas);
}

.ui-ico {
  flex: none;
  width: 16px;
  height: 16px;
}

/* App shell */
.ui-app {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 500px;
}

.ui-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #f7f8fa;
}

.ui-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ui-mark {
  width: 22px;
  height: 22px;
}

.ui-nav li {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--ink-soft);
}

.ui-nav li .ui-ico {
  color: var(--ink-muted);
}

.ui-nav li span {
  flex: 1;
}

.ui-nav li.is-active {
  background: var(--brand-50);
  color: var(--brand-800);
  box-shadow: inset 0 0 0 1px var(--brand-100);
}

.ui-nav li.is-active .ui-ico {
  color: var(--brand-700);
}

.ui-nav li b {
  padding: 0 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #78350f;
  font-size: 11px;
}

.ui-nav--end {
  margin-top: auto;
}

.ui-org {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.ui-org-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ui-demo-tag {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 10.5px;
  font-weight: 600;
}

.ui-main {
  padding: 0 24px 24px;
}

.ui-banner {
  margin: 0 -24px 20px;
  padding: 8px 24px;
  border-bottom: 1px solid #ddd6fe;
  background: #f5f3ff;
  font-size: 12px;
  color: #4c1d95;
}

.ui-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ui-title {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.ui-head .ui-titles p {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.ui-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ui-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.ui-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ui-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ui-panel + .ui-panel {
  margin-top: 12px;
}

.ui-grid .ui-panel + .ui-panel {
  margin-top: 0;
}

.ui-panel--wide {
  grid-column: 1 / -1;
}

.ui-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.ui-subtitle {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.ui-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-700);
}

.ui-list li + li {
  border-top: 1px solid var(--line);
}

.ui-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
}

.ui-row--compact {
  padding-block: 9px;
}

.ui-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-50);
  box-shadow: inset 0 0 0 1px var(--brand-100);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-700);
}

.ui-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ui-row-main strong,
.ui-row-main span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ui-row-main span {
  font-size: 12px;
  color: var(--ink-muted);
}

.ui-when {
  flex: none;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.ui-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ui-pill--urgent { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ui-pill--attention { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ui-pill--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.ui-pill--info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.ui-pill--neutral { background: var(--subtle); border-color: var(--line); color: var(--ink-soft); }

.ui-feed li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.ui-feed li + li {
  border-top: 1px solid var(--line);
}

.ui-feed i {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--brand-200);
}

.ui-feed span {
  flex: 1;
}

.ui-feed strong {
  color: var(--ink);
  font-weight: 500;
}

.ui-feed em {
  font-style: normal;
  color: var(--ink-faint);
}

/* Single-screen previews */
.ui-solo {
  padding: 22px;
}

.ui-panel--flush > table,
.ui-panel--flush > ul {
  width: 100%;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ui-table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.ui-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ui-table tr:last-child td {
  border-bottom: 0;
}

.ui-table th:first-child,
.ui-table td:first-child {
  padding-left: 16px;
}

.ui-table th:last-child,
.ui-table td:last-child {
  padding-right: 16px;
  text-align: right;
}

.ui-table td strong {
  display: block;
  font-weight: 600;
}

.ui-sub {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

.ui-next {
  color: var(--ink-soft);
}

.ui-quote {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.ui-score {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px 6px;
  font-size: 12.5px;
}

.ui-score span {
  font-weight: 500;
  color: var(--ink-soft);
}

.ui-meter {
  height: 6px;
  margin: 0 16px;
  border-radius: 999px;
  background: var(--subtle);
  overflow: hidden;
}

.ui-meter i {
  display: block;
  width: 95%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-700);
}

.ui-parts {
  margin: 12px 16px 0;
  border-top: 1px dashed var(--line-strong);
}

.ui-parts li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.ui-parts b {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ui-note {
  padding: 10px 16px 14px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ui-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  overflow: hidden;
}

.ui-tabs span {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
}

.ui-tabs .is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.ui-tabs b {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #78350f;
  font-size: 11px;
}

.ui-card {
  padding: 16px;
}

.ui-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ui-card-head > div {
  flex: 1;
  min-width: 0;
}

.ui-card-head strong,
.ui-task strong {
  display: block;
  font-weight: 600;
}

.ui-card-head em,
.ui-task em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-soft);
}

.ui-card-head span:not(.ui-chan):not(.ui-pill),
.ui-task div > span {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

.ui-chan {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--subtle);
  color: var(--ink-muted);
}

.ui-draft {
  display: grid;
  gap: 8px;
  margin: 14px 0 0 38px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(243 245 248 / 0.6);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ui-why {
  margin: 10px 0 0 38px;
  font-size: 12px;
  color: var(--ink-muted);
}

.ui-why b {
  font-weight: 500;
  color: var(--ink-soft);
}

.ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0 38px;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.ui-btn--primary {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

.ui-btn--ghost {
  border-color: transparent;
  background: transparent;
}

.ui-tasks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.ui-tasks li + li {
  border-top: 1px solid var(--line);
}

.ui-task > div {
  flex: 1;
  min-width: 0;
}

.ui-task p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.ui-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ui-chat .ui-head {
  margin-bottom: 6px;
}

.ui-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.ui-msg p + p {
  margin-top: 6px;
}

.ui-msg--you {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--brand-700);
  color: #fff;
}

.ui-msg--bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  background: var(--surface);
  color: var(--ink-soft);
}

.ui-input {
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-faint);
}

.ui-timeline {
  padding: 6px 16px;
}

.ui-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 82px 14px 1fr;
  gap: 8px;
  padding: 9px 0;
}

.ui-timeline em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-muted);
  padding-top: 1px;
}

.ui-timeline i {
  position: relative;
  justify-self: center;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  border: 2px solid var(--brand-500);
  background: var(--surface);
}

.ui-timeline li:not(:last-child) i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 1px;
  height: 34px;
  transform: translateX(-50%);
  background: var(--line-strong);
}

.ui-timeline span {
  font-size: 12px;
  color: var(--ink-muted);
}

.ui-timeline strong {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

/* Preview responsiveness */
@media (max-width: 1000px) {
  .ui-app {
    grid-template-columns: 168px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ui-app {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ui-side {
    display: none;
  }

  .ui-main {
    padding: 0 16px 16px;
  }

  .ui-banner {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .ui-grid {
    grid-template-columns: 1fr;
  }

  .ui-grid .ui-panel:last-child {
    display: none;
  }
}

@media (max-width: 560px) {
  .ui-window {
    font-size: 12.5px;
  }

  .ui-solo {
    padding: 14px;
  }

  .ui-hide-sm {
    display: none;
  }

  .ui-row .ui-when {
    display: none;
  }

  .ui-draft,
  .ui-why,
  .ui-actions {
    margin-left: 0;
  }

  .ui-tabs span:nth-child(n + 3) {
    display: none;
  }

  .ui-head .ui-status {
    display: none;
  }

  .ui-card-head .ui-pill {
    display: none;
  }

  .ui-timeline li {
    grid-template-columns: 70px 14px 1fr;
  }
}
