/* ni_sh_a.char — ink + signal amber, hairline technical layout */

:root {
  --ink:        #06070a;
  --ink-2:      #0b0d12;
  --surface:    #0e1117;
  --surface-2:  #131722;
  --line:       #1e232e;
  --line-2:     #2b3242;
  --text:       #e8ecf3;
  --text-2:     #9aa4b4;
  --text-3:     #626c7d;
  --amber:      #f2b544;
  --amber-2:    #ffd07a;
  --amber-dim:  rgba(242, 181, 68, 0.12);
  --mint:       #5ee9b5;
  --rose:       #ff7b72;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;

  --r:   14px;
  --r-s: 9px;
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --max: 1280px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── ambient background ─────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px 480px at 78% -8%, rgba(242, 181, 68, 0.11), transparent 70%),
    radial-gradient(620px 420px at 6% 12%, rgba(94, 233, 181, 0.055), transparent 70%),
    var(--ink);
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 75%);
}

/* ─── shell ──────────────────────────────────────────────────── */

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--amber); color: #000; padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--r-s) 0; font-weight: 600;
}
.skip:focus { left: 0; }

a { color: inherit; }

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

/* ─── nav ────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 60;
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(6, 7, 10, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: 68px;
}

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; font-weight: 700; letter-spacing: -0.02em;
  font-size: 1.02rem; white-space: nowrap;
}

.brand__mark {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  object-fit: cover; background: #000;
  box-shadow: 0 0 0 1px var(--line-2), 0 4px 14px -6px rgba(255, 255, 255, 0.25);
}

.brand__dot { color: var(--amber); }

.nav__links { display: flex; gap: 0.35rem; margin-left: auto; align-items: center; }

.nav__link {
  padding: 0.45rem 0.8rem; border-radius: var(--r-s);
  text-decoration: none; color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  transition: color 0.18s, background 0.18s;
}
.nav__link:hover { color: var(--text); background: var(--surface); }

.nav__k {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem 0.4rem 0.75rem;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--surface); color: var(--text-3);
  font-size: 0.83rem; cursor: pointer; font-family: inherit;
  transition: border-color 0.18s, color 0.18s;
}
.nav__k:hover { border-color: var(--amber); color: var(--text); }

kbd {
  font-family: var(--mono); font-size: 0.72rem;
  border: 1px solid var(--line-2); border-radius: 5px;
  padding: 0.1rem 0.35rem; color: var(--text-2); background: var(--ink-2);
}

@media (max-width: 900px) {
  .nav__links .nav__link { display: none; }
  .nav__links .nav__link--cta { display: inline-flex; }
  .nav__k span { display: none; }
}

/* ─── buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.78rem 1.35rem; border-radius: var(--r-s);
  font-family: inherit; font-size: 0.94rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.16s var(--ease), box-shadow 0.16s, background 0.16s, border-color 0.16s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(160deg, var(--amber-2), var(--amber));
  color: #150d00;
  box-shadow: 0 10px 30px -14px var(--amber);
}
.btn--primary:hover { box-shadow: 0 16px 40px -14px var(--amber); }

.btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--amber); }

/* ─── hero ───────────────────────────────────────────────────── */

.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--amber);
  border: 1px solid var(--amber-dim); background: var(--amber-dim);
  padding: 0.4rem 0.85rem; border-radius: 100px;
}

.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 rgba(94, 233, 181, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(94, 233, 181, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 233, 181, 0); }
}

.hero h1 {
  font-size: clamp(2.9rem, 8.5vw, 6.2rem);
  line-height: 0.96; letter-spacing: -0.045em; font-weight: 700;
  margin: 1.6rem 0 0; max-width: 16ch;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--amber-2), var(--amber) 45%, var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero__lede {
  margin: 1.6rem 0 0; max-width: 60ch;
  font-size: clamp(1.02rem, 1.9vw, 1.2rem); color: var(--text-2);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.4rem; }

/* ─── stats ──────────────────────────────────────────────────── */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; margin-top: 3.5rem;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}

.stat { background: var(--ink-2); padding: 1.35rem 1.4rem; }
.stat__n {
  font-family: var(--mono); font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1.1;
}
.stat__l {
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); margin-top: 0.35rem;
}

