/* =========================================================
   Aman Hardikar — Personal Site Redesign
   "Security Architect" — modern, monochrome, terminal-ish
   Light + dark themes (light default)
   ========================================================= */

:root,
[data-theme="light"] {
  /* Surfaces */
  --bg:           #fafaf7;
  --bg-1:         #f4f4ef;
  --bg-2:         #ecece5;
  --surface:      #ffffff;
  --surface-2:    #f7f7f2;
  --line:         #e3e2db;
  --line-2:       #cdccc2;

  /* Ink */
  --ink:          #14181d;
  --ink-1:        #2f3640;
  --ink-2:        #5b6470;
  --ink-3:        #8b9099;

  /* Accents */
  --accent:       #1f8a3a;          /* signal green, darker for AA on light */
  --accent-dim:   #16702c;
  --accent-soft:  rgba(31,138,58,0.10);
  --accent-line:  rgba(31,138,58,0.32);

  --warn:         #b8801c;
  --info:         #1d6dc4;
  --danger:       #c53b2c;
}

[data-theme="dark"] {
  --bg:           #0b0d10;
  --bg-1:         #0f1216;
  --bg-2:         #14181d;
  --surface:      #161b22;
  --surface-2:    #1c2128;
  --line:         #232a33;
  --line-2:       #2c3540;

  --ink:          #e6edf3;
  --ink-1:        #b1bac4;
  --ink-2:        #7d8590;
  --ink-3:        #4d5560;

  --accent:       #7ee787;
  --accent-dim:   #2ea043;
  --accent-soft:  rgba(126,231,135,0.10);
  --accent-line:  rgba(126,231,135,0.28);

  --warn:         #f0c674;
  --info:         #7cc7ff;
  --danger:       #ff7b72;
}

:root {

  /* Type */
  --font-sans: "Inter Tight", "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  /* Geometry */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --maxw: 1240px;
}

/* Slight overrides — Inter Tight has nicer metrics on small/medium UI;
   Instrument Serif gives a confident editorial accent for the hero. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { background: var(--bg); }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11", "cv02";
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  line-height: 1.55;
  transition: background-color .2s ease, color .2s ease;
}

/* Subtle architectural grid background  */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line, rgba(0,0,0,0.04)) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line, rgba(0,0,0,0.04)) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 30%, transparent 80%);
  z-index: 0;
}
[data-theme="dark"] body::before { --grid-line: rgba(255,255,255,0.022); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: rgba(126,231,135,0.25); color: #fff; }

/* ============================
   Top Nav
   ============================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-1);
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(126,231,135,0.18), 0 0 12px rgba(126,231,135,0.5);
}
.brand-mark {
  display:inline-flex; align-items:center; justify-content:center;
  width: 28px; height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
}
.brand strong { color: var(--ink); font-weight: 600; }
.brand .muted { color: var(--ink-3); }

.nav-links {
  margin-left: auto;
  display: flex; align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.nav-links a {
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--surface); }
.nav-links a.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.nav-links a.active::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  margin-left: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-1);
  cursor: pointer;
  transition: all .15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-links { width: 100%; overflow-x: auto; padding: 4px 0; }
  .nav-links a { padding: 8px 12px; white-space: nowrap; }
}

/* ============================
   Layout primitives
   ============================ */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 120px;
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 64px 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.section-head:first-child { margin-top: 0; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 8px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-xs);
}
.section-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.section-sub {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* ============================
   Cards
   ============================ */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--line-2); }
.card-corner {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.card-title {
  font-size: 18px; font-weight: 500;
  letter-spacing: -0.01em; margin: 0 0 4px;
  color: var(--ink);
}
.card-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  margin: 0 0 16px;
}

/* ============================
   Hero (Profile page)
   ============================ */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: stretch;
  padding: 24px 0 48px;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.hero-left { display: flex; flex-direction: column; gap: 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  width: fit-content;
}
.eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(126,231,135,0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126,231,135,0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(126,231,135,0); }
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}
.hero h1 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-lead {
  color: var(--ink-1);
  font-size: 17px;
  max-width: 56ch;
  line-height: 1.6;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-1);
}
.chip .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-2);
}
.chip.chip-accent .dot { background: var(--accent); }
.chip.chip-info .dot { background: var(--info); }
.chip.chip-warn .dot { background: var(--warn); }

