/* ==========================================================================
   NYZEX CORE STYLES: shared by nyzex.in and portfolio.nyzex.in
   Light, playful, sticker-ish. Page styles layer on top of this.
   ========================================================================== */

:root {
  --bg: #fbf6ee;
  --bg-2: #f3ece0;
  --card: #ffffff;
  --ink: #15171f;
  --ink-2: #4a4f60;
  --ink-3: #8a8f9e;
  --line: rgba(21, 23, 31, .12);
  --edge: #15171f;      /* outlines + offset shadows */
  --on-ink: #ffffff;    /* text on an ink-filled surface */
  --dark: #15171f;      /* text on bright yellow / mint / orange, same in both themes */
  --dot: rgba(21, 23, 31, .09);
  --nav-bg: rgba(255, 255, 255, .86);
  --mark-o: 1;
  color-scheme: light;

  --blue: #2f6bff;
  --blue-soft: #dbe6ff;
  --yellow: #ffc83d;
  --yellow-soft: #fff1c7;
  --pink: #ff6f9f;
  --pink-soft: #ffdbe7;
  --mint: #22c993;
  --mint-soft: #d2f6e8;
  --purple: #8a67ff;
  --purple-soft: #e7defe;
  --orange: #ff8a3d;
  --orange-soft: #ffe2cf;

  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r: 22px;
  --border: 2px solid var(--edge);
  --shadow: 5px 5px 0 var(--edge);
  --shadow-lg: 8px 8px 0 var(--edge);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --nav-h: 76px;
}

/* ---------- dark theme (default; light is opt-in via data-theme="light") ---------- */
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0f1118;
  --bg-2: #1a1d28;
  --card: #181b26;
  --ink: #f3efe6;
  --ink-2: #b6bacb;
  --ink-3: #80869b;
  --line: rgba(243, 239, 230, .12);
  --edge: #e9e4d8;
  --on-ink: #0f1118;
  --dot: rgba(243, 239, 230, .07);
  --nav-bg: rgba(24, 27, 38, .86);
  --mark-o: .5;
  --blue: #4a7dff;
  --blue-soft: #1d2b52;
  --yellow-soft: #3b3117;
  --pink-soft: #43202f;
  --mint-soft: #133b2f;
  --purple-soft: #2b2250;
  --orange-soft: #432817;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-padding-top: calc(var(--nav-h) + 16px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; text-rendering: optimizeLegibility;
}
/* faint dotted paper */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask: linear-gradient(to bottom, #000, rgba(0,0,0,.35));
  mask: linear-gradient(to bottom, #000, rgba(0,0,0,.35));
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: var(--dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.nx-sky, .nx-grain { display: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.nx-mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.nx-dim { color: var(--ink-3); }
.nx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); animation: nx-blink 2s ease-in-out infinite; }
@keyframes nx-blink { 50% { box-shadow: 0 0 0 6px rgba(34,201,147,.12); } }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- logo (NyZ mark recoloured through a mask) ---------- */
.nx-logo {
  display: inline-block; height: 40px; aspect-ratio: 607 / 284; background: currentColor;
  -webkit-mask: var(--nx-logo) center / contain no-repeat; mask: var(--nx-logo) center / contain no-repeat;
}

/* ---------- headings ---------- */
.h-xl, .h-lg, .h-md { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: .95; margin: 0; font-variation-settings: 'opsz' 96; }
.h-xl { font-size: clamp(52px, 9.4vw, 140px); }
.h-lg { font-size: clamp(40px, 6vw, 84px); }
.h-md { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -0.025em; }
.lede { font-size: clamp(17px, 1.5vw, 21px); color: var(--ink-2); line-height: 1.6; margin: 0; }

/* highlighter / scribble emphasis */
.mark { position: relative; white-space: nowrap; z-index: 0; }
.mark::before {
  content: ''; position: absolute; z-index: -1; left: -.08em; right: -.08em; bottom: .06em; height: .42em;
  background: var(--mark, var(--yellow)); opacity: var(--mark-o); border-radius: .2em; transform: rotate(-1.5deg) scaleX(var(--mx, 1)); transform-origin: 0 50%;
  transition: transform 1s var(--ease) .3s;
}
.nx-js .mark[data-reveal]::before, .nx-js [data-reveal] .mark::before { --mx: 0; }
.nx-js .is-in .mark::before, .nx-js .mark.is-in::before { --mx: 1; }
.c-blue { color: var(--blue); }
.c-pink { color: var(--pink); }

/* eyebrow tag */
.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--card); border: var(--border); font-weight: 700; font-size: 14px; box-shadow: 3px 3px 0 var(--edge);
}
.tag .em { font-size: 18px; line-height: 1; display: inline-block; }
.tag:hover .em { animation: nx-wave 1s ease-in-out; }
@keyframes nx-wave { 20% { transform: rotate(18deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(14deg); } 80% { transform: rotate(-4deg); } }

/* ---------- buttons ---------- */
.btn {
  --b: var(--card); --f: var(--ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px; border: var(--border);
  background: var(--b); color: var(--f); font-weight: 700; font-size: 16px; white-space: nowrap;
  box-shadow: 4px 4px 0 var(--edge); transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--edge); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--edge); }
