/* ============================================================
   Kostandin Hidri · Portfolio
   Dark, Linear-inspired system. Indigo accent.
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --bg-elev: #101018;
  --bg-card: #12121c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecedf2;
  --text-dim: #9b9daf;
  --text-faint: #5f6172;
  --accent: #6e6bff;
  --accent-soft: rgba(110, 107, 255, 0.14);
  --accent-glow: rgba(110, 107, 255, 0.45);
  --green: #3ddc97;
  --amber: #f5b056;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* JS-gated initial hidden states: page stays visible if JS fails */
.js .reveal-on-load,
.js .reveal,
.js .story-block,
.js .stat,
.js .timeline-item,
.js .stack-chip,
.js .t-line,
.js .feed-row[data-row],
.js .feed-badge,
.js .flow-node { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal-on-load, .js .reveal, .js .story-block, .js .stat,
  .js .timeline-item, .js .stack-chip, .js .t-line,
  .js .feed-row[data-row], .js .feed-badge, .js .flow-node { opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo-dot { color: var(--accent); }

.nav-links { display: flex; gap: 28px; }

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); }

.scroll-progress {
  position: absolute;
  bottom: -1px; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 48px) 24px 96px;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orb-1 { width: 480px; height: 480px; background: rgba(110, 107, 255, 0.22); top: -10%; left: -8%; }
.orb-2 { width: 420px; height: 420px; background: rgba(167, 139, 250, 0.14); bottom: -12%; right: -6%; }
.orb-3 { width: 300px; height: 300px; background: rgba(61, 220, 151, 0.08); top: 40%; left: 60%; }

.grid-overlay {
  position: absolute;
  inset: 0;
  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: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 30%, transparent 75%);
}

.hero-content { position: relative; max-width: 880px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}

.hero-title .char { display: inline-block; will-change: transform, opacity; }
.hero-title .word { display: inline-block; white-space: nowrap; }

.hero-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 10px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 24px rgba(110, 107, 255, 0.35);
}

.btn-primary:hover { box-shadow: 0 6px 32px rgba(110, 107, 255, 0.55); }

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover { border-color: var(--accent); }

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.scroll-cue-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.scroll-cue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--accent), transparent);
  display: block;
  transform-origin: top;
}

/* ===== Stats band ===== */
.stats-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.stats-grid {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stat { text-align: center; }

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  color: var(--text);
  display: block;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-dim);
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Projects ===== */
.project { padding: 140px 24px; position: relative; }

