/* ============================================================
   Basant Joshi — portfolio stylesheet
   Dark and modern: deep navy, glowing blue accents.
   Dark is the default; html.light switches to the light theme.
   ============================================================ */

:root {
  --bg:        #070D1A;
  --bg-2:      #0B1426;
  --card:      #0F1B31;
  --card-2:    #13223D;
  --line:      rgba(120, 160, 230, .14);
  --line-2:    rgba(120, 160, 230, .28);
  --text:      #E9F0FB;
  --body:      #A9B8D0;
  --muted:     #7385A3;
  --blue:      #3B8BFF;
  --cyan:      #3FD3FF;
  --glow:      rgba(59, 139, 255, .45);
  --ok:        #3DDC97;
  --danger:    #FF6B81;
  --grad:      linear-gradient(120deg, #3B8BFF 0%, #3FD3FF 100%);

  --font-display: 'Syne', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'DM Sans', 'Segoe UI', system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(44px, 5.5vw, 72px);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 70px;
  color-scheme: dark;
}

html.light {
  --bg:        #F4F7FC;
  --bg-2:      #EAF0F9;
  --card:      #FFFFFF;
  --card-2:    #F4F8FE;
  --line:      rgba(30, 64, 130, .12);
  --line-2:    rgba(30, 64, 130, .24);
  --text:      #0E1A30;
  --body:      #46566F;
  --muted:     #6B7A92;
  --blue:      #1F6FEB;
  --cyan:      #0AA5D8;
  --glow:      rgba(31, 111, 235, .25);
  --ok:        #14915E;
  --danger:    #D3264A;
  --grad:      linear-gradient(120deg, #1F6FEB 0%, #0AA5D8 100%);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* soft glow behind the top of the page */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 78% 18%, rgba(59, 139, 255, .22), transparent 70%),
    radial-gradient(500px 360px at 8% 8%, rgba(63, 211, 255, .10), transparent 70%);
}
html.light body::before { opacity: .55; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { color: var(--text); font-family: var(--font-display); margin: 0; line-height: 1.12; }
p { margin: 0 0 .85em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; }
::selection { background: var(--blue); color: #fff; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  transition: box-shadow .25s, transform .25s, background-color .25s, border-color .25s, color .25s;
  white-space: nowrap;
}
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -8px var(--glow); }
.btn-primary:hover { box-shadow: 0 10px 32px -6px var(--glow), 0 0 0 1px rgba(255,255,255,.08) inset; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,139,255,.15); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--cyan); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
html.light .text-link { color: var(--blue); }
.text-link:hover { color: var(--text); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.icon-btn:hover { border-color: var(--blue); box-shadow: 0 0 16px -4px var(--glow); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap;
}
.wordmark::after { content: "."; color: var(--cyan); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link {
  padding: 8px 12px; border-radius: 999px;
  color: var(--body); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); background: rgba(59, 139, 255, .14); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; flex-direction: column; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(32px, 4.5vw, 64px) 0 clamp(40px, 5vw, 64px); overflow-x: clip; }
.hero-dots { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-grid { position: relative; z-index: 1; }
.hero-typed { font-family: var(--font-display); font-weight: 700; font-size: clamp(0.98rem, 1.5vw, 1.15rem); letter-spacing: .01em; color: var(--cyan); min-height: 1.5em; margin: -6px 0 12px; }
html.light .hero-typed { color: var(--blue); }
.typed-cursor { margin-left: 2px; font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(40px, 6vw, 80px); align-items: center;
}
.hero-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  font-size: 0.9rem; color: var(--text); margin-bottom: 18px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.hero-title {
  font-size: clamp(2.6rem, 6.2vw, 4.9rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
  margin-bottom: 18px;
}
.name-glow {
  display: block;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 28px rgba(59, 139, 255, .35));
  padding-bottom: .06em;
}
.hero-lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--body); max-width: 42ch; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-facts {
  display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 12px 40px;
  margin: 0; padding-top: 24px; border-top: 1px solid var(--line);
}
.hero-facts dt { font-size: 0.85rem; color: var(--muted); }
.hero-facts dd { margin: 2px 0 0; color: var(--text); font-weight: 600; font-size: 0.98rem; }

/* Circular photo with glowing rings */
@media (min-width: 961px) {
  .hero-portrait { transform: translate(30px, -75px); }
}
.hero-portrait {
  position: relative; width: min(100%, 440px); aspect-ratio: 1; margin: 0 auto;
  display: grid; place-items: center;
}
.avatar {
  position: relative; z-index: 2; width: 78%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--card);
  box-shadow: 0 0 0 2px rgba(59, 139, 255, .55), 0 0 60px -6px var(--glow), 0 30px 60px -20px rgba(0,0,0,.6);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.ring { position: absolute; border-radius: 50%; pointer-events: none; }
.ring-1 { inset: 4%; border: 1px solid rgba(63, 211, 255, .35); }
.ring-2 { inset: -2%; border: 1px dashed rgba(59, 139, 255, .3); }
.badge {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
}
.badge i { color: var(--cyan); }
.badge-1 { left: -2%; bottom: 18%; }
.badge-2 { right: -2%; top: 14%; }

@media (prefers-reduced-motion: no-preference) {
  .ring-2 { animation: spin 40s linear infinite; }
  .badge-1 { animation: float 5s ease-in-out infinite; }
  .badge-2 { animation: float 5s ease-in-out 2.5s infinite; }
  .hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero-copy > *:nth-child(2) { animation-delay: .06s; }
  .hero-copy > *:nth-child(3) { animation-delay: .14s; }
  .hero-copy > *:nth-child(4) { animation-delay: .22s; }
  .hero-copy > *:nth-child(5) { animation-delay: .30s; }
  .hero-copy > *:nth-child(6) { animation-delay: .38s; }
  .avatar { animation: pop .9s cubic-bezier(.2,.7,.2,1) .1s both; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; }
.section-tint { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(1.9rem, 3.8vw, 2.7rem); font-weight: 800; letter-spacing: -0.01em; margin-bottom: 10px; }
.section-sub { color: var(--body); max-width: 50ch; margin-bottom: 0; }
.section-head { margin: 0 auto clamp(24px, 3vw, 36px); text-align: center; }
.section-head .section-sub { margin: 0 auto; }
.section-tag {
  display: inline-block; margin-bottom: 12px; padding: 5px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); background: rgba(59, 139, 255, .12); border: 1px solid rgba(59, 139, 255, .3);
}
html.light .section-tag { color: var(--blue); }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }

/* shared card look */
.project, .skill, .service, .quote, .post, .contact-form, .timeline li {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.project:hover, .skill:hover, .service:hover, .post:hover {
  border-color: rgba(59, 139, 255, .45);
  box-shadow: 0 0 0 1px rgba(59,139,255,.15), 0 18px 50px -20px var(--glow);
}
html.light .project, html.light .skill, html.light .service, html.light .quote,
html.light .post, html.light .contact-form, html.light .timeline li {
  box-shadow: 0 1px 2px rgba(14, 26, 48, .04), 0 10px 30px -18px rgba(14, 26, 48, .18);
}

/* About */
.prose { max-width: 64ch; }
.prose p { margin-bottom: 1.1em; }
.prose .lead { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.5; color: var(--text); font-family: var(--font-display); font-weight: 500; }
.about-actions { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 8px; }

/* ---------- Work ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.project { --p: #2A85C8; display: flex; flex-direction: column; overflow: hidden; }
.project-visual {
  padding: 22px 22px 0;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--p) 55%, transparent), transparent 75%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.browser { background: #fff; border-radius: 10px 10px 0 0; overflow: hidden; box-shadow: 0 -10px 40px -16px rgba(0,0,0,.6); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #EEF2F7; border-bottom: 1px solid #DCE3EB; }
.browser-bar span { width: 9px; height: 9px; border-radius: 50%; background: #C5CEDA; flex: none; }
.browser-bar span:nth-child(1) { background: #FF6159; }
.browser-bar span:nth-child(2) { background: #FFBD2E; }
.browser-bar span:nth-child(3) { background: #28C941; }
.browser-bar em {
  font-style: normal; font-size: 0.75rem; color: #5B6A80; background: #fff;
  border-radius: 6px; padding: 3px 10px; margin-left: 8px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.browser-body {
  aspect-ratio: 16 / 8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px; text-align: center; background: linear-gradient(135deg, #5DB3FF 0%, #2A85C8 60%, #1F6CB0 100%); color: #fff;
}
.browser-body i { font-size: 1.8rem; opacity: .9; }
.browser-body strong { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.browser-body small { font-size: 0.82rem; opacity: .8; }

.project-body { padding: clamp(20px, 2.6vw, 26px); display: flex; flex-direction: column; flex: 1; }
.project-kind { font-size: 0.85rem; color: var(--cyan); font-weight: 600; margin-bottom: 6px; }
html.light .project-kind { color: var(--blue); }
.project-title { font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.project-points { list-style: none; margin: 0 0 14px; display: grid; gap: 6px; }
.project-points li { position: relative; padding-left: 20px; font-size: 0.97rem; }
.project-points li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan);
}
html.light .project-points li::before { background: var(--blue); box-shadow: none; }
.project-points strong { color: var(--text); }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 20px; padding-top: 4px; font-size: 0; }
.project-stack .tag {
  font-size: 0.8rem; font-weight: 600; color: var(--text);
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(59,139,255,.08);
}
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }

/* ---------- Skills ---------- */
.skills { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skill { padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.skill-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.25rem; color: var(--cyan); background: rgba(59, 139, 255, .12); border: 1px solid var(--line);
}
html.light .skill-icon { color: var(--blue); }
.skill-name { color: var(--text); font-weight: 600; }
.skill-pct { grid-row: 1; grid-column: 3; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.skill-track { grid-row: 2; grid-column: 1 / -1; height: 6px; margin-top: 18px; background: rgba(120,160,230,.14); border-radius: 6px; overflow: hidden; }
.skill-fill { display: block; height: 100%; width: var(--w); background: var(--grad); border-radius: 6px; box-shadow: 0 0 12px var(--glow); transform-origin: left; }
@media (prefers-reduced-motion: no-preference) {
  .js .skill-fill { transform: scaleX(0); transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
  .js .skills.in-view .skill-fill { transform: scaleX(1); }
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; display: grid; gap: 16px; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--blue), transparent);
}
.timeline li { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 22px 24px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 28px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.timeline li:first-child::before { background: var(--cyan); }
.tl-date { color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; margin: 3px 0 0; }
.tl-role { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.tl-org { color: var(--cyan); font-weight: 600; font-size: 0.93rem; margin-bottom: 8px; }
html.light .tl-org { color: var(--blue); }
.timeline li p:last-child { margin-bottom: 0; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.service { padding: clamp(24px, 3vw, 32px); }
.service-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.3rem; color: #fff; background: var(--grad); box-shadow: 0 10px 26px -8px var(--glow);
  margin-bottom: 20px;
}
.service h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.service ul { list-style: none; display: grid; gap: 7px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.service li { padding-left: 24px; position: relative; font-size: 0.96rem; }
.service li::before {
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 0; top: 1px; font-size: 0.78rem; color: var(--cyan);
}
html.light .service li::before { color: var(--blue); }
.services-cta { margin: 26px 0 0; text-align: center; }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.quote { margin: 0; padding: 28px; display: flex; flex-direction: column; position: relative; }
.quote::before {
  content: "\201C"; font-family: Georgia, serif; font-size: 4.5rem; line-height: 1;
  color: var(--blue); opacity: .6; height: 36px; margin-bottom: 8px;
}
.quote blockquote { margin: 0 0 22px; flex: 1; color: var(--text); font-size: 1.02rem; line-height: 1.65; }
.quote figcaption { display: grid; padding-top: 18px; border-top: 1px solid var(--line); }
.q-name { color: var(--text); font-weight: 600; }
.q-role { color: var(--muted); font-size: 0.88rem; }

/* ---------- Blog ---------- */
.posts { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.posts li { display: flex; }
.post {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
  padding: 26px; text-align: left; cursor: pointer; color: inherit;
}
.post:hover .post-title { color: var(--cyan); }
html.light .post:hover .post-title { color: var(--blue); }
.post-date { order: -1; color: var(--muted); font-size: 0.88rem; }
.post-main { display: grid; gap: 8px; flex: 1; }
.post-title { font-family: var(--font-display); color: var(--text); font-size: clamp(1.15rem, 2vw, 1.35rem); font-weight: 700; line-height: 1.25; transition: color .2s; }
.post-excerpt { color: var(--body); font-size: 0.97rem; }
.post-meta { color: var(--cyan); font-size: 0.9rem; font-weight: 600; }
html.light .post-meta { color: var(--blue); }
.post-meta::after { content: "  \00B7  Read"; color: var(--muted); font-weight: 500; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 72px); align-items: start; }
.contact-list { list-style: none; display: grid; gap: 12px; margin: 24px 0; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list i {
  width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center;
  color: var(--cyan); background: rgba(59, 139, 255, .12); border: 1px solid var(--line);
}
html.light .contact-list i { color: var(--blue); }
.contact-list a, .contact-list span { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--cyan); }
.follow { padding-top: 24px; border-top: 1px solid var(--line); }
.follow-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
.follow-link {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  transition: border-color .2s, box-shadow .2s;
}
.follow-link i { font-size: 1.2rem; }
.follow-link:hover { border-color: var(--blue); box-shadow: 0 0 20px -6px var(--glow); }

.contact-form { padding: clamp(22px, 4vw, 36px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { color: var(--text); font-weight: 600; font-size: 0.93rem; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,139,255,.2); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.form-error { color: var(--danger); font-size: 0.85rem; }
.form-error:empty { display: none; }
.btn-submit { width: 100%; }
.form-success, .form-fail { display: none; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.95rem; }
.form-success.show, .form-fail.show { display: flex; gap: 10px; align-items: center; }
.form-success { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.form-fail { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 28px; padding-bottom: 28px; padding-right: calc(var(--gutter) + 72px); }
.footer-inner p { margin: 0 auto 0 0; font-size: 0.92rem; }
.site-footer .text-link { font-size: 0.92rem; }

/* ---------- Blog modal ---------- */
.blog-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 7, 15, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.blog-modal.active { opacity: 1; visibility: visible; }
.blog-modal-inner {
  position: relative; width: 100%; max-width: 760px; max-height: calc(100dvh - 40px);
  overflow-y: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7), 0 0 60px -30px var(--glow);
  transform: translateY(16px); transition: transform .3s;
}
.blog-modal.active .blog-modal-inner { transform: none; }
.modal-close {
  position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--text); cursor: pointer;
}
.modal-body { padding: clamp(28px, 5vw, 52px); }
.modal-tag { display: inline-block; color: var(--cyan); font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
html.light .modal-tag { color: var(--blue); }
.modal-body h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.02em; margin-bottom: 14px; padding-right: 36px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 0.9rem; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.modal-body h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.modal-body p, .modal-body li { max-width: 66ch; }
.modal-body ul { padding-left: 22px; margin-bottom: 1em; display: grid; gap: 6px; }
.modal-body li::marker { color: var(--cyan); }
.modal-body strong { color: var(--text); }
.modal-body a { color: var(--cyan); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
html.light .modal-body a { color: var(--blue); }
.modal-body code { background: rgba(59,139,255,.12); color: var(--text); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.modal-code {
  white-space: pre; overflow-x: auto; background: #050A14; color: #CFE0F7; border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.6;
  padding: 16px 18px; border-radius: var(--radius-sm); margin: 0 0 1.2em;
}

/* ---------- Chatbot ---------- */
#chatbot-wrapper { position: fixed; right: 20px; bottom: 20px; z-index: 900; font-family: var(--font-body); }
#chatbot-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: var(--grad); color: #fff; font-size: 1.3rem;
  box-shadow: 0 10px 30px -6px var(--glow);
}
.chat-notify {
  position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
#chatbot-box {
  position: absolute; right: 0; bottom: 70px; width: 340px; max-width: calc(100vw - 40px);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  flex-direction: column; box-shadow: 0 24px 60px -20px rgba(0,0,0,.7), 0 0 40px -20px var(--glow);
}
#chatbot-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--grad); color: #fff; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.chat-name { display: block; font-weight: 600; font-size: 0.95rem; }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; opacity: .9; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
#chatbot-close { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.05rem; opacity: .85; }
#chatbot-messages { height: 260px; max-height: 40dvh; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 0.88rem; line-height: 1.5; }
.msg.bot { align-self: flex-start; background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg a { color: var(--cyan) !important; }
html.light .msg a { color: var(--blue) !important; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: dots 1s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dots { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }
#chatbot-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.suggestion-btn { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 0.78rem; cursor: pointer; }
.suggestion-btn:hover { border-color: var(--blue); background: rgba(59,139,255,.12); }
#chatbot-input-area { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
#chatbot-input { flex: 1; min-width: 0; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; font-size: 0.9rem; }
#chatbot-input:focus { outline: none; border-color: var(--blue); }
#chatbot-send { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: var(--grad); color: #fff; cursor: pointer; }


/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.about-photo { position: relative; margin: 0; max-width: 420px; justify-self: center; width: 100%; }
.about-photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 35%;
  border-radius: 24px; border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px rgba(59, 139, 255, .08), 0 30px 60px -24px var(--glow);
}
.exp-badge {
  position: absolute; right: -18px; bottom: -18px;
  display: grid; justify-items: center; gap: 2px; padding: 14px 20px; border-radius: 16px;
  background: var(--grad); color: #fff; box-shadow: 0 16px 36px -12px var(--glow);
}
.exp-badge strong { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; }
.exp-badge span { font-size: 0.8rem; font-weight: 600; opacity: .95; }
.about-heading { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 700; margin-bottom: 14px; }
.about-text p { max-width: 62ch; }
.about-text strong { color: var(--text); }
.about-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--card-2), var(--card));
}
.about-stats div { display: grid; justify-items: center; gap: 2px; padding: 16px 10px; text-align: center; }
.about-stats div + div { border-left: 1px solid var(--line); }
.about-stats strong {
  font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.about-stats span { color: var(--muted); font-size: 0.85rem; }

/* ---------- Journey (alternating timeline) ---------- */
.journey { list-style: none; position: relative; max-width: 980px; margin: 0 auto; }
.journey::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--blue) 6%, var(--cyan) 94%, transparent);
  box-shadow: 0 0 12px var(--glow);
}
.journey-item { position: relative; width: 50%; padding: 0 36px 22px 0; }
.journey-item:nth-child(even) { margin-left: 50%; padding: 0 0 22px 36px; }
.journey-item:not(:first-child) { margin-top: -48px; }
.journey-item::before {
  content: ""; position: absolute; top: 24px; right: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2); border: 3px solid var(--cyan); box-shadow: 0 0 12px var(--cyan); z-index: 1;
}
.journey-item:nth-child(even)::before { right: auto; left: -8px; }
.journey-item:last-child::before { background: var(--cyan); }
.journey-card {
  padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.journey-card:hover { border-color: rgba(59, 139, 255, .45); box-shadow: 0 18px 50px -20px var(--glow); }
html.light .journey-card { box-shadow: 0 10px 30px -18px rgba(14, 26, 48, .18); }
.journey-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.journey-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 0.95rem; }
.journey-year {
  font-weight: 700; font-size: 0.82rem; padding: 3px 11px; border-radius: 999px;
  color: var(--cyan); background: rgba(59, 139, 255, .12); border: 1px solid rgba(59, 139, 255, .3);
}
html.light .journey-year { color: var(--blue); }
.journey-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 2px; }
.journey-place { color: var(--cyan); font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
html.light .journey-place { color: var(--blue); }
.journey-card p:last-child { margin: 0; font-size: 0.95rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .nav-link { padding: 8px 9px; font-size: 0.92rem; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed; left: auto; right: var(--gutter); top: calc(var(--header-h) + 6px);
    width: 190px; max-width: calc(100vw - 24px);
    flex-direction: column; gap: 2px; margin: 0; padding: 6px;
    transform-origin: top right;
    background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-link { padding: 9px 14px; font-size: 0.95rem; border-radius: var(--radius-sm); }
  .header-actions { margin-left: auto; }

  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-portrait { order: -1; width: min(78vw, 360px); }

  .split { grid-template-columns: 1fr; }
  .projects-grid, .services, .quotes { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; }
  .journey::before { left: 9px; transform: none; }
  .journey-item, .journey-item:nth-child(even) { width: 100%; margin-left: 0; margin-top: 0; padding: 0 0 16px 34px; }
  .journey-item::before, .journey-item:nth-child(even)::before { left: 2px; right: auto; }
  .journey-item:not(:first-child) { margin-top: 0; }
  .contact-info { text-align: left; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  :root { --radius: 16px; }
  .header-cta { display: none; }
  .hero { padding-top: 28px; }
  .hero-portrait { width: min(80vw, 320px); }
  .badge { padding: 7px 12px; font-size: 0.8rem; }
  .badge-1 { left: -4%; bottom: 10%; }
  .badge-2 { right: -4%; top: 8%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-facts { grid-template-columns: auto auto; gap: 16px 32px; }

  .skills { grid-template-columns: 1fr 1fr; gap: 12px; }
  .skill { padding: 16px; grid-template-columns: auto minmax(0, 1fr); row-gap: 4px; }
  .skill-icon { grid-row: 1 / 3; width: 38px; height: 38px; font-size: 1.1rem; }
  .skill-name { font-size: 0.93rem; }
  .skill-pct { grid-row: 2; grid-column: 2; font-size: 0.85rem; }
  .skill-track { grid-row: 3; margin-top: 12px; }

  .timeline { padding-left: 22px; }
  .timeline::before { left: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding: 18px; }
  .timeline li::before { left: -24px; top: 24px; }
  .tl-date { margin: 0; }

  .posts { grid-template-columns: 1fr; gap: 14px; }
  .post { padding: 22px; }
  .projects-grid { gap: 18px; }
  .project-visual { padding: 16px 16px 0; }
  .form-row { grid-template-columns: 1fr; }
  .project-links .btn { flex: 1 1 auto; }
  .services-cta .btn { width: 100%; }

  .exp-badge { right: -8px; bottom: -14px; padding: 10px 16px; }
  .exp-badge strong { font-size: 1.5rem; }
  .about-stats strong { font-size: 1.6rem; }
  .about-stats span { font-size: 0.78rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding-right: var(--gutter); padding-bottom: 96px; }
  .footer-inner p { margin: 0; }

  #chatbot-wrapper { right: 14px; bottom: 14px; }
  #chatbot-toggle { width: 52px; height: 52px; }
  #chatbot-box { position: fixed; left: 12px; right: 12px; bottom: 76px; width: auto; max-width: none; }
  .blog-modal { padding: 0; align-items: flex-end; }
  .blog-modal-inner { max-height: 92dvh; border-radius: 18px 18px 0 0; }
}

@media (max-width: 360px) {
  .skills { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- About illustration ---------- */
.about-art {
  display: block; width: 100%; height: auto; border-radius: 24px;
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px rgba(59, 139, 255, .08), 0 30px 60px -24px var(--glow);
}
.about-art .ab-1 { stop-color: #0F1F3A; }
.about-art .ab-2 { stop-color: #0A1426; }
.about-art .a-dot { fill: rgba(120, 170, 255, .16); }
.about-art .a-glow { fill: rgba(59, 139, 255, .16); }
.about-art .a-desk { fill: rgba(120, 170, 255, .25); }
.about-art .a-frame { fill: #2A3B57; }
.about-art .a-screen { fill: #0B1322; }
.about-art .a-notch { fill: #1C2A42; }
.about-art .a-caret { fill: #3FD3FF; }
.about-art .a-card { fill: #16294A; stroke: rgba(120, 170, 255, .3); stroke-width: 1; }
.about-art .a-line { fill: rgba(150, 190, 255, .55); }
.about-art .a-line-2 { fill: rgba(150, 190, 255, .28); }
.about-art .a-type { font-family: var(--font-display); font-weight: 800; font-size: 30px; fill: #E9F0FB; }
.about-art .a-tag { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 24px; fill: #fff; }
.about-art .a-mug { fill: #2A85C8; }
.about-art .a-mug-h { stroke: #2A85C8; }
.about-art .a-steam { stroke: rgba(150, 190, 255, .5); }
.about-art .a-spark { fill: #3FD3FF; }

html.light .about-art .ab-1 { stop-color: #EAF3FF; }
html.light .about-art .ab-2 { stop-color: #D6E7FB; }
html.light .about-art .a-dot { fill: rgba(31, 111, 235, .14); }
html.light .about-art .a-glow { fill: rgba(255, 255, 255, .6); }
html.light .about-art .a-desk { fill: rgba(31, 111, 235, .2); }
html.light .about-art .a-frame { fill: #20314F; }
html.light .about-art .a-card { fill: #FFFFFF; stroke: rgba(31, 111, 235, .18); }
html.light .about-art .a-line { fill: rgba(31, 111, 235, .45); }
html.light .about-art .a-line-2 { fill: rgba(31, 111, 235, .2); }
html.light .about-art .a-type { fill: #0E1A30; }
html.light .about-art .a-steam { stroke: rgba(31, 111, 235, .35); }
html.light .about-art .a-spark { fill: #1F6FEB; }

@media (prefers-reduced-motion: no-preference) {
  .about-art .a-float      { animation: artFloat 6s ease-in-out infinite; }
  .about-art .a-float-2    { animation: artFloat 6s ease-in-out 3s infinite; }
  .about-art .a-float-slow { animation: artFloat 9s ease-in-out infinite; }
  .about-art .a-caret      { animation: blink 1s steps(1) infinite; }
}
@keyframes artFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Photo placement: desktop shows the circle in the hero and the illustration in About;
   phones and tablets show the photo in About instead (like the original site). */
.about-photo-mobile { display: none; }
@media (max-width: 960px) {
  .hero-portrait { display: none; }
  .about-art { display: none; }
  .about-photo-mobile { display: block; }
}

/* ---------- Read more (projects) ---------- */
.read-more {
  display: none; align-self: flex-start; align-items: center; gap: 8px;
  margin: 0 0 16px; padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--cyan); font-weight: 600; font-size: 0.95rem;
}
html.light .read-more { color: var(--blue); }
.read-more i { font-size: 0.75rem; }

/* ---------- Swipe sliders ---------- */
.swipe-dots { display: none; }

@media (max-width: 640px) {
  /* short project cards */
  .read-more { display: inline-flex; }
  .project .browser-body { aspect-ratio: 16 / 6; padding: 14px; }
  .project .browser-body i { font-size: 1.4rem; }
  .project .browser-body small { display: none; }
  .project-body > p:not(.project-kind):not(.project-stack) {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px;
  }
  .project:not(.expanded) .project-points,
  .project:not(.expanded) .project-stack { display: none; }
  .project.expanded .project-body > p:not(.project-kind):not(.project-stack) { display: block; -webkit-line-clamp: unset; }
  .project-stack { margin-top: 0; }

  /* horizontal swipe for services, testimonials, blog */
  .swipe {
    display: flex !important; gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 10px;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { flex: 0 0 86%; scroll-snap-align: start; }
  .posts.swipe > li > .post { height: 100%; }
  .swipe-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
  .swipe-dots button {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--line-2); transition: width .25s, background-color .25s;
  }
  .swipe-dots button.active { width: 22px; background: var(--cyan); }
  html.light .swipe-dots button.active { background: var(--blue); }
}
