/* ONEPROMISE SOLUTION INC. — site styles */

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

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

:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-raised: #0b101b;
  --bg-hover: #0d1320;
  --ink: #e9edf5;
  --ink-soft: #c3cad8;
  --muted: #98a2b6;
  --cyan: #7df2ff;
  --cyan-rgb: 125, 242, 255;
  --violet: #b79cff;
  --violet-rgb: 183, 156, 255;
  --hairline: rgba(233, 237, 245, 0.09);
  --hairline-strong: rgba(233, 237, 245, 0.18);
  --glass: rgba(233, 237, 245, 0.025);
  --glass-hover: rgba(233, 237, 245, 0.05);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 36em;
  --gutter: clamp(16px, 4vw, 56px);
  --margin-col: 11rem;
  --content: 70rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

/* Keeps anchor targets and focused elements clear of the sticky masthead (up to two rows tall). */
html { scroll-padding-top: 6.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, ul { margin: 0; }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

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

.skip {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--cyan);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 160ms var(--ease);
}

.skip:focus-visible { transform: translateY(0.5rem); }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--hairline);
  background: rgba(7, 10, 18, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.mark { flex: none; }

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.9375rem; }

.nav a {
  padding: 0.25rem 0;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--cyan); }

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

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 4rem);
  padding: clamp(5rem, 14vh, 9rem) var(--gutter) clamp(4rem, 10vh, 7rem);
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.hero-aurora, .hero-grid, .hero::after, #hero-canvas { position: absolute; inset: 0; pointer-events: none; }

/* Soft washes fade to transparent in the gradient itself: no blur layer to rasterize. */
.hero-aurora {
  z-index: -4;
  background:
    radial-gradient(70% 65% at 72% 18%, rgba(var(--cyan-rgb), 0.17) 0%, rgba(var(--cyan-rgb), 0.06) 40%, transparent 72%),
    radial-gradient(65% 60% at 18% 88%, rgba(var(--violet-rgb), 0.17) 0%, rgba(var(--violet-rgb), 0.06) 40%, transparent 72%),
    radial-gradient(50% 50% at 55% 60%, rgba(96, 120, 255, 0.07) 0%, transparent 70%);
}

/* The floor grid stays below the headline and lead; the vignette finishes the job. */
.hero-grid {
  z-index: -3;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 48%, #000 68%, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, transparent 48%, #000 68%, #000 84%, transparent);
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 40% -20% -40%;
  transform-origin: 50% 0;
  transform: perspective(70vh) rotateX(62deg) scale(1.6);
  background-image:
    linear-gradient(to right, rgba(var(--cyan-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--violet-rgb), 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
}

#hero-canvas { z-index: -2; width: 100%; height: 100%; }

/* Vignette: darkens the constellation behind the text column and fades the hero into the page. */
.hero::after {
  content: "";
  z-index: -1;
  background:
    radial-gradient(60% 55% at 28% 50%, rgba(7, 10, 18, 0.72) 0%, rgba(7, 10, 18, 0) 100%),
    linear-gradient(180deg, rgba(7, 10, 18, 0) 70%, var(--bg) 100%);
}

.hero-inner { position: relative; width: 100%; max-width: var(--content); margin-inline: auto; }

.eyebrow { margin-bottom: 1.75rem; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--cyan); }

.hero h1 {
  max-width: 11em;
  font-size: clamp(2.75rem, 2rem + 6.2vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--cyan);
  text-wrap: balance;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero h1 {
    background: linear-gradient(100deg, var(--cyan) 0%, #a9d8ff 45%, var(--violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.lead {
  max-width: var(--measure);
  margin-top: 2rem;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

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

.button-primary {
  color: var(--bg);
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset, 0 10px 30px -12px rgba(var(--cyan-rgb), 0.45);
}

.button-primary:hover {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset, 0 14px 36px -12px rgba(var(--cyan-rgb), 0.7);
}

.button-ghost { color: var(--ink); border: 1px solid var(--hairline-strong); background: var(--glass); }

.button-ghost:hover { border-color: var(--cyan); background: var(--glass-hover); }

.hero-foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Chapters ---------- */

.chapter {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  gap: 2rem var(--gutter);
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 7.5rem) var(--gutter);
  border-bottom: 1px solid var(--hairline);
}

.chapter-margin { position: relative; }

.counter {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.counter-num { font-size: 2.25rem; line-height: 1; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); }

.counter-num::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 1px;
  margin-top: 0.9rem;
  background: linear-gradient(to right, var(--cyan), var(--violet));
}

.chapter-body { min-width: 0; }

.chapter h2 {
  max-width: 14em;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 500;
  text-wrap: balance;
}

.intro { max-width: var(--measure); margin-top: 1.25rem; font-size: 1.125rem; color: var(--ink-soft); }

.prose { max-width: var(--measure); margin-top: 0.75rem; color: var(--ink-soft); }

.prose a, .colophon-links a { color: var(--cyan); text-decoration: underline; }

/* ---------- Capability panels ---------- */

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 3rem;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}

.panel {
  position: relative;
  padding: 2rem 1.75rem 1.75rem;
  background: var(--bg-raised);
  background-image: linear-gradient(160deg, var(--glass), transparent 60%);
  transition: background-color 200ms var(--ease);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 0% 0%, rgba(var(--cyan-rgb), 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 240ms var(--ease);
  pointer-events: none;
}

.panel:hover { background-color: var(--bg-hover); }

.panel:hover::before { opacity: 1; }

.panel h3, .area h3, .featured h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 500; }

.panel > * { position: relative; }

.panel h3 + p { max-width: 30em; margin-top: 0.75rem; color: var(--ink-soft); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.tags li { padding: 0.25rem 0.6rem; border: 1px solid var(--hairline); border-radius: 999px; }

/* ---------- Research ---------- */

.areas { margin-top: 3rem; border-top: 1px solid var(--hairline); }

.area {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--hairline);
}

.area p { max-width: var(--measure); color: var(--ink-soft); }

.featured {
  position: relative;
  margin-top: 3rem;
  padding: 2.25rem clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--hairline-strong);
  border-radius: 18px;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(var(--violet-rgb), 0.14), transparent 65%),
    radial-gradient(50% 70% at 0% 100%, rgba(var(--cyan-rgb), 0.1), transparent 65%),
    var(--bg-raised);
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.6rem;
  border: 1px solid rgba(var(--cyan-rgb), 0.35);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
}