/* Side panel – terminal block */
.terminal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex; flex-direction: column;
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11px; letter-spacing: 0.06em;
}
.terminal-bar .lights { display: flex; gap: 6px; margin-right: 8px; }
.terminal-bar .lights span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-2);
}
.terminal-bar .lights span:nth-child(1) { background: #ff5f57; opacity: .7; }
.terminal-bar .lights span:nth-child(2) { background: #febc2e; opacity: .7; }
.terminal-bar .lights span:nth-child(3) { background: #28c840; opacity: .7; }
.terminal-body {
  padding: 18px 18px 22px;
  color: var(--ink-1);
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmt    { color: var(--ink-3); }
.terminal-body .key    { color: var(--info); }
.terminal-body .val    { color: var(--ink); }
.terminal-body .ok     { color: var(--accent); }

/* ============================
   Profile content
   ============================ */

.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 800px) { .cols-2 { grid-template-columns: 1fr; } }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 8px;
}
.skill {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-1);
  font-size: 14px;
}
.skill .ico {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  flex-shrink: 0;
}

/* Experience timeline */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 12px; bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line-2), transparent);
}
.tl-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 18px;
  padding: 14px 0;
  position: relative;
}
.tl-item + .tl-item { border-top: 1px dashed var(--line); }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-2);
  margin-top: 6px;
  margin-left: 6px;
  position: relative; z-index: 1;
}
.tl-item.current .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-item.advisor .tl-dot {
  background: var(--info);
  border-color: var(--info);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--info) 18%, transparent);
}
.tl-body {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr 1fr;
  gap: 12px;
  align-items: baseline;
}
@media (max-width: 760px) {
  .tl-body { grid-template-columns: 1fr; gap: 2px; }
}
.tl-role { font-weight: 500; color: var(--ink); font-size: 15px; }
.tl-org  { color: var(--ink-1); font-size: 14px; }
.tl-org a { color: var(--info); }
.tl-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.tl-loc  { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-align: right; }
@media (max-width: 760px) { .tl-loc { text-align: left; } }

/* Education list */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.edu {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.edu-year {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.08em;
}
.edu-title { font-weight: 500; color: var(--ink); margin: 4px 0 4px; font-size: 15px; }
.edu-desc  { color: var(--ink-2); font-size: 13px; line-height: 1.5; }

/* ============================
   Certifications page
   ============================ */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.cert {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  transition: border-color .2s ease, transform .2s ease;
}
.cert:hover { border-color: var(--accent-line); }
.cert-badge {
  width: 72px; height: 72px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.05;
  padding: 6px;
  overflow: hidden;
}
.cert-badge img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.cert-badge .cert-badge-text { display: none; }
.cert-badge.no-logo .cert-badge-text { display: block; }
[data-theme="dark"] .cert-badge {
  background: #fafaf7;
  border-color: var(--line-2);
}
[data-theme="dark"] .cert-badge.no-logo {
  background: radial-gradient(circle at 30% 20%, #2a3441, #11161c);
}
.cert-name { font-weight: 500; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.cert-meta {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono); font-size: 12px;
}
.cert-meta .row { display: flex; gap: 8px; }
.cert-meta .label { color: var(--ink-3); width: 56px; flex-shrink: 0; }
.cert-meta .value { color: var(--ink-1); }

.cert-group-title {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase;
  margin: 36px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.cert-group-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ============================
   Papers page
   ============================ */

.paper {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.paper:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .paper { grid-template-columns: 1fr; gap: 12px; } }
.paper-side {
  display: flex; flex-direction: column; gap: 6px;
}
.paper-kind {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase;
}
.paper-title {
  font-family: var(--font-display);
  font-size: 26px; line-height: 1.15;
  color: var(--ink); font-weight: 400; margin: 0;
  letter-spacing: -0.01em;
}
.paper-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  margin: 12px 0 14px;
}
.paper-meta span { display: inline-flex; gap: 6px; }
.paper-meta .lbl { color: var(--ink-3); }
.paper-abstract {
  color: var(--ink-1);
  font-size: 15px;
  line-height: 1.65;
  max-width: 72ch;
  text-wrap: pretty;
}
.paper-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  transition: all .15s ease;
  width: fit-content;
}
.paper-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.paper-cta::after {
  content: "→";
  transition: transform .2s ease;
}
.paper-cta:hover::after { transform: translateX(3px); }

/* Templates */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 14px;
}
.tpl {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s;
}
.tpl:hover { border-color: var(--accent-line); }
.tpl-thumb {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(45deg, var(--bg-1) 0 8px, var(--bg-2) 8px 16px);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--font-mono); font-size: 11px;
}
.tpl-thumb img {
  width: 100%; height: 100%; object-fit: cover; opacity: .9;
}
.tpl-body { padding: 14px; }
.tpl-title { color: var(--ink); font-weight: 500; }
.tpl-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  margin-top: 4px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.tpl-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-link {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--info);
  border-bottom: 1px dotted var(--line-2);
  padding-bottom: 1px;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================
   Software page
   ============================ */

.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px;
  font-family: var(--font-mono); font-size: 12.5px;
}
.toolbar .lbl { color: var(--ink-3); margin-right: 6px; }
.filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  transition: all .15s ease;
}
.filter-btn:hover { color: var(--ink); border-color: var(--line-2); }
.filter-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}

