/* ==========================================================================
   Knightsbridge Research — marketing site
   Design tokens derived from the TALOS platform design system.
   Dark mode is the canonical theme; light mode is a tonal inversion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens — dark (default / TALOS)
   -------------------------------------------------------------------------- */
:root {
  --brand: #009cbb;
  --brand-dark: #005d70;
  --brand-glow: rgba(0, 156, 187, 0.35);
  --brand-tint: rgba(0, 156, 187, 0.08);

  --color-surface-primary: #121212;
  --color-surface-secondary: #191919;
  --color-surface-tertiary: #262626;
  --color-surface-elevated: #4d4d4d;
  --color-surface-hover: rgba(255, 255, 255, 0.05);
  --color-surface-frosted: rgba(18, 18, 18, 0.78);

  --color-text-primary: #ffffff;
  --color-text-secondary: #d8d8d8;
  --color-text-tertiary: #999999;
  --color-text-muted: #747474;
  --color-text-inverse: #121212;

  --color-interactive: #009cbb;
  --color-interactive-bright: #35c3e0;
  --color-border-default: #4d4d4d;
  --color-border-subtle: #262626;
  --color-border-strong: #999999;

  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.07),
                 inset 0 -1px 0 rgba(0, 0, 0, 0.25),
                 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 156, 187, 0.1);
  --shadow-focus: 0 0 0 2px rgba(0, 156, 187, 0.2);

  --globe-dot: rgba(216, 216, 216, 0.55);
  --globe-dot-dim: rgba(216, 216, 216, 0.18);
  --globe-arc: rgba(0, 156, 187, 0.55);
  --globe-ping: rgba(53, 195, 224, 0.9);
  --hero-fade-solid: #121212;

  --font-heading: "Decimal 2 A", "Decimal 2 B", Avenir, "Helvetica Neue", Helvetica, sans-serif;
  --font-sub-heading: "Decimal A", "Decimal B", Avenir, "Helvetica Neue", Helvetica, sans-serif;
  --font-body: "Chronicle SSm A", "Chronicle SSm B", Georgia, "Times New Roman", serif;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  --transition-fast: 100ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 300ms ease-out;

  --content-width: 1160px;
  --header-height: 72px;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Tokens — light (tonal inversion of the TALOS dark ramp)
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  --brand: #007d96;
  --brand-dark: #005d70;
  --brand-glow: rgba(0, 125, 150, 0.22);
  --brand-tint: rgba(0, 125, 150, 0.07);

  --color-surface-primary: #fbfbfa;
  --color-surface-secondary: #f2f2f0;
  --color-surface-tertiary: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-surface-hover: rgba(0, 0, 0, 0.04);
  --color-surface-frosted: rgba(251, 251, 250, 0.82);

  --color-text-primary: #121212;
  --color-text-secondary: #4d4d4d;
  --color-text-tertiary: #747474;
  --color-text-muted: #999999;
  --color-text-inverse: #ffffff;

  --color-interactive: #007d96;
  --color-interactive-bright: #009cbb;
  --color-border-default: #d8d8d8;
  --color-border-subtle: #ebebe9;
  --color-border-strong: #999999;

  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.8),
                 inset 0 -1px 0 rgba(0, 0, 0, 0.06),
                 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 8px rgba(0, 125, 150, 0.08);
  --shadow-focus: 0 0 0 2px rgba(0, 125, 150, 0.25);

  --globe-dot: rgba(77, 77, 77, 0.5);
  --globe-dot-dim: rgba(77, 77, 77, 0.16);
  --globe-arc: rgba(0, 125, 150, 0.5);
  --globe-ping: rgba(0, 125, 150, 0.9);
  --hero-fade-solid: #fbfbfa;

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  background: var(--color-surface-primary);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-text-primary);
  margin: 0;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-interactive);
  text-decoration: none;
}

a:hover {
  color: var(--color-interactive-bright);
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-xs);
}

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

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

/* Section scaffolding */
.section {
  padding: 112px 0;
  position: relative;
}

.section--alt {
  background: var(--color-surface-secondary);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.eyebrow {
  font-family: var(--font-sub-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

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

.section-title {
  font-weight: 200;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  max-width: 20ch;
  margin-bottom: 24px;
}

.section-title strong {
  font-weight: 800;
}

.section-lede {
  font-size: 19px;
  max-width: 62ch;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sub-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-normal),
              border-color var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--brand);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--color-interactive-bright);
  color: #ffffff;
  box-shadow: 0 0 24px var(--brand-glow);
}

.btn--ghost {
  border-color: var(--color-border-default);
  color: var(--color-text-primary);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-focus);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--color-surface-frosted);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--color-border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-text-primary);
}

.brand-lockup:hover {
  color: var(--color-text-primary);
}

.brand-lockup svg.mark {
  height: 17px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  font-family: var(--font-sub-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-text-tertiary);
}

.site-nav a:hover {
  color: var(--color-text-primary);
}

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

/* Theme toggle */
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: color var(--transition-normal), border-color var(--transition-normal);
}

.theme-toggle:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

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

  .header-actions .btn {
    padding: 10px 16px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .site-header .container { gap: 12px; }
  .header-actions { gap: 10px; }
  .header-actions .btn { padding: 9px 12px; letter-spacing: 0.08em; }
  .brand-lockup svg.mark { height: 14px; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero::after {
  /* readability scrim + fade into the page background */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--hero-fade-solid) 0%, transparent 62%),
    linear-gradient(180deg, transparent 55%, var(--hero-fade-solid) 100%);
  opacity: 0.85;
}

