/* ============================================================
   0xarise v2 — minimal instrumentation
   landing = bare hub  ·  sub-pages per menu item
   color = signal (paid vs free)  ·  products = micrographics
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800; font-display: swap; font-style: normal;
}

:root {
  /* lighter charcoal base (was near-black) */
  --bg:        #15151a;
  --bg-2:      #1b1b21;
  --panel:     #1a1a20;
  --panel-2:   #1f1f26;
  --fg:        #f2f2f3;
  --fg-dim:    #9a9aa1;
  --fg-faint:  #82828b;
  --line:      #2a2a32;
  --line-2:    #38383f;

  --magenta:   #ff3aa0;
  --cyan:      #3ce0ff;
  --turq:      #25e6c8;
  --green:     #34e07a;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gut: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg); color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; min-height: 100svh;
}
a { color: inherit; text-decoration: none; }

/* visible keyboard focus (a11y 2.4.7) */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 1px; }
.mgx:focus-visible, .scard:focus-visible, .crow:focus-visible { outline-offset: -2px; }

/* ---------- atmosphere ---------- */
.grain { position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: .05; mix-blend-mode: overlay; }
.grain svg { width: 100%; height: 100%; }
.haze {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120vw 80vh at 50% -15%, rgba(120,120,140,.16), transparent 60%),
    radial-gradient(80vw 60vh at 85% 115%, rgba(70,90,110,.12), transparent 55%);
}
.corner-marks {
  position: fixed; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; justify-content: space-between; padding: 1.1rem var(--gut);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--fg-faint); pointer-events: none;
}
.frost-rule {
  position: fixed; left: var(--gut); right: var(--gut); z-index: 7; height: 1px; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); opacity: .55;
}
.frost-rule--top { top: 2.6rem; }
.frost-rule--bottom { bottom: 2.6rem; }

/* glyph (shared) */
.glyph path, .glyph line, .glyph polygon, .glyph polyline {
  stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400);
  animation: draw 1.1s var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .glyph path, .glyph line, .glyph polygon, .glyph polyline { stroke-dashoffset: 0; animation: none; } }

/* glitch-on-hover nav (shared) */
.navlink {
  font-family: var(--mono); font-size: .76rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: .12em; color: var(--fg);
  cursor: pointer; position: relative; padding-bottom: .35rem; white-space: nowrap;
}
.navlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px);
  opacity: 0; transform: translateY(3px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.navlink:hover::after, .navlink[aria-current="page"]::after { opacity: .85; transform: none; }
.navlink[aria-current="page"] { color: var(--fg); }

/* unified glitch link — every clickable speaks the same language */
.glink {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg); cursor: pointer; position: relative; padding-bottom: .3rem;
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; align-self: flex-start;
}
.glink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px);
  opacity: 0; transform: translateY(3px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.glink:hover::after, .glink:focus-visible::after { opacity: .9; transform: none; }
.glink--green { color: var(--green); }
.glink--green::after { opacity: .5; transform: none; }   /* persistent green underline */
.glink--green:hover::after { opacity: 1; }

/* ============================================================
   LANDING HUB (index)
   ============================================================ */
.hub {
  position: relative; z-index: 1; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6rem var(--gut) 4rem;
}
.hub__glyph { width: 84px; height: 98px; margin-bottom: 2.2rem; }
.hub__id {
  font-family: var(--mono); font-size: .68rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .22em; color: var(--fg-dim); margin-bottom: 1.1rem;
}
.hub__mark {
  font-weight: 800; letter-spacing: -.03em; line-height: 1;
  font-size: clamp(3rem, 11vw, 7rem); color: var(--fg);
  display: flex; align-items: baseline; gap: .12em;
  font-feature-settings: "zero" 1; /* slashed zero -> reads 0x not Ox */
}
.hub__mark .pre { color: var(--green); font-family: var(--mono); font-weight: 700; font-size: .82em; }
.hub__mark .sep { color: var(--fg-faint); font-weight: 300; }
.hub__tagline {
  font-weight: 300; font-size: clamp(.95rem, 2.2vw, 1.1rem); line-height: 1.6;
  color: var(--fg-dim); max-width: 30rem; margin: 1.5rem auto 2.6rem;
}
.hub__nav { display: flex; gap: clamp(1.4rem, 4vw, 3rem); flex-wrap: wrap; justify-content: center; }
.hub__ref {
  margin-top: 3rem; font-family: var(--mono); font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--fg-faint); display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center;
}
.hub__ref b { color: var(--fg-dim); font-weight: 500; }

