/*
  EPV site styles.
  Theme: follows the system (light / dark). One accent: EPV mint, matching the extension.
  Shape rule: controls 10px, panels and screenshots 18px, chips full pill.
  Motion: transform/opacity only, disabled under prefers-reduced-motion.
*/

:root {
  color-scheme: dark;
  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* KasunRocz Softwares family, violet world */
  --bg: #04050a;
  --bg-raised: rgba(12, 16, 28, 0.58);
  --bg-solid: #0c111d;
  --bg-sunk: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #eef1fb;
  --muted: #aab2c8;
  --quiet: #8089a3;
  --accent: #b197fc;
  --accent-rgb: 177, 151, 252;
  --accent-ink: #cbbaff;
  --accent-soft: rgba(177, 151, 252, 0.1);
  --on-accent: #12082b;
  --caution: #ffb547;
  --caution-soft: rgba(255, 181, 71, 0.08);
  --code-bg: #070a10;
  --code-ink: #dfe4f5;
  --code-line: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 40px 90px -40px rgb(0 0 0 / 0.9);
  --glow: rgba(177, 151, 252, 0.16);
  --back-opacity: 0.62;

  --r-control: 999px;
  --r-box: 14px;
  --r-panel: 22px;
  --wrap: min(1200px, calc(100% - 40px));
  --reading: 70ch;
  --header-h: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  min-width: 320px;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-sunk);
  overflow-wrap: anywhere;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: currentColor;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--r-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  font: 600 15px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, #ffffff);
}

.button-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-ghost:hover {
  border-color: var(--ink);
}

.button .icon {
  transition: transform 0.25s var(--ease);
}

.button:hover .icon {
  transform: translateX(3px);
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--bg-raised);
  color: var(--accent-ink);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a:not(.button) {
  padding: 8px 12px;
  border-radius: var(--r-control);
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.primary-nav a:not(.button):hover,
.primary-nav a:not(.button)[aria-current='page'] {
  color: var(--ink);
}

.primary-nav a:not(.button)[aria-current='page'] {
  background: var(--bg-sunk);
}

.primary-nav .button {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle .icon {
  width: 20px;
  height: 20px;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded='true'] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

/* ---------- Section rhythm ---------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section-head {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

.section-head p {
  max-width: 60ch;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  color: var(--accent-ink);
  font: 500 13px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: clip;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto 35%;
  height: 120%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  min-height: min(760px, calc(100dvh - var(--header-h)));
  padding-block: clamp(48px, 7vw, 88px);
}

.hero-copy {
  display: grid;
  gap: 24px;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 650;
}

.hero-lead {
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.hero-stage {
  position: relative;
  height: clamp(460px, 44vw, 600px);
}

.device {
  position: absolute;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  background: #11161a;
  box-shadow: var(--shadow);
}

.device img {
  width: 100%;
}

.device-back {
  top: 0;
  right: 0;
  width: 54%;
  opacity: var(--back-opacity);
}

.device-front {
  top: 9%;
  left: 6%;
  width: 60%;
}

/* ---------- How it works ---------- */

.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow::before {
  content: '';
  position: absolute;
  top: 23px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-ink), var(--line-strong) 60%, var(--line));
}

.flow li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
}

.flow-node {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent-ink);
}

.flow-node .icon {
  width: 22px;
  height: 22px;
}

.flow-where {
  margin-top: 10px;
  color: var(--quiet);
  font: 500 13px/1.2 var(--font-mono);
}

.flow h3 {
  font-size: 22px;
}

.flow p {
  max-width: 36ch;
  color: var(--muted);
}

/* ---------- Features bento ---------- */

.bento {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    'types share policy'
    'types fill breach'
    'recovery recovery recovery';
  gap: 16px;
}

.tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--bg-raised);
}

