/* ---------- Fonts: Iosevka Nerd Font Mono (subset) ---------- */
@font-face {
  font-family: "Iosevka NFM";
  src: local("Iosevka Nerd Font Mono"), local("IosevkaNerdFontMono-Regular"),
       url("../fonts/iosevka-nfm-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Iosevka NFM";
  src: local("Iosevka Nerd Font Mono Medium"), local("IosevkaNerdFontMono-Medium"),
       url("../fonts/iosevka-nfm-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Iosevka NFM";
  src: local("Iosevka Nerd Font Mono Bold"), local("IosevkaNerdFontMono-Bold"),
       url("../fonts/iosevka-nfm-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Iosevka NFM";
  src: local("Iosevka Nerd Font Mono ExtraBold"), local("IosevkaNerdFontMono-ExtraBold"),
       url("../fonts/iosevka-nfm-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

/* ---------- Catppuccin flavors ---------- */
:root, [data-flavor="mocha"] {
  --rosewater:#f5e0dc; --flamingo:#f2cdcd; --pink:#f5c2e7; --mauve:#cba6f7; --red:#f38ba8; --maroon:#eba0ac;
  --peach:#fab387; --yellow:#f9e2af; --green:#a6e3a1; --teal:#94e2d5; --sky:#89dceb; --sapphire:#74c7ec;
  --blue:#89b4fa; --lavender:#b4befe; --text:#cdd6f4; --subtext1:#bac2de; --subtext0:#a6adc8;
  --overlay2:#9399b2; --overlay1:#7f849c; --overlay0:#6c7086; --surface2:#585b70; --surface1:#45475a;
  --surface0:#313244; --base:#1e1e2e; --mantle:#181825; --crust:#11111b;
  color-scheme: dark;
}
[data-flavor="macchiato"] {
  --rosewater:#f4dbd6; --flamingo:#f0c6c6; --pink:#f5bde6; --mauve:#c6a0f6; --red:#ed8796; --maroon:#ee99a0;
  --peach:#f5a97f; --yellow:#eed49f; --green:#a6da95; --teal:#8bd5ca; --sky:#91d7e3; --sapphire:#7dc4e4;
  --blue:#8aadf4; --lavender:#b7bdf8; --text:#cad3f5; --subtext1:#b8c0e0; --subtext0:#a5adcb;
  --overlay2:#939ab7; --overlay1:#8087a2; --overlay0:#6e738d; --surface2:#5b6078; --surface1:#494d64;
  --surface0:#363a4f; --base:#24273a; --mantle:#1e2030; --crust:#181926;
  color-scheme: dark;
}
[data-flavor="frappe"] {
  --rosewater:#f2d5cf; --flamingo:#eebebe; --pink:#f4b8e4; --mauve:#ca9ee6; --red:#e78284; --maroon:#ea999c;
  --peach:#ef9f76; --yellow:#e5c890; --green:#a6d189; --teal:#81c8be; --sky:#99d1db; --sapphire:#85c1dc;
  --blue:#8caaee; --lavender:#babbf1; --text:#c6d0f5; --subtext1:#b5bfe2; --subtext0:#a5adce;
  --overlay2:#949cbb; --overlay1:#838ba7; --overlay0:#737994; --surface2:#626880; --surface1:#51576d;
  --surface0:#414559; --base:#303446; --mantle:#292c3c; --crust:#232634;
  color-scheme: dark;
}
[data-flavor="latte"] {
  --rosewater:#dc8a78; --flamingo:#dd7878; --pink:#ea76cb; --mauve:#8839ef; --red:#d20f39; --maroon:#e64553;
  --peach:#fe640b; --yellow:#df8e1d; --green:#40a02b; --teal:#179299; --sky:#04a5e5; --sapphire:#209fb5;
  --blue:#1e66f5; --lavender:#7287fd; --text:#4c4f69; --subtext1:#5c5f77; --subtext0:#6c6f85;
  --overlay2:#7c7f93; --overlay1:#8c8fa1; --overlay0:#9ca0b0; --surface2:#acb0be; --surface1:#bcc0cc;
  --surface0:#ccd0da; --base:#eff1f5; --mantle:#e6e9ef; --crust:#dce0e8;
  color-scheme: light;
}

:root {
  --font: "Iosevka NFM", "Iosevka Nerd Font Mono", "Iosevka", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --accent: var(--mauve);
  --radius: 14px;
  --gutter: 28px;
  --maxw: 1120px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: contextual;
  transition: background-color .4s ease, color .4s ease;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--mauve) 35%, transparent); color: var(--text); }
a { color: inherit; text-decoration: none; }
p a { color: var(--blue); border-bottom: 1px dashed color-mix(in srgb, var(--blue) 50%, transparent); }
p a:hover { color: var(--sapphire); }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
strong { color: var(--text); font-weight: 700; }
em { font-style: normal; color: var(--mauve); }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
.nf { font-style: normal; font-family: var(--font); line-height: 1; font-size: 1.4em; display: inline-block; text-align: center; min-width: 1em; vertical-align: -.08em; }
:focus-visible { outline: 2px solid var(--mauve); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.c-red{color:var(--red)} .c-green{color:var(--green)} .c-sky{color:var(--sky)} .c-mauve{color:var(--mauve)}
.bg-red{background:var(--red)} .bg-peach{background:var(--peach)} .bg-yellow{background:var(--yellow)} .bg-green{background:var(--green)}
.bg-teal{background:var(--teal)} .bg-blue{background:var(--blue)} .bg-mauve{background:var(--mauve)} .bg-pink{background:var(--pink)}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .72em 1.35em; border-radius: 999px;
  font: 600 15px/1 var(--font); letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--mauve); color: var(--crust); }
.btn--primary:hover { box-shadow: 0 8px 28px -8px color-mix(in srgb, var(--mauve) 70%, transparent); }
.btn--ghost { border-color: var(--surface1); color: var(--subtext1); background: color-mix(in srgb, var(--mantle) 60%, transparent); }
.btn--ghost:hover { border-color: var(--mauve); color: var(--mauve); }
.btn--sm { padding: .6em 1.1em; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--base) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--surface0) 70%, transparent);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.logo { font-weight: 800; font-size: 19px; color: var(--text); display: inline-flex; align-items: center; letter-spacing: -.01em; }
.logo__dot { color: var(--green); }
.logo__cursor { width: .55em; height: 1.05em; margin-left: 3px; background: var(--mauve); animation: blink 1.6s ease-in-out infinite; }
.nav__links { display: flex; gap: 30px; }
.nav__links a {
  font-size: 14px; color: var(--overlay2); letter-spacing: .06em; position: relative; padding: 4px 0;
  transition: color .2s ease;
}
.nav__links a::before { content: "./"; color: var(--surface2); opacity: 0; margin-right: 1px; transition: opacity .2s ease; }
.nav__links a:hover, .nav__links a.active { color: var(--text); }
.nav__links a:hover::before, .nav__links a.active::before { opacity: 1; color: var(--green); }
.nav__actions { display: flex; align-items: center; gap: 12px; }

