/* ============================================================
   Litzen Systems — litzensystems.com
   Single stylesheet. Dark, system-font based, no external deps.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg:            #08090b;
  --bg-alt:        #0b0d10;
  --surface:       #101317;
  --surface-2:     #14181e;
  --surface-hover: #171c22;

  /* lines */
  --border:        #1d232b;
  --border-strong: #2a323d;

  /* type */
  --text:          #e7eaef;
  --text-dim:      #aab3c0;
  --muted:         #78828f;

  /* accent */
  --accent:        #4c8dff;
  --accent-strong: #2f6feb;
  --accent-soft:   rgba(76, 141, 255, .10);
  --accent-line:   rgba(76, 141, 255, .32);
  --amber:         #d9a05b;
  --amber-soft:    rgba(217, 160, 91, .12);

  /* spacing scale */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 88px; --s-10: 120px;

  /* geometry */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shell:     1160px;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .22s;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
p  { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #7dabff; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 14px;
}
.skip-link:focus { left: 16px; top: 12px; }

.shell {
  width: 100%; max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 9, 11, .72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(8, 9, 11, .88);
}
.header-inner {
  height: 64px;
  display: flex; align-items: center; gap: var(--s-4);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 600; letter-spacing: -.01em;
  font-size: 15.5px; margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand-mark { color: var(--accent); flex: none; }
.brand:hover .brand-mark { color: #7dabff; }
.brand-name-alt { color: var(--text-dim); font-weight: 500; }

.nav-panel { display: flex; align-items: center; gap: var(--s-5); }
.nav-links { display: flex; align-items: center; gap: var(--s-2); }
.nav-link {
  display: block; padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.nav-link.is-active { color: var(--text); }

.nav-git {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; font-size: 14px; font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-git:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

/* mobile toggle */
.nav-toggle {
  display: none;
  width: 38px; height: 38px; padding: 0;
  align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.nav-toggle-bars { display: block; width: 16px; }
.nav-toggle-bars span {
  display: block; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle-bars span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 550; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-primary { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: none; }

/* ---------- Section frame ---------- */
.section { padding-block: var(--s-9); border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 660px; margin-bottom: var(--s-7); }
.section-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3);
}
.section-title { font-size: clamp(26px, 3.4vw, 36px); }
.section-lead { margin-top: var(--s-4); color: var(--text-dim); font-size: 16.5px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 96px) clamp(64px, 9vw, 104px);
  overflow: hidden;
}
.hero::before { /* faint technical grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}
.hero::after { /* single restrained wash of accent */
  content: ""; position: absolute; inset: -20% 0 auto 0; height: 420px; pointer-events: none;
  background: radial-gradient(ellipse 46% 60% at 22% 40%, rgba(76, 141, 255, .10), transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero-copy { max-width: 620px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); padding: 5px 12px 5px 10px;
  margin-bottom: var(--s-5);
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.hero-title { font-size: clamp(34px, 5.4vw, 56px); letter-spacing: -.03em; max-width: 15ch; }
.hero-lead { margin-top: var(--s-5); font-size: clamp(16px, 1.6vw, 18px); color: var(--text-dim); max-width: 56ch; }
.hero-actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* hero diagram panel */
.panel {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
}
.panel-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .015);
}
.panel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .75; }
.panel-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }

.diagram { width: 100%; height: auto; padding: 8px; }
.diagram pattern path { stroke: rgba(255, 255, 255, .07); }
.diagram .link path { stroke: var(--border-strong); stroke-width: 1; fill: none; }
.diagram .node rect, .diagram rect.node {
  fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1;
}
.diagram rect.node-accent { fill: var(--accent-soft); stroke: var(--accent-line); }
.diagram .node-label, .diagram text.node-label {
  font-family: var(--font-mono); font-size: 11px; fill: var(--muted);
  text-anchor: middle; letter-spacing: .04em;
}
.diagram text.node-label-accent { fill: #9dc0ff; font-size: 11.5px; }
.diagram .pulse { fill: var(--accent); }

@keyframes flow-a { 0% { transform: translateY(0); opacity: 0 } 12% { opacity: 1 } 80% { opacity: 1 } 100% { transform: translateY(60px); opacity: 0 } }
@keyframes flow-b { 0% { transform: translateY(0); opacity: 0 } 12% { opacity: 1 } 80% { opacity: 1 } 100% { transform: translateY(52px); opacity: 0 } }
.pulse-down { animation: flow-a 3.2s var(--ease) infinite; }
.pulse-base { animation: flow-b 3.2s var(--ease) infinite 1.1s; }
.pulse.d2 { animation-delay: .5s; }
.pulse.d3 { animation-delay: 1s; }
.pulse-base.d2 { animation-delay: 1.7s; }

/* ---------- Cards (What we build) ---------- */
.card-grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-2px); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-bottom: var(--s-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-alt); color: var(--accent);
}
.card-title { font-size: 17px; margin-bottom: var(--s-2); }
.card-text { color: var(--muted); font-size: 15px; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: var(--s-4); }
.project {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.project:hover { border-color: var(--border-strong); }
.project-body { padding: clamp(24px, 3.4vw, 40px); }
.project-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
}
.badge-dev { color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(217, 160, 91, .28); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.project-type { font-size: 13px; color: var(--muted); }

.project-name { font-size: clamp(24px, 3vw, 30px); }
.project-name-sm { font-size: 18px; }
.project-tagline { margin-top: 6px; color: var(--text-dim); font-size: 16px; font-weight: 500; }
.project-text { margin-top: var(--s-4); color: var(--muted); font-size: 15.5px; max-width: 62ch; }

.tag-list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.tag-list li {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-alt); padding: 4px 9px;
}
.tag-note { color: var(--muted); opacity: .75; }