.btn svg { width: 18px; height: 18px; transition: transform .4s var(--bounce); }
.btn:hover svg { transform: translateX(3px) rotate(-8deg); }
.btn--blue { --b: var(--blue); --f: #fff; }
.btn--yellow { --b: var(--yellow); --f: var(--dark); }
.btn--pink { --b: var(--pink); --f: #fff; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; box-shadow: 3px 3px 0 var(--edge); }
.btn--sm:hover { box-shadow: 4px 4px 0 var(--edge); }

/* chips */
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); border: 1.5px solid var(--line); white-space: nowrap; }

/* keyboard key */
.nx-kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px;
  border: 1.5px solid var(--edge); border-bottom-width: 3px; background: var(--card); font-family: var(--mono); font-size: 13px; line-height: 1; color: var(--ink);
}

/* animated underline link */
.nx-u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .45s var(--ease); padding-bottom: 1px; }
.nx-u:hover { background-size: 100% 2px; }

/* ---------- card base ---------- */
.card {
  background: var(--card); border: var(--border); border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}

/* ---------- page transition curtain (three coloured panels) ---------- */
.nx-curtain {
  position: fixed; inset: 0; z-index: 200; pointer-events: none; display: grid; place-items: center;
  background: var(--blue); color: #fff; transform: translateY(calc(100% + 80px));
}
.nx-curtain::before, .nx-curtain::after { content: ''; position: absolute; left: 0; right: 0; height: 36px; }
.nx-curtain::before { top: -36px; background: var(--yellow); }
.nx-curtain::after { top: -72px; background: var(--pink); }
.nx-curtain .nx-logo { height: clamp(60px, 9vw, 110px); animation: nx-bob 1s ease-in-out infinite; }
@keyframes nx-bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.nx-booted .nx-curtain { transform: none; }
.nx-curtain.is-leaving { transform: translateY(calc(-100% - 80px)); transition: transform .8s var(--ease-io); }
.nx-curtain.is-covering { transform: none; transition: transform .65s var(--ease-io); pointer-events: all; }
.nx-curtain.is-reset { transform: translateY(calc(100% + 80px)); transition: none; }

/* ---------- reveals ---------- */
.nx-w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .05em .14em; margin: 0 -.05em -.14em; }
.nx-wi, .nx-c { display: inline-block; }
.nx-js [data-split] .nx-c,
.nx-js [data-split] .nx-wi { transform: translate3d(0, 110%, 0) rotate(8deg); transform-origin: 0 100%; transition: transform .9s var(--bounce); transition-delay: calc(var(--i, 0) * 28ms + var(--d, 0ms)); }
.nx-js [data-split].is-in .nx-c,
.nx-js [data-split].is-in .nx-wi { transform: none; }