.tile h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.tile p {
  color: var(--muted);
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tile-icon {
  display: inline-flex;
  color: var(--accent-ink);
}

.tile-icon .icon {
  width: 24px;
  height: 24px;
}

.tile-types {
  grid-area: types;
  grid-template-rows: auto auto auto 1fr;
  padding-bottom: 0;
}

.tile-types .shot {
  align-self: end;
  width: min(100%, 380px);
  max-height: 300px;
  margin: 20px auto 0;
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
  mask-image: linear-gradient(#000 72%, transparent);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  background: #11161a;
}

.tile-types .shot img {
  width: 100%;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.type-chips li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.tile-share {
  grid-area: share;
}

.tile-policy {
  grid-area: policy;
}

.tile-fill {
  grid-area: fill;
  border-color: color-mix(in oklab, var(--accent-ink) 35%, var(--line));
  background: var(--accent-soft);
}

.tile-breach {
  grid-area: breach;
}

.tile-recovery {
  grid-area: recovery;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      color-mix(in oklab, var(--line) 55%, transparent) 14px 15px
    ),
    var(--bg-raised);
}

.tile-recovery p {
  max-width: 70ch;
}

/* ---------- Administrators ---------- */

.admin {
  border-block: 1px solid var(--line);
  background: var(--bg-sunk);
}

.admin-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.admin-copy {
  display: grid;
  gap: 20px;
}

.admin-copy h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
}

.admin-copy > p {
  color: var(--muted);
  font-size: 18px;
}

.admin-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.admin-points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 15px;
}

.admin-points .icon {
  grid-row: span 2;
  margin-top: 3px;
  color: var(--accent-ink);
}

.admin-points strong {
  color: var(--ink);
  font-weight: 600;
}

.admin-figure {
  margin: 0;
}

.admin-figure .frame {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  background: #0f1312;
  box-shadow: var(--shadow);
}

.admin-figure figcaption {
  margin-top: 14px;
  color: var(--quiet);
  font-size: 14px;
}

/* ---------- Status ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--bg-raised);
}

.status-col {
  padding: clamp(24px, 4vw, 40px);
}

.status-col + .status-col {
  border-left: 1px solid var(--line);
}

.status-col h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 18px;
}

.status-col h3 .icon {
  color: var(--accent-ink);
}

.status-col.is-pending h3 .icon {
  color: var(--caution);
}

.status-col ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.status-col li {
  padding-left: 18px;
  background: linear-gradient(var(--line-strong), var(--line-strong)) 0 0.72em / 8px 1px no-repeat;
}

.status-note {
  margin-top: 20px;
  color: var(--quiet);
  font-size: 14px;
}

/* ---------- Start paths ---------- */

.paths {
  display: grid;
  border-top: 1px solid var(--line);
}

.path {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 28px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s var(--ease);
}

.path:hover {
  background: var(--bg-raised);
}

.path-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-control);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.path-icon .icon {
  width: 22px;
  height: 22px;
}

.path strong {
  display: block;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.path small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.path-arrow {
  color: var(--quiet);
  transition:
    transform 0.3s var(--ease),
    color 0.3s var(--ease);
}

.path-arrow .icon {
  width: 24px;
  height: 24px;
}

.path:hover .path-arrow {
  color: var(--accent-ink);
  transform: translateX(6px);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 48px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.6fr));
  gap: 32px;
}

.footer-brand {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.footer-brand p {
  max-width: 44ch;
  color: var(--quiet);
  font-size: 14px;
}

.footer-col h2 {
  margin-bottom: 12px;
  color: var(--quiet);
  font: 500 13px/1.2 var(--font-mono);
  letter-spacing: 0.02em;
}

.footer-col ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--ink);
}

/* ---------- Guide pages ---------- */

.doc-hero {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(48px, 7vw, 80px) clamp(32px, 5vw, 48px);
}

.doc-hero-inner {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.doc-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  letter-spacing: -0.04em;
}

.doc-hero .lead {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(18px, 1.6vw, 20px);
}

.doc-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--quiet);
  font-size: 14px;
}

.doc-meta .icon {
  color: var(--accent-ink);
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(40px, 6vw, 72px) clamp(72px, 10vw, 120px);
}

.page-index {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
}

.page-index-title {
  margin-bottom: 12px;
  color: var(--quiet);
  font: 500 13px/1.2 var(--font-mono);
}

.page-index nav {
  display: grid;
  border-left: 1px solid var(--line);
}

.page-index a {
  margin-left: -1px;
  padding: 7px 0 7px 16px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.page-index a:hover {
  color: var(--ink);
}

.page-index a.is-active {
  border-left-color: var(--accent-ink);
  color: var(--ink);
  font-weight: 500;
}

.guide-document {
  max-width: var(--reading);
}

.doc-section {
  padding-bottom: 48px;
}

.doc-section + .doc-section {
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.doc-section h2 {
  margin-bottom: 18px;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}

.doc-section > p,
.doc-section li,
.doc-section dd,
.doc-section details p {
  color: var(--muted);
}

.doc-section > p + p,
.doc-section > * + .notice,
.doc-section > * + .code-block,
.doc-section > .code-block + p,
.doc-section > .notice + p,
.doc-section > ol + p,
.doc-section > dl + p {
  margin-top: 16px;
}

.doc-section strong {
  color: var(--ink);
  font-weight: 600;
}

.step-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  position: relative;
  padding-left: 44px;
  counter-increment: step;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  font: 500 13px/1 var(--font-mono);
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 30px;
}

.check-list li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 4px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg);
}

