
@font-face{font-family:"Vazirmatn";src:url("../fonts/Vazirmatn.woff2") format("woff2");font-weight:100 900;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/Inter-latin.woff2") format("woff2");font-weight:100 900;font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";src:url("../fonts/Inter-latin-ext.woff2") format("woff2");font-weight:100 900;font-display:swap;
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
/* ───────────────────────── Masoud Hasan Beigi — portfolio ───────────────────────── */

:root {
  color-scheme: dark;
  --bg: #f5f7fb;
  --bg-2: #eceff6;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #e1e6ef;
  --border-strong: #cfd6e3;
  --text: #0d1526;
  --text-2: #46536a;
  --muted: #6b778c;
  --accent: #0891b2;
  --accent-2: #7c3aed;
  --accent-soft: rgba(8, 145, 178, .1);
  --grad: linear-gradient(120deg, #0891b2 0%, #4f46e5 55%, #7c3aed 100%);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 28px -12px rgba(15, 23, 42, .14);
  --shadow-lg: 0 30px 80px -30px rgba(30, 41, 90, .35);
  --glass: rgba(255, 255, 255, .72);
  --grid-line: rgba(15, 23, 42, .06);
  --orb-1: rgba(8, 145, 178, .22);
  --orb-2: rgba(124, 58, 237, .18);
  --orb-3: rgba(236, 72, 153, .10);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media all { /* dark is the default; light only when chosen */
  :root:not([data-theme="light"]) {
    --bg: #060a14;
    --bg-2: #0a1020;
    --surface: rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .06);
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #e9edf6;
    --text-2: #a9b3c7;
    --muted: #7d889e;
    --accent: #22d3ee;
    --accent-2: #a78bfa;
    --accent-soft: rgba(34, 211, 238, .1);
    --grad: linear-gradient(120deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -15px rgba(0, 0, 0, .6);
    --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .8);
    --glass: rgba(10, 16, 32, .66);
    --grid-line: rgba(255, 255, 255, .045);
    --orb-1: rgba(34, 211, 238, .20);
    --orb-2: rgba(139, 92, 246, .22);
    --orb-3: rgba(236, 72, 153, .10);
  }
}
:root[data-theme="dark"] {
  --bg: #060a14;
  --bg-2: #0a1020;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #e9edf6;
  --text-2: #a9b3c7;
  --muted: #7d889e;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-soft: rgba(34, 211, 238, .1);
  --grad: linear-gradient(120deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -15px rgba(0, 0, 0, .6);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .8);
  --glass: rgba(10, 16, 32, .66);
  --grid-line: rgba(255, 255, 255, .045);
  --orb-1: rgba(34, 211, 238, .20);
  --orb-2: rgba(139, 92, 246, .22);
  --orb-3: rgba(236, 72, 153, .10);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

.fa { --font: "Vazirmatn", Tahoma, system-ui, sans-serif; }

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.fa body, body.fa { line-height: 1.95; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--accent); color: #fff; }

.ic { width: 20px; height: 20px; flex: none; stroke-width: 1.8; }
.ic-fill { width: 18px; height: 18px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; }
.skip:focus { top: 12px; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding-inline: 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(79, 70, 229, .6); background-size: 140% 100%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(79, 70, 229, .7); background-position: 100% 0; }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); backdrop-filter: blur(10px); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn-sm { height: 40px; padding-inline: 16px; font-size: 14px; gap: 8px; }
.btn-lg { height: 56px; padding-inline: 30px; font-size: 16px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn .ic { width: 18px; height: 18px; }

/* ── nav ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom-color: var(--border); }
.nav-in { max-width: 1180px; margin-inline: auto; padding: 14px 20px; display: flex; align-items: center; gap: 20px; }
@media (min-width: 768px) { .nav-in { padding-inline: 32px; } }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad); color: #fff; font: 800 13px/1 "Inter", sans-serif; letter-spacing: .04em;
  box-shadow: 0 6px 20px -8px rgba(79, 70, 229, .7);
}
.brand-name { font-size: 15px; display: none; }
@media (min-width: 1100px) { .brand-name { display: inline; } }
.nav-links { display: none; margin-inline-start: auto; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; color: var(--text-2); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-actions { margin-inline-start: 8px; }
}
.lang-switch {
  height: 40px; min-width: 40px; padding-inline: 12px; display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font: 700 13px/1 var(--font); transition: border-color .2s;
}
.lang-switch[lang="fa"] { font-family: "Vazirmatn", sans-serif; font-size: 15px; }
.lang-switch:hover { border-color: var(--accent); }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media all { /* dark is the default; light only when chosen */
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}
.nav-cv { display: none; }
@media (min-width: 640px) { .nav-cv { display: inline-flex; } }
.menu-btn { display: inline-grid; gap: 5px; align-content: center; justify-items: center; }
.menu-btn span { display: block; width: 16px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }
@media (min-width: 960px) { .menu-btn { display: none; } }
@media (max-width: 959px) {
  /* solid panel: a backdrop-filter nested inside the (already blurred) nav bar
     is ignored by browsers, which left the old glass panel see-through */
  .nav-links.is-open {
    display: flex; flex-direction: column; position: absolute; top: calc(100% + 8px); inset-inline: 12px;
    padding: 10px; border-radius: 18px; background: var(--bg-2);
    border: 1px solid var(--border-strong); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
    animation: menu-in .22s var(--ease);
  }
  .nav-links.is-open a { padding: 13px 16px; font-size: 16px; border-radius: 12px; }
  .nav-links.is-open a + a { border-top: 1px solid var(--border); border-radius: 0; }
  .nav.menu-open { background: var(--bg); border-bottom-color: var(--border); }
  /* dim the page behind the open menu */
  .nav.menu-open::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: rgba(2, 4, 10, .6);
  }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
}

/* ── hero ── */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 90px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg .grid {
  position: absolute; inset: -2px;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.orb-1 { width: 520px; height: 520px; background: var(--orb-1); top: -120px; inset-inline-end: -80px; animation: drift 18s ease-in-out infinite alternate; }
.orb-2 { width: 460px; height: 460px; background: var(--orb-2); bottom: -160px; inset-inline-start: -120px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 300px; height: 300px; background: var(--orb-3); top: 40%; left: 45%; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.08); } }