/* load choreography */
.loading .hub__id, .loading .hub__tagline, .loading .hub__nav, .loading .hub__ref { opacity: 0; transform: translateY(20px); }
.hub__id, .hub__tagline, .hub__nav, .hub__ref { transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* ============================================================
   SUB-PAGE shell
   ============================================================ */
/* sub-page = centered stack, consistent with the landing hub */
.page { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; padding: clamp(3rem, 7vh, 5rem) var(--gut) 0; }
.page__inner { margin: auto 0; width: 100%; max-width: 1100px; margin-left: auto; margin-right: auto; display: flex; flex-direction: column; align-items: center; }

/* back-home mark + nav, centered */
.page__home {
  display: inline-flex; align-items: baseline; gap: .25rem; font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.02em; margin-bottom: 1.25rem;
}
.page__home .pre { color: var(--green); font-family: var(--mono); font-weight: 700; font-size: .9em; }
.page__home .sep { color: var(--fg-faint); font-weight: 300; }
.page__home:hover { opacity: .85; }
.page__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.2rem, 4vw, 2.6rem); margin-bottom: clamp(2.5rem, 6vh, 3.5rem); }
.page__nav .navlink { font-size: .7rem; }
@media (max-width: 520px) { .page__nav { gap: 1.1rem; } .page__nav .navlink { font-size: .62rem; letter-spacing: .08em; } }

.page__head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem; margin-bottom: 2.75rem; }
.page__no { font-family: var(--mono); font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--fg-faint); }
.page__title { font-family: var(--sans); font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.2rem); letter-spacing: -.025em; color: var(--fg); }
.page__title small { display: block; font-family: var(--mono); font-weight: 400; font-size: .74rem; letter-spacing: .04em; color: var(--fg-dim); margin-top: .7rem; }
.page__rail { font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-faint); }
.page__body { width: 100%; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============================================================
   INSTALLS — product = micrographic spec sheet
   ============================================================ */
.mg {
  --c: var(--fg);
  position: relative; border: 1px solid var(--line); background: var(--panel);
  margin-bottom: 1.5rem; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; min-height: 360px;
}
@media (max-width: 800px) { .mg { grid-template-columns: 1fr; } }
.mg__bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--c); opacity: .9; z-index: 3; }

/* left: drawn schematic */
.mg__viz { position: relative; border-right: 1px solid var(--line); min-height: 260px; }
@media (max-width: 800px) { .mg__viz { border-right: none; border-bottom: 1px solid var(--line); } }
.mg__viz svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mg__viz svg text { font-family: var(--mono); }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* right: woven spec text */
.mg__spec { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .85rem; }
.mg__tag { font-family: var(--mono); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c); }
.mg__name { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: -.02em; line-height: 1; }
.mg__rows { font-family: var(--mono); font-size: .68rem; line-height: 1.9; color: var(--fg-dim); letter-spacing: .02em; margin-top: .3rem; }
.mg__rows .k { color: var(--fg-faint); display: inline-block; min-width: 4.6em; }
.mg__rows .v { color: var(--fg); }
.mg__rows .c { color: var(--c); }
.mg__desc { font-family: var(--sans); font-weight: 300; font-size: .9rem; line-height: 1.6; color: var(--fg-dim); margin-top: auto; }
.mg__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px dashed var(--line-2); }
.mg__badge { font-family: var(--mono); font-size: .56rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c); border: 1px solid var(--c); border-radius: 2px; padding: .3rem .55rem; opacity: .9; }
.mg__cta { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg); display: inline-flex; gap: .4rem; align-items: center; }
.mg__cta .arr { color: var(--c); transition: transform .3s var(--ease); }
.mg:hover .mg__cta .arr { transform: translateX(4px); }

/* ============================================================
   MGX — micrographic product tile (compact, label-scale)
   golden-ratio tile · main text wrapped by micro labels
   barcode/reticle accents ≤ ~1/10 · all real text
   ============================================================ */
.installs__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 840px) { .installs__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .installs__grid { grid-template-columns: 1fr; } }

