/* ---------------- Base layout ---------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  font: 16px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  color:#dbe6ff;
  background: radial-gradient(1200px 800px at 10% -10%, #123368 0%, transparent 40%),
              linear-gradient(180deg, #0b1e3a, #081833 70%);
}

.container{ max-width: 980px; margin: 0 auto; padding: 24px; }
.header{ display:flex; gap:14px; align-items:center; }
.logo{ width:36px; height:36px; border-radius:8px; }
.brand h1{ margin:0; font-size:1.35rem; color:#e9f1ff; }
.brand p{ margin:.1rem 0 0; color:#a9b8d9; }

.card{
  background: linear-gradient(180deg, #0f2345, #0c1f3d);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:18px 18px 20px;
  margin:18px 0;
}

h2{ margin:0 0 .6rem; color:#e9f1ff; font-size:1.25rem; }

/* ---------------- What we do pills ---------------- */
.pill-list{
  display:flex; flex-wrap:wrap; gap:.6rem .6rem; margin:.9rem 0 0; padding:0; list-style:none;
}
.pill-list li{
  background:#1a3a74; color:#ffd089; border:1px solid rgba(255,255,255,.14);
  padding:.42rem .7rem; border-radius:18px; font-weight:500;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
  cursor: default;
}

.pill-list li:focus{ outline: 2px solid #6fb6ff; outline-offset: 2px; }

.pill-detail{
  margin-top:.8rem; color:#a9c7f5;
  min-height: 2.2em; /* prevents layout jump */
}

/* ---------------- Status banner ---------------- */
.status-banner{
  display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  background: linear-gradient(180deg,#0d213f,#0c1e39);
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px; padding:.6rem .8rem; margin:0 0 .6rem 0;
  color:#dbe6ff;
}
.status-banner .dot{
  width:10px; height:10px; border-radius:50%;
  background:#22c55e; box-shadow:0 0 10px #22c55eAA; flex:0 0 auto;
}
.status-banner .sep{ opacity:.6 }
.s-crit{ color:#ff6b6b }
.s-high{ color:#ff9a4d }
.s-med { color:#ffd166 }
.s-low { color:#5ad1e6 }
.s-info{ color:#58e086 }

/* Optional stacked bar under banner; hide if you don't want the line */
.status-meter{ display:none; height:8px; border-radius:6px; overflow:hidden;
  background:rgba(255,255,255,.06); margin:.4rem 0 .8rem; }
.status-meter .seg{ height:100%; display:inline-block }
.seg-crit{ background:#b91c1c }
.seg-high{ background:#ea580c }
.seg-med { background:#eab308 }
.seg-low { background:#0ea5e9 }
.seg-info{ background:#16a34a }

/* ---------------- Terminal (black) ---------------- */
.card.terminal{ background:#0a0a0f; border-color:rgba(255,255,255,.06); }
.terminal-header{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background:#0e0e16; color:#c9ffb3; padding:10px 12px; border-radius:6px; margin:0 0 .6rem;
}
.terminal-body{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color:#2bff72; background:transparent; margin:0; white-space:pre;
  overflow:auto; height:260px; line-height:1.4; /* fixed to prevent growth while typing */
}
.terminal--small{ margin-top: 12px; }
.terminal--small .terminal-body{
  font-size:13px; height:160px; -webkit-overflow-scrolling:touch; scrollbar-width:none; /* fixed height */
}
.terminal--small .terminal-body::-webkit-scrollbar{ display:none; }

/* ---------------- Contact form ---------------- */
.contact .grid{
  display:grid; grid-template-columns: 1fr 1fr; gap:14px;
}
.contact label{ display:flex; flex-direction:column; gap:.35rem; }
.contact label.full{ grid-column: 1 / -1; }
.contact input, .contact textarea{
  background:#0a1327; color:#e8f0ff; border:1px solid rgba(255,255,255,.1);
  border-radius:10px; padding:.75rem .8rem; outline:none;
}
.contact input:focus, .contact textarea:focus{ border-color:#4aa3ff; box-shadow:0 0 0 3px #4aa3ff22; }
.btn{
  grid-column: 1 / -1; justify-self:start;
  background:#1b294a; color:#e8f0ff; border:1px solid rgba(255,255,255,.12);
  border-radius:10px; padding:.6rem 1.2rem; cursor:pointer;
}
.btn:hover{ background:#21325e; }
.status{ margin:.2rem 0 0; }
.fineprint{ color:#a9b8d9; margin:.8rem 0 0; }

.footer{ display:flex; justify-content:space-between; align-items:center; gap:.8rem; }
.footer small{ color:#a9b8d9; }

/* Submit steps checklist (replaces mini terminal) */
.send-steps{
  list-style:none; margin:.4rem 0 0; padding:0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color:#9fc0ff;
}
.send-steps li{
  position:relative; padding-left:22px; margin:.18rem 0;
}
.send-steps li::before{
  content:"•"; position:absolute; left:0; top:0; color:#7aa2ff; opacity:.7;
}
.send-steps li.done{ color:#2bff72; }
.send-steps li.done::before{ content:"✓"; color:#2bff72; }
.send-steps li.error{ color:#ff7a7a; }
.send-steps li.error::before{ content:"×"; color:#ff7a7a; }

/* Optional: make the status line look like a banner */
.status{
  margin:.5rem 0 0;
  font-weight:600;
}
.status.ok{ color:#2bff72; }
.status.err{ color:#ff7a7a; }

/* ---------------- Mobile polish ---------------- */
@media (max-width: 560px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .card { padding: 14px 14px 16px; border-radius: 10px; }

  .pill-list { gap: .5rem .5rem; }
  .pill-list li {
    font-size: .95rem;
    padding: .38rem .62rem;
    border-radius: 18px;
    white-space: normal; /* allow wrapping if needed */
  }

  .status-banner { font-size:.92rem; padding:.5rem .6rem; }
  .terminal-header { font-size:.95rem; padding: 8px 10px; }
  .terminal-body {
    font-size:12.5px; line-height:1.35; max-height:200px;
    -webkit-overflow-scrolling:touch; scrollbar-width:none;
  }
  .terminal-body::-webkit-scrollbar{ display:none; }

  .contact .grid{ grid-template-columns: 1fr; gap:12px; }
  .contact input, .contact textarea{ font-size:16px; } /* prevent iOS zoom */
  .contact .btn{ width:100%; }
}

/* Contact card: make it the star */
.card.contact{
  position: relative;
  border: 1.5px solid rgba(99, 179, 237, .45);       /* blue accent */
  box-shadow: 0 10px 30px rgba(12, 22, 40, .55),
              inset 0 0 0 1px rgba(255,255,255,.03);
  background: radial-gradient(120% 140% at 10% -20%, rgba(35,70,120,.18) 0, transparent 50%),
              var(--card-bg, rgba(10,14,22,.75));
  backdrop-filter: blur(2px);
}

/* a thin top bar to anchor the eye */
.card.contact::before{
  content:"";
  position:absolute; left:0; top:0; right:0; height:4px;
  background: linear-gradient(90deg,#3aa0ff, #7cc0ff 50%, #3aa0ff);
  opacity:.9; border-top-left-radius:12px; border-top-right-radius:12px;
}

/* Section spacing */
.card.contact { margin-top: 28px; margin-bottom: 32px; }

/* Headline */
.card.contact h2{
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  letter-spacing:.2px;
}

/* Inputs: lighter outline + focus glow */
.card.contact input,
.card.contact textarea{
  border:1px solid rgba(120,170,230,.35);
  background: rgba(6,10,18,.65);
}
.card.contact input:focus,
.card.contact textarea:focus{
  outline: none;
  border-color: #69b1ff;
  box-shadow: 0 0 0 3px rgba(105,177,255,.25);
}

/* Make the Send button look primary */
.card.contact .btn{
  width: 100%;
  padding:.9rem 1rem;
  font-weight: 700;
  border-radius:10px;
  background: linear-gradient(180deg,#3aa0ff,#1d7ed6);
  color:#fff; border:none;
  box-shadow: 0 8px 18px rgba(26,125,214,.35);
}
.card.contact .btn:hover{ filter: brightness(1.06); transform: translateY(-1px); }
.card.contact .btn:active{ transform: translateY(0); filter: brightness(.98); }

/* Slim subtitle line to guide the user */
.contact-sub{
  margin:-2px 0 12px; color:#a9c7f5; opacity:.9; font-size:.95rem;
}

/* Make Turnstile sit closer to the button and align */
.card.contact .turnstile{ margin: 4px 0 10px; }

/* On wide screens, give the form a max width so it doesn't feel endless */
@media (min-width: 900px){
  .card.contact form{ max-width: 900px; margin-inline:auto; }
}

/* On small screens, increase vertical rhythm */
@media (max-width: 640px){
  .card.contact { padding-top: 18px; }
  .card.contact .grid label{ margin-bottom: 10px; }
}

.cta-link{
  display:inline-block; margin-top:8px;
  padding:.55rem .9rem; border-radius:999px;
  background:#1d7ed6; color:#fff; font-weight:700; text-decoration:none;
  box-shadow:0 6px 16px rgba(29,126,214,.35);
}
.cta-link:hover{ filter:brightness(1.07) }

/* Scope styles to Mermaid blocks we want to animate */
.merm-flow .messageLine { 
  stroke: #7aa2ff; 
  opacity: .35; 
}
.merm-flow .messageText { 
  fill: #cfe3ff; 
  opacity: .5; 
}

/* Active step: brighter colour, thicker line, subtle glow */
.merm-flow .messageLine.active {
  stroke: #ffb454;                /* orange highlight */
  opacity: 1;
  stroke-width: 3px;
  filter: drop-shadow(0 0 6px rgba(255,180,84,.5));
  stroke-dasharray: 90;           /* draw-on animation */
  animation: merm-dash .8s ease-out forwards;
}
.merm-flow .messageText.active {
  fill: #ffb454;
  opacity: 1;
  font-weight: 700;
}

@keyframes merm-dash {
  from { stroke-dashoffset: 90; }
  to   { stroke-dashoffset: 0; }
}

/* Scope to this diagram only: give the wrapper an id or class */
#packet-journey .messageLine { stroke:#7aa2ff; opacity:.35; }
#packet-journey .messageText { fill:#cfe3ff; opacity:.55; }

#packet-journey .messageLine.active{
  stroke:#ffb454; opacity:1; stroke-width:3px;
  filter: drop-shadow(0 0 6px rgba(255,180,84,.5));
  stroke-dasharray: 90;
  animation: merm-dash .8s ease-out forwards;
}
#packet-journey .messageText.active{
  fill:#ffb454; opacity:1; font-weight:700;
}
@keyframes merm-dash{ from{stroke-dashoffset:90} to{stroke-dashoffset:0} }