.flavor {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--mantle); border: 1px solid var(--surface0); color: var(--subtext0);
  font: 500 13px/1 var(--font); cursor: pointer; transition: border-color .2s ease, color .2s ease;
}
.flavor:hover { border-color: var(--surface2); color: var(--text); }
.flavor__dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(var(--red), var(--peach), var(--yellow), var(--green), var(--teal), var(--blue), var(--mauve), var(--pink), var(--red));
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 104px; overflow: hidden; }
.hero__grid {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 78% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 80% at 78% 45%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.08fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--green); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 26px; }
.eyebrow__rule { width: 34px; height: 1px; background: var(--green); flex: none; }
.hero__title { text-wrap: balance; font-size: clamp(2.5rem, 5.2vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; }
.hero__lead { margin-top: 26px; max-width: 34em; color: var(--subtext0); font-size: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- Terminal windows ---------- */
.term {
  background: var(--crust);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.6), 0 0 0 1px color-mix(in srgb, var(--mauve) 6%, transparent);
}
.term__bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--mantle); border-bottom: 1px solid var(--surface0);
}
.term__dots { display: inline-flex; gap: 7px; }
.term__dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--red); }
.term__dots i:nth-child(2) { background: var(--yellow); }
.term__dots i:nth-child(3) { background: var(--green); }
.term__title { font-size: 12.5px; color: var(--overlay1); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__body { padding: 20px 22px 22px; font-size: 14.5px; line-height: 1.6; }
.code { margin: 0; color: var(--subtext1); white-space: pre; overflow-x: auto; font-family: var(--font); }
.c-com { color: var(--overlay0); font-style: italic; }
.c-hdr { color: var(--mauve); font-weight: 700; }
.c-key { color: var(--blue); }
.c-str { color: var(--green); }
.c-bool { color: var(--peach); }

.term--hero { position: relative; }
/* Kali-style two-line zsh prompt; line-height: normal lets the box-drawing corners join across lines */
.prompt { color: var(--text); margin-bottom: 18px; line-height: normal; }
.prompt > div { white-space: nowrap; }
.p-line, .p-user { color: var(--sapphire); }
.p-at { color: var(--mauve); }
.p-host, .p-path, .p-cmd { color: var(--green); }
.p-sym { color: var(--text); font-weight: 700; }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--rosewater); vertical-align: -.18em; margin-left: 2px; animation: blink 1.6s ease-in-out infinite; }

