/* Hypso Technologies — site styles */

:root {
  --night: #050E22;      /* page background */
  --deep: #0A1A3A;       /* raised surface */
  --deep-2: #0F2350;     /* hover / inner surface */
  --line: #1B3366;       /* rules and borders */
  --signal: #2E6BFF;     /* primary action */
  --signal-hi: #4A80FF;
  --glacier: #4FE0F5;    /* accent */
  --snow: #EAF1FF;       /* text */
  --mist: #9DB0D3;       /* secondary text */

  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  --step-5: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius-lg: 22px;
  --radius: 12px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--snow);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

a { color: var(--glacier); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--snow); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--snow);
  color: var(--night);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-weight: 600;
  font-size: var(--step-0);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--signal-hi); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--snow);
}
.btn-ghost:hover { background: var(--deep); color: var(--snow); }
.btn-small { min-height: 40px; padding: 0.45rem 1.1rem; font-size: 0.95rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 14, 34, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(27, 51, 102, 0.6);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--snow);
  text-decoration: none;
}
.brand:hover { color: var(--snow); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--mist);
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}
.nav-list a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  color: var(--snow);
  text-decoration: none;
  font-weight: 500;
}
.nav-list a:hover { background: var(--deep); }
.nav-list a[aria-current="page"] { color: var(--glacier); }

.has-sub { position: relative; }
.sub {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 13rem;
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.sub::before { /* hover bridge */
  content: "";
  position: absolute;
  inset: -8px 0 auto 0;
  height: 8px;
}
.has-sub:hover .sub,
.has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.sub a { font-weight: 500; }

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--snow);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--night);
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { padding: 0.75rem 0.5rem; font-size: 1.1rem; }
  .sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.5rem 1rem;
    min-width: 0;
  }
  .sub a { color: var(--mist); font-size: 1rem; }
  .site-nav .btn { align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 0;
  text-align: center;
  overflow: hidden;
}
.hero::before { /* contour glow */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 100%, rgba(46, 107, 255, 0.28), transparent 70%),
    radial-gradient(30% 30% at 85% 20%, rgba(79, 224, 245, 0.10), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 15ch; margin-inline: auto; }
