/* ==========================================================================
   pixeldestrukt.com — dark technical
   ========================================================================== */

:root {
  --bg:        #08090b;
  --bg-2:      #0b0d11;
  --panel:     #10131a;
  --panel-2:   #141821;
  --line:      #1d232e;
  --line-soft: #161b23;
  --text:      #dbe1ea;
  --text-dim:  #9aa5b5;
  --muted:     #6f7a8a;
  --accent:    #2bf5b0;
  --accent-dim:#1b9e73;
  --hot:       #ff3d66;
  --amber:     #ffb638;

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

  --wrap: 1120px;
  --wrap-narrow: 720px;
  --gutter: 24px;
  --radius: 3px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(transparent 0 0),
    radial-gradient(1200px 600px at 50% -200px, rgba(43, 245, 176, 0.06), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ basics */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

img, video, canvas, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
  color: #fff;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.012em; }

p { margin: 0 0 1.1em; }

.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.plain { list-style: none; margin: 0; padding: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #05140e;
  padding: 10px 16px;
  z-index: 100;
  font-family: var(--font-mono);
}
.skip:focus { left: 8px; top: 8px; }

.eyebrow {
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 0;
}

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand b { color: var(--accent); font-weight: 600; }

.brand-mark {
  width: 13px;
  height: 13px;
  flex: none;
  background:
    linear-gradient(var(--accent) 0 0) 0 0 / 6px 6px no-repeat,
    linear-gradient(var(--hot) 0 0) 7px 7px / 6px 6px no-repeat,
    linear-gradient(var(--line) 0 0) 7px 0 / 6px 6px no-repeat;
  animation: mark 6s steps(1) infinite;
}
@keyframes mark {
  0%, 100% { filter: none; }
  50%      { filter: hue-rotate(40deg); }
}

.site-nav {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.site-nav a {
  color: var(--text-dim);
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.site-nav a:hover {
  color: #fff;
  text-decoration: none;
  border-color: var(--line);
  background: var(--panel);
}
.site-nav a.is-active { color: var(--accent); border-color: var(--line); background: var(--panel); }

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

.hero {
  padding: clamp(56px, 11vw, 120px) 0 clamp(40px, 7vw, 76px);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    linear-gradient(0deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(90% 70% at 30% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(90% 70% at 30% 20%, #000 0%, transparent 75%);
  opacity: 0.75;
}

.hero > .wrap { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(2.1rem, 6.2vw, 4rem);
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
  max-width: 20ch;
}

.hero-body {
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 1.08rem;
}
.hero-body strong { color: var(--text); font-weight: 600; }

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

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 11px 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #05140e;
  border: 1px solid var(--accent);
  font-weight: 600;
  transition: transform 0.12s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px -8px var(--accent-dim);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* ------------------------------------------------------------------- bands */

.band { padding: clamp(46px, 7vw, 80px) 0; border-bottom: 1px solid var(--line); }
.band-alt { background: var(--bg-2); }

.band-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 2rem;
}
.band-head .section-title { margin-bottom: 0; }
.section-title .idx { color: var(--accent); opacity: 0.8; }

.more { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.more:hover { color: var(--accent); }

.page-head {
  padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------------ domains */

.domain-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.domain {
  background: var(--bg);
  padding: 24px 22px 26px;
  position: relative;
}
.domain h3 { color: var(--accent); margin-bottom: 0.5em; font-family: var(--font-mono); font-size: 0.86rem; letter-spacing: 0.04em; text-transform: uppercase; }
.domain p { margin: 0; color: var(--text-dim); font-size: 0.93rem; }

/* -------------------------------------------------------------------- cards */

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
}

.card { display: flex; }
.card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
}
.card-link:hover {
  text-decoration: none;
  border-color: var(--accent-dim);
  background: var(--panel-2);
  transform: translateY(-2px);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
}
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.status-shipping::before, .status-live::before, .status-active::before { background: var(--accent); box-shadow: 0 0 8px var(--accent-dim); }
.status-ongoing::before, .status-in-progress::before { background: var(--amber); }
.status-archived::before, .status-retired::before { background: var(--muted); }
.status-prototype::before, .status-r-d::before { background: var(--hot); }
.card-year { margin-left: auto; }

.card-title { margin: 0; color: #fff; }
.card-summary { margin: 0; color: var(--text-dim); font-size: 0.93rem; flex: 1; }

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.stack li {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  background: var(--bg);
}

.card-cue { color: var(--accent); opacity: 0; transform: translateX(-4px); transition: all 0.16s var(--ease); }
.card-link:hover .card-cue { opacity: 1; transform: none; }

/* --------------------------------------------------------------- post lists */

.post-list { border-top: 1px solid var(--line); }
.post-item { border-bottom: 1px solid var(--line); }

.post-link {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 18px 8px;
  color: var(--text);
  transition: background 0.14s var(--ease), padding-left 0.14s var(--ease);
}
.post-link:hover {
  text-decoration: none;
  background: var(--panel);
  padding-left: 14px;
}
.post-date { color: var(--muted); flex: none; }
.post-title { font-weight: 560; letter-spacing: -0.01em; }
.post-link:hover .post-title { color: var(--accent); }
.post-summary { display: none; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.post-list-full .post-link {
  grid-template-columns: 110px 1fr;
  grid-template-areas:
    "date  title"
    ".     summary"
    ".     tags";
  gap: 6px 18px;
  padding-block: 22px;
}
.post-list-full .post-date { grid-area: date; }
.post-list-full .post-title { grid-area: title; font-size: 1.08rem; }
.post-list-full .post-summary {
  grid-area: summary;
  display: block;
  color: var(--text-dim);
  font-size: 0.93rem;
  max-width: 68ch;
}
.post-list-full .post-tags { grid-area: tags; justify-content: flex-start; margin-top: 4px; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.14s var(--ease);
}
.chip:hover { color: #fff; border-color: var(--accent-dim); }
.chip.is-active { color: #05140e; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.empty { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; padding: 28px 0; }

/* -------------------------------------------------------------------- post */

.post-head { padding: clamp(46px, 7vw, 82px) 0 clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); margin-bottom: 1.4em; display: flex; gap: 8px; }
.crumb a { color: var(--text-dim); }
.post-meta { color: var(--muted); margin-top: 1.4em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 2rem 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec { background: var(--bg); padding: 12px 14px; }
.spec dt { color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.spec dd { margin: 0; font-size: 0.9rem; color: var(--text); }

.post-body { padding-block: clamp(32px, 5vw, 54px); }

.post-foot { padding-bottom: clamp(48px, 7vw, 80px); }
.pager-nav {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.pager {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 0.94rem;
}
.pager:hover { text-decoration: none; border-color: var(--accent-dim); background: var(--panel-2); }
.pager .mono { color: var(--muted); }
.pager-next { text-align: right; }

/* ------------------------------------------------------------------- prose */

.prose { font-size: 1.02rem; color: var(--text-dim); }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 {
  color: #fff;
  margin-top: 2.2em;
  scroll-margin-top: 78px;   /* clear the sticky header on anchor jumps */
}
.prose h2 { font-size: 1.45rem; padding-bottom: 0.35em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.14rem; }
.prose strong { color: var(--text); font-weight: 620; }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }

.prose .anchor { color: inherit; text-decoration: none; }
.prose .anchor:hover { color: var(--accent); }
.prose h2:hover .anchor::after,
.prose h3:hover .anchor::after {
  content: " #";
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 0.7em;
}

.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent-dim); }

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-dim);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }

.prose img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.6em 0;
  width: 100%;
}

.prose figure { margin: 1.8em 0; }
.prose figcaption { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 0.7em; }

.prose iframe, .prose video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.6em 0;
  height: auto;
}

/* --------------------------------------------------------------- code + tables */

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.12em 0.36em;
  color: var(--text);
}

pre {
  position: relative;
  margin: 1.7em 0;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  tab-size: 2;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--text);
}
pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: var(--radius);
  padding: 3px 9px;
}
pre[data-lang="text"]::before { content: none; }

.copy-btn {
  position: absolute;
  top: 30px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s var(--ease), color 0.14s var(--ease);
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

.tok-com  { color: #5a6674; font-style: italic; }
.tok-str  { color: #ffb638; }
.tok-num  { color: #ff8b6b; }
.tok-kw   { color: #ff3d66; }
.tok-type { color: #2bf5b0; }
.tok-fn   { color: #7cc9ff; }
.tok-meta { color: #b78cff; }
.tok-key  { color: #2bf5b0; }

.table-wrap { overflow-x: auto; margin: 1.7em 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.91rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel); }

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

.site-foot { background: var(--bg-2); padding-top: clamp(40px, 6vw, 64px); }
.foot-inner {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding-bottom: 36px;
}
.foot-brand { font-family: var(--font-mono); font-size: 0.95rem; margin-bottom: 0.4em; color: var(--text); }
.foot-brand b { color: var(--accent); font-weight: 600; }
.foot-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8em;
}
.foot-col ul li { margin-bottom: 0.45em; font-size: 0.92rem; }
.foot-col a { color: var(--text-dim); }
.foot-col a:hover { color: var(--accent); }
.foot-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 18px;
  border-top: 1px solid var(--line);
}

.notfound { min-height: 52vh; display: flex; align-items: center; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  .head-inner { height: 54px; }
  .brand-text { font-size: 0.84rem; }
  .site-nav a { padding: 6px 8px; }

  .post-link,
  .post-list-full .post-link {
    grid-template-columns: 1fr;
    grid-template-areas: "date" "title" "summary" "tags";
    gap: 5px;
    padding-inline: 4px;
  }
  .post-link:hover { padding-left: 4px; }
  .post-tags { justify-content: flex-start; }

  .pager-next { text-align: left; }
  pre { padding: 16px 14px; font-size: 0.8rem; }
  .copy-btn { opacity: 1; }
}