.hero-in { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) { .hero-in { grid-template-columns: 1.12fr .88fr; gap: 64px; } }

.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(10px);
  font-size: 13.5px; color: var(--text-2); font-weight: 500;
}
.fa .pill { padding: 7px 12px 7px 16px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hero h1 { margin-top: 26px; font-size: clamp(42px, 7.2vw, 80px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; }
.fa .hero h1 { letter-spacing: 0; line-height: 1.25; font-size: clamp(40px, 5.4vw, 70px); font-weight: 900; }
/* English: keep the full name on one line — size it from the text column width
   (name ≈ 9.2 × font-size wide in Inter 800) */
.en .hero h1 .grad { white-space: nowrap; }
.en .hero h1 { font-size: min(76px, calc((100vw - 64px) / 9.2)); }
@media (min-width: 960px) {
  .en .hero h1 { font-size: min(76px, calc((min(100vw, 1180px) - 148px) * .56 / 9.2)); }
}
.en .hello { font-size: clamp(16px, .36em, 26px); }
.hello { display: block; font-size: .36em; font-weight: 500; letter-spacing: -.01em; color: var(--text-2); margin-bottom: 14px; }
.fa .hello { margin-bottom: 4px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 8s ease-in-out infinite alternate; padding-bottom: .06em; }
@keyframes sheen { to { background-position: 100% 0; } }
.hero-role { margin-top: 22px; font-size: clamp(18px, 2.2vw, 22px); font-weight: 600; color: var(--text); }
.hero-tag { margin-top: 12px; font-size: clamp(16px, 1.8vw, 18.5px); color: var(--text-2); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.social {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: transform .25s var(--ease), color .2s, border-color .2s, background .2s;
}
.social:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }

.hero-visual { display: flex; justify-content: center; }
.portrait { position: relative; width: min(100%, 420px); aspect-ratio: 11 / 12.2; }
.portrait picture, .portrait > picture img {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 32px; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 32px; box-shadow: var(--shadow-lg); }
.portrait-ring {
  position: absolute; inset: -2px; border-radius: 34px; padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), #22d3ee, #818cf8, #c084fc, #22d3ee);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 8s linear infinite;
}
.portrait::before {
  content: ""; position: absolute; inset: 8% -6% -6% 8%; border-radius: 40px; z-index: -1;
  background: var(--grad); filter: blur(60px); opacity: .35;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
.float-badge {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 600; white-space: nowrap; animation: bob 6s ease-in-out infinite;
}
.float-badge .ic { width: 18px; height: 18px; color: var(--accent); }
.float-badge strong { font-size: 22px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.fb-1 { top: 9%; inset-inline-start: -8%; }
.fb-2 { bottom: 14%; inset-inline-end: -5%; animation-delay: -2s; }
.fb-3 { bottom: -4%; inset-inline-start: 4%; animation-delay: -4s; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; }
.fb-3 span { font-size: 12px; color: var(--text-2); font-weight: 500; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (max-width: 520px) {
  .fb-1 { inset-inline-start: -2%; }
  .fb-2 { inset-inline-end: -2%; }
  .float-badge { font-size: 12px; padding: 8px 12px; }
}
.scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--border); animation: bob 3s ease-in-out infinite;
}
.scroll-cue .ic { width: 18px; height: 18px; }
@media (max-height: 720px), (max-width: 959px) { .scroll-cue { display: none; } }

/* ── stats ── */
.stats-band { position: relative; margin-top: -30px; z-index: 2; }
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; padding: 0;
  border-radius: var(--radius); overflow: hidden; background: var(--border); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: calc(1180px - 64px);
}
@media (max-width: 767px) { .stats { margin-inline: 20px; width: auto; } }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 28px 22px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
:root[data-theme="dark"] .stat { background: var(--bg-2); }
@media all { /* dark is the default; light only when chosen */ :root:not([data-theme="light"]) .stat { background: var(--bg-2); } }
.stat-v { font-size: clamp(34px, 4vw, 46px); font-weight: 800; line-height: 1; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.fa .stat-v { letter-spacing: 0; }
.stat-l { font-size: 14px; color: var(--text-2); }

/* ── sections ── */
.section { padding: clamp(80px, 11vw, 130px) 0; position: relative; }
.section.alt { background: var(--bg-2); }
.section.alt::before, .section.alt::after { content: ""; position: absolute; inset-inline: 0; height: 1px; background: var(--border); }
.section.alt::before { top: 0; } .section.alt::after { bottom: 0; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.fa .kicker { letter-spacing: 0; font-size: 14.5px; }
.kicker::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad); }
h2 { margin-top: 14px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; }
.fa h2 { letter-spacing: 0; line-height: 1.4; font-weight: 800; }

/* about */
/* about: full-width headline, then text and focus cards side by side with
   matching top and bottom edges (cards stretch to the text's height) */
.about-head { max-width: none; margin-bottom: 40px; }
.about { display: grid; gap: 40px; }
@media (min-width: 960px) {
  .about { grid-template-columns: .95fr 1.05fr; gap: 56px; align-items: stretch; }
  :root[lang="en"] .about { grid-template-columns: .9fr 1.1fr; }   /* English card copy runs longer */
  .focus { display: grid; }   /* the card grid fills the column; spare height is shared between rows */
}
.prose { display: grid; gap: 18px; align-content: start; color: var(--text-2); font-size: 17px; }
/* Persian long-form text reads best justified (as in print); English stays ragged-right */
@media (min-width: 600px) { :root[lang="fa"] .prose { text-align: justify; text-justify: inter-word; } }
.focus-grid { display: grid; gap: 16px; }
@media (min-width: 600px) { .focus-grid { grid-template-columns: 1fr 1fr; } }
.focus-card, .skill-card, .cred-card, .edu-card, .tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.focus-card { padding: 22px; position: relative; overflow: hidden; }
.focus-card::after {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: var(--grad); opacity: 0; filter: blur(50px); transition: opacity .4s;
}
.focus-card:hover, .skill-card:hover, .cred-card:hover, .edu-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.focus-card:hover::after { opacity: .18; }
.focus-ic, .cred-ic, .edu-ic {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.focus-ic .ic, .cred-ic .ic, .edu-ic .ic { width: 22px; height: 22px; }
.focus-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.focus-card p { font-size: 15px; line-height: 1.75; color: var(--text-2); }

/* timeline */
.timeline { position: relative; display: grid; gap: 22px; }
.timeline::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 7px; width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2) 60%, transparent);
  border-radius: 2px; opacity: .55;
}
.tl-item { position: relative; display: grid; gap: 10px; padding-inline-start: 40px; }
@media (min-width: 860px) {
  .timeline::before { inset-inline-start: 207px; }
  .tl-item { grid-template-columns: 170px 1fr; gap: 0 70px; padding-inline-start: 0; }
}
.tl-dot {
  position: absolute; inset-inline-start: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--accent);
}
.tl-item.is-current .tl-dot { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
@media (min-width: 860px) { .tl-dot { inset-inline-start: 200px; top: 26px; } }
.tl-date { font-size: 14px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
@media (min-width: 860px) { .tl-date { padding-top: 22px; text-align: end; font-size: 15px; } }
.tl-card { padding: 24px 26px; }
.tl-card:hover { border-color: var(--border-strong); transform: translateX(4px); }
.fa .tl-card:hover { transform: translateX(-4px); }
.tl-card h3 { font-size: 19px; font-weight: 700; }
.tl-org { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 15px; font-weight: 500; }
.tl-org .ic { width: 16px; height: 16px; color: var(--accent); }
.tl-org .dot { color: var(--muted); }
.tl-card ul { margin-top: 14px; display: grid; gap: 8px; }
.tl-card li { position: relative; padding-inline-start: 22px; color: var(--text-2); font-size: 15.5px; }
.tl-card li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .78em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--grad); }
.fa .tl-card li::before { top: .9em; }