.nx-js [data-reveal] { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
.nx-js [data-reveal].is-in { opacity: 1; transform: none; }
.nx-js [data-reveal="pop"] { transform: scale(.85) rotate(var(--pr, -4deg)); transition: opacity .5s var(--ease), transform .9s var(--bounce); transition-delay: var(--d, 0ms); }
.nx-js [data-reveal="pop"].is-in { transform: none; }
.nx-js [data-reveal="fade"] { transform: none; }

/* scroll-scrubbed words */
.nx-sw { color: var(--ink-3); opacity: .45; transition: color .35s, opacity .35s; }
.nx-sw.is-lit { color: inherit; opacity: 1; }

/* ---------- marquee ---------- */
.nx-marquee { overflow: hidden; white-space: nowrap; user-select: none; }
.nx-marquee__track { display: inline-flex; will-change: transform; }
.nx-marquee__track > * { flex: none; }

/* ---------- toast ---------- */
.nx-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 210; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 15px;
  box-shadow: 4px 4px 0 var(--yellow);
  transform: translate(-50%, 30px) scale(.9); opacity: 0; transition: transform .5s var(--bounce), opacity .3s; pointer-events: none;
}
.nx-toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- terminal easter egg (stays dark: it is a terminal) ---------- */
.nx-term {
  position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(21, 23, 31, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s .3s;
}
.nx-term.is-open { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
.nx-term__win {
  width: min(760px, 100%); height: min(520px, 76svh); display: flex; flex-direction: column;
  background: #12141c; color: #c9cede; border: var(--border); border-radius: 16px; box-shadow: 8px 8px 0 var(--yellow);
  font-family: var(--mono); font-size: 14px; line-height: 1.6; overflow: hidden;
  transform: translateY(20px) scale(.96) rotate(-1deg); transition: transform .5s var(--bounce);
}
.nx-term.is-open .nx-term__win { transform: none; }
.nx-term__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #1c1f2a; color: #8a90a4; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,.06); }
.nx-term__bar .dots { display: flex; gap: 6px; }
.nx-term__bar .dots i { width: 11px; height: 11px; border-radius: 50%; }
.nx-term__bar .dots i:first-child { background: #ff5f57; }
.nx-term__bar .dots i:nth-child(2) { background: #febc2e; }
.nx-term__bar .dots i:nth-child(3) { background: #28c840; }
.nx-term__x { margin-left: auto; font-family: var(--mono); font-size: 11px; color: #8a90a4; padding: 2px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; }
.nx-term__x:hover { color: #fff; }
.nx-term__out { flex: 1; overflow-y: auto; padding: 16px 18px 4px; white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain; }
.nx-term__out .c { color: #fff; }
.nx-term__out .b { color: #8db4ff; }
.nx-term__out .g { color: #4ee3a8; }
.nx-term__out .d { color: #6e7489; }
.nx-term__out .r { color: #ff8a8a; }
.nx-term__out a { color: #8db4ff; text-decoration: underline; text-underline-offset: 3px; }
.nx-term__line { display: flex; gap: 10px; align-items: center; padding: 8px 18px 16px; }
.nx-term__ps { color: #4ee3a8; white-space: nowrap; }
.nx-term__line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; caret-color: var(--yellow); }

/* ---------- sticker playground (toy.js) ---------- */
.toy { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.toy__s {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; text-align: center;
  border-radius: 50%; border: var(--border); box-shadow: 3px 3px 0 var(--edge);
  font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  cursor: grab; touch-action: none; will-change: transform; background: var(--card);
}
.toy__s.is-grab { cursor: grabbing; box-shadow: 6px 8px 0 var(--edge); z-index: 3; }
.toy__s img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; pointer-events: none; -webkit-user-drag: none; }
.toy__s small { display: block; font-family: var(--sans); font-weight: 700; font-size: 10px; letter-spacing: .02em; margin-top: 3px; opacity: .8; }
.toy__hint { position: absolute; z-index: 4; top: 14px; left: 50%; transform: translateX(-50%); pointer-events: none; transition: opacity .6s; }
.toy.is-touched .toy__hint { opacity: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .nx-js [data-reveal], .nx-js [data-split] .nx-c, .nx-js [data-split] .nx-wi { opacity: 1 !important; transform: none !important; }
}

/* rotated strips and floating stickers may poke past the edges */
html, body { overflow-x: clip; }

/* ---------- theme switch ---------- */
.nx-theme { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--ink); transition: border-color .3s, background .3s, rotate .5s var(--bounce); flex: none; }
.nx-theme:hover { border-color: var(--edge); background: var(--yellow-soft); rotate: -20deg; }
.nx-theme svg { width: 19px; height: 19px; position: absolute; transition: scale .5s var(--bounce), rotate .5s var(--bounce), opacity .3s; }
.nx-theme .i-sun { scale: 0; rotate: -90deg; opacity: 0; }
:root:not([data-theme="light"]) .nx-theme .i-sun { scale: 1; rotate: 0deg; opacity: 1; }
:root:not([data-theme="light"]) .nx-theme .i-moon { scale: 0; rotate: 90deg; opacity: 0; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
