/* ─────────────────────────────────────────────────────────────
   Mart — portfolio styles
   Design: deep near-black canvas, emerald accent, glass cards,
   restrained motion. Built to feel current without gimmicks.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #111114;
  --surface:   rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border:    rgba(255, 255, 255, 0.09);
  --border-2:  rgba(255, 255, 255, 0.16);
  --text:      #ededf0;
  --text-dim:  #a1a1aa;
  --text-mute: #6b6b76;
  --accent:    #34d399;
  --accent-2:  #10b981;
  --accent-3:  #2dd4bf;
  --grad:      linear-gradient(120deg, #34d399 0%, #2dd4bf 45%, #38bdf8 100%);
  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1140px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

::selection { background: rgba(52, 211, 153, 0.28); color: #fff; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; }
strong { color: var(--text); font-weight: 600; }

/* ── background ambience ────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  border-radius: 50%; filter: blur(120px); opacity: 0.5;
}
.bg-glow--1 { top: -180px; left: 50%; transform: translateX(-50%); width: 700px; height: 480px; background: radial-gradient(circle, rgba(52,211,153,0.30), transparent 65%); }
.bg-glow--2 { top: 700px; right: -200px; width: 520px; height: 520px; background: radial-gradient(circle, rgba(56,189,248,0.16), transparent 65%); }

/* ── layout helpers ─────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(70px, 11vw, 140px) clamp(20px, 5vw, 40px);
}
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__index {
  display: inline-block; font-family: "Space Grotesk", monospace;
  font-size: 0.8rem; color: var(--accent); letter-spacing: 0.18em;
  margin-bottom: 14px; opacity: 0.85;
}
.section__title { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.section__desc { color: var(--text-dim); margin-top: 16px; font-size: 1.05rem; max-width: 52ch; }

/* ── buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.94rem; font-weight: 550; padding: 12px 20px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.25s var(--ease); white-space: nowrap;
}
.btn svg { transition: transform 0.25s var(--ease); }
.btn--primary { background: var(--grad); color: #04140d; font-weight: 600; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(52,211,153,0.55); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-2); transform: translateY(-2px); }

/* ── nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 16px clamp(20px, 5vw, 40px);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.nav__logo { display: flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.nav__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--grad); color: #04140d;
  font-weight: 700; font-size: 1.1rem;
}
.nav__name { font-size: 1.05rem; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; transition: color 0.2s; position: relative; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:hover::after { width: 100%; }
.nav__cv { padding: 9px 16px; font-size: 0.88rem; }

/* ── hero ───────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(130px, 20vh, 210px) clamp(20px, 5vw, 40px) clamp(50px, 8vw, 90px);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.85rem; color: var(--text-dim); font-weight: 500;
  padding: 7px 15px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); margin-bottom: 28px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.55);} 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0);} }

.hero__title { font-size: clamp(2.6rem, 8vw, 5.4rem); letter-spacing: -0.035em; margin-bottom: 28px; }
.hero__title-sub { color: var(--text-dim); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-dim); max-width: 58ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.hero__stats {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border);
}
.hero__stats li { display: flex; flex-direction: column; gap: 4px; }
.stat__num { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; }
.stat__label { color: var(--text-mute); font-size: 0.85rem; }

/* ── marquee ────────────────────────────────────────────── */
.marquee {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 18px 0; overflow: hidden; background: rgba(255,255,255,0.012);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; gap: 26px; width: max-content; animation: scroll 38s linear infinite; }
.marquee__track span { font-family: "Space Grotesk", sans-serif; font-size: 1.15rem; font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.marquee__track span:nth-child(odd) { color: var(--text-mute); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ── projects ───────────────────────────────────────────── */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  display: flex; flex-direction: column;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s var(--ease);
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(52,211,153,0.10), transparent 40%);
  pointer-events: none; /* let clicks pass through to the links below */
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card--feature { grid-column: span 1; }
.card__top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card__badge {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); padding: 5px 10px; border-radius: 7px;
  background: rgba(52,211,153,0.10); border: 1px solid rgba(52,211,153,0.22);
}
.card__type { font-size: 0.78rem; color: var(--text-mute); }
.card__title { font-size: 1.6rem; margin-bottom: 12px; }
.card--feature .card__title { font-size: 1.9rem; }
.card__text { color: var(--text-dim); font-size: 0.98rem; flex: 1; }
.card__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.card__tags li {
  font-size: 0.78rem; color: var(--text-dim);
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.card__links { margin-top: auto; position: relative; z-index: 1; }
.card__link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 550;
  color: var(--text); transition: color 0.2s, gap 0.2s;
}
.card__link:hover { color: var(--accent); gap: 9px; }

/* ── about ──────────────────────────────────────────────── */
.about { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(28px, 6vw, 80px); margin-bottom: 90px; }
.about__lead { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 500; line-height: 1.3; margin-bottom: 26px; letter-spacing: -0.02em; }
.about__body p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.04rem; }
.about__body p:last-child { margin-bottom: 0; }

/* ── timeline ───────────────────────────────────────────── */
.timeline__title { font-size: 1.5rem; margin-bottom: 32px; }
.timeline__list { list-style: none; position: relative; }
.timeline__list::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl { position: relative; display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding: 0 0 38px 28px; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: -4px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); transition: box-shadow 0.3s;
}
.tl:hover::before { box-shadow: 0 0 0 5px rgba(52,211,153,0.15); }
.tl__years { font-family: "Space Grotesk", monospace; font-size: 0.86rem; color: var(--text-mute); padding-top: 2px; }
.tl__body h4 { font-size: 1.15rem; margin-bottom: 3px; }
.tl__org { color: var(--accent); font-size: 0.92rem; font-weight: 500; margin-bottom: 9px; }
.tl__desc { color: var(--text-dim); font-size: 0.96rem; }

/* ── skills ─────────────────────────────────────────────── */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-group { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color 0.3s, transform 0.3s var(--ease); }
.skill-group:hover { border-color: var(--border-2); transform: translateY(-3px); }
.skill-group h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 16px; }
.skill-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li { font-size: 0.9rem; color: var(--text-dim); padding: 6px 12px; border-radius: 9px; background: rgba(255,255,255,0.025); border: 1px solid var(--border); }

/* ── contact ────────────────────────────────────────────── */
.section--contact { padding-bottom: clamp(60px, 9vw, 120px); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 70px); align-items: start; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.contact__form { display: flex; flex-direction: column; gap: 16px; padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s, background 0.2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: rgba(0,0,0,0.4); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); }
.contact__form .btn { justify-content: center; margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__status { font-size: 0.88rem; min-height: 1.2em; text-align: center; }
.form__status.is-ok { color: var(--accent); }
.form__status.is-err { color: #f87171; }

/* ── footer ─────────────────────────────────────────────── */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px clamp(20px, 5vw, 40px); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap;
  color: var(--text-mute); font-size: 0.9rem;
}
.footer__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-family: "Space Grotesk", sans-serif; font-weight: 700; color: var(--accent); }
.footer p { flex: 1; }
.footer__top { color: var(--text-dim); transition: color 0.2s; }
.footer__top:hover { color: var(--accent); }

/* ── reveal animation ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 880px) {
  .nav__links { display: none; }
  .projects { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
}
@media (max-width: 560px) {
  .nav__cv span, .nav__name { display: inline; }
  .skills { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 1fr; gap: 6px; }
  .tl__years { padding-top: 0; }
  .footer { flex-direction: column; text-align: center; }
}
