/* ===========================================================================
   Torzon Link — style.css
   Palette: professional blue (Torzon). Dark theme, glass cards, status pills.
   Mobile-first. 8px spacing scale. One dominant accent (blue), purple/green
   used sparingly. Reduced-motion aware.
   =========================================================================== */

/* ---- Tokens -------------------------------------------------------------- */
:root {
  /* Brand */
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #60a5fa;
  --accent:         #8b5cf6;
  --ok:             #00cc66;
  --warn:           #f59e0b;

  /* Surfaces (dark) */
  --bg:             #0f172a;
  --bg-2:           #0b1220;
  --bg-card:        #1e293b;
  --bg-card-2:      #243349;
  --text:           #e2e8f0;
  --muted:          #94a3b8;
  --border:         rgba(37, 99, 235, .30);
  --border-soft:    rgba(148, 163, 184, .16);

  /* Brand effects */
  --grad: linear-gradient(135deg, #2563eb, #8b5cf6);
  --glow: 0 0 20px rgba(37, 99, 235, .35);

  /* Spacing (8px scale) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-12: 3rem; --s-16: 4rem;

  /* Type */
  --font: "Inter", "Roboto", system-ui, -apple-system, Segoe UI, sans-serif;
  --r: 10px;
  --r-sm: 6px;
  --r-pill: 999px;
  --t: 200ms;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --container: 1100px;
}

/* Light theme override (toggle) */
:root[data-theme="light"] {
  --bg:        #f4f7fb;
  --bg-2:      #e9eef6;
  --bg-card:   #ffffff;
  --bg-card-2: #f1f5fb;
  --text:      #0f172a;
  --muted:     #475569;
  --border:    rgba(37, 99, 235, .22);
  --border-soft: rgba(15, 23, 42, .10);
  --glow:      0 0 18px rgba(37, 99, 235, .18);
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -10%, rgba(37, 99, 235, .12), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(139, 92, 246, .08), transparent 55%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
.copy-btn:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-4); }
main { display: block; }
.section { padding-block: var(--s-12); }
.section + .section { border-top: 1px solid var(--border-soft); }

/* Skip link */
.skip-link {
  position: absolute; left: var(--s-4); top: -100px;
  background: var(--primary); color: #fff; padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm); z-index: 200; transition: top var(--t) var(--ease);
}
.skip-link:focus { top: var(--s-4); color: #fff; }

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.18; font-weight: 700; margin: 0 0 var(--s-4); letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3.4vw, 2.6rem); }
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.85rem);
  padding-bottom: var(--s-3);
  margin-top: 0;
  border-bottom: 2px solid var(--border);
}
h3 { font-size: 1.2rem; font-weight: 600; color: #f1f5f9; margin-top: var(--s-8); }
:root[data-theme="light"] h3 { color: #0f172a; }
p { margin: 0 0 var(--s-4); }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.section p, .section li { max-width: 72ch; }
strong { color: #fff; font-weight: 600; }
:root[data-theme="light"] strong { color: #0f172a; }

ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-6); }
li { margin-bottom: var(--s-2); }

/* Gradient brand text */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .site-header { background: rgba(244, 247, 251, .82); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: 1.2rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: var(--glow);
}

.nav__links { display: flex; align-items: center; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3);
  color: var(--text); border-radius: var(--r-sm); font-weight: 500;
}
.nav__links a:hover { background: rgba(37, 99, 235, .14); color: var(--primary-light); }
.nav__links a[aria-current="page"] { color: var(--primary-light); background: rgba(37, 99, 235, .12); }

.nav__actions { display: flex; align-items: center; gap: var(--s-2); }
.theme-toggle, .nav-toggle {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); cursor: pointer; font-size: 1.1rem; transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--primary-light); }
.nav-toggle { display: inline-grid; }

