/* ===================== TOKENS ===================== */
:root {
  --bg:        #07111F;
  --bg-alt:    #0A1524;
  --card:      #0D1B2A;
  --card-2:    #0F2033;
  --text:      #F3F6FA;
  --text-dim:  #9CAABD;
  --accent:    #3B82F6;
  --accent-2:  #60A5FA;
  --border:    #1E3045;
  --border-soft: #17273a;

  --maxw: 1160px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,.65);

  --ff-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ff-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ===================== RESET ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

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

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn--sm { padding: 8px 16px; font-size: 13.5px; border-radius: 8px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(59,130,246,.7); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,17,31,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.nav__logo { display: flex; align-items: center; gap: 11px; font-family: var(--ff-head); font-weight: 600; }
.nav__logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--accent-2); font-size: 14px; letter-spacing: .5px;
}
.nav__logo-text { font-size: 16px; }
.nav__links { display: flex; gap: 30px; }
.nav__links a { font-size: 14.5px; color: var(--text-dim); font-weight: 500; position: relative; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav__links a:hover::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: 18px; }
.nav__social { display: flex; gap: 14px; }
.nav__social a { color: var(--text-dim); transition: color .2s, transform .2s; display: grid; place-items: center; }
.nav__social a:hover { color: var(--accent-2); transform: translateY(-2px); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav__mobile { display: none; flex-direction: column; padding: 8px 24px 18px; border-bottom: 1px solid var(--border-soft); background: var(--bg); }
.nav__mobile a { padding: 12px 0; color: var(--text-dim); border-bottom: 1px solid var(--border-soft); font-weight: 500; }
.nav__mobile a:last-child { border-bottom: 0; color: var(--accent-2); }

/* ===================== HERO ===================== */
.hero { padding: clamp(70px, 12vw, 140px) 0 clamp(60px, 9vw, 110px); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 340px at 78% -8%, rgba(59,130,246,.14), transparent 70%),
    radial-gradient(520px 300px at 5% 8%, rgba(96,165,250,.07), transparent 70%);
}
.hero > .container { position: relative; }
.hero__eyebrow {
  color: var(--text-dim); font-size: 13.5px; font-weight: 500; letter-spacing: .3px;
  text-transform: uppercase; margin-bottom: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.hero__eyebrow .dot { color: var(--accent); margin: 0 8px; }
.hero__title {
  font-family: var(--ff-head); font-weight: 600;
  font-size: clamp(2.15rem, 5.4vw, 4rem); line-height: 1.07;
  letter-spacing: -.02em; max-width: 16ch; margin-bottom: 28px;
}
.hero__title .accent { color: var(--accent-2); }
.hero__bio { color: var(--text-dim); font-size: clamp(1rem, 1.5vw, 1.12rem); max-width: 62ch; margin-bottom: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 42px; }
.hero__contact-link { color: var(--accent-2); font-weight: 600; font-size: 15px; margin-left: 4px; transition: gap .2s, opacity .2s; }
.hero__contact-link:hover { opacity: .8; }
.hero__availability {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--text-dim); font-size: 14px;
  background: var(--card); border: 1px solid var(--border-soft);
  padding: 11px 18px; border-radius: 999px;
}
.pulse, .pulse::after { width: 9px; height: 9px; border-radius: 50%; background: #34d399; }
.pulse { position: relative; flex-shrink: 0; box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
.pulse::after { content: ""; position: absolute; inset: 0; animation: ping 1.9s cubic-bezier(0,0,.2,1) infinite; opacity: .75; }
@keyframes ping { 75%,100% { transform: scale(2.4); opacity: 0; } }

/* ===================== SECTIONS ===================== */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--border-soft); }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__label {
  display: inline-block; color: var(--accent); font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px;
}
.section__title { font-family: var(--ff-head); font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.02em; }
.section__sub { color: var(--text-dim); margin-top: 14px; font-size: 1.02rem; }

/* ===================== PROJECTS ===================== */
.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 64px);
  align-items: center; padding: clamp(30px, 4vw, 46px) 0;
}
.project + .project { border-top: 1px solid var(--border-soft); margin-top: 8px; }
.project--reverse .project__media { order: 2; }