.project-alt { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.project-inner { max-width: 1160px; margin: 0 auto; }

.project-head {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 72px;
  max-width: 860px;
}

.project-index {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(110, 107, 255, 0.5);
  flex-shrink: 0;
}

.project-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.project-eyebrow.center { text-align: center; }

.project-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.title-accent { color: var(--accent); }

.project-lead {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-dim);
  max-width: 600px;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.story-col { display: flex; flex-direction: column; gap: 44px; }

.story-block h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-num { color: var(--accent); font-size: 21px; }

.story-block p { color: var(--text-dim); font-size: 15.5px; }

.story-block strong { color: var(--text); font-weight: 600; }

.story-block em { color: var(--text); font-style: italic; }

.visual-col { position: relative; }

.sticky-visual { position: sticky; top: calc(var(--nav-h) + 40px); }

/* ===== Terminal (SneakerWare) ===== */
.terminal-card {
  background: #0c0c14;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(110,107,255,0.06);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-red { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green { background: #28c840; }

.terminal-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  min-height: 280px;
}

.t-line { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-cmd { color: var(--text); }
.t-ok { color: #8ab4ff; }
.t-success { color: var(--green); }
.t-dim { color: var(--text-faint); }
.t-cursor { color: var(--accent); animation: blink 1s steps(2) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.terminal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

.terminal-stats div {
  padding: 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.terminal-stats div:last-child { border-right: none; }

.terminal-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}

.terminal-stats span { font-size: 12px; color: var(--text-faint); }

/* ===== Flow diagram (Onboarding) ===== */
.flow-wrap { margin-bottom: 80px; }

.flow-svg { width: 100%; height: auto; display: block; }

.flow-path {
  stroke: rgba(110, 107, 255, 0.65);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.flow-node circle {
  fill: var(--bg-card);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

/* Phase colors mirror the FigJam board's swimlane key */
.phase-sales circle { stroke: #2ec4b6; }
.phase-sales .node-glyph { fill: #2ec4b6; }
.phase-setup circle { stroke: #8b5cf6; }
.phase-setup .node-glyph { fill: #8b5cf6; }
.phase-training circle { stroke: #ec4899; }
.phase-training .node-glyph { fill: #ec4899; }
.phase-done circle { stroke: var(--green); }
.phase-done .node-glyph { fill: var(--green); }

.auto-badge circle {
  fill: var(--bg-card);
  stroke: var(--amber);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 5px rgba(245, 176, 86, 0.45));
}

.auto-badge text {
  fill: var(--amber);
  font-size: 10px;
  text-anchor: middle;
  font-family: var(--font-body);
}

.node-glyph {
  fill: var(--accent);
  font-size: 19px;
  text-anchor: middle;
  font-family: var(--font-body);
}

.node-label {
  fill: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-anchor: middle;
  font-family: var(--font-display);
}

.node-sub {
  fill: var(--text-faint);
  font-size: 12px;
  text-anchor: middle;
  font-family: var(--font-body);
}

.flow-payload {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  opacity: 0;
}

.flow-caption {
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 18px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  margin-top: 16px;
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.lg::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lg-sales::before { background: #2ec4b6; }
.lg-setup::before { background: #8b5cf6; }
.lg-training::before { background: #ec4899; }
.lg-done::before { background: var(--green); }
.lg-auto { color: var(--amber); }
.lg-auto::before { display: none; }

.split-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}

/* ===== Feed card (AI Feed Builder) ===== */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(110,107,255,0.06);
}

.feed-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.feed-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); }

.feed-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
}

.feed-platforms { display: flex; gap: 8px; padding: 14px 18px 4px; }

.pf {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}

.pf-meta { color: #7aa7ff; border-color: rgba(122,167,255,0.4); }
.pf-tiktok { color: #6ee7e0; border-color: rgba(110,231,224,0.4); }
.pf-snap { color: #f5e663; border-color: rgba(245,230,99,0.35); }
.pf-reddit { color: #ff8d66; border-color: rgba(255,141,102,0.4); }

.feed-table { padding: 12px 8px; }

.feed-row {
  display: grid;
  grid-template-columns: 44px 1.1fr 1.5fr 0.9fr;
  gap: 10px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border-radius: 7px;
}

.feed-row:nth-child(even) { background: rgba(255,255,255,0.02); }

.feed-header-row {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 4px;
}

.cell-ok { color: var(--green); }
.cell-sched { color: var(--amber); }

.feed-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
}

.feed-foot-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 220, 151, 0.7);
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 80px;
}

.stack-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.stack-chip:hover { border-color: var(--accent); color: var(--text); }

/* ===== Journey / timeline ===== */
.journey { padding: 140px 24px; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 80px;
}

.center { text-align: center; }

.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 40px; }

.timeline-line {
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.timeline-line-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--accent), #a78bfa);
  transform: scaleY(0);
  transform-origin: top;
}

.timeline-item { position: relative; padding-bottom: 48px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -37px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover { border-color: rgba(110, 107, 255, 0.45); transform: translateY(-2px); }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.timeline-card h3 {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 600;
  margin: 8px 0 10px;
}

.timeline-card p { font-size: 14.5px; color: var(--text-dim); }

/* ===== Contact ===== */
.contact {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 80% at 50% 110%, rgba(110, 107, 255, 0.14), transparent),
    var(--bg-elev);
  padding: 140px 24px 56px;
  text-align: center;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
}

.contact-email::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.6, 0, 0.2, 1);
}

.contact-email:hover::after { transform: scaleX(1); transform-origin: left; }

.contact-meta { margin-top: 18px; color: var(--text-dim); font-size: 15px; }

.footer-note { margin-top: 88px; font-size: 13px; color: var(--text-faint); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .project-body { grid-template-columns: 1fr; gap: 56px; }
  .sticky-visual { position: relative; top: 0; }
  .visual-col { order: 2; }
  .split-grid { grid-template-columns: 1fr; gap: 36px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .project { padding: 96px 20px; }
  .journey { padding: 96px 20px; }
  .project-head { flex-direction: column; gap: 16px; margin-bottom: 52px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 28px; padding: 44px 20px; }
  .timeline { padding-left: 32px; }
  .timeline-dot { left: -29px; }
}
