/* ============================================================
   Antonios Sigalas — Portfolio
   Modern Dark · cinematic · editorial-tech
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --bg-soft: #0e0e15;
  --surface: rgba(255, 255, 255, 0.026);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f3f4f8;
  --muted: #a2a7b8;
  --faint: #6b7185;

  --accent: #6d7cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(109, 124, 255, 0.14);
  --accent-glow: rgba(109, 124, 255, 0.45);
  --grad: linear-gradient(115deg, #8b93ff 0%, #6d7cff 40%, #22d3ee 100%);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
  --radius: 18px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* ---------- Ambient background layers ---------- */
.ambient {
  position: fixed; inset: 0; z-index: -3; overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.blob-1 { width: 620px; height: 620px; top: -18%; left: -8%;
  background: radial-gradient(circle, rgba(109,124,255,0.55), transparent 68%);
  animation: drift1 22s var(--ease) infinite alternate; }
.blob-2 { width: 520px; height: 520px; top: 12%; right: -12%;
  background: radial-gradient(circle, rgba(34,211,238,0.30), transparent 68%);
  animation: drift2 26s var(--ease) infinite alternate; }
.blob-3 { width: 560px; height: 560px; bottom: -22%; left: 32%;
  background: radial-gradient(circle, rgba(139,147,255,0.28), transparent 68%);
  animation: drift3 30s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(80px, 60px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-70px, 50px) scale(1.08); } }
@keyframes drift3 { to { transform: translate(50px, -60px) scale(1.12); } }

.grid-overlay {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 80%);
}
.scanline {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,15,0.0) 60%, rgba(10,10,15,0.9) 100%);
}

.cursor-glow {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px; z-index: -1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(109,124,255,0.10), transparent 60%);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.4s ease;
  will-change: transform;
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.1rem, 5vw, 3rem);
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(10,10,15,0.72); }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; }
.brand-mark {
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; color: #fff;
  background: var(--accent-soft); border: 1px solid var(--border-strong);
  color: var(--accent);
}
.brand-text { font-family: var(--display); letter-spacing: -0.01em; font-size: 0.98rem; }
.nav-links { display: flex; gap: 0.4rem; }
.nav-links a {
  position: relative; text-decoration: none; color: var(--muted);
  font-size: 0.9rem; padding: 0.5rem 0.85rem; border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-cta {
  text-decoration: none; font-size: 0.88rem; font-weight: 500;
  padding: 0.55rem 1.1rem; border-radius: 9px; color: var(--text);
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s var(--ease), background 0.2s ease;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 5vw, 2rem); }
.section { padding: clamp(4.5rem, 11vw, 8rem) 0; }

.section-head { max-width: 760px; margin-bottom: 3rem; }
.sec-idx {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--accent); text-transform: uppercase;
}
.sec-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem);
  line-height: 1.12; letter-spacing: -0.02em; margin-top: 0.9rem;
}
.sec-sub { color: var(--muted); margin-top: 0.9rem; }
.sec-sub a { color: var(--accent-2); text-decoration: none; }
.sec-sub a:hover { text-decoration: underline; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js .reveal[data-delay="1"].in { transition-delay: 0.09s; }
.js .reveal[data-delay="2"].in { transition-delay: 0.18s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 11px; text-decoration: none;
  font-weight: 500; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s ease, border-color 0.2s ease;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad); color: #0a0a0f; font-weight: 600;
  box-shadow: 0 8px 30px -10px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--accent-glow); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; font-family: var(--mono); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-top: 6rem; padding-bottom: 3rem;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--muted); font-family: var(--mono);
  padding: 0.4rem 0.85rem; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 1.6rem;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: pulse 2.2s 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-eyebrow {
  font-family: var(--mono); color: var(--muted); font-size: 0.92rem;
  letter-spacing: 0.02em; margin-bottom: 0.8rem;
}
.hero-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(3rem, 9vw, 6rem); line-height: 0.98;
  letter-spacing: -0.035em;
}
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-lede {
  max-width: 520px; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.18rem);
  margin-top: 1.6rem; line-height: 1.7;
}
.hero-lede strong { color: var(--text); font-weight: 600; }
.hero-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.6rem; }
.meta-item { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--faint); font-size: 0.9rem; }
.meta-item .ic { width: 17px; height: 17px; color: var(--accent); }
.hero-cta { display: flex; gap: 0.9rem; margin-top: 2.2rem; flex-wrap: wrap; }

