/* ============================================
   ivan.tech — Full CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- TOKENS ---- */
:root {
  --bg: #07090f;
  --bg2: #0d1018;
  --bg3: #131720;
  --fg: #eef1f8;
  --fg2: #8a93a8;
  --accent: #2563ff;
  --accent2: #1a4fd8;
  --accentg: rgba(37,99,255,0.12);
  --card: #0f1219;
  --border: #1e2535;
  --nav-h: 64px;
}
.light {
  --bg: #f4f6fb;
  --bg2: #ebeef5;
  --bg3: #e1e6f0;
  --fg: #0a0c12;
  --fg2: #5a6178;
  --accent: #2055e8;
  --accent2: #1644c9;
  --accentg: rgba(32,85,232,0.08);
  --card: #fff;
  --border: #d0d6e8;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background .3s, color .3s;
}

/* ---- NAV ---- */
nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg); border-bottom: 1px solid var(--border);
  height: var(--nav-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 2rem;
}
.logo {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 1.2rem; letter-spacing: -0.03em;
  color: var(--fg); text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.8rem; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--fg2);
  font-size: .875rem; transition: color .2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; gap: .8rem; align-items: center; }
.theme-btn {
  background: none; border: 1px solid var(--border);
  color: var(--fg2); padding: 6px 14px; border-radius: 20px;
  cursor: pointer; font-size: .78rem; transition: all .2s; white-space: nowrap;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn {
  display: none; background: none; border: none;
  color: var(--fg); cursor: pointer; font-size: 1.4rem; padding: 4px;
}
.mobile-menu {
  display: none; flex-direction: column; gap: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  text-decoration: none; color: var(--fg); font-size: 1rem;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border);
}

/* ---- HERO ---- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  padding: 5rem 2rem; position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute; top: 10%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 500px;
  background: radial-gradient(ellipse, rgba(37,99,255,0.1) 0%, transparent 65%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px; opacity: .3; pointer-events: none;
}
.hero-content {
  max-width: 1100px; margin: 0 auto; width: 100%; position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accentg); border: 1px solid rgba(37,99,255,.3);
  padding: 6px 16px; border-radius: 20px; font-size: .78rem;
  color: var(--accent); margin-bottom: 2.5rem; font-weight: 500;
}
.hero-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }

h1 {
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 1.5rem;
}
h1 .accent { color: var(--accent); }
h1 .muted { color: var(--fg2); font-weight: 400; }
.hero-sub {
  font-size: 1.1rem; color: var(--fg2); max-width: 540px;
  margin-bottom: 3rem; font-weight: 300; line-height: 1.8;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 5rem; }

.btn-primary {
  background: var(--accent); color: #fff;
  padding: 13px 30px; border-radius: 6px; text-decoration: none;
  font-weight: 500; font-size: .9rem; transition: transform .2s, background .2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); }
.btn-secondary {
  border: 1px solid var(--border); color: var(--fg);
  padding: 13px 30px; border-radius: 6px; text-decoration: none;
  font-weight: 400; font-size: .9rem; transition: all .2s; display: inline-block;
}
.btn-secondary:hover { border-color: var(--fg2); }

.hero-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.stat { padding: 1.8rem 2rem; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-n {
  font-family: 'Outfit', sans-serif; font-size: 2.2rem;
  font-weight: 800; color: var(--fg); line-height: 1;
}
.stat-n span { color: var(--accent); }
.stat-l { font-size: .82rem; color: var(--fg2); margin-top: .4rem; }

/* ---- TECH STRIP ---- */
.tech-strip {
  padding: 1.5rem 2rem; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); background: var(--bg2); overflow: hidden;
}
.tech-track {
  display: flex; gap: 2.5rem; align-items: center;
  width: max-content; animation: scroll 28s linear infinite;
}
@keyframes scroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }
.tech-item { font-size: .8rem; color: var(--fg2); white-space: nowrap; display: flex; align-items: center; gap: .5rem; }
.tech-item strong { color: var(--fg); font-weight: 500; }
.tech-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .5; }

