/* prasishsharma.com.np — single stylesheet, no external dependencies. */

/* ---------- fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

/* Dark is the default theme for everyone. Light applies only when the
   visitor chooses it with the toggle (data-theme="light"). */

:root {
  --bg: #080b13;
  --bg-2: #0c111c;
  --surface: #0f1522;
  --surface-2: #161d2d;
  --ink: #eaeef6;
  --ink-2: #b6bfd0;
  --muted: #8690a5;
  --rule: #1f2738;
  --rule-strong: #2c3650;
  --accent: #6d9bff;
  --accent-2: #2dd4bf;
  --accent-ink: #06101f;
  --accent-soft: #14213d;
  --ok: #34d399;
  --grad: linear-gradient(120deg, #6d9bff 0%, #2dd4bf 100%);
  --focus: #8fb3ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -8px rgb(0 0 0 / 50%);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 40%), 0 24px 48px -16px rgb(0 0 0 / 70%);
  --term-bg: #060912;
  color-scheme: dark;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --wrap: 72rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --term-ink: #d6deeb;
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --ink: #0c1222;
  --ink-2: #3b4457;
  --muted: #687186;
  --rule: #e1e5ee;
  --rule-strong: #cfd5e2;
  --accent: #2458e6;
  --accent-2: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefe;
  --ok: #059669;
  --grad: linear-gradient(120deg, #2458e6 0%, #0d9488 100%);
  --focus: #2458e6;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%);
  --shadow: 0 1px 2px rgb(15 23 42 / 5%), 0 8px 24px -8px rgb(15 23 42 / 12%);
  --shadow-lg: 0 2px 4px rgb(15 23 42 / 4%), 0 24px 48px -16px rgb(15 23 42 / 22%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --wrap: 72rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --term-bg: #0b1020;
  --term-ink: #d6deeb;
  color-scheme: light;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0; font-weight: 700; }
p { margin: 0 0 1rem; }
strong { font-weight: 650; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
@media (min-width: 64rem) { .wrap { padding: 0 2rem; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem;
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand {
  font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; font-size: 1.02rem;
}
.brand img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.93rem; font-weight: 500;
  padding: 0.45rem 0.7rem; border-radius: 999px; transition: background-color .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }
.nav-toggle, .theme-toggle {
  appearance: none; border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); border-radius: 12px; width: 2.5rem; height: 2.5rem;
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
  transition: border-color .15s, transform .15s;
}
.nav-toggle:hover, .theme-toggle:hover { border-color: var(--rule-strong); }
.nav-toggle { display: none; margin-left: auto; }
.nav-toggle svg, .theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }

@media (max-width: 56rem) {
  .nav-toggle { display: inline-grid; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: var(--bg); border-bottom: 1px solid var(--rule); padding: 0.5rem 1rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0.85rem; font-size: 1rem; border-radius: 12px; }
  .site-header .theme-toggle { order: 3; margin-left: auto; }
  .site-header .nav-toggle ~ .theme-toggle { margin-left: 0; }
}

/* ---------- hero ---------- */

.hero { position: relative; padding: 3.5rem 0 3rem; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  opacity: 0.7;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; width: 46rem; height: 46rem; right: -14rem; top: -18rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 62%);
  pointer-events: none;
}
@media (min-width: 56rem) { .hero { padding: 5.5rem 0 4.5rem; } }

.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 3.5rem; } }

.status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-sm);
  padding: 0.35rem 0.85rem 0.35rem 0.7rem; border-radius: 999px; margin-bottom: 1.4rem;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 6%, transparent); }
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem); letter-spacing: -0.045em; line-height: 1.02;
  margin-bottom: 1rem; font-weight: 800;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .role { font-size: clamp(1.08rem, 2.2vw, 1.28rem); color: var(--ink-2); margin-bottom: 1.5rem; max-width: 36rem; line-height: 1.6; }
.hero .role strong { color: var(--ink); }

