/* ============================================================
   Syed Farhat Ali Shah — Portfolio
   assets/css/style.css
   All colors and spacing live in the variables below.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Colors: change these to restyle the whole site ---- */
  --bg: #04050e;
  --bg-2: #080a18;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-solid: #0b0d1c;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  --text: #eaeefb;
  --muted: #98a1bd;
  --dim: #6b7495;

  --blue: #3b82f6;
  --blue-2: #2563eb;
  --violet: #8b5cf6;
  --purple: #a855f7;
  --cyan: #22d3ee;
  --green: #22c55e;
  --amber: #f59e0b;

  --grad: linear-gradient(100deg, var(--blue) 0%, var(--violet) 55%, var(--purple) 100%);

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ---- Layout ---- */
  --max: 1180px;
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 76px;
}

/* ---------------- Base ---------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; color: var(--muted); }
::selection { background: var(--violet); color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mono { font-family: var(--font-mono); }

/* ---------------- Ambient background ---------------- */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
}
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .3;
}
.bg-orbs span:nth-child(1) { width: 480px; height: 480px; background: var(--blue); top: -120px; right: -80px; animation: drift 24s ease-in-out infinite; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; background: var(--purple); top: 50%; left: -160px; animation: drift 30s ease-in-out infinite reverse; }
.bg-orbs span:nth-child(3) { width: 360px; height: 360px; background: var(--cyan); bottom: -140px; right: 20%; opacity: .18; animation: drift 36s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -50px) scale(1.15); }
}
.grid-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  opacity: .5;
}
main, header, footer { position: relative; z-index: 2; }

/* Mouse spotlight */
#cursor-glow {
  position: fixed; width: 460px; height: 460px; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, rgba(99, 102, 241, .13), transparent 62%);
  transform: translate(-50%, -50%); transition: opacity .4s;
}

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky; top: 0; z-index: 60; height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: rgba(4, 5, 14, .72);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; gap: 28px; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: 17px; letter-spacing: -.03em; color: #fff;
  box-shadow: 0 6px 22px rgba(99, 102, 241, .38);
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; }
.brand-role { font-size: 12.5px; color: var(--dim); line-height: 1.2; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 13px; font-size: 14.5px; color: var(--muted); border-radius: 9px;
  position: relative; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--blue); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: -2px; height: 2px;
  background: var(--grad); border-radius: 2px;
}
.nav-cta {
  background: var(--grad); color: #fff; border: 0; padding: 12px 20px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, .32); transition: transform .2s, box-shadow .2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 70, 229, .45); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 11px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px;
  border-radius: 12px; font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 28px rgba(79, 70, 229, .3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(79, 70, 229, .45); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--panel); }
.btn-ghost:hover { border-color: rgba(139, 92, 246, .5); transform: translateY(-3px); }