/* Terminal card */
.terminal {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(20,20,30,0.75), rgba(12,12,20,0.75));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(109,124,255,0.05);
}
.term-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.tdot { width: 11px; height: 11px; border-radius: 50%; background: #3a3a45; }
.term-bar .tdot:nth-child(1) { background: #ff5f57; }
.term-bar .tdot:nth-child(2) { background: #febc2e; }
.term-bar .tdot:nth-child(3) { background: #28c840; }
.term-title { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.term-body {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.85;
  padding: 1.3rem 1.4rem; color: var(--muted); overflow-x: auto;
}
.term-body .tl { color: var(--text); }
.tp { color: var(--accent-2); }
.to { color: var(--muted); }
.tk { color: var(--accent); }
.ts { color: #8fe3a6; }
.caret {
  display: inline-block; width: 8px; height: 1em; background: var(--accent-2);
  vertical-align: -2px; animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 1.1rem 0; margin: 0 calc(-1 * clamp(1.1rem, 5vw, 2rem));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex; gap: 1.4rem; white-space: nowrap;
  font-family: var(--mono); font-size: 0.95rem; color: var(--muted);
  animation: scroll 34s linear infinite; will-change: transform;
}
.marquee-track span:not(:nth-child(2n)) { color: var(--text); }
.marquee-track span:nth-child(2n) { color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-lede p { color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.18rem); line-height: 1.75; }
.about-lede p + p { margin-top: 1.2rem; }
.about-lede strong { color: var(--text); }
.stat-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.stat-list li {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 1.1rem 1.3rem; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
}
.stat-num { font-family: var(--display); font-size: 1.8rem; font-weight: 600; color: var(--text); min-width: 3rem; }
.stat-label { color: var(--faint); font-size: 0.9rem; }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.cert-card {
  position: relative; padding: 1.5rem; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s ease, background 0.3s ease;
}
.cert-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.3s ease; pointer-events: none;
}
.cert-card:hover { transform: translateY(-5px); background: var(--surface-2); }
.cert-card:hover::before { opacity: 0.9; }
.cert-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.cert-badge {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--border-strong);
}
.cert-badge.mono { font-family: var(--mono); font-size: 0.85rem; }
.verified {
  font-size: 0.72rem; font-family: var(--mono); color: #34d399;
  padding: 0.25rem 0.6rem; border-radius: 100px;
  background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2);
}
.cert-card h3 { font-family: var(--display); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.cert-issuer { color: var(--muted); font-size: 0.88rem; margin-top: 0.35rem; }
.cert-id { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); margin-top: 0.8rem; }

/* ---------- Work ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center; text-decoration: none; color: inherit;
  padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: 22px;
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 1.3rem; overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s ease, background 0.3s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.feature-tag { font-family: var(--mono); font-size: 0.76rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.feature-info h3 { font-family: var(--mono); font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0.7rem 0 0.8rem; font-weight: 500; }
.feature-info p { color: var(--muted); max-width: 460px; line-height: 1.7; }
.feature-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.4rem; color: var(--accent-2); font-weight: 500; font-size: 0.95rem; }
.feature-visual {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(109,124,255,0.08), rgba(10,10,15,0.4));
  aspect-ratio: 16 / 10; display: grid; place-items: stretch;
}
.chart { width: 100%; height: 100%; }
.chart svg { width: 100%; height: 100%; display: block; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.work-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  padding: 1.6rem; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); min-height: 180px;
  transition: transform 0.35s var(--ease), border-color 0.3s ease, background 0.3s ease;
}
.work-card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.wc-top { display: flex; align-items: center; justify-content: space-between; }
.wc-top h3 { font-family: var(--mono); font-size: 1.05rem; font-weight: 500; }
.work-card p { color: var(--muted); font-size: 0.92rem; margin: 0.7rem 0 1.1rem; flex: 1; line-height: 1.6; }
.arr { color: var(--faint); transition: transform 0.3s var(--ease), color 0.3s ease; font-size: 1.1rem; }
.work-card:hover .arr, .feature:hover .arr { color: var(--accent-2); transform: translate(3px, -3px); }
.work-card--more { justify-content: center; border-style: dashed; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags span {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  padding: 0.25rem 0.6rem; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { max-width: 720px; margin: 0 auto; }
.contact-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4.2rem); line-height: 1.05; letter-spacing: -0.03em;
  margin: 1.2rem 0 1.2rem;
}
.contact-sub { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); max-width: 520px; margin: 0 auto 2.4rem; }
.social-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.6rem; }
.social {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none;
  color: var(--muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.7rem 1.2rem; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.25s var(--ease), color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.social svg { width: 19px; height: 19px; }
.social:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-3px); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.4rem clamp(1.1rem, 5vw, 2rem);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--faint); font-size: 0.86rem;
}
.footer-mid { font-family: var(--mono); }
.to-top { text-decoration: none; color: var(--muted); transition: color 0.2s ease; }
.to-top:hover { color: var(--accent-2); }

/* ---------- Focus ---------- */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; gap: 2.5rem; }
  .hero-right { max-width: 460px; }
  .about-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature-visual { order: -1; }
  .nav-links { display: none; }
  .stat-list { flex-direction: row; flex-wrap: wrap; }
  .stat-list li { flex: 1; min-width: 130px; flex-direction: column; gap: 0.3rem; }
}
@media (max-width: 560px) {
  .nav-cta { display: none; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .footer { flex-direction: column; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .cursor-glow { display: none; }
}