.meta-line { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; color: var(--muted); font-size: 0.93rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.meta-line li { display: inline-flex; align-items: center; gap: 0.45rem; }
.meta-line svg { width: 16px; height: 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  font-weight: 600; font-size: 0.94rem; padding: 0.72rem 1rem; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { border-color: var(--rule-strong); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #06101f; }
:root[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { border-color: transparent; }

/* photo + terminal */
.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 27rem; }
.hero-photo {
  margin: 0; padding: 5px; border-radius: 28px; background: var(--grad); box-shadow: var(--shadow-lg);
}
.hero-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 23px; }

.terminal {
  margin: -3.5rem 0 0 auto; position: relative; width: min(100%, 22rem);
  background: var(--term-bg); color: var(--term-ink); border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 8%); box-shadow: var(--shadow-lg);
  font: 500 0.78rem/1.65 var(--mono); overflow: hidden;
}
@media (min-width: 56rem) { .terminal { position: absolute; left: -3.5rem; bottom: -2.25rem; margin: 0; } }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 0.6rem 0.8rem; background: rgb(255 255 255 / 4%); border-bottom: 1px solid rgb(255 255 255 / 6%); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: auto; margin-right: auto; color: #7c89a3; font-size: 0.72rem; transform: translateX(-14px); }
.terminal pre { margin: 0; padding: 0.85rem 1rem 1rem; white-space: pre-wrap; font: inherit; }
.terminal .p { color: #5eead4; }
.terminal .c { color: #93b4ff; }
.terminal .o { color: #cbd5e1; }
.terminal .cursor { display: inline-block; width: 0.55em; height: 1.05em; background: #5eead4; vertical-align: -0.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* stats */
.stats { padding: 0 0 1rem; }
.stats ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.stats li { background: var(--surface); padding: 1.2rem 1.25rem; }
@media (min-width: 40rem) { .stats li { padding: 1.35rem 1.5rem; } }
.stats b {
  display: block; font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats span { color: var(--muted); font-size: 0.9rem; font-weight: 500; }

/* ---------- sections ---------- */

section { padding: 4.5rem 0; }
@media (min-width: 56rem) { section { padding: 6rem 0; } }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { margin-bottom: 2.5rem; max-width: 44rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.035em; margin-bottom: 0.75rem; font-weight: 800; }
.section-head p { color: var(--ink-2); margin: 0; font-size: 1.05rem; }
.kicker {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem;
  font: 600 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
.kicker::before { content: ""; width: 1.5rem; height: 2px; background: var(--grad); border-radius: 2px; }

.prose { max-width: 44rem; color: var(--ink-2); font-size: 1.06rem; }
.prose strong { color: var(--ink); }
.prose .toolkit { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.6rem; }
.prose .toolkit li {
  padding: 0.8rem 1rem 0.8rem 2.6rem; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; position: relative; font-size: 0.99rem;
}
.prose .toolkit li::before {
  content: ""; position: absolute; left: 1rem; top: 1.2rem; width: 0.7rem; height: 0.7rem; border-radius: 3px;
  background: var(--grad); transform: rotate(45deg);
}

.two-col { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 56rem) { .two-col { grid-template-columns: 1.45fr 1fr; gap: 4rem; } }

.facts {
  margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
@media (min-width: 56rem) { .facts { position: sticky; top: 6rem; } }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 1.35rem; border-top: 1px solid var(--rule); }
.facts div:first-child { border-top: 0; }
.facts dt { font: 600 0.72rem/1.9 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--ink); }

/* ---------- resume ---------- */

.cv-timeline { list-style: none; margin: 0; padding: 0 0 0 1.75rem; position: relative; display: grid; gap: 1.25rem; }
.cv-timeline::before {
  content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2) 80%, transparent); border-radius: 2px;
}
.cv-timeline > li { position: relative; }
.cv-timeline > li::before {
  content: ""; position: absolute; left: -1.75rem; top: 1.55rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.cv-item {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s;
}
.cv-item:hover { box-shadow: var(--shadow); border-color: var(--rule-strong); }
.cv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; }
.cv-head h3 { font-size: 1.15rem; margin-bottom: 0.25rem; letter-spacing: -0.02em; }
.cv-org { margin: 0; font-weight: 600; color: var(--accent); }
.cv-org span { font-weight: 450; color: var(--muted); }
.cv-when {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem;
  font-size: 0.88rem; color: var(--muted); text-align: right; white-space: nowrap;
}
.cv-when .when {
  font: 600 0.75rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 0.4rem 0.6rem; border-radius: 999px;
}
.cv-item ul { margin: 1rem 0 0; padding: 0; list-style: none; color: var(--ink-2); display: grid; gap: 0.45rem; }
.cv-item ul li { position: relative; padding-left: 1.2rem; }
.cv-item ul li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
@media (max-width: 40rem) {
  .cv-when { flex-direction: row; align-items: center; gap: 0.6rem; text-align: left; white-space: normal; }
  .cv-timeline { padding-left: 1.4rem; }
  .cv-timeline > li::before { left: -1.4rem; }
  .cv-timeline::before { left: 0.3rem; }
}

.cv-split { display: grid; gap: 2.5rem; margin-top: 3.5rem; }
@media (min-width: 56rem) { .cv-split { grid-template-columns: 1fr 1fr; } }
.cv-subhead { font-size: 1.35rem; margin-bottom: 1.1rem; letter-spacing: -0.025em; display: flex; align-items: center; gap: 0.6rem; }
.cv-subhead svg { width: 22px; height: 22px; color: var(--accent); }
.cred { display: grid; gap: 0.85rem; }
.cred .cv-item { display: flex; gap: 1rem; align-items: flex-start; }
.cred .cv-item > img, .cred .cv-item > .cred-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.cred-icon { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cred-icon svg { width: 22px; height: 22px; }
.cred .cv-head { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 700;
  padding: 0.3rem 0.65rem; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok);
}
.badge-muted { background: var(--accent-soft); color: var(--accent); }

/* ---------- skills: horizontal tools rail ---------- */

.rail-wrap { position: relative; margin: 0 -1rem 3rem; }
@media (min-width: 40rem) { .rail-wrap { margin: 0 0 3rem; } }
.rail {
  list-style: none; margin: 0; padding: 0.5rem 1rem 1.25rem; display: flex; gap: 0.85rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 1rem;
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.5rem, #000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 1.5rem, #000 calc(100% - 3rem), transparent);
}
@media (min-width: 40rem) { .rail { padding: 0.5rem 0.25rem 1.25rem; scroll-padding: 0; } }
.rail:focus-visible { outline-offset: -3px; }
.rail li {
  flex: 0 0 auto; width: 8.25rem; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center;
  padding: 1.15rem 0.75rem 1rem; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: 0.86rem; font-weight: 600; color: var(--ink-2); line-height: 1.3;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rail li:hover { transform: translateY(-3px); border-color: var(--rule-strong); box-shadow: var(--shadow); }
.rail img { width: 44px; height: 44px; }
.rail small { display: block; font: 500 0.68rem/1.2 var(--mono); color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; margin-top: 0.15rem; }

.rail-controls { display: none; gap: 0.5rem; justify-content: flex-end; margin: -0.5rem 0 0.75rem; }
.js .rail-controls { display: flex; }
@media (max-width: 40rem) { .js .rail-controls { padding: 0 1rem; } }
.rail-btn {
  appearance: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: border-color .15s, opacity .15s;
}
.rail-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.rail-btn:disabled { opacity: 0.35; cursor: default; }
.rail-btn svg { width: 18px; height: 18px; }

/* skill rows: label + horizontal chips */
.skill-rows { margin: 0; display: grid; border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.skill-row { display: grid; gap: 0.75rem 1.5rem; padding: 1.2rem 1.4rem; border-top: 1px solid var(--rule); align-items: center; }
.skill-row:first-child { border-top: 0; }
@media (min-width: 48rem) { .skill-row { grid-template-columns: 13rem 1fr; } }
.skill-row dt { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 0.6rem; }
.skill-row dt img { width: 24px; height: 24px; border-radius: 6px; }
.skill-row dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.86rem; font-weight: 550; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 999px; padding: 0.32rem 0.75rem;
}

.invert-dark { filter: invert(1); }
:root[data-theme="light"] .invert-dark { filter: none; }

/* ---------- apps ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.filters[hidden] { display: none; }
.chip {
  appearance: none; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink-2); transition: all .15s;
}
.chip:hover { border-color: var(--rule-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.app-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.app {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 1.35rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.app:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--rule-strong); }
.app[hidden] { display: none; }
.app-top { display: flex; gap: 1rem; align-items: center; }
.app-top img { width: 64px; height: 64px; border-radius: 16px; flex: none; box-shadow: var(--shadow); background: var(--surface-2); }
.app h3 { font-size: 1.06rem; margin-bottom: 0.3rem; letter-spacing: -0.015em; }
.tag { font: 600 0.7rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.app p { color: var(--ink-2); font-size: 0.94rem; margin: 0; flex: 1; }
.app-links { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.25rem; }
.app-links a {
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.85rem; font-weight: 600; padding: 0.45rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--ink-2); transition: all .15s;
}
.app-links a:first-child { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.app-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- repos ---------- */

.repo-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.repo {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.3rem;
  display: flex; flex-direction: column; gap: 0.6rem; box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
.repo:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.repo h3 { font: 600 0.98rem/1.3 var(--mono); display: flex; align-items: center; gap: 0.5rem; letter-spacing: 0; }
.repo h3 svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.repo h3 a { text-decoration: none; overflow-wrap: anywhere; }
.repo h3 a:hover { text-decoration: underline; }
.repo p { color: var(--ink-2); font-size: 0.93rem; margin: 0; flex: 1; }
.repo .lang { font-size: 0.8rem; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.repo .lang::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); }

/* ---------- privacy list ---------- */

.policy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.policy-list a {
  display: flex; gap: 0.9rem; align-items: flex-start; text-decoration: none; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--ink); font-weight: 650;
  transition: border-color .15s, transform .15s;
}
.policy-list a:hover { border-color: var(--accent); transform: translateY(-2px); }
.policy-list svg { width: 22px; height: 22px; color: var(--accent-2); flex: none; margin-top: 0.1rem; }
.policy-list span span { display: block; font-weight: 450; color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }

/* ---------- contact ---------- */

.contact-card {
  position: relative; background: var(--surface); border-radius: 28px; padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: var(--shadow-lg); border: 1px solid var(--rule); overflow: hidden; isolation: isolate;
}
.contact-card::before {
  content: ""; position: absolute; z-index: -1; width: 30rem; height: 30rem; right: -12rem; top: -14rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 65%);
}
.contact-card h2 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.04em; font-weight: 800; margin-bottom: 0.75rem; }
.contact-card > p { color: var(--ink-2); font-size: 1.08rem; max-width: 36rem; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.contact-list a {
  display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 14px; padding: 0.9rem 1rem; background: var(--bg);
  overflow-wrap: anywhere; font-weight: 600; font-size: 0.95rem; transition: border-color .15s, transform .15s;
}
.contact-list a:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-list .ic { width: 2.4rem; height: 2.4rem; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.contact-list svg { width: 19px; height: 19px; }
.contact-list small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 500; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; text-align: center; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.trust { display: inline-flex; align-items: center; gap: 0.45rem; }
.trust svg { width: 16px; height: 16px; color: var(--ok); }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:hover, .app:hover, .rail li:hover, .policy-list a:hover, .contact-list a:hover { transform: none; }
}

/* ---------- document pages (privacy etc.) ---------- */

.doc { max-width: 47rem; margin: 0 auto; padding: 3rem 1rem 5rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 0.75rem; letter-spacing: -0.035em; font-weight: 800; }
.doc h2 { font-size: 1.3rem; margin: 2.75rem 0 0.8rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.doc h3 { font-size: 1.04rem; margin: 1.75rem 0 0.45rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.4rem 0; }
.doc .meta { color: var(--muted); font-size: 0.93rem; }
.doc .meta strong { color: var(--ink); }
.doc .lede-box {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin: 1.5rem 0 1.75rem; box-shadow: var(--shadow-sm);
}
.doc .lede-box p:last-child { margin-bottom: 0; }
.doc .note {
  border-left: 3px solid var(--accent); background: var(--surface);
  padding: 1rem 1.15rem; margin: 1.5rem 0; border-radius: 0 12px 12px 0;
}
.doc .note p { margin: 0; }
.doc code {
  font-family: var(--mono); font-size: 0.84em; background: var(--surface-2);
  padding: 0.12rem 0.4rem; border-radius: 5px; border: 1px solid var(--rule); overflow-wrap: anywhere;
}
.scroller { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.25rem; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--rule); }
.doc th { color: var(--ink); font-weight: 650; }
.doc .back { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 1.75rem; font-weight: 600; text-decoration: none; font-size: 0.93rem; }
.doc .back:hover { text-decoration: underline; }

.notfound { text-align: center; padding: 7rem 1rem; }
.notfound h1 { font-size: clamp(4rem, 14vw, 7rem); margin-bottom: 0.5rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound p { color: var(--ink-2); }
.notfound .actions { justify-content: center; margin-top: 1.5rem; }

.cred-title { font-size: 1.02rem; letter-spacing: -0.015em; margin: 0 0 0.2rem; line-height: 1.3; }
.cred-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- Google Play branding ---------- */

.h-logo { display: flex; align-items: center; gap: 0.75rem; }
.h-logo img { width: clamp(30px, 4vw, 40px); height: auto; flex: none; }
.play-badge { display: inline-block; margin-top: 1.1rem; border-radius: 10px; }
.play-badge img { height: 58px; width: auto; margin-left: -9px; transition: transform .18s ease; }
.play-badge:hover img { transform: translateY(-2px); }
.play-ico { width: 15px; height: 15px; }
.contact-list .ic img { width: 20px; height: 20px; }

/* ---------- full policies embedded in the home page (#privacy_policy, #privacy_policy_kids) ---------- */

.policy-doc {
  max-width: 52rem; margin: 2.5rem auto 0; padding: clamp(1.4rem, 4vw, 2.75rem);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); scroll-margin-top: 5.5rem;
}
.policy-doc h2 { border-top: 0; padding-top: 0; margin-top: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 0.75rem; letter-spacing: -0.035em; font-weight: 800; }
.policy-doc h3 { font-size: 1.25rem; margin: 2.5rem 0 0.8rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.policy-doc h4 { font-size: 1.03rem; margin: 1.6rem 0 0.45rem; }
.policy-doc .lede-box, .policy-doc .note { background: var(--bg); }
