/* ============================================================
   0xNyx — personal homepage
   Theme: near-black surface, single luminous jade signal.
   ============================================================ */

/* ---------- Self-hosted fonts (latin subsets, variable) ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans SC Subset";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-sc-page.woff2") format("woff2");
}

:root {
  /* Color — OKLCH, Committed dark strategy */
  --bg: oklch(0.155 0 0);
  --bg-2: oklch(0.125 0 0);
  --surface: oklch(0.205 0.004 160);
  --surface-2: oklch(0.245 0.006 160);
  --line: oklch(1 0 0 / 0.1);
  --line-strong: oklch(1 0 0 / 0.16);
  --ink: oklch(0.965 0 0);
  --muted: oklch(0.74 0.012 160);
  --signal: oklch(0.86 0.17 158);
  --signal-deep: oklch(0.72 0.15 160);
  --signal-soft: oklch(0.86 0.17 158 / 0.14);
  --on-signal: oklch(0.16 0.02 160);

  /* Type */
  --font-cjk: "Noto Sans SC Subset", "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "HONOR Sans CN", "Source Han Sans SC", "Microsoft YaHei";
  --font-display: "Bricolage Grotesque", var(--font-cjk), system-ui, sans-serif;
  --font-body: "Hanken Grotesk", var(--font-cjk), system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, var(--font-cjk), monospace;

  /* Space + shape */
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index scale */
  --z-canvas: 0;
  --z-base: 1;
  --z-header: 50;
  --z-toast: 80;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  isolation: isolate;
}

/* Full-page pointer field: fixed viewport canvas, lattice in page space
   so dots scroll with the document; glow stays under the cursor. */
.page-field {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
  overflow: hidden;
}
.page-field__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  display: block;
  max-width: none;
}
.page-field__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 38%),
    var(--signal-soft),
    transparent 60%
  );
  transition: opacity 0.35s var(--ease);
}

/* Content above the field */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: var(--z-base);
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

ul { margin: 0; padding: 0; list-style: none; }

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0;
}

::selection {
  background: var(--signal);
  color: var(--on-signal);
}

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

