/* musa-website: public site styles
   Palette: night indigo, pearl, lychee pink. Green and saffron are for status only. */
:root {
  --bg: #12162b;
  --surface: #1a2040;
  --surface-2: #222a52;
  --line: rgba(241, 235, 226, 0.12);
  --line-strong: rgba(241, 235, 226, 0.24);
  --text: #f1ebe2;
  --muted: #aab0cb;
  --accent: #ff5c8a;
  --accent-deep: #b92d58;
  --accent-ink: #2a0b18;
  --ok: #5fe3a1;
  --warn: #ffc24b;
  --err: #ff8478;
  --key-shadow: #0a0d1c;
  --term-bg: #0b0e1c;
  --term-text: #e9e4da;
  --term-dim: #8187a6;
  --glyph: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --tile-ink: color-mix(in srgb, var(--accent) 45%, var(--surface-2));
  --sans: "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1160px;
  --pad: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef0f7;
  --surface: #ffffff;
  --surface-2: #e2e6f3;
  --line: rgba(23, 27, 52, 0.12);
  --line-strong: rgba(23, 27, 52, 0.26);
  --text: #171b34;
  --muted: #535a7c;
  --accent: #d6245f;
  --accent-deep: #9c1643;
  --accent-ink: #ffffff;
  --ok: #0c8f58;
  --warn: #9a6200;
  --err: #c2372b;
  --key-shadow: #b9bfd6;
  --glyph: color-mix(in srgb, var(--accent) 6%, var(--bg));
  --tile-ink: color-mix(in srgb, var(--accent) 40%, var(--surface-2));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 300; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}
@view-transition { navigation: auto; }
h1, h2, h3 { font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 4.75rem); }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
[lang="ar"] { font-family: "Readex Pro", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif; letter-spacing: 0; }

.mono { font-family: var(--mono); font-weight: 400; }
.prompt { color: var(--warn); font-family: var(--mono); user-select: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 6px; z-index: 100; font-weight: 500; }
.skip:focus { top: 12px; color: var(--accent-ink); }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--pad) * 2); margin-inline: auto; padding-inline: var(--pad); }
.wrap-narrow { max-width: calc(760px + var(--pad) * 2); }