.badge-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.featured h3 { margin-top: 1.25rem; font-family: var(--mono); font-size: 1.75rem; letter-spacing: -0.01em; }

.featured-text { max-width: var(--measure); margin-top: 0.9rem; color: var(--ink-soft); }

.points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.points li::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 1px;
  margin: 0 0.6rem 0.25rem 0;
  background: var(--violet);
}

/* ---------- Security & contact ---------- */

#security .chapter-body > p:not([class]) { margin-top: 1.5rem; font-size: 1.125rem; }

.contact-email {
  margin-top: 2.25rem;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
  letter-spacing: -0.02em;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact-email a {
  border-bottom: 1px solid var(--hairline-strong);
  text-decoration: none;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.contact-email a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

.contact-location { margin-top: 1rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }

/* ---------- Colophon ---------- */

.colophon {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr) auto;
  gap: 0.75rem var(--gutter);
  align-items: baseline;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.colophon-copy { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); }

.nowrap { white-space: nowrap; }

.colophon-note { max-width: var(--measure); }

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

.notfound {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 4rem);
  padding: 6rem var(--gutter);
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

/* Fades the wash out before the footer, like the index hero's bottom fade. */
.notfound .hero-aurora { z-index: -1; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

.notfound-inner { width: 100%; max-width: var(--content); margin-inline: auto; }

.notfound h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 500; }

/* ---------- Motion (smooth scrolling and one orchestrated entrance, only when motion is allowed) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero-inner > * { animation: rise 900ms var(--ease) both; }

  .hero-inner > :nth-child(2) { animation-delay: 80ms; }

  .hero-inner > :nth-child(3) { animation-delay: 180ms; }

  .hero-inner > :nth-child(4) { animation-delay: 260ms; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .chapter, .colophon {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .counter {
    position: static;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 0.75rem;
  }

  .counter-num {
    font-size: 1.5rem;
  }

  .counter-num::after {
    display: none;
  }

  .panels, .area {
    grid-template-columns: minmax(0, 1fr);
  }

  .area {
    gap: 0.35rem;
  }

  .hero-foot {
    display: none;
  }

  .hero::after {
    /* Wider and higher than on desktop so it covers the eyebrow and headline, not just the lead. */
    background:
      radial-gradient(85% 65% at 40% 42%, rgba(7, 10, 18, 0.72) 0%, rgba(7, 10, 18, 0) 100%),
      linear-gradient(180deg, rgba(7, 10, 18, 0) 70%, var(--bg) 100%);
  }
}

@media (max-width: 480px) {
  .masthead {
    padding-block: 0.75rem;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    font-size: 0.875rem;
  }

  .hero {
    min-height: 0;
    padding-top: 4rem;
  }

  .panel {
    padding: 1.5rem 1.25rem;
  }

  .featured { padding: 1.75rem 1.25rem; }
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
    background-color: #fff;
    color: #111;
  }

  .nav, .skip, .hero-aurora, .hero-grid, .hero::after, .hero-foot, .button, #hero-canvas {
    display: none;
  }

  .hero, .notfound {
    min-height: 0;
  }

  .masthead {
    position: static;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hero h1 {
    background: none;
    color: #111;
    -webkit-text-fill-color: #111;
  }

  /* The id outranks every class so no screen colour survives on white. */
  #main :is(p, li, span, a), .colophon, .colophon :is(p, a) {
    color: #333;
  }

  #main :is(h1, h2, h3) {
    color: #111;
  }

  .masthead, .panel, .featured, .areas, .area, .tags li, .badge, .chapter {
    border-color: #ccc;
  }

  .panels, .panel, .featured { background: none; transition: none; }

  .panel, .area, .featured { break-inside: avoid; }

  h2, h3, .chapter-margin { break-after: avoid; }
}
