/* =========================================================
   gabriel.migama.ro — Portfolio
   Stil inspirat de Intel Graphics Software (albastru/cyan)
   Temă dark/light prin [data-theme] + variabile CSS
   ========================================================= */

/* ---------- Variabile temă ---------- */
:root{
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --maxw: 980px;
  --sidebar-w: 304px;
  --topbar-h: 64px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --t: .25s ease;
}

[data-theme="dark"]{
  --bg: #0a0f1a;
  --bg-glow: radial-gradient(1100px 520px at 18% -8%, rgba(0,199,253,.14), transparent 60%),
             radial-gradient(900px 480px at 110% 0%, rgba(10,110,209,.18), transparent 55%);
  --surface: #111a2b;
  --surface-2: #16223a;
  --surface-3: #1b2a45;
  --border: #213254;
  --border-soft: #1a2740;
  --text: #e9eff8;
  --muted: #95a6c0;
  --muted-2: #6f82a0;
  --primary: #2a8fff;
  --primary-2: #0a6ed1;
  --accent: #00c7fd;
  --ring: rgba(0,199,253,.30);
  --shadow: 0 16px 40px rgba(0,0,0,.45);
  --shadow-sm: 0 6px 18px rgba(0,0,0,.35);
  --grad: linear-gradient(135deg, #0a6ed1, #00c7fd);
  --chip-bg: rgba(0,199,253,.10);
  --chip-bd: rgba(0,199,253,.28);
}

[data-theme="light"]{
  --bg: #eef3fa;
  --bg-glow: radial-gradient(1100px 520px at 18% -10%, rgba(0,145,234,.14), transparent 60%),
             radial-gradient(900px 480px at 110% 0%, rgba(10,110,209,.12), transparent 55%);
  --surface: #ffffff;
  --surface-2: #f3f8fd;
  --surface-3: #e9f1fb;
  --border: #d7e3f2;
  --border-soft: #e4edf7;
  --text: #0d1b2e;
  --muted: #51637e;
  --muted-2: #7387a3;
  --primary: #0a6ed1;
  --primary-2: #0858a8;
  --accent: #0091ea;
  --ring: rgba(10,110,209,.22);
  --shadow: 0 16px 40px rgba(13,40,80,.12);
  --shadow-sm: 0 6px 18px rgba(13,40,80,.08);
  --grad: linear-gradient(135deg, #0a6ed1, #00a3e0);
  --chip-bg: rgba(10,110,209,.08);
  --chip-bd: rgba(10,110,209,.22);
}

/* ---------- Reset / base ---------- */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
h1,h2,h3,h4{ margin: 0; line-height: 1.25; font-weight: 700; }
p{ margin: 0; }
ul{ margin: 0; padding: 0; list-style: none; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.layout{ min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar{
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 22px;
  background: linear-gradient(180deg, var(--surface), var(--bg));
  border-right: 1px solid var(--border-soft);
  overflow-y: auto;
  z-index: 40;
}
.sidebar::-webkit-scrollbar{ width: 8px; }
.sidebar::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 8px; }

.profile{ text-align: center; }
.avatar{
  width: 116px; height: 116px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--surface-2), 0 0 26px var(--ring);
  background: var(--surface-2);
}
.name{ font-size: 1.42rem; letter-spacing: .2px; }
.role{
  margin-top: 4px;
  font-size: .9rem;
  color: var(--accent);
  font-weight: 600;
}
.profile-loc{
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.profile-loc svg{ width: 14px; height: 14px; }

/* nav */
.nav{ display: flex; flex-direction: column; gap: 4px; }
.nav a{
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .94rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--t);
}
.nav a svg{ width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover{ background: var(--surface-2); color: var(--text); }
.nav a.active{
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.nav a.active::before{
  content:""; width: 4px; height: 18px; border-radius: 4px;
  background: var(--grad); margin-left: -4px; margin-right: 4px;
}

/* controls */
.controls{
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.seg{
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.seg-btn{
  border: 0; cursor: pointer;
  background: transparent;
  color: var(--muted);
  font: 600 .82rem/1 var(--font);
  padding: 7px 14px;
  border-radius: 999px;
  transition: var(--t);
}
.seg-btn.active{ color: #fff; background: var(--grad); box-shadow: var(--shadow-sm); }

.icon-btn{
  width: 40px; height: 40px;
  display: grid; place-items: center;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: var(--t);
}
.icon-btn:hover{ border-color: var(--accent); color: var(--accent); }
.icon-btn svg{ width: 20px; height: 20px; }
.theme-toggle .i-sun{ display: none; }
.theme-toggle .i-moon{ display: block; }
[data-theme="light"] .theme-toggle .i-sun{ display: block; }
[data-theme="light"] .theme-toggle .i-moon{ display: none; }

/* ---------- Topbar (mobil) ---------- */
.topbar{
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  align-items: center; gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 50;
}
.topbar .tb-name{ font-weight: 700; font-size: 1.02rem; }
.topbar .tb-avatar{ width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); }
.hamburger{ margin-left: auto; }
.overlay{
  display: none;
  position: fixed; inset: 0;
  background: rgba(2,6,15,.55);
  z-index: 39;
}
.overlay.show{ display: block; }

/* ---------- Main ---------- */
.main{ margin-left: var(--sidebar-w); }
.container{ max-width: var(--maxw); margin: 0 auto; padding: 56px 32px 80px; }

.section{ padding-top: 26px; margin-bottom: 26px; scroll-margin-top: 24px; }
.section-head{ display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-head .s-ico{
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-bd);
  color: var(--accent);
}
.section-head .s-ico svg{ width: 20px; height: 20px; }
.section-title{ font-size: 1.3rem; letter-spacing: .2px; }
.section-sub{ font-size: .86rem; color: var(--muted); margin-top: 1px; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding: 38px 34px;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-2) 16%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::after{
  content:""; position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: var(--grad); opacity: .12; filter: blur(8px);
}
.hero .eyebrow{
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--accent);
  padding: 6px 12px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--chip-bd);
}
.hero h2{
  margin: 16px 0 12px;
  font-size: clamp(1.7rem, 1rem + 2.2vw, 2.6rem);
  letter-spacing: -.4px;
}
.hero h2 .grad{
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p{ color: var(--muted); max-width: 60ch; font-size: 1.02rem; }
.hero-actions{ margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn{
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px;
  font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border);
  transition: var(--t); cursor: pointer;
}
.btn svg{ width: 17px; height: 17px; }
.btn-primary{ background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.btn-primary:hover{ filter: brightness(1.07); transform: translateY(-1px); }
.btn-ghost{ background: var(--surface-2); color: var(--text); }
.btn-ghost:hover{ border-color: var(--accent); color: var(--accent); }

/* ---------- Timeline (experiență) ---------- */
.timeline{ position: relative; padding-left: 30px; }
.timeline::before{
  content:""; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent), transparent);
}
.tl-item{ position: relative; margin-bottom: 16px; }
.tl-item::before{
  content:""; position: absolute; left: -29px; top: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--chip-bg);
}
.tl-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: var(--t);
}
.tl-card:hover{ border-color: var(--accent); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.tl-period{
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .4px;
  color: var(--accent); margin-bottom: 6px;
  padding: 3px 10px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--chip-bd);
}
.tl-role{ font-size: 1.06rem; }
.tl-org{ color: var(--primary); font-weight: 600; font-size: .92rem; margin-top: 2px; }
.tl-desc{ color: var(--muted); font-size: .92rem; margin-top: 8px; }

/* ---------- Proiecte ---------- */
.grid-projects{ display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.project{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: var(--t);
}
.project:hover{ border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.project-media{
  position: relative; display: block; width: 100%; margin: 0; padding: 0;
  border: 0; border-bottom: 1px solid var(--border);
  background: var(--surface-2); cursor: zoom-in; overflow: hidden;
}
.project-media:focus-visible{ outline: 2px solid var(--accent); outline-offset: -2px; }
.project-img{ aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.project-media:hover .project-img{ transform: scale(1.05); }
.project-zoom{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; background: rgba(8,15,30,0);
  transition: var(--t);
}
.project-media:hover .project-zoom,
.project-media:focus-visible .project-zoom{ opacity: 1; background: rgba(8,15,30,.38); }
.project-zoom svg{ width: 36px; height: 36px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.project-body{ padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-name{ font-size: 1.12rem; display: flex; align-items: center; gap: 9px; }
.project-name .dot{ width: 9px; height: 9px; border-radius: 50%; background: var(--grad); flex: none; }
.project-desc{ color: var(--muted); font-size: .92rem; }
.project-list{ display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.project-list li{ position: relative; padding-left: 18px; font-size: .87rem; color: var(--muted); }
.project-list li::before{
  content:""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.tags{ display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 6px; }
.chip{
  font-size: .76rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  color: var(--accent);
  background: var(--chip-bg); border: 1px solid var(--chip-bd);
}
details.proj-details{ margin-top: 2px; }
details.proj-details > summary{
  cursor: pointer; list-style: none;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  display: inline-flex; align-items: center; gap: 6px;
}
details.proj-details > summary::-webkit-details-marker{ display: none; }
details.proj-details > summary::after{ content: "▾"; transition: var(--t); }
details.proj-details[open] > summary::after{ transform: rotate(180deg); }

/* ---------- Lightbox (imagini proiecte la dimensiune completă) ---------- */
.lightbox{
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(3,7,15,.86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lightbox.open{ display: flex; animation: lb-fade .2s ease; }
@keyframes lb-fade{ from{ opacity: 0; } to{ opacity: 1; } }
.lightbox-figure{
  margin: 0; max-width: 1200px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: lb-zoom .22s ease;
}
@keyframes lb-zoom{ from{ transform: scale(.96); opacity: .6; } to{ transform: scale(1); opacity: 1; } }
.lightbox-img{
  max-width: 100%; max-height: 86vh; width: auto; height: auto;
  object-fit: contain; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  background: #0d1422;
}
.lightbox-caption{ color: #e9eff8; font-size: .92rem; font-weight: 600; text-align: center; }
.lightbox-close{
  position: absolute; top: 18px; right: 20px;
  width: 44px; height: 44px; display: grid; place-items: center;
  cursor: pointer; border-radius: 12px; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  transition: var(--t);
}
.lightbox-close:hover{ background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.lightbox-close svg{ width: 22px; height: 22px; }

/* ---------- Competențe ---------- */
.skill-group{ margin-bottom: 22px; }
.skill-group-title{
  font-size: .82rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.skill-group-title::after{ content:""; flex: 1; height: 1px; background: var(--border-soft); }
.skill-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.skill{
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 18px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--t);
}
.skill:hover{ border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.skill img{ width: 40px; height: 40px; object-fit: contain; }
.skill .skill-fallback{
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 1.1rem;
}
.skill span{ font-size: .82rem; font-weight: 600; color: var(--text); text-align: center; }

/* ---------- Educație ---------- */
.grid-edu{ display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.edu{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: var(--t);
}
.edu:hover{ border-color: var(--accent); box-shadow: var(--shadow-sm); }
.edu-top{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.edu-period{
  font-size: .76rem; font-weight: 700; color: var(--accent);
  padding: 3px 10px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--chip-bd);
}
.edu-type{ font-size: .74rem; color: var(--muted-2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.edu-title{ font-size: 1.08rem; }
.edu-school{ color: var(--primary); font-weight: 600; font-size: .9rem; margin-top: 3px; }
.edu-meta{ display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.edu-meta a{ color: var(--accent); }
.edu-meta a:hover{ text-decoration: underline; }
details.edu-details{ margin-top: 12px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
details.edu-details > summary{
  cursor: pointer; list-style: none;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  display: inline-flex; align-items: center; gap: 6px;
}
details.edu-details > summary::-webkit-details-marker{ display: none; }
details.edu-details > summary::after{ content: "▾"; transition: var(--t); }
details.edu-details[open] > summary::after{ transform: rotate(180deg); }
.edu-details .ed-row{ font-size: .85rem; color: var(--muted); margin-top: 8px; }
.edu-details .ed-row b{ color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.grid-contact{ display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-card{
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--t);
}
.contact-card:hover{ border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.contact-ico{
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--grad); color: #fff;
}
.contact-ico svg{ width: 22px; height: 22px; }
.contact-label{ font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.contact-val{ font-weight: 600; font-size: .95rem; word-break: break-word; }

/* ---------- Footer ---------- */
.footer{
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  text-align: center; color: var(--muted-2); font-size: .84rem;
}
.footer b{ color: var(--muted); font-weight: 600; }

/* ---------- Reveal animații ---------- */
.reveal{ opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible{ opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .sidebar{
    transform: translateX(-100%);
    transition: transform .3s ease;
    width: min(86vw, 320px);
    box-shadow: var(--shadow);
  }
  .sidebar.open{ transform: translateX(0); }
  .topbar{ display: flex; }
  .main{ margin-left: 0; }
  .container{ padding: calc(var(--topbar-h) + 26px) 18px 64px; }
  .hero{ padding: 28px 22px; }
}
@media (max-width: 480px){
  .container{ padding: calc(var(--topbar-h) + 18px) 14px 52px; }
  .grid-projects, .grid-edu{ grid-template-columns: 1fr; }
}

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