/* ==========================
   IvanWeb — Modern Portfolio UI
   Dark/Light theme, mobile-first
   ========================== */

:root{
  --bg0:#070A12;
  --bg1:#0B1224;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.12);

  --text:#ECF2FF;
  --muted:rgba(236,242,255,.72);

  --accent:#22C55E;     /* green */
  --accent2:#22D3EE;    /* cyan */
  --accent3:#A7F3D0;    /* mint */

  --radius: 18px;
  --shadow: 0 18px 55px rgba(0,0,0,.38);

  --container: 1100px;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 15% 12%, rgba(34,197,94,.20), transparent 60%),
    radial-gradient(900px 520px at 85% 18%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(167,243,208,.10), transparent 65%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

a{ color: inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
.container{
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

.section{ padding: 38px 0; }
.muted{ color: var(--muted); }

/* ===== PRELOADER ===== */
#preloader{
  position: fixed;
  inset: 0;
  background: var(--bg0);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.loader{
  width:54px; height:54px;
  border-radius:999px;
  border:4px solid rgba(255,255,255,.12);
  border-top:4px solid var(--accent2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HEADER ===== */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7,10,18,.55);
  border-bottom: 1px solid var(--line);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 0;
}
.logo{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 950;
  letter-spacing: .3px;
}
.logo-dot{
  width:12px;height:12px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(34,211,238,.35);
}

.menu{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.menu-link{
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(236,242,255,.80);
  font-weight: 850;
  font-size: 14px;
  transition: .2s;
}
.menu-link:hover{
  transform: translateY(-1px);
  border-color: rgba(34,211,238,.35);
  color: var(--text);
  box-shadow: 0 0 18px rgba(34,211,238,.10);
}
.menu-link.active{
  color: #06101F;
  background: linear-gradient(90deg, var(--accent2), var(--accent3));
  border-color: transparent;
}

.nav-actions{ display:flex; align-items:center; gap: 10px; }
.menu-actions{ display:none; }

.theme-btn, .burger{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: .2s;
}
.theme-btn:hover, .burger:hover{
  transform: translateY(-1px);
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 0 18px rgba(34,197,94,.10);
}

/* ===== HERO ===== */
.hero-grid{
  display:grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 18px;
  align-items: start;
}

.hero-card, .price-card, .panel, .cta, .project-card, .footer{
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.hero-card::before, .price-card::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(600px 220px at 10% 15%, rgba(34,211,238,.18), transparent 60%),
    radial-gradient(600px 220px at 90% 25%, rgba(34,197,94,.16), transparent 60%);
  pointer-events:none;
}
.hero-card > *, .price-card > *{ position:relative; z-index:1; }

.kicker{
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(236,242,255,.78);
  margin-bottom: 10px;
}

.title{
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.lead{
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

.hero-cta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  transition: .2s;
}
.btn:hover{
  transform: translateY(-2px);
  border-color: rgba(34,211,238,.35);
  box-shadow: 0 0 22px rgba(34,211,238,.12);
}
.btn.primary{
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none;
  color: #06101F;
}
.btn.ghost{
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
}
.btn-wide{ width: 100%; justify-content:center; }

.hero-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.stat{
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.stat-num{ font-weight: 950; margin-bottom: 4px; }
.stat-label{ color: var(--muted); font-size: 13px; }

/* ===== PRICE CARD ===== */
.card-title{ font-size: 18px; margin-bottom: 12px; }
.price-list{ display:grid; gap: 10px; }
.price-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.price-name{ font-weight: 950; }
.price-desc{ color: var(--muted); font-size: 13px; margin-top: 3px; }
.price-tag{
  font-weight: 950;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34,211,238,.14);
  border: 1px solid rgba(34,211,238,.22);
  white-space: nowrap;
}

.mini-note{
  margin-top: 14px;
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

/* ===== SECTION HEAD ===== */
.section-head{ margin-bottom: 12px; }
.section-title{
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(236,242,255,.80);
  margin-bottom: 8px;
}
.section-subtitle{ color: var(--muted); line-height: 1.6; }

/* ===== CARDS ===== */
.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.cardx{
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  transition: .2s;
}
.cardx:hover{
  transform: translateY(-2px);
  border-color: rgba(34,197,94,.28);
  box-shadow: 0 0 26px rgba(34,197,94,.10);
}
.cardx-icon{ font-size: 20px; margin-bottom: 10px; }
.cardx h3{ margin-bottom: 8px; }
.cardx p{ color: var(--muted); line-height: 1.6; }
.bullets{
  margin-top: 12px;
  list-style: none;
  display:grid;
  gap: 8px;
  color: var(--muted);
}
.bullets li::before{
  content:"✓";
  margin-right: 8px;
  color: rgba(34,211,238,.95);
}

/* ===== STEPS ===== */
.steps{ list-style: none; display:grid; gap: 10px; margin-top: 14px; }
.step{
  display:flex; gap: 12px; align-items:flex-start;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.step-num{
  width: 34px; height: 34px;
  display:grid; place-items:center;
  border-radius: 12px;
  font-weight: 950;
  background: rgba(34,197,94,.16);
  border: 1px solid rgba(34,197,94,.25);
}
.step h3{ margin-bottom: 4px; }
.step p{ color: var(--muted); line-height: 1.6; }

/* ===== CTA ===== */
.cta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 14px;
  padding: 22px;
}
.cta.small{ margin-top: 14px; }
.cta h2{ margin-bottom: 6px; }
.cta p{ color: var(--muted); }
.cta-actions{ display:flex; gap: 10px; flex-wrap:wrap; }

/* ===== PAGES ===== */
.page-head{
  margin-bottom: 14px;
}
.page-head h1{
  font-size: 34px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

/* split layout */
.split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.panel{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: none;
}
.chips{
  display:flex; gap: 8px; flex-wrap:wrap;
  margin-top: 12px;
}
.chip{
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-weight: 850;
  font-size: 13px;
  color: rgba(236,242,255,.82);
}

.checklist{
  list-style: none;
  display:grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
}
.checklist li::before{
  content:"✓";
  margin-right: 8px;
  color: rgba(34,197,94,.95);
}

/* ===== PROJECTS ===== */
.project-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.project-card{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: none;
  transition: .2s;
}
.project-card:hover{
  transform: translateY(-2px);
  border-color: rgba(34,211,238,.26);
  box-shadow: 0 0 24px rgba(34,211,238,.10);
}
.project-card.featured{
  border-color: rgba(34,211,238,.22);
  background: linear-gradient(180deg, rgba(34,211,238,.12), rgba(255,255,255,.05));
}
.project-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.22);
  white-space: nowrap;
}
.project-card p{ color: var(--muted); line-height: 1.6; }
.tags{ display:flex; gap: 8px; flex-wrap:wrap; margin-top: 12px; }
.tag{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-weight: 850;
  font-size: 12px;
  color: rgba(236,242,255,.80);
}
.project-actions{ display:flex; gap: 10px; flex-wrap:wrap; margin-top: 14px; }

/* ===== CONTACTS + FORM ===== */
.contact-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.contact-list{ display:grid; gap: 10px; margin-top: 12px; }
.contact-item{
  width:100%;
  text-align:left;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(236,242,255,.86);
  cursor:pointer;
}
.contact-item:hover{
  border-color: rgba(34,211,238,.26);
  box-shadow: 0 0 18px rgba(34,211,238,.08);
}
.hint{ color: var(--muted); font-weight: 700; margin-left: 6px; }

.form{ display:grid; gap: 12px; margin-top: 12px; }
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field{ display:grid; gap: 6px; }
.field span{ font-size: 14px; color: var(--muted); }

input, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline: none;
}
textarea{ min-height: 120px; resize: vertical; }
input:focus, textarea:focus{
  border-color: rgba(34,211,238,.35);
  box-shadow: 0 0 0 3px rgba(34,211,238,.12);
}

/* ===== SKILLS ===== */
.skill-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.skill{
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.skill-top{
  display:flex; justify-content:space-between; gap: 10px;
  margin-bottom: 10px;
}
.progress{
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
.progress-bar{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .7s ease;
}

/* ===== FOOTER ===== */
.footer{
  margin-top: 18px;
  padding: 22px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: none;
}
.footer-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.footer-contacts{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.footer-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  transition: .2s;
}
.footer-btn:hover{
  transform: translateY(-2px);
  border-color: rgba(34,211,238,.35);
  box-shadow: 0 0 22px rgba(34,211,238,.12);
}
.footer-copy{
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ===== BACK TO TOP ===== */
.to-top{
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  display:none;
  z-index:60;
}
.to-top.show{ display:block; }

/* ===== REVEAL ===== */
.reveal{
  opacity:0;
  transform: translateY(16px);
  transition: .55s ease;
}
.reveal.show{
  opacity:1;
  transform: translateY(0);
}

/* ===== MOBILE ===== */
.burger{ display:none; }

@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .cards{ grid-template-columns: 1fr; }
  .project-grid{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
  .skill-grid{ grid-template-columns: 1fr; }
  .hero-stats{ grid-template-columns: 1fr; }
  .footer-top{ flex-direction: column; }
}

@media (max-width: 640px){
  .burger{ display:inline-flex; }
  .nav-actions{ display:none; }
  .menu-actions{ display:flex; justify-content:flex-end; padding-top: 6px; }

  .menu{
    display:none;
    position:absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(7,10,18,.82);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 10px;
  }
  .menu.open{ display:flex; }

  .title{ font-size: 30px; }
  .hero-cta{ flex-direction: column; }
  .btn{ width: 100%; }
  .form-row{ grid-template-columns: 1fr; }
  .cta{ flex-direction: column; align-items: stretch; }
}

/* ===== LIGHT THEME ===== */
body.light{
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(34,197,94,.14), transparent 60%),
    radial-gradient(900px 520px at 85% 18%, rgba(34,211,238,.10), transparent 60%),
    #F6F7FB;
  color:#0B1224;
}
body.light .header{
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.light .menu-link{
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.08);
  color: rgba(11,18,36,.78);
}
body.light .menu-link:hover{ color:#0B1224; }
body.light .menu-link.active{ color:#06101F; }

body.light .hero-card,
body.light .price-card,
body.light .panel,
body.light .project-card,
body.light .cta,
body.light .footer{
  background: rgba(255,255,255,.78);
  border-color: rgba(0,0,0,.10);
}
body.light .cardx,
body.light .skill{
  background: rgba(255,255,255,.72);
  border-color: rgba(0,0,0,.10);
}
body.light .lead,
body.light .muted,
body.light .project-card p,
body.light .footer-copy{
  color: rgba(11,18,36,.70);
}
body.light input,
body.light textarea{
  background: rgba(0,0,0,.04);
  color: #0B1224;
  border-color: rgba(0,0,0,.10);
}