.project-specs {
  display: flex; flex-wrap: wrap; gap: var(--s-6);
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}
.project-specs dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
}
.project-specs dd { font-size: 14.5px; color: var(--text-dim); }

.project-aside {
  border-left: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(76, 141, 255, .04), transparent 60%),
    var(--bg-alt);
  padding: clamp(24px, 3vw, 32px);
  display: flex; align-items: center;
}
.stack { width: 100%; display: grid; gap: 8px; }
.stack-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 11px 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.stack-row:first-child { border-color: var(--accent-line); background: var(--accent-soft); }
.stack-key { font-family: var(--font-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stack-val { font-size: 13.5px; color: var(--text-dim); text-align: right; }

.project-slot {
  grid-template-columns: 1fr;
  background: transparent;
  border-style: dashed;
}
.project-slot .project-text { margin-top: var(--s-2); }

/* ---------- Technology ---------- */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); }
.split-lead { align-self: start; position: sticky; top: 96px; }

.tech-list { border-top: 1px solid var(--border); }
.tech-item {
  display: grid; grid-template-columns: auto minmax(150px, .8fr) minmax(0, 1.4fr);
  gap: var(--s-4); align-items: baseline;
  padding: var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
}
.tech-item:hover { background: var(--surface); }
.tech-index { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.tech-name { font-size: 15.5px; font-weight: 550; color: var(--text); }
.tech-desc { font-size: 14.5px; color: var(--muted); }

/* ---------- Principles ---------- */
.principles { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.principle {
  padding: var(--s-5) var(--s-5) var(--s-6);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  border-top: 2px solid var(--border-strong);
  transition: border-top-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.principle:hover { border-top-color: var(--accent); background: var(--surface-hover); }
.principle-num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; }
.principle-title { margin-top: var(--s-3); font-size: 16.5px; }
.principle-text { margin-top: var(--s-2); font-size: 14.5px; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 72px); }
.about-lead { align-self: start; }
.about-body { display: grid; gap: var(--s-4); color: var(--text-dim); font-size: 16.5px; max-width: 62ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-top: var(--s-8); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: var(--s-7);
  justify-content: space-between; padding-bottom: var(--s-7);
}
.footer-tagline { margin-top: var(--s-3); color: var(--muted); font-size: 14.5px; }
.footer-nav ul { display: grid; grid-template-columns: repeat(2, minmax(120px, auto)); gap: 10px var(--s-7); }
.footer-nav a { color: var(--muted); font-size: 14.5px; }
.footer-nav a:hover { color: var(--text); }

.footer-legal {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
  padding-block: var(--s-5);
  color: var(--muted); font-size: 13.5px;
}
.footer-domain { font-family: var(--font-mono); letter-spacing: .04em; }

/* ---------- Reveal on scroll (JS only) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: 2; max-width: 620px; }
  .split, .about { grid-template-columns: 1fr; }
  .split-lead { position: static; }
  .project { grid-template-columns: 1fr; }
  .project-aside { border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }

  .js .nav-panel {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none;
    flex-direction: column; align-items: stretch; gap: var(--s-3);
    padding: var(--s-4) var(--s-5) var(--s-5);
    background: rgba(9, 11, 14, .97);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .js .nav-panel.is-open { display: flex; animation: nav-in .18s var(--ease); }
  .js .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .js .nav-link { padding: 11px 12px; font-size: 16px; border-radius: var(--radius-sm); }
  .js .nav-link:hover { background: rgba(255, 255, 255, .05); }
  .js .nav-git { justify-content: center; padding: 11px 16px; }

  /* no-JS fallback: links simply wrap below the wordmark */
  .no-js .header-inner { flex-wrap: wrap; height: auto; padding-block: var(--s-3); }
  .no-js .nav-toggle { display: none; }
  .no-js .nav-links { flex-wrap: wrap; }

  .site-header { position: sticky; }
  .header-inner { position: relative; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 76px; }
  .section { padding-block: var(--s-8); }
  .shell { padding-inline: var(--s-4); }
  .tech-item { grid-template-columns: auto 1fr; row-gap: 4px; }
  .tech-desc { grid-column: 2; }
  .project-specs { gap: var(--s-5); }
  .footer-inner { flex-direction: column; gap: var(--s-6); }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 400px) {
  .brand-name-alt { display: none; }
  .footer-nav ul { grid-template-columns: 1fr; }
}

@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

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

/* ---------- Print ---------- */
@media print {
  .site-header, .hero-visual, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
}