.ff { display: flex; gap: 22px; align-items: flex-start; transition: opacity .5s ease; }
.js .ff.pending { opacity: 0; }
.ff__logo { margin: 4px 0 0; color: var(--mauve); font-family: var(--font); font-size: 15px; line-height: 1.15; flex: none; }
.ff__logo b { color: var(--peach); font-weight: 400; }
.ff__info { font-size: 14px; line-height: 1.6; min-width: 0; }
.ff__info > div { display: flex; gap: .6em; }
.ff__info dt { color: var(--blue); font-weight: 700; flex: none; }
.ff__info dt::after { content: ":"; color: var(--overlay1); }
.ff__info dd { color: var(--subtext1); min-width: 0; }
.ff__info > .ff__head { display: block; font-weight: 700; color: var(--text); }
.ff__rule { color: var(--surface2); }
.ff__swatches { margin-top: 10px; gap: 0 !important; }
.ff__swatches i { width: 22px; height: 14px; }

/* ---------- Stats ---------- */
.stats { background: var(--mantle); border-block: 1px solid var(--surface0); transition: background-color .4s ease; }
.stats__inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 38px; }
.stat__num { display: block; font-size: 40px; font-weight: 800; color: var(--mauve); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: 12px; font-size: 12.5px; color: var(--overlay1); letter-spacing: .14em; text-transform: uppercase; line-height: 1.5; }

/* ---------- Sections ---------- */
.section { padding: 120px 0 40px; }
.label { color: var(--green); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 18px; }
.label::before { content: "# "; color: var(--surface2); }
.section__title { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 56px; max-width: 30ch; text-wrap: balance; }

/* About */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.about__copy p { color: var(--subtext0); font-size: 17.5px; margin-bottom: 22px; }
.facts { margin-top: 34px; display: grid; gap: 0; border-top: 1px solid var(--surface0); }
.facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--surface0); font-size: 15px; }
.facts dt { color: var(--overlay1); display: flex; align-items: baseline; gap: .6em; }
.facts dt .nf { color: var(--peach); width: 1.1em; }
.facts dd { color: var(--subtext1); }

/* Timeline */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px;
  background: linear-gradient(to bottom, var(--mauve), var(--green) 55%, var(--surface0));
  border-radius: 2px;
}
.tl { position: relative; padding-bottom: 54px; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: -39px; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--base); border: 2px solid var(--green);
}
.tl--current::before { background: var(--mauve); border-color: var(--mauve); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mauve) 22%, transparent), 0 0 22px color-mix(in srgb, var(--mauve) 60%, transparent); }
.tl__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 12px; }
.tl h3 { font-size: 22px; font-weight: 700; }
.tl__org { color: var(--green); font-weight: 600; }
.tl--current .tl__org { color: var(--mauve); }
.tl__when { font-size: 13.5px; color: var(--overlay1); letter-spacing: .05em; white-space: nowrap; }
.tl p { color: var(--subtext0); max-width: 46em; }
.tl__link { display: inline-flex; align-items: center; gap: .55em; margin-top: 18px; font-size: 14px; color: var(--mauve); border-bottom: 1px solid color-mix(in srgb, var(--mauve) 40%, transparent); padding-bottom: 2px; transition: color .2s ease, border-color .2s ease, gap .2s ease; }
.tl__link:hover { color: var(--pink); border-color: var(--pink); gap: .8em; }
.tl__link .nf { color: var(--green); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; line-height: 1.5;
  color: var(--subtext1); background: var(--mantle); border: 1px solid var(--surface0);
  transition: border-color .2s ease, color .2s ease;
}
.chip .nf { color: var(--overlay2); }
.chip--hl { color: var(--peach); border-color: color-mix(in srgb, var(--peach) 45%, transparent); background: color-mix(in srgb, var(--peach) 8%, var(--mantle)); }
.chips--sm .chip { font-size: 12px; padding: 3px 10px; }

