/* ============================================================
   Angel Stoynov — portfolio
   JetBrains-adjacent: geometric type, sharp 0-radius panels,
   one diagonal duotone slab as the single bold moment.
   ============================================================ */

:root {
  --bg: #0A0A0B;
  --surface: #141417;
  --surface-2: #19191C;
  --ink: #F5F5F4;
  --muted: #9B9BA0;
  --faint: #6A6A70;
  --line: #2A2A2E;
  --line-strong: #3A3A40;

  /* JetBrains-style duotone + single data accent */
  --violet: #A371F7;
  --pink: #FF318C;
  --green: #3DDC84;
  --grad: linear-gradient(115deg, var(--violet), var(--pink));

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);

  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .sr { opacity: 1 !important; transform: none !important; }
}

/* one orchestrated hero reveal on load, staggered by --d */
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  animation: reveal-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--d, 0) * 90ms);
}

/* scroll reveal — IntersectionObserver adds .sr--in */
.sr {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.22, 1, .36, 1), transform .6s cubic-bezier(.22, 1, .36, 1);
}
.sr--in { opacity: 1; transform: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

a { color: inherit; text-decoration: none; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; font-weight: 600;
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,11,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__inner {
  display: flex; align-items: center; gap: 32px;
  height: 64px;
}
.mark {
  font-family: var(--f-display); font-weight: 700; font-size: 20px;
  letter-spacing: -0.02em;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--grad); color: #fff;
}
.nav { display: flex; gap: 26px; margin-right: auto; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .15s; }
.nav a:hover { color: var(--ink); }
.top__links { display: flex; gap: 18px; font-size: 15px; font-weight: 500; }
.top__links a { color: var(--muted); transition: color .15s; }
.top__links a:hover { color: var(--green); }

/* active nav link: ink color + gradient underline */
.nav a.is-active { color: var(--ink); position: relative; }
.nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--grad);
}