.skip-link {
  position: fixed;
  top: -120px;
  left: 1rem;
  z-index: var(--z-toast);
  background: var(--signal);
  color: var(--on-signal);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.9rem, 1.6vw, 1.4rem) var(--gutter);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: oklch(0.155 0 0 / 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.brand__mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--signal);
  box-shadow: 0 0 16px var(--signal);
  transform: rotate(45deg);
}
.brand__accent { color: var(--signal); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.1rem);
  font-size: 0.95rem;
}
.site-nav a { color: var(--muted); position: relative; transition: color 0.25s var(--ease); }
.site-nav a:not(.site-nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:not(.site-nav__cta):hover::after { transform: scaleX(1); }
.site-nav a.is-active:not(.site-nav__cta) { color: var(--ink); }
.site-nav a.is-active:not(.site-nav__cta)::after { transform: scaleX(1); }
.site-nav__cta.is-active { border-color: var(--signal); color: var(--signal); }
.site-nav__cta {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.site-nav__cta:hover { border-color: var(--signal); color: var(--signal); }

.nav-toggle,
.mobile-nav,
.nav-scrim {
  display: none;
}

@media (max-width: 560px) {
  body.is-nav-open { overflow: hidden; }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 49;
    display: block;
    padding: 0;
    border: 0;
    background: oklch(0.08 0 0 / 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  .nav-scrim[hidden] { display: none; }
  .site-header.is-menu-open {
    background: oklch(0.155 0 0 / 0.94);
    border-bottom-color: var(--line);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
  }
  .site-nav { display: none; }
  .nav-toggle {
    display: inline-grid;
    place-content: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: oklch(1 0 0 / 0.02);
    color: var(--ink);
    cursor: pointer;
  }
  .nav-toggle span {
    width: 16px;
    height: 1px;
    background: currentColor;
    transition: transform 0.3s var(--ease);
  }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .mobile-nav {
    position: fixed;
    inset: 4.8rem var(--gutter) auto;
    display: grid;
    padding: 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: oklch(0.19 0.006 160);
    box-shadow: 0 24px 70px -24px oklch(0 0 0 / 0.9);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a {
    display: grid;
    grid-template-columns: 2.2rem 1fr;
    align-items: center;
    min-height: 48px;
    padding: 0 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
  }
  .mobile-nav a + a { border-top: 1px solid var(--line); }
  .mobile-nav a span { color: var(--signal); font-size: 0.72rem; }
  .mobile-nav a:is(:hover, .is-active) {
    background: var(--signal-soft);
    color: var(--ink);
  }
}

/* ---------- Buttons ---------- */

.btn {
  --pad-y: 0.8rem;
  --pad-x: 1.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn--lg { --pad-y: 1rem; --pad-x: 1.7rem; font-size: 1.05rem; }

.btn--primary {
  background: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 0 0 0 var(--signal-soft);
}
.btn--primary:hover {
  background: oklch(0.9 0.17 158);
  box-shadow: 0 8px 30px -8px var(--signal);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }

.btn__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}
.btn--primary:hover .btn__icon { transform: translateX(4px); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem var(--gutter) 5rem;
  overflow: visible;
  isolation: isolate;
}
/* Hero no longer owns the field; page-field covers the whole site. */

.hero__inner {
  position: relative;
  z-index: var(--z-base);
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.hero__avatar-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  line-height: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  box-shadow: 0 0 0 4px oklch(0.86 0.17 158 / 0.12), 0 12px 30px -12px oklch(0 0 0 / 0.7);
}
.hero__avatar-link:hover,
.hero__avatar-link:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 4px oklch(0.86 0.17 158 / 0.22), 0 16px 36px -12px oklch(0 0 0 / 0.75);
  outline: none;
}
.hero__avatar-link:focus-visible {
  box-shadow:
    0 0 0 4px oklch(0.86 0.17 158 / 0.22),
    0 0 0 6px oklch(0.86 0.17 158 / 0.45),
    0 16px 36px -12px oklch(0 0 0 / 0.75);
}
.hero__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 1px solid var(--line-strong);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.6rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.02);
  font-size: 0.82rem;
  color: var(--muted);
}
.hero__status-sep { color: var(--line-strong); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--signal);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.86 0.17 158 / 0.5); }
  70% { box-shadow: 0 0 0 9px oklch(0.86 0.17 158 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.86 0.17 158 / 0); }
}

.hero__title {
  font-size: clamp(3.6rem, 13vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
}
.hero__title-accent { color: var(--signal); }

.hero__role {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--muted);
  margin: 0 0 1.6rem;
}

.hero__lede {
  max-width: 33ch;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 2.4rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* hero terminal art */
.hero__art {
  display: none;
  min-width: 0;
}
@media (min-width: 960px) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 3.5vw, 4rem);
  }
  .hero__art {
    display: flex;
    justify-content: flex-end;
    animation: termFloat 8s ease-in-out infinite;
  }
}

