/* firzan.dev look: dark editorial, Geist type, lime accent with violet glow, bento grids. */
:root {
  --bg: #08090a;
  --bg-2: #0d0f11;
  --card: #111316;
  --card-2: #15181c;
  --ink: #f2f2ef;
  --muted: #8b9098;
  --dim: #5b6068;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --lime: #d4ff3f;
  --violet: #8b6cff;
  --cyan: #3ee6d1;
  --up: #3ddc84;
  --down: #ff5c5c;
  --sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 96px; background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
::selection { background: var(--lime); color: #000; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
img, svg { max-width: 100%; }

/* ambient background: grid + glows */
.bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bgfx::before { content: ""; position: absolute; inset: -1px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); opacity: .55; }
.bgfx i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .38; }
.bgfx i:nth-child(1) { width: 520px; height: 520px; background: var(--violet); top: -220px; left: -120px; }
.bgfx i:nth-child(2) { width: 420px; height: 420px; background: var(--lime); top: -260px; right: -140px; opacity: .16; }

/* floating nav */
.nav { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: rgba(17, 19, 22, .72); border: 1px solid var(--line-2); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 10px 40px rgba(0,0,0,.45); max-width: calc(100vw - 24px); }
.nav .logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--lime); color: #000; font: 600 15px var(--sans); text-decoration: none; flex: none; }
.nav .links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav .links::-webkit-scrollbar { display: none; }
.nav .links a { font: 500 14px var(--sans); color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; white-space: nowrap; transition: color .2s, background .2s; }
.nav .links a:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.nav .links a[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.1); }
.nav .cta { font: 600 14px var(--sans); color: #000; background: var(--ink); text-decoration: none; padding: 8px 16px; border-radius: 999px; white-space: nowrap; flex: none; }
@media (max-width: 640px) { .nav .cta { display: none; } .nav .links a { padding: 8px 10px; font-size: 13px; } }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }
section { padding: 110px 0 0; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--lime); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; letter-spacing: -.035em; }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.02; margin-bottom: 18px; }
h2 em, h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--lime); }
h3 { font-size: 1.15rem; letter-spacing: -.02em; }
p { margin: 0; }
.sub { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* hero */
.hero { padding-top: 150px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; padding-top: 120px; } }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font: 500 13px var(--sans); color: var(--muted); margin-bottom: 28px; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } }
.hero h1 { font-size: clamp(2.7rem, 6.2vw, 4.9rem); line-height: 1; }
.hero .name { font: 500 15px var(--mono); color: var(--muted); margin: 26px 0 0; }
.hero .name b { color: var(--ink); font-weight: 500; }
.hero .sub { margin-top: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font: 600 15px var(--sans); text-decoration: none; border: 1px solid var(--line-2); color: var(--ink); background: rgba(255,255,255,.03); transition: transform .2s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.06); }
.btn.primary { background: var(--lime); color: #000; border-color: var(--lime); }
.btn.primary:hover { background: #e2ff7a; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* terminal card */
.term { border-radius: var(--r); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); overflow: hidden; position: relative; }
.term::after { content: ""; position: absolute; inset: -40% -20% auto auto; width: 300px; height: 300px; background: radial-gradient(circle, rgba(139,108,255,.35), transparent 65%); pointer-events: none; }
.term .bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term .bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a2d33; }
.term .bar span { margin-left: 8px; font: 500 12px var(--mono); color: var(--dim); }
.term pre { margin: 0; padding: 16px 18px 20px; font: 12.5px/1.75 var(--mono); color: var(--muted); height: 300px; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.term .k { color: var(--violet); } .term .s { color: var(--cyan); } .term .ok { color: var(--up); } .term .bad { color: var(--down); } .term .hl { color: var(--lime); }
.term .cursor { display: inline-block; width: 7px; height: 14px; background: var(--lime); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 90px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); }
.stats > div { background: var(--bg-2); padding: 26px 24px; }
.stats b { display: block; font: 600 clamp(2rem, 4vw, 2.9rem)/1 var(--sans); letter-spacing: -.04em; }
.stats b small { font-size: .5em; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stats > div > span { display: block; margin-top: 10px; font-size: .92rem; color: var(--muted); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }

/* companies marquee */
.marquee { margin-top: 70px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee .track { display: flex; gap: 64px; width: max-content; animation: slide 32s linear infinite; }
.marquee span { font: 600 1.35rem var(--sans); letter-spacing: -.03em; color: var(--dim); white-space: nowrap; }
.marquee span em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--muted); }
@keyframes slide { to { transform: translateX(-50%); } }

