/* =========================================================
   LOUDE — loudevpn.com
   Aesthetic: "Loude OS" — pure black, bold grotesk, mono labels,
   connected-green live accent. Matched to the app (LoudeColors.swift).
   ========================================================= */

:root {
  /* palette — canonical, from Loude/Loude/UI/Theme/LoudeColors.swift */
  --bg:        #000000;
  --surface:   #0b0b0d;
  --surface-2: #121214;
  --text:      #ffffff;
  --read:      #c2c2c8;   /* long-form body, lifted for contrast on black */
  --dim:       #8a8a90;
  --mute:      #5a5a60;
  --line:      rgba(255, 255, 255, 0.09);
  --line-hi:   rgba(255, 255, 255, 0.18);
  --line-lo:   rgba(255, 255, 255, 0.045);
  --ac:        #00ff88;   /* connected / live state */
  --ac-dim:    rgba(0, 255, 136, 0.14);
  --prem:      #e8c875;   /* premium tier only */

  --sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --gutter: 24px;
  --radius: 11px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--ac); color: #001a0f; }

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

/* ---------- Layout primitives ---------- */
.wrap { width: min(var(--wrap), 100% - (var(--gutter) * 2)); margin: 0 auto; }
.col  { max-width: 70ch; }

.eye {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ac);
}
.eye .sl { color: var(--mute); }

.ghost {
  position: absolute;
  font-weight: 900;
  font-size: clamp(180px, 26vw, 360px);
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.022);
  z-index: 0;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

/* ---------- Topbar (status strip) ---------- */
.topbar { border-bottom: 1px solid var(--line); background: #000; position: relative; z-index: 10; }
.topbar .wrap {
  display: flex; gap: 16px; align-items: center;
  padding: 9px 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute);
  white-space: nowrap; overflow: hidden;
}
.topbar b { color: var(--dim); font-weight: 400; }
.topbar .sep { color: #2a2a2e; }
.topbar .tright { margin-left: auto; }
.tdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ac); box-shadow: 0 0 10px var(--ac);
  display: inline-block; animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; transform: scale(0.8); } }