/* ─── sections ───────────────────────────────────────────────── */

.section { padding: clamp(4rem, 8vw, 6.5rem) 0; border-top: 1px solid var(--line); }

.section__head { max-width: 62ch; margin-bottom: 2.5rem; }

.section__tag {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 0.9rem;
}

.section h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.08;
  letter-spacing: -0.035em; font-weight: 700; margin: 0;
}

.section__sub { color: var(--text-2); margin: 1rem 0 0; font-size: 1.03rem; }

/* ─── toolbar ────────────────────────────────────────────────── */

.toolbar { display: grid; gap: 1rem; margin-bottom: 1.75rem; }

.toolbar__row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.field { position: relative; flex: 1 1 260px; min-width: 0; }
.field svg { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-3); }

.input, .select {
  width: 100%; font-family: inherit; font-size: 0.93rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 0.72rem 0.95rem; transition: border-color 0.18s;
}
.input { padding-left: 2.7rem; }
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { border-color: var(--amber); outline: none; }

.select { flex: 0 0 auto; width: auto; cursor: pointer; padding-right: 2rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.36rem 0.75rem; border-radius: 100px;
  border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-family: var(--mono); font-size: 0.78rem;
  cursor: pointer; transition: all 0.16s;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--amber-dim); border-color: var(--amber); color: var(--amber-2);
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip__n { color: var(--text-3); font-size: 0.72rem; }

.count { font-family: var(--mono); font-size: 0.82rem; color: var(--text-3); margin-left: auto; }

/* ─── repo grid ──────────────────────────────────────────────── */

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

.card {
  position: relative; display: flex; flex-direction: column; gap: 0.85rem;
  padding: 1.4rem; text-align: left;
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; font-family: inherit; color: inherit;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
  overflow: hidden;
}

.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0; transition: opacity 0.25s;
}

.card:hover {
  border-color: var(--line-2); transform: translateY(-4px);
  box-shadow: 0 22px 46px -26px rgba(0, 0, 0, 0.9);
}
.card:hover::before { opacity: 1; }

.card__top { display: flex; align-items: flex-start; gap: 0.7rem; }

.card__name {
  font-family: var(--mono); font-size: 0.98rem; font-weight: 600;
  letter-spacing: -0.02em; word-break: break-word; line-height: 1.35;
  flex: 1; min-width: 0;
}

.card__badges { display: flex; gap: 0.35rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 0.2rem 0.45rem; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--text-3); white-space: nowrap;
}
.badge--live { color: var(--mint); border-color: rgba(94, 233, 181, 0.35); background: rgba(94, 233, 181, 0.08); }
.badge--arch { color: var(--rose); border-color: rgba(255, 123, 114, 0.3); }

.card__desc {
  margin: 0; font-size: 0.9rem; color: var(--text-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.card__desc em { color: var(--text-3); font-style: italic; }

.card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.76rem; color: var(--text-3);
}

.meta { display: inline-flex; align-items: center; gap: 0.4rem; }
.lang-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 4rem 1rem;
  color: var(--text-3); border: 1px dashed var(--line-2); border-radius: var(--r);
}