/* ---- SECTIONS ---- */
section { padding: 6rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .8rem; font-weight: 500;
}
h2 {
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.03em; margin-bottom: 1rem;
}
.divider {
  width: 2.5rem; height: 3px; background: var(--accent);
  margin-bottom: 2rem; border-radius: 2px;
}

/* ---- ABOUT ---- */
.about-grid {
  display: grid; grid-template-columns: 5fr 7fr;
  gap: 5rem; align-items: center;
}
.about-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 2.5rem; position: relative; overflow: hidden;
}
.about-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--accent);
}
.about-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accentg); border: 2px solid rgba(37,99,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 1.8rem;
  font-weight: 800; color: var(--accent); margin-bottom: 1.5rem;
}
.about-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.5rem; margin-bottom: .3rem; }
.about-role { color: var(--accent); font-size: .88rem; font-weight: 500; margin-bottom: 1.5rem; }
.about-location, .about-since { display: flex; align-items: center; gap: .5rem; color: var(--fg2); font-size: .82rem; margin-bottom: .5rem; }
.about-text p { color: var(--fg2); font-size: .95rem; line-height: 1.85; margin-bottom: 1rem; }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.5rem; }
.skill-item {
  background: var(--bg3); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 6px; font-size: .8rem;
  color: var(--fg2); display: flex; align-items: center; gap: .5rem;
}
.skill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ---- SERVICES ---- */
.services-section { background: var(--bg2); }
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; margin-top: 3rem; }
.service-card {
  background: var(--card); border: 1px solid var(--border);
  padding: 2rem 1.8rem; border-radius: 10px;
  transition: border-color .3s, transform .3s; position: relative; overflow: hidden;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.service-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .3s; transform-origin: left;
}
.service-card:hover::after { transform: scaleX(1); }
.svc-icon { font-size: 1.6rem; margin-bottom: 1.2rem; display: block; }
.service-card h3 { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: .7rem; color: var(--fg); }
.service-card p { color: var(--fg2); font-size: .85rem; line-height: 1.7; margin-bottom: 1.2rem; }
.svc-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.svc-tag { background: var(--accentg); color: var(--accent); padding: 3px 9px; border-radius: 3px; font-size: .72rem; font-weight: 500; }

/* ---- BLOG ---- */
.blog-section { background: var(--bg2); }
.blog-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem; }
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.loading-msg { color: var(--fg2); font-size: .9rem; }
.blog-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; transition: border-color .3s, transform .3s; cursor: pointer;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.blog-thumb {
  height: 160px; background: var(--bg3);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
}
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-thumb-placeholder { font-size: 2.5rem; opacity: .3; }
.blog-body { padding: 1.5rem; }
.blog-meta { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.blog-date { font-size: .73rem; color: var(--fg2); }
.blog-cat { font-size: .7rem; background: var(--accentg); color: var(--accent); padding: 2px 8px; border-radius: 3px; font-weight: 500; }
.blog-card h3 { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: .95rem; line-height: 1.4; margin-bottom: .6rem; color: var(--fg); }
.blog-card p { color: var(--fg2); font-size: .83rem; line-height: 1.65; }
.blog-read { display: inline-flex; align-items: center; gap: .3rem; color: var(--accent); font-size: .8rem; font-weight: 500; margin-top: 1rem; }

/* ---- ARTICLE VIEW ---- */
.article-view {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 500; overflow-y: auto; padding: 2rem;
}
.article-view.open { display: block; }
.article-inner { max-width: 720px; margin: 0 auto; }
.article-back {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--fg2); font-size: .88rem; cursor: pointer; margin-bottom: 2.5rem;
  background: none; border: none; font-family: 'DM Sans', sans-serif;
  transition: color .2s; padding: 0;
}
.article-back:hover { color: var(--fg); }
.article-cat {
  font-size: .72rem; background: var(--accentg); color: var(--accent);
  padding: 3px 10px; border-radius: 3px; font-weight: 500;
  display: inline-block; margin-bottom: 1rem;
}
.article-title {
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 1.2rem;
}
.article-meta {
  display: flex; gap: 1.5rem; color: var(--fg2); font-size: .83rem;
  margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}