.mgx {
  --c: var(--magenta);
  position: relative; container-type: inline-size; aspect-ratio: 1.618 / 1;
  background: #101013; overflow: hidden; color: var(--fg); font-feature-settings: "zero" 1;
  transition: background .4s var(--ease);
}
.mgx:hover { background: #131317; }
.mgx__bg { position: absolute; inset: 0; z-index: 0;
  background: repeating-linear-gradient(58deg, rgba(255,255,255,.018) 0 1px, transparent 1px 30px);
}
.mgx > *:not(.mgx__bg) { position: absolute; z-index: 1; }
.mgx__bar { top: 0; left: 0; right: 0; height: 2px; background: var(--c); opacity: .9; }
.mgx__m { font-family: var(--mono); letter-spacing: .08em; }
.mgx__c { color: var(--c); }

/* top strip: tag · unit */
.mgx__top { top: 7%; left: 7%; right: 7%; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: max(9px, 2.4cqw); letter-spacing: .14em; color: var(--fg-faint); }
.mgx__top .tag { color: var(--c); }

/* center cluster: small glyph + name, wrapped by micro labels */
.mgx__cluster { left: 7%; right: 7%; top: 50%; transform: translateY(-50%); }
.mgx__hd { display: flex; align-items: center; gap: 3.2cqw; }
.mgx__glyph { width: 12cqw; height: 12cqw; flex: none; color: var(--c); }
.mgx__glyph svg { width: 100%; height: 100%; display: block; }
.mgx__name { font-family: var(--sans); font-weight: 800; font-size: 6.4cqw; line-height: .92; letter-spacing: -.01em; text-transform: uppercase; }
.mgx__l { margin-top: 2.4cqw; font-family: var(--mono); font-size: max(9.5px, 2.5cqw); letter-spacing: .1em; color: var(--fg-dim); }
.mgx__l + .mgx__l { margin-top: .4cqw; }
.mgx__l .sep, .mgx__l .st { color: var(--fg-faint); }
.mgx__l .on { color: var(--c); }
.mgx__scatter { margin-top: 1.8cqw; font-family: var(--mono); font-size: max(8.5px, 2.3cqw); letter-spacing: .12em; color: var(--fg-faint); white-space: nowrap; overflow: hidden; }
.mgx__jp { margin-top: 2.4cqw; display: flex; align-items: center; gap: 2.4cqw; font-size: max(11px, 3cqw); color: var(--fg-dim); }
.mgx__jp .ic { font-family: var(--mono); font-size: max(9px, 2.4cqw); letter-spacing: .22em; color: var(--fg-faint); }
.mgx__hd { text-decoration: none; }
a.mgx__hd:hover .mgx__name { opacity: .82; }
.mgx__install { bottom: 6.5%; right: 7%; font-size: max(9px, 2.4cqw); letter-spacing: .14em; }

/* ============================================================
   SKILLS — open source, restrained green
   ============================================================ */
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 720px) { .skills__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .skills__grid { grid-template-columns: 1fr; } }
.scard { background: var(--panel); padding: 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .45rem; transition: background .35s var(--ease); }
.scard:hover { background: var(--panel-2); }
.scard__cat { font-family: var(--mono); font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--green); opacity: .85; }
.scard__name { font-family: var(--mono); font-size: .92rem; font-weight: 600; color: var(--fg); }
.scard__desc { font-weight: 300; font-size: .78rem; line-height: 1.45; color: var(--fg-dim); flex: 1; margin-bottom: .35rem; }
.skills__all { margin-top: 1.6rem; }

/* ============================================================
   SERVICES
   ============================================================ */
.svc { max-width: 38rem; }
.svc__p { font-weight: 300; font-size: .95rem; line-height: 1.7; color: var(--fg-dim); }
.svc__meta { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-faint); margin-top: 1.6rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.svc__cta { margin-top: 2rem; }

/* ============================================================
   CONTACT
   ============================================================ */
/* contact = slim list, no tiles */
.contact__list { border-top: 1px solid var(--line); max-width: 38rem; }
.crow { display: flex; align-items: baseline; gap: 1.5rem; padding: 1.05rem .1rem; border-bottom: 1px solid var(--line); }
.crow__k { font-family: var(--mono); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-faint); min-width: 8rem; }
.crow__v { font-size: .82rem; }   /* glink--green applied inline */

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 1.4rem var(--gut); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-faint); max-width: 1180px; margin: 0 auto; }
.footer a:hover { color: var(--fg); }
.footer .ok { color: var(--green); }
.footer__sep { color: var(--line-2); margin: 0 .4rem; }