/* bento */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.tile { position: relative; grid-column: span 2; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 26px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; text-decoration: none; color: inherit; min-width: 0; transition: border-color .25s, transform .25s; isolation: isolate; }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(212,255,63,.07), transparent 45%); opacity: 0; transition: opacity .3s; }
a.tile:hover { border-color: var(--line-2); transform: translateY(-3px); }
a.tile:hover::before { opacity: 1; }
.tile.w4 { grid-column: span 4; } .tile.w3 { grid-column: span 3; } .tile.w6 { grid-column: span 6; }
.tile .lbl { font: 500 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.tile h3 { font-size: 1.6rem; letter-spacing: -.035em; }
.tile p { color: var(--muted); font-size: .97rem; }
.tile .more { margin-top: auto; padding-top: 8px; font: 600 14px var(--sans); color: var(--lime); }
.tile .viz { margin: 4px -26px -26px; }
@media (max-width: 900px) { .tile, .tile.w4, .tile.w3 { grid-column: span 6; } }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 500 12px/1 var(--mono); padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: rgba(255,255,255,.02); transition: color .2s, border-color .2s; }
.pill:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }

/* experience */
.exp { margin-top: 40px; display: grid; gap: 16px; }
.role { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; padding: 34px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
@media (max-width: 860px) { .role { grid-template-columns: 1fr; gap: 14px; padding: 24px; } }
.role .co { display: grid; gap: 6px; align-content: start; }
.role .co b { font-size: 1.5rem; letter-spacing: -.035em; font-weight: 600; }
.role .co .when { font: 500 13px var(--mono); color: var(--lime); }
.role .co .where { font-size: .9rem; color: var(--dim); }
.role h3 { font-size: 1.12rem; margin-bottom: 14px; }
.role h3 small { color: var(--dim); font-weight: 400; }
.wins { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wins li { position: relative; padding-left: 22px; color: var(--muted); }
.wins li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--violet); transform: rotate(45deg); }
.wins b { color: var(--ink); font-weight: 600; }
.metric { font-family: var(--mono); color: var(--lime); font-size: .95em; }
.role details { margin-top: 14px; }
.role summary { cursor: pointer; font: 600 14px var(--sans); color: var(--muted); list-style: none; }
.role summary::-webkit-details-marker { display: none; }
.role summary::before { content: "+ "; color: var(--lime); }
.role details[open] summary::before { content: "− "; }
.role details .wins { margin-top: 12px; }

/* skills */
.skillgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
@media (max-width: 900px) { .skillgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .skillgrid { grid-template-columns: 1fr; } }
.skillgrid > div { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 24px; }
.skillgrid h3 { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.skillgrid h3 i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(212,255,63,.1); color: var(--lime); font-style: normal; font-size: 14px; }

/* small lists */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.duo > div { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 28px; }
.li { display: grid; gap: 3px; padding: 16px 0; border-top: 1px solid var(--line); }
.li:first-of-type { border-top: 0; padding-top: 4px; }
.li b { font-weight: 600; letter-spacing: -.01em; }
.li .m { font: 500 12.5px var(--mono); color: var(--lime); }
.li span:not(.m) { color: var(--muted); font-size: .95rem; }

/* contact */
.contact { margin-top: 110px; border-radius: 28px; padding: clamp(36px, 7vw, 80px); background: radial-gradient(600px circle at 15% 0%, rgba(139,108,255,.35), transparent 60%), radial-gradient(500px circle at 100% 100%, rgba(212,255,63,.16), transparent 55%), var(--card); border: 1px solid var(--line-2); text-align: left; overflow: hidden; }
.contact h2 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: .98; }
.contact .btns { margin-top: 30px; }