.article-body { font-size: 1rem; line-height: 1.85; color: var(--fg2); }
.article-body h2 {
  font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 700;
  color: var(--fg); margin: 2.5rem 0 1rem;
}
.article-body p { margin-bottom: 1.2rem; }
.article-body img { width: 100%; border-radius: 8px; margin: 1.5rem 0; border: 1px solid var(--border); }
.article-body strong { color: var(--fg); font-weight: 500; }
.yt-embed { margin: 2rem 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; border: 1px solid var(--border); }
.yt-embed iframe { width: 100%; height: 100%; display: block; border: none; }
.yt-placeholder {
  width: 100%; aspect-ratio: 16/9; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .8rem; cursor: pointer; transition: border-color .2s; margin: 2rem 0;
}
.yt-placeholder:hover { border-color: var(--accent); }
.yt-play { width: 60px; height: 60px; background: #ff0000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.yt-title { color: var(--fg2); font-size: .88rem; text-align: center; padding: 0 1rem; }

/* ---- CONTACT ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 5rem; align-items: start; }
.contact-info p { color: var(--fg2); margin-bottom: 2rem; font-size: .95rem; line-height: 1.8; }
.contact-links { display: flex; flex-direction: column; gap: .8rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem; color: var(--fg2);
  text-decoration: none; font-size: .88rem; padding: .8rem 1rem;
  border-radius: 8px; border: 1px solid transparent; transition: all .2s;
}
.contact-link:hover { border-color: var(--border); color: var(--fg); background: var(--card); }
.clink-icon {
  width: 36px; height: 36px; background: var(--accentg); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0;
}
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .78rem; color: var(--fg2); font-weight: 500; letter-spacing: .03em; }
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--fg);
  padding: 11px 14px; border-radius: 6px; font-family: 'DM Sans', sans-serif;
  font-size: .9rem; transition: border-color .2s; outline: none; width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group select { appearance: none; cursor: pointer; }
.btn-submit {
  background: var(--accent); color: #fff; border: none;
  padding: 13px 28px; border-radius: 6px; font-weight: 500; font-size: .9rem;
  cursor: pointer; transition: background .2s, transform .2s; font-family: 'DM Sans', sans-serif;
}
.btn-submit:hover { background: var(--accent2); transform: translateY(-1px); }

/* ---- FOOTER ---- */
footer {
  padding: 2rem 2rem; border-top: 1px solid var(--border);
  background: var(--bg2);
}
.footer-top {
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 1.2rem; padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.footer-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; }
.footer-logo span { color: var(--accent); }
.footer-tagline { color: var(--fg2); font-size: .82rem; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .8rem;
}
.footer-bottom p { color: var(--fg2); font-size: .78rem; }
.footer-legal { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.footer-legal a {
  color: var(--fg2); text-decoration: none; font-size: .78rem;
  transition: color .2s;
}
.footer-legal a:hover { color: var(--accent); }
.footer-legal span { color: var(--border); font-size: .7rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 960px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats .stat:nth-child(2) { border-right: none; }
  .hero-stats .stat:nth-child(3) { border-top: 1px solid var(--border); grid-column: 1 / -1; }
  .skills-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  section { padding: 4rem 1.2rem; }
  nav { padding: 0 1.2rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .stat { border-right: none !important; border-top: 1px solid var(--border); }
  .stat:first-child { border-top: none; }
  .services-grid, .blog-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.6rem; }
}