.term {
  width: min(560px, 100%);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, var(--surface-2), oklch(0.16 0 0));
  box-shadow: 0 40px 80px -40px oklch(0 0 0 / 0.85);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.3s var(--ease);
}
.term:focus-within { border-color: oklch(0.86 0.17 158 / 0.35); }
@media (min-width: 960px) {
  .hero__art:focus-within { animation-play-state: paused; }
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 0.9rem;
  background: oklch(1 0 0 / 0.03);
  border-bottom: 1px solid var(--line);
}
.term__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.term__title { margin-left: 0.6rem; font-size: 0.72rem; color: var(--muted); }
.term__body {
  padding: 1.3rem 1.3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.55;
  height: clamp(380px, 46vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.term__out {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.term__line {
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term__line--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}
.term__line--out { color: var(--muted); }
.term__line--err { color: oklch(0.74 0.16 25); }
.term__prompt { color: var(--signal); margin-right: 0.4rem; }
.term__ok { color: var(--signal); }
.term__link { color: var(--signal); text-decoration: underline; text-decoration-color: oklch(0.86 0.17 158 / 0.4); text-underline-offset: 2px; }
.term__link:hover { text-decoration-color: var(--signal); }
.term__form {
  display: flex;
  align-items: baseline;
  margin: 0;
  flex: none;
}
.term__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  caret-color: var(--signal);
}
.term__caret {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--signal);
  animation: caretBlink 1.1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
@keyframes termFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.js .hero__art .term__line--boot {
  opacity: 0;
  transform: translateY(6px);
}
.js .hero__art.is-in .term__line--boot {
  animation: termLine 0.45s var(--ease-out) forwards;
  animation-delay: calc(0.2s + var(--i, 0) * 0.28s);
}
@keyframes termLine {
  to { opacity: 1; transform: none; }
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%);
  z-index: var(--z-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, var(--signal), transparent);
  animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  40% { transform: scaleY(1); transform-origin: top; }
  60% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (max-width: 560px) { .hero__scroll { display: none; } }

/* ---------- Sections ---------- */

.section {
  position: relative;
  z-index: var(--z-base);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
  scroll-margin-top: 4.5rem;
}
.section__head { margin-bottom: clamp(2rem, 3.5vw, 3rem); }
.section__index {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--signal);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.section__title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
  max-width: 18ch;
}

/* ---------- About ---------- */

.about__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.2rem, 4vw, 3.5rem);
}
.about__lead {
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem);
  line-height: 1.5;
  max-width: 24ch;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
}
@media (min-width: 860px) {
  .about__body { grid-template-columns: 0.95fr 1.05fr; align-items: start; }
}

.capabilities { display: grid; gap: 0.4rem; }
.capability {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.capability:last-child { border-bottom: 1px solid var(--line); }
.capability__no { color: var(--signal); font-size: 0.85rem; padding-top: 0.35rem; }
.capability__text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.capability__text p { color: var(--muted); margin: 0; max-width: 46ch; }

/* ---------- Stack ---------- */

.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(1.6rem, 3vw, 2.6rem);
}
.stack__label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.02);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.tags li:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- Work: album gallery ---------- */

.gallery {
  position: relative;
}
.gallery__viewport {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: clamp(1rem, 2.5vw, 2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--radius);
  outline: none;
}
.gallery__viewport::-webkit-scrollbar { display: none; }
.gallery__viewport:focus-visible {
  outline: 2px solid oklch(0.86 0.17 158 / 0.5);
  outline-offset: 4px;
}
.gallery__slide {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-width: 0;
  display: grid;
}
.gallery__slide > .feature {
  margin-bottom: 0;
  height: 100%;
}

.gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: clamp(1.2rem, 2.5vw, 1.8rem);
}
.gallery__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: oklch(1 0 0 / 0.02);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s var(--ease);
}
.gallery__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery__btn:hover:not(:disabled) {
  border-color: var(--signal);
  color: var(--signal);
  background: var(--signal-soft);
}
.gallery__btn:disabled {
  opacity: 0.32;
  cursor: default;
}
.gallery__dots {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.gallery__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.gallery__dot:hover { background: var(--muted); }
.gallery__dot.is-active {
  width: 24px;
  background: var(--signal);
}

/* ---------- Work: featured ---------- */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.6rem, 3vw, 2.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--signal-soft), transparent 55%),
    var(--surface);
  transition: border-color 0.4s var(--ease), transform 0.18s var(--ease);
  overflow: hidden;
  transform-style: preserve-3d;
}
.feature:hover { border-color: var(--line-strong); }
.feature__tag { color: var(--signal); font-size: 0.82rem; }
.feature__title {
  font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.4rem);
  margin: 0.7rem 0 1rem;
  letter-spacing: -0.03em;
}
.feature__desc { color: var(--muted); max-width: 44ch; margin: 0 0 1.4rem; }
.feature__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.feature__stack li { position: relative; }
.feature__stack li:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -0.7rem;
  color: var(--line-strong);
}
.feature__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 0.9rem;
}
.feature__link svg { width: 16px; height: 16px; fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease); }
.feature:hover .feature__link svg { transform: translateX(5px); }

