/* Muhamed Hoxha — portfolio
   IBM Plex Sans + Plex Mono, slate ink, teal accent. Light and dark via <html data-theme>. */

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --ink: #12202b;
  --body: #34434f;
  --muted: #6a7883;
  --line: #dde4e2;
  --accent: #1f7a6d;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ee;
  --grid: rgba(18, 32, 43, 0.05);
  --shadow: 0 20px 50px rgba(18, 32, 43, 0.08);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  --bg: #0c1317;
  --surface: #121c22;
  --ink: #eef3f2;
  --body: #c3cdcf;
  --muted: #8a989d;
  --line: #22303a;
  --accent: #4cc3ad;
  --accent-ink: #062520;
  --accent-soft: #123029;
  --grid: rgba(238, 243, 242, 0.045);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px max(20px, calc((100% - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: var(--bg); font: 600 13px/1 var(--mono); letter-spacing: -.02em;
}
.site-header nav { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.site-header nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.site-header nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:root[data-theme="dark"] .i-sun, :root[data-theme="light"] .i-moon { display: none; }

/* ── Buttons & links ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .2s ease, filter .2s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-small { padding: 9px 14px; font-size: 14px; }
.text-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); }

/* ── Hero ── */
.hero { padding: 88px 0 80px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.request { font: 500 14px/1 var(--mono); color: var(--muted); }
.request .verb { color: var(--accent); font-weight: 600; margin-right: 6px; }
.request .status { margin-left: 8px; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hero h1 { margin-top: 22px; max-width: 18ch; font-size: clamp(36px, 5vw, 58px); line-height: 1.04; letter-spacing: -.035em; color: var(--ink); font-weight: 700; }
.hero h1 span { color: var(--accent); }
.lead { margin-top: 24px; max-width: 62ch; font-size: 18px; }
.lead strong { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 32px; }
/* Terminal card: always dark, like a real terminal */
.terminal { border-radius: var(--radius); overflow: hidden; background: #0b1216; border: 1px solid #1d2a31; box-shadow: var(--shadow); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #1d2a31; }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3a42; }
.terminal-bar span { margin-left: 8px; font: 500 12px/1 var(--mono); color: #7f9298; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.terminal pre { margin: 0; padding: 18px 20px 20px; overflow-x: auto; font: 400 13.5px/1.75 var(--mono); color: #c9d6d8; }
.terminal .k { color: #7fd8c6; }
.terminal .s { color: #f0c58c; }
.terminal .p { color: #8fa3a8; }

/* ── Section heads ── */
section { scroll-margin-top: 80px; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.section-head h2 { margin-top: 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.025em; color: var(--ink); }
.section-head p:not(.eyebrow) { margin-top: 12px; color: var(--body); }
#experience, #projects, #skills, .two-col { padding: 88px 0 0; }

/* ── Architecture diagram ── */
.arch-section { padding: 72px 0; background: color-mix(in srgb, var(--surface) 70%, transparent); border-block: 1px solid var(--line); }
.arch {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 230px; grid-template-rows: auto;
  column-gap: 28px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.arch > .arch-row, .arch > .arch-link { grid-column: 1; }
.arch-row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.row-label { flex-basis: 100%; text-align: center; margin-top: 4px; font: 500 12px/1.4 var(--mono); color: var(--muted); }
.node {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  font: 600 13px/1.25 var(--mono); color: var(--ink); text-align: center; cursor: default;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.node small { font-weight: 400; font-size: 11px; color: var(--muted); }
.node:hover, .node.is-active, .arch-services:hover .svc { border-color: var(--accent); }
.node:hover, .node.is-active { box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.node-client { min-width: 88px; }
.node-gateway { min-width: 280px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.arch-services { display: grid; grid-template-columns: repeat(6, 44px); justify-content: center; gap: 8px; cursor: default; }
.arch-services .row-label { grid-column: 1 / -1; }
.svc { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); position: relative; transition: border-color .2s; }
/* each service carries its own little database */
.svc::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 14px; height: 10px; transform: translateX(-50%); border-radius: 50% / 30%; border: 1.5px solid var(--accent); opacity: .7; }
.node-bus { position: relative; min-width: 320px; overflow: hidden; }
.bus-track { position: absolute; inset: auto 12px 6px; height: 2px; background: var(--line); }
.bus-track i { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bus 3.2s linear infinite; }
.bus-track i:nth-child(2) { animation-delay: -1.1s; }
.bus-track i:nth-child(3) { animation-delay: -2.2s; }
@keyframes bus { from { left: 0; } to { left: calc(100% - 6px); } }
.arch-link { position: relative; height: 34px; }
.arch-link::before { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; border-left: 1.5px dashed var(--line); }
.arch-link i { position: absolute; left: calc(50% - 3px); top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: down 1.8s ease-in infinite; }
@keyframes down { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(20px); opacity: 0; } }
.arch-side { grid-column: 2; grid-row: 1 / span 7; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-left: 28px; border-left: 1px dashed var(--line); }
.arch-side .node { width: 100%; }
.arch-tip { grid-column: 1 / -1; margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--body); min-height: 48px; }

/* ── Timeline ── */
.timeline { list-style: none; }
.job { display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; padding-top: 0; }
.job-when { font: 500 13px/1.6 var(--mono); color: var(--muted); padding-top: 3px; }
.job h3 { font-size: 19px; color: var(--ink); letter-spacing: -.01em; }
.job h3 span { color: var(--accent); font-weight: 600; }
.job-meta { margin-top: 2px; font-size: 14px; color: var(--muted); }
.job ul { margin-top: 12px; padding-left: 18px; }
.job li { margin-top: 6px; }
.job li::marker { color: var(--accent); }
.job li b { color: var(--ink); }
.stack { margin-top: 12px; font: 500 13px/1.6 var(--mono); color: var(--muted); }

/* ── Projects ── */
.project {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.project > div { flex: 1 1 420px; }
.project-kind { font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.project h3 { margin-top: 10px; font-size: 28px; letter-spacing: -.02em; color: var(--ink); }
.project p { margin-top: 10px; max-width: 60ch; }
.project-credit { font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; list-style: none; }
.tags li, .interests li { padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 500 13px/1.3 var(--mono); }
.also { margin-top: 28px; }
.also ul { list-style: none; margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
.also li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.also b { color: var(--ink); }

/* ── Skills ── */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.skills > div { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.skills > div:hover { border-color: var(--accent); }
.skills h3 { font: 600 13px/1.3 var(--mono); letter-spacing: .04em; color: var(--accent); }
.skills p { margin-top: 10px; font-size: 15px; }

/* ── Education & interests ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.edu { margin-top: 16px; }
.edu h3 { font-size: 19px; color: var(--ink); }
.edu p { color: var(--muted); }
.interests { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; list-style: none; }

/* ── Footer ── */
.site-footer { margin-top: 110px; padding: 56px 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.footer-title { margin-bottom: 16px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.footer-meta { font: 500 13px/1 var(--mono); color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 64px; }
  .arch { grid-template-columns: 1fr; padding: 20px; }
  .arch-side { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 22px; padding: 22px 0 0; border-left: 0; border-top: 1px dashed var(--line); }
  .arch-side .node { width: auto; }
  .job { grid-template-columns: 1fr; gap: 6px; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .also ul { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 64px 0 48px; }
  .terminal pre { font-size: 12px; padding: 14px 14px 16px; }
  .node-gateway, .node-bus { min-width: 0; width: 100%; }
  .arch-services { grid-template-columns: repeat(4, 44px); }
  .arch-clients { display: grid; grid-template-columns: 1fr 1fr; }
  .arch-clients .row-label { grid-column: 1 / -1; }
  .project { padding: 22px; }
  .btn-small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bus-track i, .arch-link i { animation: none; opacity: 0; }
}

/* ── Hero entrance (subtle, once) ── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes line-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } 100% { content: "..."; } }
.hero .request, .hero h1, .hero .lead, .hero .hero-actions, .hero .terminal { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero h1 { animation-delay: .08s; }
.hero .lead { animation-delay: .18s; }
.hero .hero-actions { animation-delay: .28s; }
.hero .terminal { animation-delay: .22s; }
/* Request badge: pending → 200 OK (only when JS runs; without it the badge just says 200 OK) */
.request .status.is-pending { background: var(--line); color: var(--muted); }
.request .status.is-pending::after { content: ""; animation: dots 1s steps(4) infinite; }
.request .status.is-ok { animation: pop .35s ease-out; }
/* Response lines stream in once the request resolves */
.js-anim .terminal .ln { display: block; opacity: 0; }
.js-anim .hero.is-loaded .terminal .ln { animation: line-in .35s ease-out both; animation-delay: calc(var(--i) * 65ms); }
.terminal .caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: #7fd8c6; animation: caret 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .hero .request, .hero h1, .hero .lead, .hero .hero-actions, .hero .terminal,
  .request .status.is-ok, .js-anim .hero.is-loaded .terminal .ln { animation: none; }
  .js-anim .terminal .ln { opacity: 1; }
  .terminal .caret { animation: none; }
}

/* ── Nav: active section ── */
.site-header nav a { position: relative; padding: 4px 0; }
.site-header nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.site-header nav a.is-active { color: var(--ink); }
.site-header nav a.is-active::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .site-header nav a::after { transition: none; } }

/* ── Language switch ── */
.lang-switch { display: flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.lang-switch a { padding: 6px 9px; border-radius: 7px; font: 600 12px/1 var(--mono); color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.lang-switch a:not([aria-current]):hover { color: var(--ink); }

/* ── Freelance services ── */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.services > div { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.services > div:hover { border-color: var(--accent); }
.services h3 { font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.services p { margin-top: 8px; font-size: 15px; }
.services-cta { margin-top: 24px; }
#freelance { padding: 88px 0 0; }