/* ---------------- Hero ---------------- */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 48px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; color: var(--muted);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hero h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 700; margin: 26px 0 18px; }
.hero h1 .line-2 { display: block; min-height: 1.15em; }
.type-cursor { display: inline-block; width: 3px; height: .95em; background: var(--violet); vertical-align: -3px; margin-left: 4px; animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { font-size: 16.5px; max-width: 470px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 30px 0 42px; }

.trusted-label { font-size: 12.5px; color: var(--dim); letter-spacing: .04em; margin-bottom: 14px; }
.trusted { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.trusted span { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted); opacity: .8; transition: opacity .2s, transform .2s; }
.trusted span:hover { opacity: 1; transform: translateY(-2px); }

/* Hero visual: 3D orb + floating cards */
.hero-visual { position: relative; height: 460px; perspective: 1100px; }
.orb-stage { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; transition: transform .18s ease-out; }
.orb { position: relative; width: 290px; height: 290px; display: grid; place-items: center; transform-style: preserve-3d; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(139, 92, 246, .28); }
.ring.r1 { animation: spin 18s linear infinite; border-top-color: var(--blue); border-right-color: transparent; }
.ring.r2 { inset: 26px; animation: spin 26s linear infinite reverse; border-bottom-color: var(--purple); border-left-color: transparent; }
.ring.r3 { inset: 52px; animation: spin 34s linear infinite; border-top-color: var(--cyan); border-left-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.orb-core {
  width: 150px; height: 150px; border-radius: 34px; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 25%, rgba(59, 130, 246, .35), rgba(11, 13, 28, .9));
  border: 1px solid rgba(139, 92, 246, .35); box-shadow: 0 0 70px rgba(99, 102, 241, .35);
  transform: translateZ(60px); animation: float 6s ease-in-out infinite;
}
.orb-core b { font-family: var(--font-display); font-size: 40px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes float { 0%, 100% { transform: translateZ(60px) translateY(0); } 50% { transform: translateZ(60px) translateY(-14px); } }
.orb-label { position: absolute; bottom: 6px; text-align: center; width: 100%; transform: translateZ(30px); }
.orb-label b { display: block; font-family: var(--font-display); font-size: 19px; letter-spacing: .06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.orb-label small { color: var(--muted); font-size: 13px; }

.float-card {
  position: absolute; background: rgba(11, 13, 28, .82); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; text-align: center; min-width: 104px;
  backdrop-filter: blur(10px); animation: float-y 7s ease-in-out infinite;
  transition: transform .2s, border-color .2s;
}
.float-card:hover { border-color: rgba(139, 92, 246, .55); transform: scale(1.06); }
.float-card i { font-size: 22px; display: block; margin-bottom: 6px; font-style: normal; }
.float-card small { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: block; }
.fc-1 { top: 10px; left: -6px; animation-delay: 0s; }
.fc-2 { top: 176px; left: -14px; animation-delay: 1.4s; }
.fc-3 { top: 4px; right: -8px; animation-delay: .7s; }
.fc-4 { top: 200px; right: -16px; animation-delay: 2.1s; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.contact-card {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: rgba(11, 13, 28, .88); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 20px; backdrop-filter: blur(12px); width: 330px; max-width: 100%;
}
.contact-card a, .contact-card div { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--muted); padding: 5px 0; }
.contact-card a:hover { color: var(--blue); }
.contact-card svg { flex: none; }

/* ---------------- Stats ---------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 40px 0; padding: 26px 10px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 8px 22px; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: 0; }
.stat-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; flex: none; }
.stat b { display: block; font-family: var(--font-display); font-size: 27px; line-height: 1.1; }
.stat small { color: var(--dim); font-size: 13px; }

/* ---------------- Sections ---------------- */
.section { padding: 62px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); display: inline-block; padding-bottom: 12px; position: relative; }
.section-head h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 62px; height: 3px; background: var(--grad); border-radius: 3px; }
.section-head p { max-width: 620px; margin: 14px auto 0; }
.eyebrow { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--violet); margin-bottom: 10px; }

/* What I do */
.services-row { display: grid; grid-template-columns: repeat(5, 1fr); padding: 34px 8px; }
.svc { text-align: center; padding: 8px 20px; border-right: 1px solid var(--line-soft); transition: transform .25s; }
.svc:last-child { border-right: 0; }
.svc:hover { transform: translateY(-6px); }
.svc-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; font-size: 27px; }
.svc h3 { font-size: 16px; margin-bottom: 8px; }
.svc p { font-size: 13.5px; line-height: 1.6; margin: 0; }

/* Icon color tints */
.t-violet { background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .3); color: var(--violet); }
.t-cyan   { background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .3); color: var(--cyan); }
.t-blue   { background: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .3); color: var(--blue); }
.t-purple { background: rgba(168, 85, 247, .1); border: 1px solid rgba(168, 85, 247, .3); color: var(--purple); }
.t-amber  { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .3); color: var(--amber); }
.t-green  { background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .3); color: var(--green); }

/* Skills grid */
.skills-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.skill {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 24px 10px; text-align: center; transition: transform .25s, border-color .25s, background .25s;
}
.skill:hover { transform: translateY(-7px); border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .06); }
.skill i { font-size: 30px; font-style: normal; display: block; margin-bottom: 10px; }
.skill span { font-size: 13.5px; color: var(--muted); }

/* Cards / generic grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, .4); }
.card h3 { font-size: 18px; }
.card .tag {
  display: inline-block; font-size: 11.5px; font-family: var(--font-mono); padding: 4px 10px;
  border-radius: 99px; background: rgba(139, 92, 246, .12); color: #c4b5fd; margin: 0 6px 6px 0;
}

/* Timeline (experience) */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--blue), var(--purple), transparent); }
.tl-item { position: relative; margin-bottom: 30px; }
.tl-item::before {
  content: ''; position: absolute; left: -30px; top: 28px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}