footer { margin-top: 70px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--dim); font-size: .9rem; }
footer .in { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer a { color: var(--muted); text-decoration: none; margin-left: 18px; }
footer a:hover { color: var(--ink); }

/* trading page bits */
.tbl { overflow-x: auto; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); margin-top: 30px; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line); }
th { font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--up); } .neg { color: var(--down); }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); }
caption { caption-side: bottom; text-align: left; padding: 14px 20px; color: var(--dim); font-size: .85rem; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; counter-reset: f; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .flow { grid-template-columns: 1fr; } }
.flow > div { counter-increment: f; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 24px; display: grid; gap: 8px; align-content: start; }
.flow > div::before { content: "0" counter(f); font: 500 12px var(--mono); color: var(--lime); }
.flow .t { font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.flow p { color: var(--muted); font-size: .95rem; }
.rules { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px; color: var(--muted); }
.rules li::before { content: counter(r, decimal-leading-zero); font: 500 13px/1.75 var(--mono); color: var(--lime); }
.rules b { color: var(--ink); font-weight: 600; }
.notebox { margin-top: 30px; border-radius: var(--r); padding: 18px 22px; border: 1px dashed var(--line-2); color: var(--muted); display: flex; gap: 12px; align-items: center; }
.notebox::before { content: "🔒"; }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .marquee .track, .badge .dot, .term .cursor { animation: none; }
}

@media (max-width: 440px) { .nav .links a[href$="#stack"], .nav .links a[href$="#work"] { display: none; } }

/* trading section tabs, under the main nav */
.subnav { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 49; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(17,19,22,.72); border: 1px solid var(--line-2); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { font: 500 13px var(--mono); color: var(--muted); text-decoration: none; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--lime); color: #000; }
.subnav + main .hero { padding-top: 190px; }
.subnav + main.desk, .subnav + main.hist { padding-top: 160px; }
@media (max-width: 960px) { .subnav + main .hero { padding-top: 165px; } }
@media (max-width: 440px) { .subnav a { padding: 7px 10px; font-size: 12px; } }

/* ── motion ─────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 80; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--violet), var(--lime)); pointer-events: none; }
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .04em .02em .2em; margin: -.04em -.02em -.2em; }
[data-split] .w > span { display: inline-block; transform: translateY(110%); animation: wordup .9s cubic-bezier(.2, .75, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes wordup { to { transform: none; } }
.bgfx i { transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.tile, .role, .skillgrid > div, .flow > div { transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .25s; transform-style: preserve-3d; }
.cdl { animation: cdl .55s cubic-bezier(.2, .8, .2, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes cdl { from { opacity: 0; transform: scaleY(.1); } }
.drawline { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 2.2s .4s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.term { animation: float 7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  [data-split] .w > span { transform: none; animation: none; }
  .cdl, .drawline, .float, .term { animation: none; stroke-dasharray: none; }
  .progress { display: none; }
}

/* simple pager under long tables */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 20px 14px; font: 500 13px var(--mono, monospace); color: var(--muted, #9aa); }
.pager button { font: inherit; color: inherit; background: none; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager:empty { display: none; }

/* ── motion (motion.js): all of it is off with reduced motion ── */
@media (prefers-reduced-motion: no-preference) {
  body { animation: mo-fade .45s ease-out both; }
  @keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
  .mo-rv { opacity: 0; transform: translateY(16px) scale(.995); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
  .mo-rv.mo-in { opacity: 1; transform: none; }
  .card:not(:has(#bv)):not(:has(iframe)), .panel { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .card:not(:has(#bv)):not(:has(iframe)):hover, .panel:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 0 0 1px rgba(212,255,63,.08); }
  .card:has(#bv) { transition: box-shadow .3s ease; }
  .card:has(#bv):hover { box-shadow: 0 0 0 1px rgba(212,255,63,.10), 0 14px 40px rgba(0,0,0,.35); }
  main button { transition: transform .12s ease, background .2s, color .2s; }
  main button:active { transform: scale(.96); }
  main tbody tr { transition: background .2s ease; }
  main tbody tr:hover { background: rgba(255,255,255,.035); }
  .mo-up { animation: mo-up 1.1s ease-out; border-radius: 4px; }
  .mo-down { animation: mo-down 1.1s ease-out; border-radius: 4px; }
  @keyframes mo-up { 0% { background: rgba(61,220,132,.30); text-shadow: 0 0 10px rgba(61,220,132,.6); } 100% { background: transparent; text-shadow: none; } }
  @keyframes mo-down { 0% { background: rgba(255,92,92,.30); text-shadow: 0 0 10px rgba(255,92,92,.6); } 100% { background: transparent; text-shadow: none; } }
  .mo-shim { background: linear-gradient(90deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.14) 40%, rgba(255,255,255,0) 60%); background-size: 300% 100%; animation: mo-shim 1.6s ease-in-out infinite; border-radius: 6px; }
  @keyframes mo-shim { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
}