.notice {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid color-mix(in oklab, var(--accent-ink) 30%, var(--line));
  border-radius: var(--r-control);
  background: var(--accent-soft);
}

.notice strong {
  color: var(--ink);
}

.notice p {
  color: var(--muted);
}

.notice-caution {
  border-color: color-mix(in oklab, var(--caution) 35%, var(--line));
  background: var(--caution-soft);
}

.code-block {
  overflow: hidden;
  border: 1px solid var(--code-line);
  border-radius: var(--r-control);
  background: var(--code-bg);
  color: var(--code-ink);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--code-line);
  color: #8c9c97;
  font: 500 12px/1 var(--font-mono);
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--code-line);
  border-radius: 8px;
  background: transparent;
  color: #b9c8c3;
  font: 500 12px/1 var(--font-mono);
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.copy-button:hover {
  border-color: #4a5a56;
  color: #ffffff;
}

.copy-button.is-copied {
  color: #8fe3bd;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font: 14px/1.7 var(--font-mono);
}

.code-block code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.service-list {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg-raised);
}

.service-list div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 14px 18px;
}

.service-list div + div {
  border-top: 1px solid var(--line);
}

.service-list dt {
  color: var(--ink);
  font-weight: 500;
}

.service-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg-raised);
}

details + details {
  margin-top: 10px;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  color: var(--quiet);
  font: 400 20px/1 var(--font-mono);
  transition: transform 0.25s var(--ease);
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  padding: 0 18px 18px;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 500;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.doc-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.doc-next a {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg-raised);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}

.doc-next a:hover {
  border-color: var(--accent-ink);
}

.doc-next small {
  color: var(--quiet);
  font: 500 12px/1.2 var(--font-mono);
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  place-content: center;
  justify-items: start;
  gap: 18px;
  min-height: calc(100dvh - var(--header-h) - 160px);
  padding-block: 64px;
}

.not-found h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.04em;
}

.not-found p {
  max-width: 46ch;
  color: var(--muted);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-stage .device {
    animation: rise 0.9s var(--ease) both;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero-stage .device-back {
    animation-name: rise-faded;
    animation-delay: 0.2s;
  }

  .hero-stage .device-front {
    animation-delay: 0.3s;
  }

  .reveal-pending {
    opacity: 0;
    transform: translateY(18px);
  }

  .reveal-in {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.8s var(--ease),
      transform 0.8s var(--ease);
  }

  .flow li:nth-child(2).reveal-in,
  .bento > :nth-child(2).reveal-in,
  .bento > :nth-child(4).reveal-in {
    transition-delay: 0.1s;
  }

  .flow li:nth-child(3).reveal-in,
  .bento > :nth-child(3).reveal-in,
  .bento > :nth-child(5).reveal-in {
    transition-delay: 0.2s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes rise-faded {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: var(--back-opacity);
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'types share'
      'types policy'
      'fill breach'
      'recovery recovery';
  }

  .admin-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 0.5fr));
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a:not(.button) {
    padding: 12px;
    font-size: 16px;
  }

  .primary-nav .button {
    margin: 10px 0 0;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-stage {
    height: auto;
  }

  .device-back {
    display: none;
  }

  .device-front {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 360px);
    margin-inline: auto;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-index {
    position: static;
  }

  .page-index nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    gap: 2px 16px;
  }

  .page-index a {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .page-index a.is-active {
    color: var(--accent-ink);
  }
}

@media (max-width: 767px) {
  :root {
    --wrap: calc(100% - 32px);
    --header-h: 60px;
  }

  .wordmark-text {
    display: none;
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .flow::before {
    top: 24px;
    bottom: 24px;
    left: 23px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--accent-ink), var(--line));
  }

  .flow li {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 18px;
  }

  .flow-node {
    grid-row: span 3;
  }

  .flow-where {
    margin-top: 0;
  }

  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'types' 'share' 'policy' 'fill' 'breach' 'recovery';
  }

  .tile {
    padding: 22px;
  }

  .tile-types {
    padding-bottom: 0;
  }

  .admin-points {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-col + .status-col {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .path {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 22px 0;
  }

  .path-icon {
    width: 44px;
    height: 44px;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .service-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .doc-next {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }
}

/* ---------- Downloads ---------- */

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.step-list .code-block {
  margin-top: 12px;
}

.code-block-tall pre {
  max-height: 420px;
  overflow: auto;
}

details .code-block {
  margin: 0 18px 18px;
}

.download-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 12px;
}

.download-card p {
  color: var(--quiet);
  font-size: 14px;
}

/* ==========================================================================
   KasunRocz Softwares family layer: fonts, glass, pill nav, labels.
   ========================================================================== */
body {
  background:
    radial-gradient(70% 45% at 85% 0%, rgba(var(--accent-rgb), 0.11), transparent 70%),
    radial-gradient(50% 35% at 0% 45%, rgba(92, 200, 255, 0.05), transparent 70%),
    var(--bg);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .site-footer { position: relative; z-index: 1; }

h1, h2, h3,
.path strong,
.wordmark-text,
.doc-next a { font-family: var(--font-display); font-weight: 500; }
.hero h1 { font-weight: 500; letter-spacing: -0.045em; }
.section-head h2, .admin-copy h2 { letter-spacing: -0.035em; }

/* Boxes keep a softer radius where pills would look wrong */
.code-block, .service-list, details, .notice, .doc-next a, .path-icon { border-radius: var(--r-box); }
code { border-radius: 6px; }
.copy-button { border-radius: 8px; }

/* Buttons */
.button { min-height: 50px; padding: 0 22px; font-weight: 700; }
.button-primary {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 12px 40px -14px rgba(var(--accent-rgb), 0.9);
}
.button-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 18px 50px -12px rgba(var(--accent-rgb), 1);
}
.button-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); }