.project__img-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(160deg, var(--card-2), var(--card));
  box-shadow: var(--shadow); aspect-ratio: 4 / 3;
}
.project__img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project__img-wrap:hover img { transform: scale(1.035); }
.project__img-wrap--placeholder { display: grid; place-items: center; }
.placeholder { text-align: center; color: var(--text-dim); padding: 24px; max-width: 260px; display: grid; gap: 12px; justify-items: center; }
.placeholder svg { color: var(--border); }
.placeholder span { font-size: 13.5px; line-height: 1.5; }

.project__thumbs { display: flex; gap: 12px; margin-top: 14px; }
.thumb {
  flex: 1; padding: 0; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; background: var(--card); aspect-ratio: 16 / 10;
  transition: border-color .2s, transform .2s; opacity: .7;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; transform: translateY(-2px); }
.thumb.is-active { border-color: var(--accent); opacity: 1; }

.project__num { font-family: var(--ff-head); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .1em; }
.project__title { font-family: var(--ff-head); font-weight: 600; font-size: clamp(1.35rem, 2.6vw, 1.85rem); letter-spacing: -.015em; margin: 10px 0 16px; line-height: 1.2; }
.project__desc { color: var(--text-dim); margin-bottom: 14px; font-size: .98rem; }
.project__desc--muted { color: #7f8fa4; font-size: .92rem; }
.project__meta { color: #6f8098; font-size: 13px; margin-top: 16px; font-style: italic; }

/* ===================== TAGS ===================== */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tags li {
  font-size: 12.5px; font-weight: 500; color: var(--accent-2);
  background: rgba(59,130,246,.09); border: 1px solid rgba(59,130,246,.28);
  padding: 5px 12px; border-radius: 999px;
}
.tags--soft li { color: var(--text-dim); background: var(--card-2); border-color: var(--border); }

/* ===================== SKILLS ===================== */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .25s, transform .25s;
}
.skill-card:hover { border-color: var(--border); transform: translateY(-3px); }
.skill-card h3 { font-family: var(--ff-head); font-weight: 600; font-size: 1.12rem; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.skill-card__ico { color: var(--accent); font-size: 12px; }

/* ===================== TIMELINE ===================== */
.timeline { display: grid; gap: 4px; max-width: 900px; }
.tl-item {
  display: grid; grid-template-columns: 220px 1fr; gap: 32px;
  padding: 28px 0; border-top: 1px solid var(--border-soft);
}
.tl-item:first-child { border-top: 0; }
.tl-item__side { display: flex; flex-direction: column; gap: 4px; }
.tl-item__date { color: var(--accent-2); font-weight: 600; font-size: 14px; }
.tl-item__place { color: var(--text-dim); font-size: 13.5px; }
.tl-item__main h3 { font-family: var(--ff-head); font-weight: 600; font-size: 1.2rem; margin-bottom: 8px; }
.tl-item__main p { color: var(--text-dim); font-size: .96rem; }
.tl-item__main strong { color: var(--text); font-weight: 600; }
.muted { color: #6f8098; }

/* ===================== CONTACT ===================== */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 40px; }
.contact-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 24px 22px;
  transition: border-color .22s, transform .22s, background .22s;
}
a.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); background: var(--card-2); }
.contact-card svg { color: var(--accent-2); margin-bottom: 8px; }
.contact-card__label { color: var(--text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.contact-card__value { font-weight: 600; font-size: 15px; word-break: break-word; }
.contact-card--static { opacity: .92; }

.langs { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; padding-top: 26px; border-top: 1px solid var(--border-soft); }
.langs__title { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.lang { color: var(--text); font-weight: 600; font-size: 15px; }
.lang em { color: var(--text-dim); font-weight: 400; font-style: normal; font-size: 13.5px; margin-left: 4px; }

/* ===================== FOOTER ===================== */
.footer { border-top: 1px solid var(--border-soft); padding: 30px 0; background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; color: var(--text-dim); font-size: 14px; }
.footer__links { display: flex; gap: 22px; }
.footer__links a { transition: color .2s; }
.footer__links a:hover { color: var(--accent-2); }

/* ===================== REVEAL ANIM ===================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .pulse::after { animation: none; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 940px) {
  .nav__links { display: none; }
  .nav__right { display: none; }
  .nav__toggle { display: flex; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav__mobile.is-open { display: flex; }

  .project { grid-template-columns: 1fr; gap: 26px; }
  .project--reverse .project__media { order: 0; }
  .skills { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .tl-item { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 520px) {
  .contact-grid { grid-template-columns: 1fr; }
  .hero__actions { gap: 12px; }
  .btn { width: 100%; }
  .hero__contact-link { width: 100%; text-align: center; }
}