.tool {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  margin-bottom: 16px;
  transition: border-color .2s ease;
}
.tool:hover { border-color: var(--line-2); }
@media (max-width: 800px) { .tool { grid-template-columns: 1fr; } }

.tool-head {
  display: flex; align-items: baseline; flex-wrap: wrap;
  column-gap: 12px; row-gap: 2px;
  line-height: 1.3;
  margin-bottom: 10px;
}
.tool-name {
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink); margin: 0;
  line-height: 1.2;
}
.tool-codename {
  font-family: var(--font-display); font-style: italic;
  font-size: 18px; color: var(--accent);
  font-weight: 400;
  line-height: 1.2;
}
.tool-tagline {
  color: var(--ink-1); font-size: 14px;
  margin: 0 0 16px;
}
.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.stat {
  background: var(--surface-2);
  padding: 10px 14px;
}
.stat-lbl {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase;
  display: block; margin-bottom: 2px;
}
.stat-val {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink);
}
.stat-val.released { color: var(--accent); }
.stat-val.beta     { color: var(--warn); }

.tool-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.tool-actions .spacer { flex: 1; }
.tool-actions .secondary {
  display: inline-flex; align-items: center; gap: 18px;
  margin-left: auto;
}
.dl {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-sm);
  transition: all .15s ease;
}
.dl:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.dl::before {
  content: "↓"; font-weight: 700;
}

.details-toggle {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  background: transparent; border: 0;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; gap: 6px;
  user-select: none;
  white-space: nowrap;
}
.details-toggle:hover { color: var(--accent); }
.details-toggle .caret { transition: transform .2s ease; display: inline-block; }
.tool[data-open="true"] .details-toggle .caret { transform: rotate(90deg); }

.details-panel {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink-1);
  line-height: 1.65;
}
.tool[data-open="true"] .details-panel { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.details-panel h4 {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase;
  margin: 14px 0 6px; font-weight: 500;
}
.details-panel h4:first-child { margin-top: 0; }
.details-panel ul { margin: 0; padding-left: 18px; }
.details-panel li { margin: 2px 0; }
.details-panel a { color: var(--info); }
.details-panel a:hover { color: var(--accent); }

.tool-shot {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0 10px, transparent 10px 20px),
    var(--bg-1);
  color: var(--ink-3);
  font-family: var(--font-mono); font-size: 11px;
  text-align: center;
  padding: 24px;
  min-height: 180px;
  position: relative;
}
.tool-shot img { max-width: 100%; max-height: 220px; border-radius: 6px; opacity: .92; }
.tool-shot .placeholder-mark {
  font-size: 32px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* ============================
   Mind Maps page
   ============================ */

.mm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.mm {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.mm:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.mm-thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.mm-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.mm-thumb .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-family: var(--font-mono); font-size: 12px;
  background:
    radial-gradient(circle at 50% 40%, rgba(126,231,135,0.07), transparent 60%),
    repeating-linear-gradient(0deg, var(--bg-1) 0 30px, var(--bg-2) 30px 31px),
    repeating-linear-gradient(90deg, var(--bg-1) 0 30px, var(--bg-2) 30px 31px);
  flex-direction: column; gap: 8px;
}
.mm-version {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-1);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--line-2);
  padding: 3px 8px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
.mm-body { padding: 14px 16px 16px; }
.mm-title {
  font-size: 16px; font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
}
.mm-meta {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.mm-links {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px;
}
.mm-links a { color: var(--info); }
.mm-links a:hover { color: var(--accent); }
.mm-links .sep { color: var(--ink-3); }

.under-dev {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-1);
}
.under-dev h4 {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--warn); letter-spacing: 0.1em; text-transform: uppercase;
  margin: 0 0 10px; font-weight: 500;
}
.under-dev ul { margin: 0; padding-left: 18px; color: var(--ink-1); font-size: 14px; }
.under-dev li { margin: 4px 0; }
@media (max-width: 600px) { .under-dev { grid-template-columns: 1fr; } }

/* ============================
   Footer
   ============================ */

.foot {
  margin-top: 80px;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3);
}
.foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.foot a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-1);
  background: var(--surface);
  transition: all .15s ease;
}
.foot a:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.foot a.donate { color: var(--accent); border-color: var(--accent-line); }
@media (max-width: 700px) {
  .foot { grid-template-columns: 1fr; }
}

/* ============================
   Utility
   ============================ */

.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* Page title block */
.page-title {
  display: flex; align-items: end; gap: 16px;
  margin-bottom: 8px;
}
.page-title h1 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(36px, 4.6vw, 56px);
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}
.page-title h1 em {
  font-family: var(--font-display); font-style: italic; color: var(--accent); font-weight: 400;
  line-height: 1.15;
}
.page-sub {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 70ch;
  margin: 8px 0 0;
}
.page-counter {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
