/* Plexward landing: operations-room editorial.
   Instrument Serif display · Instrument Sans body · IBM Plex Mono telemetry.
   Layout is fluid: --pad, --sec and --h2gap carry the responsive rhythm,
   so the mobile blocks at the bottom only retune tokens, never redo layout. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #07090f;
  --panel: #0c101b;
  --line: #1a2132;
  --txt: #dfe5f1;
  --dim: #8b94a8;
  --faint: #5a6478;
  --acc: #a5b4fc;
  --acc2: #7c7bf2;
  --ok: #34d399;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  /* responsive rhythm */
  --pad: 28px;    /* page gutter */
  --sec: 130px;   /* space between major sections */
  --h2gap: 46px;  /* space under a section heading */
  --edge: max(var(--pad), env(safe-area-inset-left));
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--txt);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(124,123,242,.2);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
::selection { background: var(--acc2); color: #fff; }
/* sticky header must not hide anchor targets */
section[id] { scroll-margin-top: 84px; }

/* atmosphere */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.glow { position: fixed; border-radius: 50%; filter: blur(120px); z-index: 0; pointer-events: none; }
.glow-a { width: 900px; height: 600px; top: -260px; left: 50%; transform: translateX(-42%); background: rgba(124,123,242,.13); }
.glow-b { width: 700px; height: 500px; top: 60vh; right: -280px; background: rgba(52,211,153,.05); }

/* header */
.top {
  position: relative; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; max-width: 1180px; margin: 0 auto;
  padding: 26px var(--edge);
  gap: 14px;
}
.wordmark {
  font-family: var(--mono); font-size: 17px; letter-spacing: .06em;
  color: var(--txt); text-decoration: none; white-space: nowrap; flex: none;
}
.wordmark .glyph {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: linear-gradient(145deg, #262c55, #131627);
  border: 1px solid #2d3560; color: var(--acc); margin-right: 8px; vertical-align: -8px;
}
.wordmark.small { font-size: 14px; }
.top nav { display: flex; gap: 26px; align-items: center; min-width: 0; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.top nav a { color: var(--dim); text-decoration: none; font-size: 14.5px; transition: color .18s; }
.nav-cta .short { display: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 11px 22px; min-height: 44px; border-radius: 10px;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn-solid {
  background: linear-gradient(140deg, #8b8bf5, #6d6ce8); color: #fff;
  box-shadow: 0 6px 24px rgba(124,123,242,.28);
}
.btn-solid.big { font-family: var(--mono); font-size: clamp(15px, 4vw, 17px); padding: 15px 30px; min-height: 52px; }
.btn-ghost { border: 1px solid var(--line); color: var(--txt) !important; background: rgba(255,255,255,.02); }
.nav-cta { padding: 9px 18px; min-height: 40px; font-size: 14.5px; }
@media (hover: hover) {
  .top nav a:hover { color: var(--txt); }
  .btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(124,123,242,.4); }
  .btn-ghost:hover { border-color: #333e5e; background: rgba(255,255,255,.05); }
}
.btn:active { transform: translateY(1px); }

main { position: relative; z-index: 2; }

/* hero */
.hero { max-width: 940px; margin: 0 auto; padding: 84px var(--edge) 40px; text-align: center; }
.eyebrow {
  font-family: var(--mono); font-size: clamp(10.5px, 2.9vw, 12.5px);
  letter-spacing: .22em; color: var(--acc); margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 8.4vw, 76px);
  line-height: 1.06; letter-spacing: -.01em; margin-bottom: 26px;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--acc); }
.lede { max-width: 640px; margin: 0 auto 34px; color: var(--dim); font-size: clamp(16px, 4.3vw, 18.5px); }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.bootlog {
  margin-top: 46px; font-family: var(--mono); font-size: 13px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  padding: 9px 22px; background: rgba(12,16,27,.7); max-width: 100%;
}
.bootlog .stat { white-space: nowrap; }
.bootlog i { font-style: normal; color: var(--ok); margin-right: 7px; }
.bootlog .dim { color: var(--faint); }

/* screenshot frames */
.shot-hero { max-width: 1180px; margin: 30px auto 0; padding: 0 var(--edge); }
.frame {
  border: 1px solid #222b44; border-radius: 14px; overflow: hidden;
  background: #0a0d16;
  box-shadow: 0 30px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(124,123,242,.06), 0 -1px 40px rgba(124,123,242,.07) inset;
}
.frame picture { display: block; }
.frame img, .frame video { display: block; width: 100%; height: auto; }

/* tour + floor */
.tour, .floor { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); }
.tour-sub { color: var(--dim); max-width: 560px; margin: calc(var(--h2gap) * -.48) 0 34px; }

/* approval gate */
.gate { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); }
.gate-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 46px; align-items: start; }
@media (max-width: 920px) { .gate-grid { grid-template-columns: 1fr; gap: 30px; } }
.gate-copy p { color: var(--dim); margin-bottom: 16px; }
.gate-copy strong { color: var(--txt); }
.phone {
  margin: 26px auto 0; width: min(360px, 100%); border: 1px solid #232c46;
  border-radius: 22px; background: #0a0e18; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
.phone-top {
  font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  padding: 12px 16px; border-bottom: 1px solid #1a2138; background: #0d1220;
}
.pt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; }
.chat { padding: 16px 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.msg {
  border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45;
  background: #131a2c; color: var(--txt); max-width: 92%;
  opacity: 0; transform: translateY(10px);
}
.msg-head { font-family: var(--mono); font-size: 10.5px; color: var(--acc);
  letter-spacing: .06em; margin-bottom: 7px; }
.msg p { color: var(--dim); margin: 0 0 10px; }
.msg-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-btns span {
  font-size: 12.5px; padding: 5px 12px; border-radius: 8px;
  border: 1px solid #2b3556; color: var(--acc);
}
.msg.me { align-self: flex-end; background: linear-gradient(140deg, #5d5cd6, #4b4ac2);
  color: #fff; padding: 9px 16px; }
.msg.sys { align-self: center; background: none; border: 1px dashed #24314f;
  color: var(--ok); font-family: var(--mono); font-size: 12px; text-align: center; }
/* staged 12s conversation loop, all keyframe-synchronized */
@keyframes m1cyc { 0%, 6% { opacity: 0; transform: translateY(10px); }
  11%, 100% { opacity: 1; transform: none; } }
@keyframes m2cyc { 0%, 38% { opacity: 0; transform: translateY(10px); }
  43%, 100% { opacity: 1; transform: none; } }
@keyframes m3cyc { 0%, 48% { opacity: 0; transform: translateY(10px); }
  53%, 100% { opacity: 1; transform: none; } }
@keyframes chatcycle { 0%, 96% { opacity: 1; } 100% { opacity: 0; } }
.chat { animation: chatcycle 12s linear infinite; }
.phone .m1 { animation: m1cyc 12s linear infinite; }
.phone .m2 { animation: m2cyc 12s linear infinite; }
.phone .m3 { animation: m3cyc 12s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .chat, .phone .m1, .phone .m2, .phone .m3 { animation: none; opacity: 1; transform: none; }
}
.framebar {
  display: flex; align-items: center; gap: 7px; padding: 11px 16px;
  background: #0e1220; border-bottom: 1px solid #1b2338;
}
.framebar span { width: 10px; height: 10px; border-radius: 50%; background: #232c46; flex: none; }
.framebar em {
  font-family: var(--mono); font-style: normal; font-size: 12px;
  color: var(--faint); margin-left: 10px; letter-spacing: .05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.cap { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 16px; }

/* stations */
.stations { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); }
h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6.2vw, 48px);
  letter-spacing: -.01em; margin-bottom: var(--h2gap); line-height: 1.1;
  text-wrap: balance;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 24px;
  background: linear-gradient(170deg, rgba(20,25,42,.6), rgba(10,13,22,.6));
  transition: transform .22s, border-color .22s;
}
@media (hover: hover) { .card:hover { transform: translateY(-4px); border-color: #2c3554; } }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.card .k { font-family: var(--mono); font-size: 12px; color: var(--acc); margin-right: 9px; }
.card p { color: var(--dim); font-size: 15.5px; }

/* duo */
.duo { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); display: flex; flex-direction: column; gap: 90px; }
.duo-item { display: grid; grid-template-columns: 7fr 5fr; gap: 46px; align-items: center; }
.duo-item.flip { grid-template-columns: 5fr 7fr; }
.duo-item.flip figure { order: 2; }
.duo-copy h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 5.6vw, 30px); margin-bottom: 14px; line-height: 1.15; }
.duo-copy p { color: var(--dim); }
@media (max-width: 880px) {
  .duo { gap: 64px; }
  .duo-item, .duo-item.flip { grid-template-columns: 1fr; gap: 26px; }
  .duo-item.flip figure { order: 0; }
}

/* how */
.how { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); }
.how-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: start; }
@media (max-width: 880px) { .how-cols { grid-template-columns: 1fr; gap: 34px; } }
.term { border: 1px solid #222b44; border-radius: 14px; overflow: hidden; background: #05070c; }
.term pre { padding: 22px 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.term code { font-family: var(--mono); font-size: clamp(12px, 3.4vw, 14.5px); line-height: 2.05; color: #c8d0e2; }
.term .p { color: var(--acc); }
.term .c { color: var(--ok); }
.facts { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.facts li { color: var(--dim); font-size: 15.5px; padding-left: 22px; position: relative; }
.facts li::before { content: "▸"; position: absolute; left: 0; color: var(--acc); }
.facts strong { color: var(--txt); font-weight: 600; }

/* rails */
.rails { max-width: 1180px; margin: var(--sec) auto 0; padding: 0 var(--edge); }
.rails-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 18px 22px; }
.rail { border-top: 1px solid var(--line); padding-top: 18px; }
.rail .k { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--ok); }
.rail p { color: var(--dim); font-size: 15px; margin-top: 10px; }

/* closing */
.closing { max-width: 760px; margin: calc(var(--sec) * 1.15) auto 0; padding: 0 var(--edge) 20px; text-align: center; }
.closing p { color: var(--dim); margin-bottom: 34px; }
.closing a { color: var(--acc); }

footer {
  max-width: 1180px; margin: calc(var(--sec) * .85) auto 0;
  padding: 30px var(--edge) calc(44px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px;
}
footer p { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
footer a { color: var(--dim); }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .18s; }
.d3 { animation-delay: .28s; } .d4 { animation-delay: .42s; }
.reveal-on-scroll { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal-on-scroll.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-on-scroll { animation: none; opacity: 1; transform: none; transition: none; }
}

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  :root { --sec: 96px; --h2gap: 36px; --pad: 24px; }
  /* once the telemetry line wraps, a stadium pill reads as a squashed blob */
  .bootlog { border-radius: 16px; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  :root { --sec: 76px; --h2gap: 28px; --pad: 20px; }
  body { font-size: 16px; }
  /* the deck is always one tap away while scrolling */
  .top {
    position: sticky; top: 0; padding: 14px var(--edge);
    background: rgba(7,9,15,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(26,33,50,.9);
  }
  .nav-links { display: none; }
  .wordmark { font-size: 15px; }
  .wordmark .glyph { width: 27px; height: 27px; margin-right: 7px; vertical-align: -7px; }
  .hero { padding: 46px var(--edge) 30px; }
  .eyebrow { margin-bottom: 18px; letter-spacing: .18em; }
  .hero h1 { margin-bottom: 18px; }
  .lede { margin-bottom: 26px; }
  .bootlog {
    margin-top: 30px; font-size: 12px; border-radius: 16px;
    padding: 12px 18px; gap: 6px 16px;
  }
  /* wide desktop captures need every pixel: run them edge to edge */
  .shot-hero .frame, .floor .frame, .tour .frame {
    margin-inline: calc(var(--edge) * -1);
    border-radius: 0; border-left: none; border-right: none;
  }
  /* the art-directed shots are captures of Plexward's own phone UI, so they
     present as a phone: legible at 1:1-ish instead of a shrunk desktop window */
  .shot-swap {
    width: min(340px, 88%); margin-inline: auto;
    border-radius: 20px; border-color: #232c46;
    box-shadow: 0 18px 60px rgba(0,0,0,.5);
  }
  .shot-swap .framebar { display: none; }
  .framebar { padding: 9px 14px; }
  .framebar span { width: 8px; height: 8px; }
  .framebar em { font-size: 11px; margin-left: 8px; }
  .shot-hero { margin-top: 22px; }
  .cap { margin-top: 12px; font-size: 11.5px; }
  .card { padding: 22px 20px 20px; }
  .term pre { padding: 18px 16px; }
  .term code { line-height: 1.95; }
  .duo { gap: 56px; }
  .facts { gap: 15px; }
  section[id] { scroll-margin-top: 68px; }
  /* big blurred glows are expensive to composite on phone GPUs */
  .glow-a { width: 520px; height: 380px; top: -180px; filter: blur(80px); }
  .glow-b { width: 420px; height: 320px; right: -180px; filter: blur(80px); }
  .grain { opacity: .38; }
}

/* ---------- small phone ---------- */
@media (max-width: 480px) {
  .cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .cta .btn { width: 100%; }
  .btn-solid.big { padding: 15px 18px; word-break: break-word; }
  .msg { max-width: 100%; font-size: 13px; }
  .phone { border-radius: 18px; }
}
@media (max-width: 350px) {
  .nav-cta .long { display: none; }
  .nav-cta .short { display: inline; }
  .nav-cta { padding: 9px 14px; }
}

/* ---------- phone landscape: reclaim vertical space ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-top: 34px; padding-bottom: 22px; }
  .bootlog { margin-top: 22px; }
  :root { --sec: 68px; }
}