/* ---------- keys (buttons) ---------- */
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.72em 1.15em; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--key-shadow);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease), background-color 0.2s;
}
.key:hover { color: var(--text); transform: translateY(-1px); box-shadow: 0 5px 0 var(--key-shadow); }
.key:active { transform: translateY(4px); box-shadow: 0 0 0 var(--key-shadow); }
.key-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 4px 0 var(--accent-deep); }
.key-accent:hover { color: var(--accent-ink); box-shadow: 0 5px 0 var(--accent-deep); }
.key-accent:active { box-shadow: 0 0 0 var(--accent-deep); }
.key-small { padding: 0.5em 0.85em; font-size: 0.9rem; box-shadow: 0 3px 0 var(--accent-deep); }
.key[disabled] { opacity: 0.6; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--line); }
[data-theme="dark"] .icon-btn svg:last-child, [data-theme="light"] .icon-btn svg:first-child { display: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: 12px max(var(--pad), calc((100vw - var(--wrap)) / 2)); padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-ar { font-size: 1.6rem; font-weight: 600; color: var(--accent); line-height: 1; }
.brand-path { font-family: var(--mono); font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tilde, .brand-here { color: var(--muted); }
.brand:hover .brand-path { color: var(--text); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 6px; text-decoration: none; font-size: 0.95rem; font-weight: 400; color: var(--muted); }
.nav-links a:hover, .nav-links a.is-current { color: var(--text); background: var(--surface); }
.nav-tools { display: flex; align-items: center; gap: 10px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 9vw, 120px); overflow: hidden; }
.hero-glyph {
  position: absolute; right: -0.06em; top: -0.32em; z-index: 0; pointer-events: none; user-select: none;
  font-size: clamp(16rem, 44vw, 40rem); font-weight: 600; line-height: 1; color: var(--glyph); transition: transform 0.6s var(--ease); will-change: transform;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 400; color: var(--muted); margin-bottom: 22px; }
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--term-dim); flex: none; }
.led-up { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.6s infinite; }
.led-down { background: var(--err); }
.led-wait { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.hero h1 { margin-bottom: 0.32em; }
.lede { font-size: clamp(1.25rem, 2.3vw, 1.6rem); font-weight: 400; line-height: 1.35; max-width: 24em; margin-bottom: 0.7em; }
.intro { color: var(--muted); max-width: 32em; margin-bottom: 1.4em; }
.aka { font-size: 0.9rem; color: var(--muted); min-height: 1.6em; margin-bottom: 1.8em; }
.typed { color: var(--text); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 2px; vertical-align: -0.2em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- terminal ---------- */
.terminal {
  background: var(--term-bg); color: var(--term-text); border-radius: 12px; border: 1px solid rgba(241, 235, 226, 0.14);
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.7), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  font-family: var(--mono); font-size: 0.875rem; font-weight: 400; line-height: 1.65; overflow: hidden; min-width: 0;
}
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #151a33; border-bottom: 1px solid rgba(241, 235, 226, 0.08); }
.term-dots { display: inline-flex; gap: 7px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a4170; }
.term-dots i:first-child { background: var(--accent); }
.term-title { color: var(--term-dim); font-size: 0.8rem; }
.term-screen { height: 372px; overflow-y: auto; padding: 16px 18px 18px; cursor: text; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a4170 transparent; }
.term-screen:focus-visible { outline-offset: -3px; }
.term-screen p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.term-screen a { color: #ff8fb0; }
.term-screen .t-cmd { color: var(--term-text); }
.term-screen .t-dim { color: var(--term-dim); }
.term-screen .t-ok { color: #5fe3a1; }
.term-screen .t-err { color: #ff8478; }
.term-screen .t-warn { color: #ffc24b; }
.term-screen .t-hi { color: #ff8fb0; }
.term-screen .t-gap { height: 0.6em; }
.term-screen .prompt { color: #ffc24b; margin-right: 0.6em; }
.term-input { display: flex; align-items: center; margin-top: 2px; }
.term-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0; color: var(--term-text); font-family: var(--mono); font-size: max(0.875rem, 16px); caret-color: var(--accent); }
.term-input input::placeholder { color: #4d547a; }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid rgba(241, 235, 226, 0.08); }
.term-chips button { font-family: var(--mono); font-size: 0.78rem; padding: 5px 10px; border-radius: 6px; border: 1px solid rgba(241, 235, 226, 0.16); background: #151a33; color: #c9cde4; cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.08s; }
.term-chips button:hover { border-color: var(--accent); color: #fff; }
.term-chips button:active { transform: translateY(2px); }
.terminal-static .term-screen { height: auto; cursor: default; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.page-top { padding-top: clamp(32px, 5vw, 64px); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h1, .section-head h2 { margin-bottom: 0.45em; }
.section-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.section-head p { color: var(--muted); font-size: 1.15rem; margin: 0; max-width: 38rem; }
.section-cta { margin: clamp(28px, 4vw, 44px) 0 0; }
.empty { color: var(--muted); padding: 28px; border: 1px dashed var(--line-strong); border-radius: 10px; }

.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.about-copy h2 { margin-bottom: 0.6em; }
.avatar { width: 132px; height: 132px; object-fit: cover; border-radius: 50%; border: 2px solid var(--accent); margin-top: 12px; }
.prose { max-width: 40rem; }
.prose > * { margin-block: 0; }
.prose > :not(:first-child) { margin-top: 1em; }
.prose h2 { font-size: 1.55rem; }
.prose > h2:not(:first-child) { margin-top: 2em; }
.prose > h3:not(:first-child) { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.1em; top: 0.68em; width: 7px; height: 2px; background: var(--accent); }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose strong { font-weight: 600; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 4px; }
.prose pre { background: var(--term-bg); color: var(--term-text); border: 1px solid rgba(241, 235, 226, 0.12); padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 0.875rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { margin: 0; padding-left: 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose img { border-radius: 10px; display: block; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .task { list-style: none; }
.prose .task::before { display: none; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prose-page { margin-top: clamp(32px, 5vw, 56px); font-size: 1.1rem; }

.gitlog { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px 26px; }
.gitlog-cmd { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.gitlog ol { position: relative; padding-left: 26px; }
.gitlog ol::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line-strong); }
.gitlog li { position: relative; padding-bottom: 20px; }
.gitlog li:last-child { padding-bottom: 0; }
.commit-dot { position: absolute; left: -26px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.gitlog li:first-child .commit-dot { background: var(--accent); }
.commit-title { margin: 0; font-weight: 500; line-height: 1.35; }
.ref { font-size: 0.78rem; color: var(--warn); white-space: nowrap; }
.commit-detail { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line); }
.skills-wrap { display: block; }
.skill-group h3 { font-size: 1rem; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.skill-group ul { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li { font-family: var(--mono); font-size: 0.82rem; padding: 5px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- projects ---------- */
.project { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color 0.25s, transform 0.25s var(--ease), opacity 0.7s var(--ease); }
.project:hover { border-color: var(--accent); }
.project-link { display: grid; grid-template-rows: auto 1fr; height: 100%; text-decoration: none; color: inherit; }
.project-link:hover { color: inherit; }
.project-featured { margin-bottom: clamp(18px, 2.4vw, 28px); }
.project-featured .project-link { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: none; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: clamp(18px, 2.4vw, 28px); }
.tile { position: relative; display: grid; place-items: center; height: 168px; background: var(--surface-2); overflow: hidden; }
.tile-big { height: 100%; min-height: 280px; }
.tile-ar span { font-size: 6.4rem; font-weight: 600; line-height: 1.2; color: var(--tile-ink); transition: color 0.35s var(--ease), transform 0.5s var(--ease); padding-bottom: 0.14em; }
.tile-big.tile-ar span { font-size: clamp(7rem, 15vw, 12rem); }
.project:hover .tile-ar span, .project-hero .tile-ar span { color: var(--accent); }
.project:hover .tile-ar span { transform: scale(1.04); }
.tile-path span { font-family: var(--mono); font-size: 1.3rem; color: var(--muted); padding: 0 16px; text-align: center; word-break: break-all; transition: color 0.3s; }
.tile-path span::after { content: ""; display: inline-block; width: 0.55em; height: 1.05em; margin-left: 4px; vertical-align: -0.18em; background: var(--accent); opacity: 0; }
.project:hover .tile-path span { color: var(--text); }
.project:hover .tile-path span::after { opacity: 1; animation: blink 1.1s steps(1) infinite; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.project:hover .tile-img img { transform: scale(1.04); }
.project-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.project-featured .project-body { padding: clamp(24px, 3.4vw, 44px); justify-content: center; gap: 14px; }
.project-featured h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.project-featured .project-tagline { font-size: 1.2rem; }
.meaning { font-weight: 300; font-size: 0.92rem; color: var(--muted); letter-spacing: 0; margin-left: 6px; white-space: nowrap; }
.meaning-lg { font-size: 1.1rem; margin: 6px 0 0; white-space: normal; }
.project-tagline { margin: 0; }
.built-for { margin: 0; font-size: 0.92rem; color: var(--accent); font-weight: 400; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tags li { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); }

.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: clamp(24px, 4vw, 40px); }
.crumb a { color: var(--muted); }
.draft-flag { color: var(--warn); margin-left: 10px; }
.project-hero { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.project-hero .tile { border-radius: 14px; min-height: 300px; border: 1px solid var(--line); }
.project-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.project-hero .lede { margin-top: 0.7em; }
.project-hero .tags { margin: 14px 0 22px; padding: 0; }
.next-up { margin-top: clamp(40px, 6vw, 72px); padding-top: 24px; border-top: 1px solid var(--line); font-weight: 400; }

@media (min-width: 1124px) {
  .project-grid > .project:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
  .project-grid > .project:last-child:nth-child(3n + 1) .project-link { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: none; }
  .project-grid > .project:last-child:nth-child(3n + 1) .tile { height: 100%; min-height: 150px; }
}

/* ---------- homelab ---------- */
.section-lab { background: linear-gradient(var(--surface), var(--surface)) center / 100% 100%; border-block: 1px solid var(--line); }
.route { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; margin-bottom: clamp(32px, 5vw, 56px); }
.hop { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-strong); min-width: 0; }
.hop-home { border-color: var(--accent); }
.hop-name { font-weight: 500; line-height: 1.2; }
.hop-note { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.wire { position: relative; height: 2px; background: var(--line-strong); overflow: hidden; }
.wire-tunnel { height: 10px; background: none; border-block: 2px solid var(--accent); }
.wire i { position: absolute; top: 50%; left: 0; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--ok); animation: packet 2.4s linear infinite; }
.wire:not(.wire-tunnel) { height: 8px; background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 2px no-repeat; }
.wire-tunnel i { width: 6px; height: 6px; margin-top: -3px; }
.wire i:nth-child(2) { animation-delay: -0.8s; }
.wire i:nth-child(3) { animation-delay: -1.6s; }
@keyframes packet { from { left: -8px; } to { left: 100%; } }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(24px, 4vw, 56px); align-items: start; }
.ps { background: var(--term-bg); color: var(--term-text); border-radius: 12px; border: 1px solid rgba(241, 235, 226, 0.12); padding: 18px 6px 8px; }
.ps-cmd { padding: 0 14px; font-size: 0.85rem; margin-bottom: 10px; }
.ps th { font-family: var(--mono); font-size: 0.74rem; font-weight: 400; color: var(--term-dim); text-align: left; padding: 6px 14px; }
.ps td { padding: 9px 14px; border-top: 1px solid rgba(241, 235, 226, 0.07); font-size: 0.94rem; vertical-align: top; }
.ps-name { color: #ff8fb0; white-space: nowrap; font-size: 0.86rem !important; }
.ps-status { white-space: nowrap; }
.ps-status .led { margin-right: 8px; }
.ps-note { color: var(--term-dim); font-size: 0.84rem; }
.facts { display: grid; gap: 22px; margin: 0; }
.facts div { padding-left: 16px; border-left: 2px solid var(--accent); }
.facts dt { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; line-height: 1.1; color: var(--text); }
.facts dd { margin: 4px 0 0; color: var(--muted); }

/* ---------- services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
.service { padding: 26px 0 28px; border-top: 1px solid var(--line-strong); }
.service-cmd { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.service h3 { margin-bottom: 8px; }
.service p { color: var(--muted); margin-bottom: 12px; }
.service ul { display: grid; gap: 4px; font-size: 0.95rem; }
.service li { position: relative; padding-left: 1.1em; }
.service li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 7px; height: 2px; background: var(--accent); }

/* ---------- off the clock ---------- */
.usb { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px clamp(16px, 3vw, 28px) 10px; }
.usb-cmd { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.usb li { display: grid; grid-template-columns: 11.5rem minmax(9rem, 14rem) 1fr; gap: 6px 22px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; transition: padding-left 0.3s var(--ease); }
.usb li:hover { padding-left: 8px; }
.usb-bus { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.usb-dev { font-weight: 500; }
.usb li:hover .usb-dev { color: var(--accent); }
.usb-note { color: var(--muted); font-size: 0.98rem; }

/* ---------- notes ---------- */
.post-list { border-top: 1px solid var(--line-strong); }
.post-row a { display: grid; grid-template-columns: 8rem 1fr auto; gap: 8px 28px; align-items: baseline; padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding 0.3s var(--ease), background-color 0.3s; }
.post-row a:hover { color: inherit; padding-inline: 14px 4px; background: var(--surface); }
.post-row time, .post-row-time { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.post-row-main { display: grid; gap: 4px; }
.post-row-title { font-size: 1.3rem; font-weight: 500; line-height: 1.25; }
.post-row a:hover .post-row-title { color: var(--accent); }
.post-row-excerpt { color: var(--muted); }
.post-head h1 { font-size: clamp(2.2rem, 5.6vw, 3.6rem); }
.post-meta { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; margin: 18px 0 12px; }
.post-cover { border-radius: 12px; margin-top: 28px; display: block; }

/* ---------- subscribe band ---------- */
.band { background: var(--surface-2); border-block: 1px solid var(--line); padding: clamp(48px, 7vw, 88px) 0; }
.band-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.band h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 0.4em; }
.band p { color: var(--muted); margin: 0; }
.cmd-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: stretch; }
.cmd-line { display: flex; align-items: center; gap: 0.6em; padding: 0 14px; min-height: 50px; background: var(--term-bg); border: 1px solid rgba(241, 235, 226, 0.16); border-radius: 8px; font-family: var(--mono); font-size: 0.9rem; cursor: text; transition: border-color 0.2s; }
.cmd-line:focus-within { border-color: var(--accent); }
.cmd-word { color: var(--term-text); }
.cmd-line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 12px 0; color: var(--term-text); font-family: var(--mono); font-size: max(0.9rem, 16px); }
.cmd-line input::placeholder { color: #5a6189; }
.form-msg { grid-column: 1 / -1; margin: 0 !important; min-height: 1.5em; font-size: 0.95rem; font-weight: 400; }
.form-msg.is-ok { color: var(--ok); }
.form-msg.is-err { color: var(--err); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact-grid h2 { margin-bottom: 0.45em; }
.contact-intro { color: var(--muted); font-size: 1.15rem; max-width: 26rem; }
.contact-mail { font-family: var(--mono); font-weight: 400; margin: 1.6em 0 0.8em; }
.contact-socials { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-size: max(1rem, 16px); font-weight: 300; transition: border-color 0.2s; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.contact-form .key { justify-self: start; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 max(40px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 40px; align-items: start; }
.footer-note { margin: 0; max-width: 32rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-exit { grid-column: 1 / -1; margin: 12px 0 0; font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 0 0.6em; }
.footer-zero { color: var(--ok); }
.footer-year { margin-left: auto; font-family: var(--sans); }

/* ---------- notices (404, confirm, unsubscribe) ---------- */
.notice { min-height: 62vh; }
.notice h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 36px 0 24px; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero-grid, .about-grid, .band-inner, .contact-grid, .project-hero, .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .project-featured .project-link { grid-template-columns: minmax(0, 1fr); }
  .tile-big { min-height: 200px; height: 200px; }
  .project-hero .tile { min-height: 200px; }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .usb li { grid-template-columns: 1fr; gap: 2px; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .nav { gap: 10px; }
  .brand-ar { font-size: 1.4rem; }
  .term-screen { height: 300px; padding: 14px; }
  .terminal { font-size: 0.8rem; }
  .route { grid-template-columns: 1fr; justify-items: stretch; }
  .wire, .wire:not(.wire-tunnel) { width: 8px; height: 34px; margin-left: 24px; background: linear-gradient(var(--line-strong), var(--line-strong)) center / 2px 100% no-repeat; }
  .wire-tunnel { width: 10px; background: none; border-block: 0; border-inline: 2px solid var(--accent); }
  .wire i { top: 0; left: 50%; margin: 0 0 0 -4px; animation-name: packet-down; }
  .wire-tunnel i { margin-left: -3px; }
  .post-row a { grid-template-columns: 1fr; gap: 4px; }
  .post-row-time { display: none; }
  .cmd-form { grid-template-columns: 1fr; }
  .cmd-word { display: none; }
  .ps td:nth-child(2), .ps th:nth-child(2) { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-year { margin-left: 0; flex-basis: 100%; margin-top: 6px; }
  .hero-glyph { top: -0.1em; opacity: 0.8; }
}
@keyframes packet-down { from { top: -8px; } to { top: 100%; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .wire i { display: none; }
  @view-transition { navigation: none; }
}
@media print { .nav, .terminal, .band, .footer, .hero-glyph { display: none; } body { background: #fff; color: #000; } }