/* device mockup as imagery */
.feature__art { display: flex; justify-content: center; }
.device {
  width: min(280px, 70vw);
  aspect-ratio: 9 / 17.5;
  border-radius: 32px;
  padding: 12px;
  background: linear-gradient(160deg, var(--surface-2), oklch(0.17 0 0));
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 0.8);
}
.device__screen {
  height: 100%;
  border-radius: 22px;
  background: var(--bg-2);
  padding: 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
}
.device__bubble {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.6rem 0.8rem;
  border-radius: 13px;
  max-width: 88%;
}
.device__bubble--in { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.device__bubble--out { align-self: flex-end; background: var(--signal); color: var(--on-signal); border-bottom-right-radius: 4px; }
.device__bubble--card {
  align-self: stretch;
  margin-top: auto;
  text-align: center;
  font-size: 0.7rem;
  color: var(--signal);
  background: var(--signal-soft);
  border: 1px dashed oklch(0.86 0.17 158 / 0.4);
}

@media (min-width: 720px) {
  .feature { grid-template-columns: 1.1fr 0.9fr; }
  .feature--reverse { grid-template-columns: 0.9fr 1.1fr; }
  .feature--reverse .feature__art { order: -1; }
}

@media (min-width: 720px) and (max-width: 959px) {
  .feature { gap: 1.5rem; }
  .device {
    width: min(240px, 100%);
    aspect-ratio: 9 / 15.5;
  }
}

.feature--reverse {
  background:
    radial-gradient(120% 140% at 0% 0%, var(--signal-soft), transparent 55%),
    var(--surface);
}

.mqlt-canvas,
.eq-canvas {
  width: min(430px, 100%);
  aspect-ratio: 19 / 12;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 0.8);
  transition: filter 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.feature:hover .mqlt-canvas,
.feature:hover .eq-canvas {
  filter: saturate(1.08);
  box-shadow: 0 34px 65px -28px oklch(0 0 0 / 0.9);
}

/* mock imagery enters once the card is revealed */
.js .feature .device__bubble {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.js .feature.is-in .device__bubble { opacity: 1; transform: none; }
.js .feature.is-in .device__bubble--in { transition-delay: 0.35s; }
.js .feature.is-in .device__bubble--out { transition-delay: 0.85s; }
.js .feature.is-in .device__bubble--card { transition-delay: 1.3s; }

/* ---------- Work: mini cards inside gallery ---------- */

.feature__pill {
  margin-left: 0.6rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.025);
  color: var(--project-accent, var(--signal));
  font-size: 0.68rem;
  vertical-align: 1px;
}
.feature__glyph {
  display: grid;
  place-items: center;
  width: clamp(120px, 18vw, 180px);
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: var(--project-soft, var(--signal-soft));
  color: var(--project-accent, var(--signal));
  font-size: clamp(2rem, 4vw, 3rem);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 0.8);
}
.feature--gh { --project-accent: oklch(0.8 0.02 160); --project-soft: oklch(0.8 0.02 160 / 0.08); }
.feature--gh .feature__tag { color: var(--project-accent); }
.feature--gh:hover { border-color: var(--project-accent); }

@media (max-width: 640px) {
  .feature__glyph { border-radius: 20px; }
  .device {
    width: min(230px, 68vw);
    aspect-ratio: 9 / 14;
  }
}

/* ---------- Links ---------- */