/* Mobile nav drawer */
@media (max-width: 820px) {
  .nav__links {
    position: fixed; inset: 60px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: var(--s-2) var(--s-4) var(--s-4);
    transform: translateY(-130%);
    transition: transform var(--t) var(--ease);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { min-height: 48px; padding: 0 var(--s-3); border-radius: var(--r-sm); }
  .nav__links li { margin: 0; }
}
@media (min-width: 821px) {
  .nav-toggle { display: none; }
}

/* ---- Hero / INSTANT VALUE ------------------------------------------------ */
.hero { position: relative; padding-block: var(--s-12) var(--s-12); overflow: clip; }
.hero__blob {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(70vw, 560px); aspect-ratio: 1; top: -18%; left: 50%;
  transform: translateX(-50%); filter: blur(70px); opacity: .5;
  background: radial-gradient(circle at 40% 40%, var(--primary), transparent 62%),
              radial-gradient(circle at 65% 60%, var(--accent), transparent 60%);
  animation: blob 16s var(--ease) infinite alternate;
}
.hero > .container { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary-light); background: rgba(37, 99, 235, .12);
  border: 1px solid var(--border); padding: var(--s-2) var(--s-3); border-radius: var(--r-pill);
  margin-bottom: var(--s-4);
}
.hero h1 { max-width: 18ch; }
.hero__intro { max-width: 60ch; color: var(--muted); font-size: 1.08rem; }

/* Onion box — the value */
.onion-box {
  margin: var(--s-6) 0 var(--s-4);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-6);
  box-shadow: var(--glow);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.onion-box:hover { border-color: var(--primary-light); box-shadow: 0 0 32px rgba(37, 99, 235, .5); }
.onion-box__label { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.onion-box__label span:first-child { font-weight: 600; color: var(--text); }
.onion-row { display: flex; gap: var(--s-3); align-items: stretch; flex-wrap: wrap; }
.onion-url {
  flex: 1 1 240px; min-width: 0;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem; color: var(--primary-light);
  background: var(--bg-2); border: 1px dashed var(--border);
  border-radius: var(--r-sm); padding: var(--s-3) var(--s-4);
  user-select: all; -webkit-user-select: all; cursor: text;
  word-break: break-all; overflow-wrap: anywhere; line-height: 1.5;
}
.onion-note { font-size: .9rem; color: var(--muted); margin: var(--s-3) 0 0; }
.hero__mirrors-link { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; font-weight: 600; }
.hero__mirrors-link::after { content: "→"; transition: transform var(--t) var(--ease); }
.hero__mirrors-link:hover::after { transform: translateX(4px); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: var(--s-3) var(--s-6);
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  border: 1px solid transparent; border-radius: var(--r); cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .35); }
.btn--primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform 600ms var(--ease);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(37, 99, 235, .5); }
.btn--primary:hover::before { transform: translateX(130%); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn--lg { min-height: 52px; padding: var(--s-4) var(--s-8); font-size: 1.05rem; }

/* Copy button */
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; min-width: 96px; padding: var(--s-2) var(--s-4);
  font-family: inherit; font-size: .95rem; font-weight: 600;
  background: var(--grad); color: #fff; border: none; border-radius: var(--r-sm); cursor: pointer;
  transition: transform var(--t) var(--ease), filter var(--t) var(--ease);
}
.copy-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.copy-btn:active { transform: translateY(0); }
.copy-btn.copied { background: var(--ok); }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* ---- Status pills -------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: .82rem; font-weight: 600; padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap;
}
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
.pill--online { color: var(--ok); background: rgba(0, 204, 102, .12); border-color: rgba(0, 204, 102, .35); }
.pill--online .pill__dot { animation: pulse-dot 2s var(--ease) infinite; }
.pill--checking { color: var(--warn); background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
.pill--checking .pill__dot { animation: pulse-dot 1.4s var(--ease) infinite; }

/* ---- Cards / grid -------------------------------------------------------- */
.grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

.card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: var(--s-6);
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card__icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(37, 99, 235, .14); color: var(--primary-light); margin-bottom: var(--s-4);
  border: 1px solid var(--border);
}
.card__icon svg { width: 22px; height: 22px; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: var(--s-4) 0; }
.checklist li { position: relative; padding-left: var(--s-8); margin-bottom: var(--s-3); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .15em;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 204, 102, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300cc66' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid rgba(0, 204, 102, .3);
}