/* ---------- Header ---------- */
header.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header.nav .wrap { display: flex; align-items: center; gap: 30px; padding: 16px 0; }
.wm { font-weight: 800; letter-spacing: 0.28em; font-size: 16px; }
.menu {
  display: flex; gap: 26px; margin-left: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--dim);
}
.menu a { transition: color 0.2s; }
.menu a:hover { color: #fff; }
.lang {
  margin-left: auto; display: flex; gap: 2px;
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.lang a { padding: 7px 11px; color: var(--mute); transition: color 0.2s; }
.lang a:hover { color: #fff; }
.lang a.on { background: #fff; color: #000; }
.navcta {
  padding: 9px 16px; border: 1px solid var(--ac); color: var(--ac);
  border-radius: 8px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; transition: background 0.2s, color 0.2s;
}
.navcta:hover { background: var(--ac); color: #001a0f; }
@media (max-width: 880px) { .menu { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 15px 26px; border-radius: var(--radius);
  background: var(--ac); color: #001a0f; font-weight: 700; font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(0, 255, 136, 0.22); }
.btn-ghost {
  display: inline-block; padding: 15px 24px; border: 1px solid var(--line-hi);
  border-radius: var(--radius); font-weight: 600; font-size: 15px; color: #fff;
  transition: border-color 0.2s;
}
.btn-ghost:hover { border-color: #fff; }
.rate { font-family: var(--mono); font-size: 11.5px; color: var(--dim); letter-spacing: 0.04em; }
.rate b { color: var(--ac); }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh; display: flex; align-items: center;
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero .vig {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(125% 90% at 72% 35%, transparent 28%, #000 76%);
}
.hero .wrap { position: relative; z-index: 3; padding: 80px 0; }
.hero h1 {
  font-weight: 800; font-size: clamp(44px, 7.2vw, 98px);
  line-height: 0.94; letter-spacing: -0.035em; margin: 20px 0 0;
}
.hero h1 .g { color: var(--mute); }
.hero h1 .a { color: var(--ac); }
.hero .lede {
  margin-top: 24px; color: var(--dim);
  font-size: clamp(15px, 1.5vw, 18px); max-width: 46ch;
}
.pill {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 15px; border: 1px solid var(--line-hi); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #d8d8dc; background: rgba(255, 255, 255, 0.03);
}
.ctas { margin-top: 30px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- Section shell ---------- */
.sec { padding: clamp(72px, 11vw, 128px) 0; border-bottom: 1px solid var(--line); position: relative; }
.shead { position: relative; z-index: 2; max-width: 760px; margin-bottom: 54px; }
.shead h2 {
  font-weight: 800; font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.0; letter-spacing: -0.03em; margin: 14px 0 0;
}
.shead h2 em { font-style: normal; color: var(--ac); }
.shead p { margin-top: 18px; color: var(--dim); font-size: 16px; max-width: 54ch; }

/* ---------- Tiles (apps) ---------- */
.tiles { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  background: linear-gradient(180deg, var(--surface), #000);
  transition: transform 0.25s var(--ease), border-color 0.25s; position: relative;
}
.tile:hover { transform: translateY(-4px); border-color: var(--line-hi); }
.tile .th {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute);
}
.tile .glyph { width: 34px; height: 34px; color: #fff; margin: 26px 0 18px; opacity: 0.9; }
.tile h3 { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.tile .tag { color: var(--dim); font-size: 13.5px; margin-top: 5px; }
.tile dl { margin: 22px 0; border-top: 1px solid var(--line); }
.tile dl > div {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.tile dl dt { color: var(--mute); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tile dl dd { color: #cfcfd4; }
.tile .tcta {
  display: flex; justify-content: space-between; align-items: center; padding-top: 6px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ac);
}
.tile .tsub {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mute);
}
.tile .tsub:hover { color: var(--ac); }
.tile .flag {
  position: absolute; top: 18px; right: 18px;
  background: var(--ac); color: #001a0f; font-family: var(--mono);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 5px; text-transform: uppercase;
}

/* ---------- Pricing ---------- */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; position: relative; z-index: 2; }
.pc {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px;
  background: linear-gradient(180deg, var(--surface), #000);
}
.pc.prem { border-color: rgba(232, 200, 117, 0.35); background: linear-gradient(180deg, rgba(232, 200, 117, 0.05), #000); }
.pc .pm {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
}
.pc.prem .pm b { color: var(--prem); }
.pc .amt { margin: 26px 0 6px; font-weight: 800; letter-spacing: -0.04em; font-size: clamp(54px, 9vw, 86px); line-height: 0.9; }
.pc .amt small { font-size: 20px; color: var(--dim); font-weight: 600; letter-spacing: 0; }
.pc .arow { color: var(--dim); font-size: 13.5px; font-family: var(--mono); }
.pc .arow .save { color: var(--ac); margin-left: 8px; }
.pc ul { list-style: none; margin: 26px 0; padding: 0; border-top: 1px solid var(--line); }
.pc li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: #d4d4d8; }
.pc li .mk { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.pc .pcta { display: block; text-align: center; padding: 14px; border-radius: var(--radius); font-weight: 700; font-size: 14px; transition: transform 0.2s; }
.pc .pcta:hover { transform: translateY(-2px); }
.pc.free .pcta { background: #fff; color: #000; }
.pc.prem .pcta { background: var(--prem); color: #1c1405; }
.pfoot {
  position: relative; z-index: 2; margin-top: 26px; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mute);
}

/* ---------- Principles ---------- */
.prin { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); position: relative; z-index: 2; }
.prin .p { padding: 34px 30px 34px 0; border-right: 1px solid var(--line); }
.prin .p:last-child { border-right: 0; }
.prin .n { font-family: var(--mono); font-size: 12px; color: var(--ac); letter-spacing: 0.1em; }
.prin h4 { font-weight: 700; font-size: 20px; margin: 16px 0 10px; letter-spacing: -0.01em; }
.prin p { color: var(--dim); font-size: 14.5px; }

/* ---------- Network stat board ---------- */
.net {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  position: relative; z-index: 2; background: var(--surface);
}
.ns { padding: 30px 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ns:nth-child(4n) { border-right: 0; }
.ns dt { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.ns .num { font-weight: 800; font-size: clamp(40px, 6vw, 62px); letter-spacing: -0.03em; margin: 14px 0 10px; }
.ns .num.ac { color: var(--ac); text-shadow: 0 0 26px rgba(0, 255, 136, 0.4); }
.ns .num.sm { font-size: 24px; font-family: var(--mono); font-weight: 500; }
.ns .nt { color: var(--dim); font-size: 12.5px; }
.network-foot {
  position: relative; z-index: 2; margin-top: 22px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--mute);
}
.network-foot a { color: var(--ac); }

/* ---------- Closing ---------- */
.closing { padding: clamp(90px, 14vw, 160px) 0; text-align: center; position: relative; border-bottom: 1px solid var(--line); }
.closing .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.closing h2 { font-weight: 800; font-size: clamp(36px, 6vw, 72px); letter-spacing: -0.035em; line-height: 0.98; margin: 18px 0 32px; }
.closing h2 .a { color: var(--ac); }

/* ---------- P.S. aside ---------- */
.aside-alt { border-bottom: 1px solid var(--line); }
.aside-alt .wrap { display: flex; gap: 16px; align-items: baseline; padding: 28px 0; flex-wrap: wrap; }
.aside-alt .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ac); }
.aside-alt p { color: var(--dim); font-size: 14.5px; }
.aside-alt a { color: #fff; border-bottom: 1px solid var(--ac); }

/* ---------- Footer ---------- */
footer.site-footer { padding: 60px 0 40px; }
.fg { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.fg h5 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); margin: 0 0 14px; }
.fg a { display: block; color: var(--dim); font-size: 14px; padding: 5px 0; transition: color 0.2s; }
.fg a:hover { color: #fff; }
.fg .fb { color: var(--dim); font-size: 14px; max-width: 30ch; margin-top: 14px; }
.fbase {
  display: flex; justify-content: space-between; margin-top: 46px; padding-top: 22px;
  border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px;
  color: var(--mute); letter-spacing: 0.04em; flex-wrap: wrap; gap: 10px;
}

/* =========================================================
   SUB-PAGE TEMPLATES
   ========================================================= */

/* page hero (shared by A / B / C) */
.phero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); position: relative; }
.crumb { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-bottom: 18px; }
.crumb a { color: var(--dim); }
.crumb .ac { color: var(--ac); }
.phero h1 { font-weight: 800; font-size: clamp(34px, 5vw, 58px); letter-spacing: -0.03em; line-height: 0.98; margin: 0; }
.phero .lede { margin-top: 18px; color: var(--dim); font-size: 16px; max-width: 54ch; }
.phero .upd { position: absolute; top: 56px; right: 0; font-family: var(--mono); font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.08em; text-align: right; }

/* Template A — long-form (privacy / terms / support / team) */
.legal { padding: 46px 0 56px; }
.legal h2 { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; margin: 38px 0 4px; display: flex; align-items: baseline; gap: 12px; }
.legal h2 .s { font-family: var(--mono); font-size: 12px; color: var(--ac); font-weight: 500; }
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-weight: 700; font-size: 17px; margin: 26px 0 4px; }
.legal p { color: var(--read); font-size: 15.5px; line-height: 1.75; margin-top: 14px; }
.legal a { color: #fff; border-bottom: 1px solid var(--ac); }
.legal ul { margin: 14px 0 0; padding-left: 0; list-style: none; }
.legal li { color: var(--read); font-size: 15px; line-height: 1.7; padding: 7px 0 7px 22px; position: relative; }
.legal li::before { content: "—"; position: absolute; left: 0; color: var(--mute); }
.legal .callout {
  border-left: 2px solid var(--ac); background: var(--ac-dim);
  padding: 16px 20px; margin-top: 20px; border-radius: 0 10px 10px 0;
  color: #d6f7e6; font-size: 14.5px; line-height: 1.6;
}

/* Press — facts table + asset downloads (variant of A) */
.facts { padding: 40px 0; border-bottom: 1px solid var(--line); }
.facts dl { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
.facts dl > div { display: contents; }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.facts dd { color: var(--read); font-size: 15px; }
.facts dd a { color: #fff; border-bottom: 1px solid var(--ac); }
.assets { padding: 40px 0; }
.assets-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.asset {
  border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  background: var(--surface); transition: border-color 0.2s, transform 0.2s;
}
.asset:hover { border-color: var(--line-hi); transform: translateY(-3px); }
.asset .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.asset .v { font-weight: 700; margin-top: 8px; }
.asset .dl { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--ac); }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.swatch { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.swatch i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.quote-box { border-left: 2px solid var(--prem); padding: 16px 20px; margin: 20px 0; color: var(--read); font-size: 15.5px; line-height: 1.7; font-style: italic; }
.quote-box cite { display: block; margin-top: 10px; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* Template B — changelog */
.clog { padding: 24px 0 50px; }
.entry { display: grid; grid-template-columns: 200px 1fr; gap: 30px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.entry .meta { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.entry .meta .ver { display: inline-block; margin-top: 8px; color: #fff; border: 1px solid var(--line-hi); border-radius: 6px; padding: 3px 9px; font-size: 11px; }
.entry .meta .ver.ac { color: var(--ac); border-color: rgba(0, 255, 136, 0.4); }
.entry h3 { font-weight: 700; font-size: 18px; margin: 0 0 10px; }
.entry ul { list-style: none; margin: 0; padding: 0; }
.entry li { color: var(--read); font-size: 14.5px; line-height: 1.7; padding: 5px 0 5px 22px; position: relative; }
.entry li::before { content: "+"; position: absolute; left: 0; color: var(--ac); font-family: var(--mono); }
.entry li.fix::before { content: "~"; color: var(--prem); }

/* Template C — network full */
.netf { padding: 24px 0 50px; }
.region { padding: 26px 0; border-bottom: 1px solid var(--line); }
.region .rh { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.region .rh h3 { font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; margin: 0; }
.region .rh .ln { flex: 1; height: 1px; background: var(--line); }
.region .rh .ct { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.node { display: grid; grid-template-columns: 1fr 90px 130px 90px; gap: 14px; padding: 9px 0; font-size: 14px; color: var(--read); border-bottom: 1px solid var(--line-lo); }
.node .code { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.node .st { font-family: var(--mono); font-size: 11px; color: var(--ac); text-transform: uppercase; letter-spacing: 0.06em; }
.node .st::before { content: "\25CF  "; }
.node .cnt { font-family: var(--mono); font-size: 12px; color: var(--mute); text-align: right; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 880px) {
  .tiles, .price, .assets-grid { grid-template-columns: 1fr; }
  .prin { grid-template-columns: 1fr; }
  .prin .p { border-right: 0; border-bottom: 1px solid var(--line); padding: 30px 0; }
  .net { grid-template-columns: 1fr 1fr; }
  .fg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar .hidesm { display: none; }
  .fg { grid-template-columns: 1fr 1fr; }
  .facts dl { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .facts dd { padding-top: 4px; }
}
@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr; gap: 12px; }
  .node { grid-template-columns: 1fr auto; }
  .node .code, .node .cnt { display: none; }
  .phero .upd { position: static; margin-top: 14px; text-align: left; }
}

/* =========================================================
   REDUCED MOTION  (canvas loop is also halted in JS)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tdot { animation: none; }
  .btn:hover, .tile:hover, .asset:hover, .pc .pcta:hover { transform: none; }
}