.hero .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 640px;
  padding: 140px 0 120px;
}

.hero-title {
  font-weight: 200;
  font-size: clamp(30px, 8.6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-title strong {
  font-weight: 800;
  display: block;
}

.hero-lede {
  font-size: 19px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 56ch;
  margin-bottom: 40px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--color-text-muted);
  font-family: var(--font-sub-heading);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-scroll-cue::after {
  content: "";
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, var(--color-text-muted), transparent);
  animation: cue-drop 2.2s ease-in-out infinite;
}

@keyframes cue-drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   Statement (positioning paragraph)
   -------------------------------------------------------------------------- */
.statement {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.5;
  color: var(--color-text-tertiary);
  max-width: 34ch;
}

.statement em {
  font-style: normal;
  color: var(--color-text-primary);
}

.statement .accent {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Solutions grid
   -------------------------------------------------------------------------- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

@media (max-width: 980px) {
  .solutions-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.solution-card {
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 30px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-slow),
              transform var(--transition-normal);
}

.solution-card:hover {
  border-color: var(--brand-dark);
  box-shadow: var(--shadow-panel);
  transform: translateY(-3px);
}

.solution-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.solution-card:hover::before {
  opacity: 1;
}

.solution-card .icon {
  width: 40px;
  height: 40px;
  color: var(--brand);
  margin-bottom: 20px;
}

.solution-card h3 {
  font-family: var(--font-sub-heading);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.solution-card p {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--color-text-tertiary);
  margin: 0;
}

/* --------------------------------------------------------------------------
   TALOS platform section
   -------------------------------------------------------------------------- */
.talos-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.talos-header .talos-mark {
  width: 88px;
  height: auto;
  filter: drop-shadow(0 0 18px var(--brand-glow));
}

.talos-wordmark {
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: 15px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-top: 14px;
  text-align: center;
}

/* Stats band */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 64px 0;
}

@media (max-width: 900px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  border-left: 2px solid var(--brand-dark);
  padding: 6px 0 6px 22px;
}

.stat .stat-value {
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.stat .stat-value .unit {
  color: var(--brand);
}

.stat .stat-label {
  font-family: var(--font-sub-heading);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 10px;
}

/* Lifecycle timeline */
.lifecycle {
  position: relative;
  margin-top: 24px;
  display: grid;
  gap: 0;
}

.lifecycle-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 28px;
  position: relative;
  padding-bottom: 48px;
}

.lifecycle-step:last-child {
  padding-bottom: 0;
}

.lifecycle-step::before {
  /* connecting rail */
  content: "";
  position: absolute;
  left: 31px;
  top: 64px;
  bottom: 8px;
  width: 1px;
  background: var(--color-border-default);
}

.lifecycle-step:last-child::before {
  display: none;
}

.step-index {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-default);
  background: var(--color-surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: 22px;
  color: var(--brand);
  box-shadow: var(--shadow-card);
}

.lifecycle-step h3 {
  font-family: var(--font-sub-heading);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  padding-top: 16px;
  margin-bottom: 10px;
}

.lifecycle-step h3 .kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}

.lifecycle-step p {
  color: var(--color-text-tertiary);
  max-width: 68ch;
  margin: 0;
}

.lifecycle-step ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 68ch;
}

.lifecycle-step ul li {
  position: relative;
  padding-left: 22px;
  color: var(--color-text-tertiary);
  font-size: 15.5px;
}

.lifecycle-step ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--brand);
}

/* --------------------------------------------------------------------------
   Difference section
   -------------------------------------------------------------------------- */
.difference-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 56px;
}

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

.difference-item {
  border-top: 1px solid var(--color-border-default);
  padding-top: 24px;
}

.difference-item h3 {
  font-family: var(--font-sub-heading);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.difference-item p {
  color: var(--color-text-tertiary);
  font-size: 15.5px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Contact / CTA
   -------------------------------------------------------------------------- */
.contact-panel {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--brand-tint), transparent 55%),
    var(--color-surface-tertiary);
  box-shadow: var(--shadow-panel);
  padding: clamp(40px, 6vw, 80px);
  text-align: center;
}

.contact-panel .section-title {
  margin-left: auto;
  margin-right: auto;
}

.contact-panel .section-lede {
  margin: 0 auto 40px;
}

.contact-meta {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  font-family: var(--font-sub-heading);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-family: var(--font-sub-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 8px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text-primary);
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form input[type="submit"] {
  width: 100%;
  justify-content: center;
  text-align: center;
}

/* Flash messages */
.flash {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(560px, calc(100vw - 48px));
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-sub-heading);
  font-size: 14px;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-panel);
  animation: flash-in 300ms ease-out;
}

.flash--notice {
  background: var(--color-surface-tertiary);
  border: 1px solid var(--brand);
  color: var(--color-text-primary);
}

.flash--alert {
  background: var(--color-surface-tertiary);
  border: 1px solid #c0392b;
  color: var(--color-text-primary);
}

@keyframes flash-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: 56px 0;
  background: var(--color-surface-secondary);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer .mark {
  height: 14px;
  width: auto;
  color: var(--color-text-muted);
}

.footer-meta {
  font-family: var(--font-sub-heading);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-scroll-cue::after { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