.hero .lede {
  max-width: 40rem;
  margin: 0 auto 2rem;
  color: var(--mist);
  font-size: var(--step-1);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Stage: browser + phone */
.stage {
  position: relative;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  max-width: 64rem;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(180deg, #0D2150 0%, #0A1A3A 60%, var(--night) 100%);
  border: 1px solid var(--line);
  border-bottom: 0;
  text-align: left;
  overflow: hidden;
}
.stage-topo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
}

.browser {
  position: relative;
  width: 78%;
  background: #F6F8FC;
  color: #14213D;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: #E4E9F2;
}
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 10px; height: 10px; border-radius: 50%; background: #B9C3D6; }
.browser-url {
  flex: 1;
  max-width: 20rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  font-size: 0.78rem;
  color: #5B6B8C;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
}
.mock-logo { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: #14213D; }
.mock-links { display: flex; gap: 1.1rem; color: #5B6B8C; }
.mock-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem 2.25rem;
  align-items: center;
}
.mock-headline {
  position: relative;
  display: grid;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 0.6rem + 2.4vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  padding: 0.35rem 0.5rem;
  margin: 0 0 0.9rem -0.5rem;
  outline: 2px solid var(--signal);
  outline-offset: 0;
}
.mock-headline > span { grid-area: 1 / 1; }
.mock-headline .handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid var(--signal);
}
.handle.tl { top: -5px; left: -5px; }
.handle.tr { top: -5px; right: -5px; }
.handle.bl { bottom: -5px; left: -5px; }
.handle.br { bottom: -5px; right: -5px; }
.editor-tag {
  position: absolute;
  right: -0.75rem;
  bottom: -1.9rem;
  padding: 0.25rem 0.7rem;
  border-radius: 6px 6px 6px 0;
  background: var(--glacier);
  color: var(--night);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
}
.mock-text { font-size: 0.85rem; color: #5B6B8C; margin: 1.4rem 0 1rem; max-width: 26ch; }
.mock-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: #14213D;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}
.mock-photo {
  aspect-ratio: 4 / 3.4;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 35%, #FFD7A8 0 18%, transparent 19%),
    radial-gradient(circle at 62% 58%, #F2B27A 0 26%, transparent 27%),
    linear-gradient(160deg, #CFE3FF, #9EC1F5);
}

.phone {
  position: absolute;
  right: clamp(0.75rem, 3vw, 2.5rem);
  top: clamp(2.5rem, 6vw, 4rem);
  width: min(34%, 290px);
  padding: 10px;
  border-radius: 36px;
  background: #0B1430;
  border: 1px solid #2A3F73;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  font-size: 0.8rem;
}
.phone-screen {
  border-radius: 27px;
  background: #0E1A38;
  padding: 0.9rem 0.85rem 1.4rem;
  min-height: 25rem;
}
.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--mist);
  margin-bottom: 0.8rem;
}
.phone-notch { width: 70px; height: 20px; border-radius: 999px; background: #050B1D; }
.phone-title {
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid #1E2F5C;
}
.phone-title small { display: block; font-weight: 400; color: var(--mist); font-size: 0.7rem; }
.bubble {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 16px;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.bubble.them { margin-left: auto; background: var(--signal); color: #fff; border-bottom-right-radius: 4px; }
.bubble.me { background: #1A2A55; color: var(--snow); border-bottom-left-radius: 4px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #22386D;
  color: var(--mist);
  font-size: 0.72rem;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glacier); }
.chip {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: rgba(79, 224, 245, 0.12);
  color: var(--glacier);
  font-size: 0.72rem;
  font-weight: 600;
}

/* The one orchestrated moment: a request arrives, the page updates. */
/* Without JS the final state shows. With JS, it waits until scrolled into view. */
.anim .old { opacity: 0; }
.js .anim .step { opacity: 0; transform: translateY(6px); }
.js .anim .old { opacity: 1; }
.js .anim .new { opacity: 0; }
.js .anim.play .step { animation: rise 0.45s ease forwards; }
.js .anim.play .s1 { animation-delay: 0.4s; }
.js .anim.play .s2 { animation-delay: 1.4s; }
.js .anim.play .s3 { animation-delay: 2.9s; }
.js .anim.play .s4 { animation-delay: 3.3s; }
.js .anim.play .old { animation: fade-out 0.35s ease 2.5s forwards; }
.js .anim.play .new { animation: fade-in 0.45s ease 2.75s forwards; }
.js .anim.play .status .dot { animation: pulse 1s ease-in-out 1.4s 2; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .anim .step, .js .anim .new { opacity: 1; transform: none; animation: none !important; }
  .js .anim .old { opacity: 0; animation: none !important; }
  .js .anim .status .dot { animation: none !important; }
}

@media (max-width: 760px) {
  .browser { width: 100%; }
  .mock-body { grid-template-columns: 1fr; }
  .mock-photo { display: none; }
  .mock-links { display: none; }
  .phone {
    position: relative;
    right: auto;
    top: auto;
    width: min(100%, 300px);
    margin: -3rem 0 0 auto;
  }
  .phone-screen { min-height: 0; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section + .section { border-top: 1px solid rgba(27, 51, 102, 0.55); }
.section-intro { max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-intro p { color: var(--mist); font-size: var(--step-1); }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}
.principle {
  padding-top: 1.25rem;
  border-top: 2px solid var(--signal);
}
.principle h3 { font-size: var(--step-2); }
.principle p { color: var(--mist); margin: 0; }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }

/* Service rows */
.service-rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 11rem;
  gap: 1.5rem 3rem;
  align-items: baseline;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.service-row h3, .service-row h2 { margin: 0; font-size: var(--step-3); }
.service-row p { margin: 0; color: var(--mist); }
.service-row .more { white-space: nowrap; font-weight: 600; }
@media (max-width: 760px) {
  .service-row { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* Split layout */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.places {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.places li {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--snow);
  font-size: 0.95rem;
}
.places li.home { border-color: var(--glacier); color: var(--glacier); }

.quote-panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--deep);
  border: 1px solid var(--line);
}
.quote-panel p { font-size: var(--step-1); }
.quote-panel p:last-child { margin: 0; }

/* Resource links */
.resource-list { display: grid; gap: 1rem; }
.resource {
  display: block;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--deep);
  border: 1px solid var(--line);
  color: var(--snow);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.resource:hover { border-color: var(--signal); background: var(--deep-2); color: var(--snow); }
.resource .kind { display: block; color: var(--glacier); font-size: var(--step--1); font-weight: 600; margin-bottom: 0.35rem; }
.resource h3 { font-size: var(--step-1); margin: 0 0 0.35rem; line-height: 1.25; }
.resource p { margin: 0; color: var(--mist); font-size: 0.98rem; }

/* ---------- Page header (inner pages) ---------- */
.page-head {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-head::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% 40%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(46, 107, 255, 0.25), transparent);
  pointer-events: none;
}
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { font-size: var(--step-5); max-width: 16ch; }
.page-head .lede { max-width: 42rem; color: var(--mist); font-size: var(--step-1); margin: 0; }
.crumbs { font-size: var(--step--1); color: var(--mist); margin-bottom: 1.25rem; }
.crumbs a { color: var(--mist); }
.crumbs a:hover { color: var(--snow); }

/* Long-form text */
.prose { max-width: 40rem; }
.prose h2 { font-size: var(--step-3); margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; }
.prose p, .prose li { color: #C9D6EE; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--glacier); }
.prose strong { color: var(--snow); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1.5rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--signal);
  color: var(--glacier);
  font-family: var(--font-display);
  font-weight: 700;
}
.steps h3 { font-size: var(--step-1); margin: 0.35rem 0 0.25rem; }
.steps p { margin: 0; color: var(--mist); }

.aside-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--deep);
  border: 1px solid var(--line);
}
.aside-card h2 { font-size: var(--step-2); }
.aside-card ul { margin: 0; padding-left: 1.1rem; }
.aside-card li { margin-bottom: 0.45rem; color: #C9D6EE; }
.aside-card li::marker { color: var(--glacier); }

.post-meta { color: var(--mist); font-size: var(--step--1); margin-top: 1.25rem; }

/* Checklist preview */
.check-group { margin-bottom: 2rem; }
.check-group h3 { font-size: var(--step-1); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.6rem;
  color: #C9D6EE;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--glacier);
  border-radius: 4px;
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  padding: clamp(4rem, 9vw, 6.5rem) 0;
  background:
    linear-gradient(90deg, rgba(5, 14, 34, 0.96) 30%, rgba(5, 14, 34, 0.7)),
    url("../img/monitors.jpg") center / cover no-repeat;
  border-top: 1px solid var(--line);
}
.cta-inner { max-width: var(--wrap); }
.cta-band h2 { font-size: var(--step-5); font-weight: 700; letter-spacing: -0.025em; }
.cta-band p { max-width: 36rem; color: var(--mist); font-size: var(--step-1); margin-bottom: 2rem; }
.cta-band p a { color: var(--snow); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem;
  color: var(--mist);
  font-size: 0.98rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .brand { margin-bottom: 1rem; }
.footer-brand p { margin: 0 0 0.35rem; }
.footer-head {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--snow);
  margin-bottom: 0.75rem;
}
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 0.45rem; }
.footer-list a { color: var(--mist); }
.footer-list a:hover { color: var(--snow); }
.footer-base {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(27, 51, 102, 0.55);
  font-size: var(--step--1);
}
.footer-base p { margin: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