.tl-meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--cyan); }
.tl-item h3 { font-size: 19px; margin: 6px 0 2px; }
.tl-org { color: var(--violet); font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.tl-item ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.tl-item li { margin-bottom: 6px; }

/* CTA band */
.cta-band {
  border-radius: var(--radius); padding: 34px; margin: 56px 0;
  background: linear-gradient(100deg, rgba(37, 99, 235, .22), rgba(168, 85, 247, .22));
  border: 1px solid rgba(139, 92, 246, .35);
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 28px; align-items: center;
}
.cta-icon { width: 92px; height: 92px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; font-size: 36px; box-shadow: 0 14px 40px rgba(79, 70, 229, .4); animation: float-y 5s ease-in-out infinite; }
.cta-band h3 { font-size: 23px; margin-bottom: 6px; }
.cta-band p { margin: 0; font-size: 14.5px; max-width: 380px; }
.cta-contact a, .cta-contact div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding: 4px 0; }
.cta-contact a:hover { color: #fff; }

/* World clock */
.clock {
  display: inline-flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); font-family: var(--font-mono); font-size: 13px;
}
.clock .cl-time { color: var(--cyan); font-weight: 500; letter-spacing: .04em; }
.clock .cl-zone { color: var(--dim); font-size: 11.5px; }
.clock .cl-ping { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); animation: pulse 2s infinite; }

/* Footer */
.footer { border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 26px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer small { color: var(--dim); font-size: 13px; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); transition: .2s;
}
.socials a:hover { color: #fff; border-color: var(--violet); background: rgba(139, 92, 246, .15); transform: translateY(-3px); }

/* Page header (inner pages) */
.page-head { padding: 58px 0 10px; text-align: center; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 46px); }
.page-head p { max-width: 640px; margin: 0 auto; }
.crumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--dim); margin-bottom: 14px; }
.crumb b { color: var(--violet); font-weight: 500; }

/* Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; border-radius: 12px; background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18);
}
.form-note { font-size: 13px; color: var(--dim); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Edit mode ---------------- */
.edit-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 54px; height: 54px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(11, 13, 28, .9); color: var(--muted); font-size: 20px;
  backdrop-filter: blur(10px); transition: .2s;
}
.edit-fab:hover { color: #fff; border-color: var(--violet); transform: translateY(-3px); }
body.editing .edit-fab { background: var(--grad); color: #fff; border-color: transparent; }
.edit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 89; display: none;
  align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px;
  background: rgba(11, 13, 28, .96); border-top: 1px solid var(--line); backdrop-filter: blur(14px);
}
body.editing .edit-bar { display: flex; }
body.editing { padding-bottom: 72px; }
.edit-bar strong { font-family: var(--font-display); font-size: 14px; }
.edit-bar span { font-size: 12.5px; color: var(--dim); margin-right: auto; }
.edit-bar button {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 13px; transition: .2s;
}
.edit-bar button:hover { border-color: var(--violet); }
.edit-bar button.primary { background: var(--grad); border-color: transparent; color: #fff; }
body.editing [data-edit] {
  outline: 1px dashed rgba(139, 92, 246, .55); outline-offset: 4px; border-radius: 4px; cursor: text;
}
body.editing [data-edit]:hover { outline-color: var(--cyan); background: rgba(139, 92, 246, .07); }
body.editing [data-edit]:focus { outline: 2px solid var(--cyan); background: rgba(34, 211, 238, .07); }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 95;
  background: var(--grad); color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   HIRE ME MODAL
   ============================================================ */
.modal-wrap {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(2, 3, 10, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-wrap.open { display: flex; }
.modal {
  width: 100%; max-width: 460px; margin: auto;
  background: #0b0d1c; border: 1px solid rgba(139, 92, 246, .38); border-radius: 20px;
  padding: 26px 24px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: modal-in .32s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { font-size: 20px; margin: 0 0 4px; }
.modal-head p { margin: 0; font-size: 13.5px; }
.modal-close {
  margin-left: auto; width: 38px; height: 38px; flex: none; border-radius: 11px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 19px; line-height: 1;
}
.modal-close:hover { color: #fff; border-color: var(--violet); }
.modal .field { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.modal-actions .btn { flex: 1 1 auto; justify-content: center; }
.modal-ok { text-align: center; padding: 14px 0 4px; }
.modal-ok .tick {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center;
  font-size: 28px; background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .4); color: var(--green);
}

/* ---------------- Skill bars (skills page) ---------------- */
.bar-row { margin-bottom: 18px; }
.bar-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.bar-top span:last-child { font-family: var(--font-mono); color: var(--cyan); font-size: 12.5px; }
.bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width 1.1s cubic-bezier(.2,.7,.3,1); }
.reveal.in .bar i { width: var(--w); }

/* ---------------- Checklists (services page) ---------------- */
.check { list-style: none; padding: 0; margin: 14px 0 0; }
.check li { position: relative; padding-left: 26px; margin-bottom: 9px; color: var(--muted); font-size: 14.5px; }
.check li::before { content: '\2713'; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ---------------- Blog post row ---------------- */
.post { display: grid; grid-template-columns: 96px 1fr; gap: 22px; align-items: start; }
.post-date { border: 1px solid var(--line); border-radius: 14px; text-align: center; padding: 12px 6px; font-family: var(--font-mono); background: var(--panel); }
.post-date b { display: block; font-size: 22px; color: var(--violet); }
.post-date small { font-size: 11px; color: var(--dim); }

/* ---------------- Select dropdown (dark native list) ---------------- */
.field select {
  color-scheme: dark;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a1bd' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  padding-right: 42px; cursor: pointer;
}
.field select option { background: #0b0d1c; color: #eaeefb; }
.field select option:checked { background: #1a1d35; }

/* ---------------- Status badge ---------------- */
.status {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 10px;
  padding: 4px 12px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 11.5px;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .38); color: #fbbf24;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; animation: pulse 2s infinite; }
.status.done { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .38); color: #4ade80; }
.status.done .dot { background: #22c55e; animation: none; }

/* ---------------- Live blog feed ---------------- */
.feed-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; font-size: 13.5px; color: var(--dim); }
.feed-bar button { margin-left: auto; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13px; transition: .2s; }
.feed-bar button:hover { color: #fff; border-color: var(--violet); }
.feed-bar button[disabled] { opacity: .5; cursor: default; }
.feed-item { display: block; margin-bottom: 18px; }
.feed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.feed-src { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: rgba(139, 92, 246, .12); border: 1px solid rgba(139, 92, 246, .3); color: #c4b5fd; }
.feed-date { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.feed-item h3 { font-size: 18px; margin: 0 0 8px; transition: color .2s; }
.feed-item:hover h3 { color: #c4b5fd; }
.feed-item p { font-size: 14.5px; margin: 0 0 10px; }
.feed-more { font-size: 13px; color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; }
.skeleton { pointer-events: none; }
.skeleton .line { height: 12px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 300% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
.feed-msg { text-align: center; padding: 30px 20px; color: var(--dim); font-size: 14.5px; }

/* ============================================================
   RESPONSIVE — phones, tablets, laptops, desktops, old + new
   ============================================================ */

/* Never allow sideways scroll on any device */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
* { -webkit-tap-highlight-color: rgba(139, 92, 246, .18); }

/* iPhone notch / Android gesture bar safe areas */
.nav-inner, .footer-inner { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.footer { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
.edit-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.edit-fab { bottom: calc(20px + env(safe-area-inset-bottom)); right: calc(20px + env(safe-area-inset-right)); }

/* Touch devices: no hover glow, bigger tap targets, no parallax jitter */
@media (hover: none), (pointer: coarse) {
  #cursor-glow { display: none; }
  .nav-links a { padding: 14px 13px; }
  .btn { padding: 15px 24px; }
  .socials a { width: 46px; height: 46px; }
  .skill:hover, .card:hover, .float-card:hover, .svc:hover { transform: none; }
  .float-card { margin: 0 !important; }
  input, select, textarea { font-size: 16px; }  /* prevents iOS auto-zoom */
}

/* ---- Large desktop / iMac ---- */
@media (min-width: 1500px) {
  :root { --max: 1320px; }
  .hero-visual { height: 520px; }
}

/* ---- Small laptop / large tablet landscape (iPad Pro) ---- */
@media (max-width: 1200px) {
  :root { --max: 1000px; }
  .nav-links a { padding: 8px 10px; font-size: 14px; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Tablet landscape / small laptop ---- */
@media (max-width: 1024px) {
  .hero { padding: 44px 0 30px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-sub { max-width: 100%; }
  .hero-visual { height: 440px; max-width: 460px; margin: 10px auto 0; }
  .services-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .svc { border-right: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cta-band { grid-template-columns: 1fr 1fr; }
  .cta-icon { grid-row: span 2; }
}

/* ---- Tablet portrait (iPad, Galaxy Tab) ---- */
@media (max-width: 900px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 8px; font-size: 13.5px; }
  .brand-role { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 18px 8px; }
  .stat { border-right: 0; padding: 10px 16px; }
  .stat:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
}

/* ---- Phablet / small tablet — burger menu starts here ---- */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch;
    background: rgba(6, 8, 20, .985); border-bottom: 1px solid var(--line);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 8px; font-size: 15.5px; border-bottom: 1px solid var(--line-soft); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a.active::after { display: none; }
  .nav-cta { padding: 10px 16px; font-size: 13.5px; }
  .services-row { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 28px 22px; }
  .cta-icon { grid-row: auto; }
  .cta-band p { max-width: none; }
  .cta-contact a, .cta-contact div { justify-content: center; }
}

/* ---- Large phones (iPhone Plus/Pro Max, Pixel XL) ---- */
@media (max-width: 640px) {
  :root { --nav-h: 66px; }
  .wrap { padding: 0 18px; }
  .nav-cta { display: none; }
  .brand-mark { width: 38px; height: 38px; font-size: 15px; }
  .brand-name { font-size: 15px; }
  .hero { padding: 30px 0 20px; }
  .hero h1 { margin: 20px 0 14px; }
  .hero-actions { margin: 24px 0 32px; gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .trusted { gap: 16px 20px; }
  .trusted span { font-size: 13.5px; }
  .hero-visual { height: 360px; max-width: 340px; }
  .orb { width: 230px; height: 230px; }
  .orb-core { width: 118px; height: 118px; border-radius: 26px; }
  .orb-core b { font-size: 32px; }
  .float-card { padding: 10px 12px; min-width: 86px; }
  .float-card i { font-size: 18px; }
  .float-card small { font-size: 10.5px; }
  .fc-1, .fc-2 { left: -10px; }
  .fc-3, .fc-4 { right: -10px; }
  .fc-2, .fc-4 { top: 150px; }
  .contact-card { position: static; transform: none; width: 100%; margin-top: 26px; }
  .stats { grid-template-columns: 1fr; padding: 12px 8px; }
  .stat { border-right: 0 !important; border-bottom: 1px solid var(--line-soft); padding: 14px 16px; }
  .stat:last-child { border-bottom: 0; }
  .services-row { grid-template-columns: 1fr; padding: 24px 6px; }
  .svc { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 18px 16px; }
  .svc:last-child { border-bottom: 0; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section { padding: 38px 0; }
  .section-head { margin-bottom: 30px; }
  .card { padding: 22px 20px; }
  .timeline { padding-left: 26px; }
  .tl-item::before { left: -24px; }
  .post { grid-template-columns: 1fr; gap: 14px; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ---- Standard phones (iPhone 12/13/14/15, most Androids) ---- */
@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 15.5px; }
  .hero-visual { height: 330px; max-width: 300px; }
  .orb { width: 200px; height: 200px; }
  .ring.r2 { inset: 20px; } .ring.r3 { inset: 40px; }
  .orb-core { width: 100px; height: 100px; }
  .orb-core b { font-size: 27px; }
  .orb-label b { font-size: 16px; }
  .float-card { transform: scale(.92); }
  .modal { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 16px; }
  .edit-bar { gap: 8px; padding: 10px 14px; }
  .edit-bar span { display: none; }
  .edit-bar button { flex: 1 1 auto; font-size: 12px; padding: 9px 8px; }
}

/* ---- Small / old phones (iPhone SE, older 320px Androids) ---- */
@media (max-width: 380px) {
  .wrap { padding: 0 14px; }
  .hero h1 { font-size: 26px; }
  .skills-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .skill { padding: 18px 6px; }
  .hero-visual { height: 300px; max-width: 270px; }
  .orb { width: 178px; height: 178px; }
  .float-card { transform: scale(.84); min-width: 78px; }
  .btn { padding: 13px 18px; font-size: 14.5px; }
  .section-head h2 { font-size: 23px; }
}

/* ---- Phone in landscape (short height) ---- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --nav-h: 58px; }
  .hero { padding: 22px 0 14px; }
  .hero-visual { height: 300px; }
  .nav-links { max-height: calc(100vh - var(--nav-h)); }
  .modal-wrap { align-items: flex-start; }
}

/* ---- Old browsers: solid background when backdrop-filter is unsupported ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: #050713; }
  .float-card, .contact-card, .modal-wrap { background: #0b0d1c; }
  .modal-wrap { background: rgba(2, 3, 10, .95); }
}

/* ---- Old browsers: block fallback when CSS grid is unsupported ---- */
@supports not (display: grid) {
  .hero-grid, .stats, .services-row, .skills-grid, .grid-2, .grid-3, .cta-band,
  .footer-inner, .nav-inner { display: block; }
  .skill, .svc, .card, .stat { display: inline-block; vertical-align: top; width: 100%; }
}

/* ---- Print ---- */
@media print {
  #bg-canvas, .bg-orbs, .grid-lines, #cursor-glow, .edit-fab, .edit-bar, .nav-cta, .modal-wrap { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .panel { border-color: #ccc; }
  p, .skill span { color: #333; }
}

/* ---- Motion + focus ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