/* Header: floating glass pill */
.site-header {
  top: 14px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding-inline: 16px;
}
.header-inner {
  width: min(1200px, 100%);
  height: 58px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 11, 22, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.wordmark-mark {
  border-radius: 10px;
  border-color: rgba(var(--accent-rgb), 0.5);
  background: linear-gradient(140deg, #d9cbff, var(--accent) 55%, #8d72f5);
  color: var(--on-accent);
  box-shadow: 0 0 18px -2px rgba(var(--accent-rgb), 0.7);
}
.wordmark-text { font-size: 15px; letter-spacing: -0.01em; }
.primary-nav a:not(.button) {
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.primary-nav a:not(.button):hover { background: rgba(255, 255, 255, 0.06); }
.primary-nav a.org { color: var(--quiet); }
.primary-nav a.org::before { content: '\2190  '; }
.nav-toggle { border-radius: 50%; }

/* Labels: mono, uppercase, with the family's // prefix */
.eyebrow {
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before { content: '// '; }
.flow-where, .page-index-title, .footer-col h2, .doc-next small, .code-head {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11.5px;
}

/* Hero: 3D crystal behind the screenshots */
.hero .kr-planet {
  position: absolute;
  top: -6%;
  right: -8%;
  width: 62%;
  height: 112%;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
  pointer-events: none;
}
.hero .kr-planet.is-ready { opacity: 0.85; }
.hero-inner { z-index: 1; }
.device { border-color: var(--line-strong); box-shadow: var(--shadow), 0 0 80px -24px rgba(var(--accent-rgb), 0.5); }

/* Glass panels */
.tile, .status-grid, .doc-next a, details, .service-list, .admin-figure .frame {
  background: var(--bg-raised);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.admin-figure .frame { background: var(--bg-solid); }
.tile { transition: border-color 0.3s var(--ease), transform 0.5s var(--ease); }
.tile:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.tile-icon .icon { width: 21px; height: 21px; }
.tile-fill { background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.16), transparent 60%), var(--bg-raised); }
.tile-recovery {
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.03) 14px 15px),
    var(--bg-raised);
}
.flow-node { background: var(--bg-solid); border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 0 24px -6px rgba(var(--accent-rgb), 0.6); }
.admin { background: rgba(10, 14, 26, 0.55); }
.path { border-radius: 16px; padding-inline: 16px; }
.path:hover { background: var(--bg-raised); }
.status-col li { background: linear-gradient(var(--accent), var(--accent)) 0 0.72em / 8px 1px no-repeat; }
.status-col.is-pending li { background: linear-gradient(var(--caution), var(--caution)) 0 0.72em / 8px 1px no-repeat; }

/* Mobile menu: glass dropdown under the pill */
@media (max-width: 860px) {
  .primary-nav {
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(8, 11, 22, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  .hero .kr-planet { width: 120%; height: 60%; top: 40%; right: -10%; }
  .hero .kr-planet.is-ready { opacity: 0.5; }
}