/* skills */
.skills-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.skill-card { padding: 24px; }
.skill-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.skill-card header .ic { width: 22px; height: 22px; color: var(--accent); }
.skill-card h3 { font-size: 17px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; line-height: 1.4;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: color .2s, border-color .2s, background .2s;
}
.fa .chips span[dir="ltr"] { font-family: "Inter", sans-serif; }
.chips span:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.skills-extra { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 768px) { .skills-extra { grid-template-columns: 1.6fr 1fr; } }
.lang-list { display: grid; gap: 10px; }
.lang-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.lang-list span { color: var(--text-2); font-size: 14.5px; }

/* credentials */
.cred-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .cred-grid { grid-template-columns: 1fr 1fr; } }
.cred-card { padding: 24px; display: flex; gap: 18px; align-items: flex-start; }
.cred-card .cred-ic { margin: 0; }
.cred-card h3 { font-size: 16.5px; font-weight: 700; line-height: 1.55; }
.fa .cred-card h3 { line-height: 1.8; }
.cred-card p { margin-top: 6px; font-size: 14.5px; color: var(--text-2); }
.link-btn { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14.5px; }
.link-btn .ic { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.fa .link-btn .ic { transform: scaleX(-1); }
.link-btn:hover .ic { transform: translate(2px, -2px); }
.fa .link-btn:hover .ic { transform: scaleX(-1) translate(2px, -2px); }

/* gallery */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip-btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text-2); transition: all .2s;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.doc { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.doc.is-hidden { display: none; }
.doc-thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3.3; padding: 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
  transition: border-color .3s, transform .35s var(--ease), box-shadow .35s;
}
.doc-thumb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 120%, var(--accent-soft), transparent 70%); }
.doc-thumb img {
  position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .35)); transition: transform .5s var(--ease);
}
.doc-thumb:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.doc-thumb:hover img { transform: scale(1.04) rotate(-.5deg); }
.doc-zoom {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--border);
  opacity: 0; transform: scale(.85); transition: all .25s var(--ease);
}
.doc-zoom .ic { width: 16px; height: 16px; }
.doc-thumb:hover .doc-zoom, .doc-thumb:focus-visible .doc-zoom { opacity: 1; transform: none; }
.doc figcaption { display: grid; gap: 3px; padding-inline: 4px; }
.doc-kind { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.fa .doc-kind { letter-spacing: 0; font-size: 13px; }
.doc strong { font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.doc-issuer { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.doc-date { font-size: 13px; color: var(--muted); }
.note { margin-top: 36px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.note .ic { width: 16px; height: 16px; color: var(--accent); }

/* education */
.edu-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .edu-grid { grid-template-columns: repeat(3, 1fr); } }
.edu-card { padding: 26px; display: flex; flex-direction: column; }
.edu-date { font-size: 13.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.edu-card h3 { margin-top: 6px; font-size: 18px; font-weight: 700; line-height: 1.4; }
.edu-field { margin-top: 4px; font-weight: 600; color: var(--text); font-size: 15px; }
.edu-school { margin-top: auto; padding-top: 14px; font-size: 14.5px; color: var(--text-2); }

/* contact */
.contact-card {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: clamp(40px, 7vw, 80px) clamp(22px, 5vw, 60px); border-radius: 32px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.contact-glow {
  position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(closest-side, var(--orb-2), transparent), radial-gradient(closest-side at 30% 60%, var(--orb-1), transparent);
  filter: blur(30px);
}
.contact-card .kicker { justify-content: center; }
.contact-card h2 { max-width: 16em; margin-inline: auto; }
.contact-text { margin: 18px auto 0; max-width: 36em; color: var(--text-2); font-size: 17px; }
.contact-items { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.contact-item {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 15px;
  transition: border-color .2s, transform .25s var(--ease);
}
a.contact-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-item .ic { width: 18px; height: 18px; color: var(--accent); }
.contact-links { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.contact-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 4px; color: var(--text-2); font-size: 14.5px; transition: color .2s; }
.contact-link:hover { color: var(--accent); }
.contact-link .ic { width: 16px; height: 16px; }
.contact-card .btn { margin-top: 36px; }

/* footer */
.footer { padding: 30px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer a:hover { color: var(--accent); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 20px; background: rgba(3, 6, 14, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lb-fig { margin: 0; display: grid; justify-items: center; gap: 14px; min-width: 0; color: #e9edf6; }
.lb-stage { position: relative; display: grid; place-items: center; max-width: 100%; }
.lb-fig img { display: block; max-width: 100%; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, .04); box-shadow: 0 30px 80px -20px #000;
  transform: scale(.97); transition: transform .35s var(--ease), filter .35s var(--ease), opacity .25s; }
.lightbox.is-open .lb-fig img { transform: none; }
/* while the full-size image loads: blurred thumbnail + spinner */
.lb-stage.is-loading img { filter: blur(6px) brightness(.7); }
.lb-spin { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18); border-top-color: #22d3ee; border-right-color: #a78bfa;
  opacity: 0; transition: opacity .2s; animation: lb-spin .8s linear infinite; pointer-events: none; }
.lb-stage.is-loading .lb-spin { opacity: 1; transition-delay: .12s; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lb-spin { animation-duration: 2.4s; } }
.lb-fig figcaption { text-align: center; display: grid; gap: 2px; }
.lb-fig strong { font-size: 16px; }
.lb-fig span { font-size: 13.5px; color: #a9b3c7; }
.lightbox .icon-btn { width: 46px; height: 46px; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.lb-close { position: absolute; top: 16px; inset-inline-end: 16px; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; padding: 70px 12px 90px; }
  .lb-nav { position: absolute; bottom: 22px; }
  .lb-prev { inset-inline-start: calc(50% - 58px); }
  .lb-next { inset-inline-end: calc(50% - 58px); }
}

/* reveal (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .hero-bg, .scroll-cue, .lightbox, .filters { display: none !important; }
  .section { padding: 30px 0; }
}