/* mobile nav toggle (hamburger) — hidden on desktop */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-strong); cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad); display: none;
  }
  .nav.nav--open { display: flex; }
  .nav a { padding: 12px 0; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 9vh, 96px) 0 clamp(48px, 8vh, 96px); position: relative; overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(28px, 5vw, 72px); align-items: stretch;
}
.hero__content { display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }
.hero__role {
  font-family: var(--f-mono); font-size: 14px; color: var(--green);
  margin: 0 0 22px; letter-spacing: 0.02em;
}
.hero__photo-panel {
  margin: 0; position: relative; justify-self: stretch;
  width: 100%; max-width: 340px; height: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 18px; overflow: hidden;
}
.hero__photo-panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(145deg, transparent 55%, rgba(163,113,247,0.28), rgba(255,49,140,0.30));
  mix-blend-mode: screen; pointer-events: none;
}
.hero__photo { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(0.15) contrast(1.02); }
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__photo-panel { justify-self: start; order: -1; max-width: 240px; }
}
.hero__name {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(52px, 8.5vw, 112px); line-height: 0.94;
  letter-spacing: -0.04em; margin: 0 0 30px;
}
.hero__line { display: block; }
.hero__line--cut {
  width: fit-content;
  line-height: 1; padding-bottom: 0.12em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero__lead {
  max-width: 58ch; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.5;
  color: var(--ink); margin: 0;
}
.hero__meta {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  margin: clamp(32px, 5vw, 48px) 0 40px;
}
.hero__meta > div { background: var(--bg); padding: 20px 22px; }
.hero__meta dt { font-family: var(--f-mono); font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.hero__meta dd { margin: 0; font-size: 15px; color: var(--ink); font-weight: 500; }
@media (max-width: 720px) { .hero__meta { grid-template-columns: 1fr; } }

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: var(--f-mono); font-size: 14px; font-weight: 500;
  padding: 13px 20px; border: 1px solid var(--line-strong);
  color: var(--ink); transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn--accent { border-color: var(--violet); color: #fff; }
.btn--accent:hover { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- section bands ---------- */
.band { padding: clamp(60px, 10vh, 120px) 0; border-top: 1px solid var(--line); }
.band--alt { background: var(--surface); }
.band__note { max-width: 62ch; color: var(--muted); margin: -8px 0 48px; font-size: 16px; }

.h-section {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.02em;
  margin: 0 0 44px; display: flex; align-items: center; gap: 16px;
}
.tick { width: 14px; height: 14px; background: var(--grad); display: inline-block; flex: none; }

/* ---------- work / roles ---------- */
.role { padding: 34px 0; border-top: 1px solid var(--line); }
.role:first-of-type { border-top: none; padding-top: 0; }
.role__head {
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.role__title { font-family: var(--f-display); font-weight: 600; font-size: 23px; margin: 0 0 6px; letter-spacing: -0.01em; }
.role__org { margin: 0 0 6px; color: var(--ink); font-weight: 500; }
.role__stack { margin: 0; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.role__when { font-family: var(--f-mono); font-size: 14px; color: var(--green); white-space: nowrap; margin: 2px 0 0; }
.role__points {
  margin: 0; padding: 0; list-style: none;
  columns: 2; column-gap: 48px;
}
.role__points li {
  break-inside: avoid; padding: 0 0 14px 20px; position: relative;
  color: var(--muted); font-size: 15.5px; line-height: 1.5;
}
.role__points li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 7px; height: 1px; background: var(--pink);
}
@media (max-width: 760px) { .role__points { columns: 1; } }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 900px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }
.skill-group { background: var(--bg); padding: 26px 24px; }
.band--alt .skill-group { background: var(--surface); }
.skill-group h3 { font-family: var(--f-mono); font-size: 13px; color: var(--green); margin: 0 0 18px; font-weight: 500; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  font-size: 14px; padding: 6px 12px; border: 1px solid var(--line-strong);
  color: var(--ink);
}
.skill-tag[data-level="pro"] { border-color: var(--violet); color: #fff; }
.skill-tag[data-level="adv"] { border-color: var(--line-strong); }
.skill-tag[data-level="fund"] { color: var(--muted); border-color: var(--line); }
.skill-legend, .project-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); background: var(--bg);
  padding: 28px 26px; transition: border-color .18s, transform .18s;
}
.band--alt .project { background: var(--surface-2); }
.project:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.project__badge { font-family: var(--f-mono); font-size: 11px; color: var(--bg); background: var(--green); padding: 4px 8px; font-weight: 700; }
.project__badge--fork { background: var(--violet); color: #fff; }
.project__module { font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.project__title { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin: 0 0 12px; letter-spacing: -0.01em; }
.project__desc { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 22px; flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.project__tags span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 4px 9px; }
.project__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.project__link {
  font-family: var(--f-mono); font-size: 13px; color: var(--ink);
  border: 1px solid var(--line-strong); padding: 7px 12px;
  transition: border-color .15s, color .15s;
}
.project__link:hover { color: var(--green); border-color: var(--green); }

/* ---------- certifications strip ---------- */
.cert-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px);
  gap: 16px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 0 20px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.cert-strip::-webkit-scrollbar { height: 8px; }
.cert-strip::-webkit-scrollbar-thumb { background: var(--line-strong); }
.cert-strip::-webkit-scrollbar-track { background: transparent; }
.cert {
  scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px;
  min-height: 150px; padding: 22px 20px; background: var(--bg);
  border: 1px solid var(--line);
}
.cert__issuer { font-family: var(--f-mono); font-size: 12px; color: var(--green); }
.cert__title { font-family: var(--f-display); font-weight: 600; font-size: 17px; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.cert__foot { margin-top: auto; font-family: var(--f-mono); font-size: 12px; color: var(--faint); }

/* ---------- about grid ---------- */
.about { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; }
.about .h-section { font-size: clamp(22px, 3vw, 28px); margin-bottom: 32px; }
.about__col .line-item { padding: 18px 0; border-top: 1px solid var(--line); }
.about__col .line-item:first-of-type { border-top: none; padding-top: 0; }
.line-item h3 { font-family: var(--f-display); font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.line-item__org { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.line-item__when { margin: 0; font-family: var(--f-mono); font-size: 13px; color: var(--faint); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px 0; }
.foot__inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 20px 40px; }
.foot__name { font-family: var(--f-display); font-weight: 700; font-size: 20px; margin: 0; margin-right: auto; }
.foot__links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot__links a { color: var(--muted); font-size: 15px; transition: color .15s; }
.foot__links a:hover { color: var(--green); }
.foot__fine { width: 100%; margin: 8px 0 0; font-family: var(--f-mono); font-size: 12px; color: var(--faint); }

/* ---------- toast (copy-email confirmation) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--bg);
  font-family: var(--f-mono); font-size: 14px; padding: 12px 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 80;
}
.toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