.skeleton {
  height: 176px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* ─── dialog ─────────────────────────────────────────────────── */

dialog {
  border: none; padding: 0; background: transparent;
  max-width: min(760px, calc(100vw - 2rem)); width: 100%;
  max-height: calc(100vh - 3rem); color: var(--text);
}
dialog::backdrop { background: rgba(3, 4, 6, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.sheet {
  background: var(--ink-2); border: 1px solid var(--line-2);
  border-radius: var(--r); overflow: hidden;
  max-height: calc(100vh - 3rem); display: flex; flex-direction: column;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
}

.sheet__head {
  padding: 1.5rem 1.6rem 1.25rem; border-bottom: 1px solid var(--line);
  display: flex; gap: 1rem; align-items: flex-start;
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
}

.sheet__title { flex: 1; min-width: 0; }
.sheet__title h3 {
  margin: 0; font-family: var(--mono); font-size: 1.22rem;
  letter-spacing: -0.02em; word-break: break-word;
}
.sheet__tagline { margin: 0.55rem 0 0; color: var(--amber-2); font-size: 0.95rem; }

.x {
  flex: none; width: 34px; height: 34px; border-radius: var(--r-s);
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2);
  transition: color 0.16s, border-color 0.16s;
}
.x:hover { color: var(--text); border-color: var(--text-3); }

.sheet__body { padding: 1.5rem 1.6rem 1.75rem; overflow-y: auto; }

.block { margin-bottom: 1.5rem; }
.block:last-child { margin-bottom: 0; }
.block h4 {
  margin: 0 0 0.5rem; font-family: var(--mono); font-size: 0.74rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber);
}
.block p { margin: 0; color: var(--text-2); font-size: 0.94rem; line-height: 1.7; }

.block ul { margin: 0; padding-left: 1.1rem; color: var(--text-2); font-size: 0.92rem; }
.block li { margin-bottom: 0.4rem; }
.block li::marker { color: var(--amber); }

.facts {
  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-s); overflow: hidden;
}
.fact { background: var(--surface); padding: 0.8rem 0.9rem; }
.fact__l { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.fact__v { font-family: var(--mono); font-size: 0.9rem; margin-top: 0.2rem; word-break: break-word; }

.sheet__foot {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  padding: 1.1rem 1.6rem; border-top: 1px solid var(--line); background: var(--surface);
}
.sheet__foot .btn { padding: 0.6rem 1rem; font-size: 0.88rem; }

.ai-note {
  display: flex; gap: 0.5rem; align-items: center;
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-3);
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line-2);
}

/* ─── command palette ────────────────────────────────────────── */

#palette { max-width: min(620px, calc(100vw - 2rem)); margin-top: 12vh; }
#palette .sheet { max-height: 62vh; }

.palette__input {
  width: 100%; border: none; background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 1.02rem; padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.palette__input:focus { outline: none; }
.palette__input::placeholder { color: var(--text-3); }

.palette__list { overflow-y: auto; padding: 0.5rem; }

.palette__item {
  display: flex; align-items: center; gap: 0.75rem; width: 100%;
  padding: 0.65rem 0.85rem; border-radius: var(--r-s);
  background: transparent; border: none; color: var(--text);
  font-family: inherit; text-align: left; cursor: pointer; font-size: 0.92rem;
}
.palette__item[aria-selected="true"] { background: var(--surface-2); }
.palette__item b { font-family: var(--mono); font-weight: 600; flex: none; }
.palette__item em {
  font-style: normal; color: var(--text-3); font-size: 0.83rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── prose columns ──────────────────────────────────────────── */

.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.tile {
  padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
}
.tile__n {
  font-family: var(--mono); font-size: 0.78rem; color: var(--amber);
  letter-spacing: 0.14em; margin-bottom: 0.9rem;
}
.tile h3 { margin: 0 0 0.6rem; font-size: 1.1rem; letter-spacing: -0.02em; }
.tile p { margin: 0; color: var(--text-2); font-size: 0.93rem; }
.tile a { color: var(--amber-2); }

/* ─── contact ────────────────────────────────────────────────── */

.contact {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact__card {
  padding: 1.8rem; border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: linear-gradient(155deg, rgba(242, 181, 68, 0.09), var(--ink-2) 60%);
}
.contact__card h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.contact__card p { color: var(--text-2); margin: 0 0 1.3rem; font-size: 0.94rem; }

.mail {
  font-family: var(--mono); font-size: 0.9rem; color: var(--amber-2);
  word-break: break-all; text-decoration: none;
}
.mail:hover { text-decoration: underline; }

/* ─── footer ─────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; }
.foot__grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr repeat(auto-fit, minmax(140px, 1fr)); }
.foot__about p { color: var(--text-2); font-size: 0.9rem; margin: 0.9rem 0 0; max-width: 40ch; }
.foot h4 {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); margin: 0 0 0.9rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.foot a { color: var(--text-2); text-decoration: none; font-size: 0.9rem; }
.foot a:hover { color: var(--amber-2); }
.foot__bar {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  font-family: var(--mono); font-size: 0.76rem; color: var(--text-3);
}

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