/* Ordered steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: var(--s-4) 0; display: grid; gap: var(--s-3); }
.steps li { position: relative; padding-left: 3rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -.1em;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; color: #fff;
  background: var(--grad); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

/* ---- Mirror table -------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.mirror-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.mirror-table caption { text-align: left; padding: var(--s-3) var(--s-4); color: var(--muted); font-size: .9rem; }
.mirror-table th, .mirror-table td { padding: var(--s-3) var(--s-4); text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.mirror-table thead th { background: var(--bg-card-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mirror-table tbody tr:hover { background: rgba(37, 99, 235, .07); }
.mirror-table tbody tr:last-child td { border-bottom: none; }
.mirror-table code {
  font-family: "Roboto Mono", ui-monospace, monospace; font-size: .92rem; color: var(--primary-light);
  user-select: all; -webkit-user-select: all; word-break: break-all; overflow-wrap: anywhere;
}
.mirror-table .copy-btn { min-width: 84px; }

/* Mobile: collapse table into stacked cards */
@media (max-width: 600px) {
  .mirror-table { min-width: 0; }
  .mirror-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mirror-table, .mirror-table tbody, .mirror-table tr, .mirror-table td { display: block; width: 100%; }
  .mirror-table tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--border-soft); }
  .mirror-table td { border: none; padding: var(--s-1) var(--s-4); display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
  .mirror-table td::before { content: attr(data-label); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
  .mirror-table td[data-label="Torzon mirror (onion URL)"] { flex-direction: column; align-items: flex-start; }
  .mirror-table td[data-label="Torzon mirror (onion URL)"] code { width: 100%; }
}

/* ---- FAQ accordion ------------------------------------------------------- */
.faq { display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.faq__item { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r); overflow: hidden; transition: border-color var(--t) var(--ease); }
.faq__item.open { border-color: var(--border); }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; padding: var(--s-4) var(--s-6); text-align: left; cursor: pointer;
  background: none; border: none; color: var(--text); font-family: inherit; font-size: 1.05rem; font-weight: 600;
}
.faq__q:hover { color: var(--primary-light); }
.faq__icon { flex: 0 0 auto; width: 22px; height: 22px; position: relative; transition: transform var(--t) var(--ease); }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; background: var(--primary-light); border-radius: 2px; }
.faq__icon::before { top: 50%; left: 2px; right: 2px; height: 2px; transform: translateY(-50%); }
.faq__icon::after { left: 50%; top: 2px; bottom: 2px; width: 2px; transform: translateX(-50%); transition: opacity var(--t) var(--ease); }
.faq__item.open .faq__icon::after { opacity: 0; }
.faq__a { max-height: 0; overflow: hidden; transition: max-height var(--t) var(--ease); }
.faq__a > div { padding: 0 var(--s-6) var(--s-6); color: var(--muted); }
.faq__a p:last-child { margin-bottom: 0; }

/* ---- Crypto widget ------------------------------------------------------- */
.crypto { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .crypto { grid-template-columns: 1fr 1fr; } }
.crypto__card { display: flex; align-items: center; gap: var(--s-4); background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r); padding: var(--s-4) var(--s-6); }
.crypto__sym { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: 0 0 auto; }
.crypto__sym--xmr { background: linear-gradient(135deg, #ff6600, #f60); }
.crypto__sym--btc { background: linear-gradient(135deg, #f7931a, #e8860d); }
.crypto__body { min-width: 0; }
.crypto__name { font-size: .85rem; color: var(--muted); }
.crypto__price { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.crypto__chg { font-size: .85rem; font-weight: 600; }
.crypto__chg.up { color: var(--ok); }
.crypto__chg.down { color: #ef4444; }

/* ---- CTA band ------------------------------------------------------------ */
.cta-band {
  text-align: center; background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(139, 92, 246, .14));
  border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-12) var(--s-6); margin-top: var(--s-8);
}
.cta-band h2 { border: none; padding: 0; }
.cta-band .cta-row { justify-content: center; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding-block: var(--s-12) var(--s-8); margin-top: var(--s-16); }
.footer-grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-grid h4 { font-size: .95rem; color: var(--text); margin-bottom: var(--s-3); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: var(--s-2); }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--primary-light); }
.footer-bottom { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--border-soft); color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; }
.disclaimer { font-size: .85rem; color: var(--muted); max-width: 60ch; }

/* ---- Breadcrumbs --------------------------------------------------------- */
.breadcrumb { font-size: .88rem; color: var(--muted); padding-top: var(--s-6); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--muted); }

/* ---- Scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Keyframes ----------------------------------------------------------- */
@keyframes blob {
  0%   { transform: translateX(-50%) translateY(0) scale(1); }
  100% { transform: translateX(-50%) translateY(20px) scale(1.08); }
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(0, 204, 102, .5); }
  70%  { box-shadow: 0 0 0 6px rgba(0, 204, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 204, 102, 0); }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero__blob { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