.friend-links__lede {
  max-width: 42ch;
  margin: 1rem 0 0;
  color: var(--muted);
}
.friend-links__grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.4rem);
}
.friend-link {
  min-width: 0;
  --friend-accent: var(--signal);
  --friend-soft: var(--signal-soft);
}
.friend-link > a {
  display: grid;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 100% at 100% 100%, var(--friend-soft), transparent 62%),
    oklch(1 0 0 / 0.015);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease);
}
.friend-link > a:hover {
  transform: translateY(-4px);
  border-color: var(--friend-accent);
  background:
    radial-gradient(110% 100% at 100% 100%, var(--friend-soft), transparent 62%),
    var(--surface);
}
.friend-link__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 220px;
  padding: clamp(1.3rem, 2.5vw, 1.7rem);
}
.friend-link__tag {
  color: var(--friend-accent);
  font-size: 0.76rem;
}
.friend-link h3 {
  margin: 0.6rem 0 0.55rem;
  font-size: 1.55rem;
}
.friend-link p {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.friend-link__host {
  margin-top: auto;
  overflow-wrap: anywhere;
  color: var(--friend-accent);
  font-size: 0.8rem;
}
.friend-link:nth-child(1) { --friend-accent: oklch(0.84 0.14 115); --friend-soft: oklch(0.84 0.14 115 / 0.1); }
.friend-link:nth-child(2) { --friend-accent: oklch(0.82 0.13 172); --friend-soft: oklch(0.82 0.13 172 / 0.11); }

@media (min-width: 700px) {
  .friend-links__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .friend-link__body { min-height: 0; padding: 1.15rem; }
  .friend-link h3 { font-size: 1.35rem; }
  .friend-link p { margin-bottom: 1rem; }
}

/* ---------- Contact ---------- */

.contact { text-align: center; }
.contact__inner { max-width: 720px; margin: 0 auto; }
.contact__title {
  font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}
.contact__title span { display: block; white-space: nowrap; }
.contact__lede { color: var(--muted); font-size: 1.15rem; margin: 0 auto 2.4rem; max-width: 40ch; }
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  margin-bottom: 2.4rem;
}
.socials {
  display: flex;
  gap: 1.6rem;
  justify-content: center;
  font-size: 0.92rem;
}
.socials a { color: var(--muted); transition: color 0.25s var(--ease); position: relative; }
.socials a:hover { color: var(--signal); }
.social-btn {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}
.social-btn:hover { color: var(--signal); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  align-items: center;
  justify-content: space-between;
  padding: 2rem var(--gutter) 2.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.site-footer__dim { color: oklch(0.55 0.01 160); }
.site-footer__links { display: flex; gap: 1.3rem; }
.site-footer__links a { color: var(--muted); transition: color 0.25s var(--ease); }
.site-footer__links a:hover { color: var(--signal); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 1.5rem);
  z-index: var(--z-toast);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--signal);
  box-shadow: 0 16px 45px -18px oklch(0 0 0 / 0.9);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .toast {
    top: 5rem;
    bottom: auto;
    max-width: calc(100vw - 2rem);
    transform: translate(-50%, -1rem);
    white-space: nowrap;
  }
  .toast.is-shown { transform: translate(-50%, 0); }
  .btn.is-copied {
    border-color: var(--signal);
    color: var(--signal);
    background: var(--signal-soft);
  }
}

@media (max-width: 360px) {
  .contact__title { font-size: clamp(2rem, 10.2vw, 2.25rem); }
}

/* ---------- Reveal (enhances visible baseline) ---------- */

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

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .status-dot, .hero__scroll-line { animation: none; }
  .btn, .project__link, .feature, .friend-link > a, .tags li { transition: none; }
  .page-field__glow { display: none; }
  .hero__art, .term__caret { animation: none; }
  .js .hero__art .term__line--boot { opacity: 1; transform: none; animation: none; }
  .js .feature .device__bubble { opacity: 1; transform: none; transition: none; }
  .mqlt-canvas { transition: none; }
}