/* Cards */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 26px; border-radius: var(--radius);
  background: var(--mantle); border: 1px solid var(--surface0);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .45s ease, box-shadow .5s ease, background-color .4s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--surface0));
  box-shadow: 0 18px 50px -28px color-mix(in srgb, var(--accent) 60%, transparent);
}
.card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.card > p:not([class]) { color: var(--subtext0); font-size: 15px; line-height: 1.6; }
.card .chips { margin-top: auto; padding-top: 20px; }
.card__kicker { color: var(--accent); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; }
.card__icon {
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 20px;
  display: grid; place-items: center; font-size: 26px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.mono {
  width: 56px; height: 56px; border-radius: 13px; margin-bottom: 20px;
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--crust);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--rosewater)));
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.card__link {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--surface0);
  font-size: 14px; color: var(--accent); display: inline-flex; gap: .5em; align-items: center;
}
.card__link:hover { color: var(--text); }
.card__link--muted { color: var(--overlay1); }
.more { margin-top: 34px; text-align: right; font-size: 15px; }
.more a { color: var(--mauve); border-bottom: 1px solid color-mix(in srgb, var(--mauve) 40%, transparent); }
.more a:hover { color: var(--text); }

/* Skills */
.toolset { padding: 24px; }
.toolset:hover { transform: none; box-shadow: none; border-color: var(--surface1); }
.toolset__title { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; display: flex; align-items: center; gap: .6em; }
.toolset .chips { padding-top: 0; margin-top: 18px; }

/* Contact */
.contact { padding: 150px 0 130px; text-align: center; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 800; letter-spacing: -.035em; max-width: 20ch; text-wrap: balance; }
.contact__lead { margin-top: 24px; color: var(--subtext0); max-width: 36em; font-size: 17.5px; }
.contact__email {
  margin-top: 40px; font-size: clamp(1.15rem, 3.4vw, 2rem); font-weight: 700; color: var(--mauve);
  border-bottom: 2px solid color-mix(in srgb, var(--mauve) 45%, transparent); padding-bottom: 4px;
  transition: color .2s ease, border-color .2s ease; word-break: break-all;
}
.contact__email:hover { color: var(--pink); border-color: var(--pink); }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }

/* Footer */
.footer { border-top: 1px solid var(--surface0); padding: 28px 0; font-size: 13px; color: var(--overlay1); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__meta { color: var(--overlay0); }

/* ---------- Motion ---------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .logo__cursor { animation: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .nav__links { gap: 20px; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav__links { display: none; }
  .hero { padding: 64px 0 72px; }
  .hero__inner, .about { grid-template-columns: 1fr; gap: 44px; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .stats__inner { grid-template-columns: repeat(2, 1fr); gap: 30px 24px; }
  .hero__grid { -webkit-mask-image: radial-gradient(ellipse 90% 60% at 60% 75%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse 90% 60% at 60% 75%, #000 10%, transparent 70%); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .nav__inner { height: 60px; }
  .nav__actions .btn { display: none; }
  .section { padding: 88px 0 24px; }
  .section__title { margin-bottom: 40px; }
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .tl__head { flex-direction: column; gap: 4px; }
  .tl h3 { font-size: 19px; }
  .timeline { padding-left: 32px; }
  .tl::before { left: -31px; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .ff__logo { display: none; }
  .term__body { padding: 16px; font-size: 13.5px; }
  .code { font-size: 13px; }
  .stat__num { font-size: 34px; }
  .contact { padding: 110px 0 100px; }
  .hero__lead { font-size: 16.5px; }
}
