/* ============================================================
   G VIVEGAN — portfolio
   ============================================================ */

:root {
  --bg: #06060b;
  --bg-2: #0b0b14;
  --ink: #f4f1ea;
  --muted: #8f8fa3;
  --line: rgba(244, 241, 234, 0.1);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --amber: #fbbf24;
  --grad: linear-gradient(92deg, #8b5cf6 0%, #f472b6 50%, #22d3ee 100%);
  --font-display: "Syne", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============ Preloader ============ */
/* Hidden unless JS is running ('js' on <html>); the 7s failsafe in <head>
   removes 'js' if the animation stack never boots, revealing the static page. */
.preloader { display: none; }
.js .preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (prefers-reduced-motion: reduce) {
  .js .preloader { display: none; }
}
.preloader-panel {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50.5%;
  background: #0c0c16;
}
.preloader-panel:nth-child(1) { left: 0; }
.preloader-panel:nth-child(2) { right: 0; }
.preloader-inner { position: relative; z-index: 2; text-align: center; }
.preloader-mono {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 6rem);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.preloader-count {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.preloader-count::after { content: "%"; }

/* ============ Cursor (only exists while the animation stack runs) ============ */
.cursor-dot, .cursor-ring { display: none; }
.anim .cursor-dot, .anim .cursor-ring {
  display: block;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--cyan);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(139, 92, 246, 0.8);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.cursor-ring.is-hover {
  width: 64px; height: 64px;
  border-color: var(--pink);
  background: rgba(244, 114, 182, 0.08);
}
@media (hover: none), (pointer: coarse) {
  .anim .cursor-dot, .anim .cursor-ring { display: none; }
}

/* Keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ Progress ============ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1001;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  mix-blend-mode: normal;
  transition: transform 0.4s ease;
}
.nav.nav-hidden { transform: translateY(-110%); }
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.nav-logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links {
  display: flex;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-links a { position: relative; padding: 0.3rem 0; color: var(--muted); transition: color 0.25s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.35s ease;
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  transition: border-color 0.3s, background 0.3s;
}
.nav-cta:hover { border-color: var(--violet); background: rgba(139, 92, 246, 0.12); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ============ Layout ============ */
.section { padding: clamp(5rem, 12vh, 9rem) clamp(1.2rem, 6vw, 6rem); position: relative; }
.section-tag {
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.section-tag::before {
  content: "";
  width: 2rem; height: 1px;
  background: var(--grad);
  display: inline-block;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1.2rem, 6vw, 6rem) 4rem;
  position: relative;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
}
.orb-1 { width: 52vw; height: 52vw; background: radial-gradient(circle, rgba(124, 58, 237, 0.75) 0%, rgba(124, 58, 237, 0.25) 35%, transparent 68%); top: -14%; right: -10%; }
.orb-2 { width: 42vw; height: 42vw; background: radial-gradient(circle, rgba(8, 145, 178, 0.7) 0%, rgba(8, 145, 178, 0.22) 35%, transparent 68%); bottom: -8%; left: -12%; }
.orb-3 { width: 28vw; height: 28vw; background: radial-gradient(circle, rgba(219, 39, 119, 0.6) 0%, rgba(219, 39, 119, 0.2) 35%, transparent 68%); top: 32%; left: 36%; opacity: 0.4; }

.hero-inner { position: relative; z-index: 2; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.pulse-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 11vw, 13rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-left: -0.05em;
  user-select: none;
  white-space: nowrap;
}
.hero-name .char {
  display: inline-block;
  transition: color 0.3s ease;
  cursor: default;
}
.hero-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.4rem;
  max-width: 100%;
}
.hero-blurb { max-width: 34rem; font-size: clamp(1rem, 1.6vw, 1.25rem); color: #c9c6bd; }
.hero-scramble {
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-width: 22ch;
}
.hero-ctas { display: flex; gap: 1rem; margin-top: 2.6rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.btn-fill {
  background: var(--grad);
  border: none;
  color: #0a0a12;
  font-weight: 700;
}
.btn-fill:hover { box-shadow: 0 0 40px rgba(139, 92, 246, 0.5); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-big { font-size: clamp(0.9rem, 2vw, 1.2rem); padding: 1.4rem 2.8rem; }
.magnetic-inner { display: inline-block; }

.hero-scrollhint {
  position: absolute;
  bottom: 2rem;
  right: clamp(1.2rem, 6vw, 6rem);
  color: var(--muted);
  letter-spacing: 0.3em;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  z-index: 2;
}
.scroll-line { width: 60px; height: 1px; background: var(--muted); position: relative; overflow: hidden; display: inline-block; }
.scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  transform: translateX(-100%);
  animation: scrollline 2s ease-in-out infinite;
}
@keyframes scrollline {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ============ Marquee ============ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--bg-2);
}
.marquee-track {
  display: flex;
  white-space: nowrap;
  width: fit-content;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  letter-spacing: 0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 234, 0.35);
}

/* ============ About ============ */
.about-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 3rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 62rem;
}

/* ============ Stats ============ */
.stats { padding-top: 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stat {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.6rem, 3.5vw, 3rem);
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease;
}
.stat:hover { background: rgba(139, 92, 246, 0.07); }
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-suffix, .stat-prefix { font-size: 0.5em; }
.stat-prefix { font-size: 0.6em; font-family: var(--font-body); vertical-align: 0.12em; }

/* SplitText chars inside a gradient span: re-apply the gradient per glyph */
.grad .c-char {
  background: linear-gradient(180deg, #a78bfa 0%, #f472b6 55%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--muted); margin-top: 0.9rem; text-transform: uppercase; }
@media (max-width: 860px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }

/* ============ Journey (company rows, sideways chapters) ============ */
.experience { position: relative; }
.journey-intro { padding-bottom: 1rem; }
.journey-hint { color: var(--muted); letter-spacing: 0.2em; }
.company-row {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 7vh, 5rem) clamp(1.2rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.crow-head {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 2.4vw, 2rem);
  flex-wrap: wrap;
}
.crow-idx {
  font-size: 1.7rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 234, 0.3);
}
.crow-title { flex: 1; min-width: 240px; }
.crow-co {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.crow-co-note { font-size: 0.45em; color: var(--muted); font-weight: 400; white-space: nowrap; }
.crow-role { color: var(--pink); font-size: 0.95rem; margin-top: 0.4rem; }
.crow-years { color: var(--cyan); letter-spacing: 0.16em; }
/* Static default: cards wrap into a readable grid. With the animation stack
   running ('anim' on <html>), the track becomes a horizontal strip — pinned
   rows get overflow:hidden inline from JS, unpinned rows keep native swipe. */
.crow-viewport { margin-top: 2.4rem; }
.crow-track {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.anim .crow-viewport { overflow-x: auto; scrollbar-width: none; }
.anim .crow-viewport::-webkit-scrollbar { display: none; }
.anim .crow-track {
  flex-wrap: nowrap;
  width: max-content;
  will-change: transform;
}
.anim .acard { max-width: none; }
.acard {
  width: clamp(300px, 34vw, 520px);
  max-width: 100%; /* static wrap mode: never wider than the row (320px phones) */
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.7rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.acard:hover {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(139, 92, 246, 0.06);
  transform: translateY(-6px);
}
.acard-kicker {
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.acard h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.acard p:last-child { color: #b9b6ae; font-size: 0.93rem; }
.acard b { color: var(--ink); }
.crow-progress {
  height: 2px;
  background: var(--line);
  margin-top: 2.2rem;
  border-radius: 2px;
  overflow: hidden;
}
.crow-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.crow-now { background: linear-gradient(180deg, rgba(139, 92, 246, 0.07), transparent 65%); }

/* ============ Impact ============ */
.feature {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(1.8rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transform-style: preserve-3d;
}
.feature-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature:hover .feature-glow, .skill-card:hover .feature-glow { opacity: 1; }
.feature h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  letter-spacing: -0.01em;
  margin: 0.9rem 0 0.7rem;
}
.feature p { color: #b9b6ae; max-width: 46rem; }
.feature-chip {
  display: inline-block;
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--cyan);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  text-transform: uppercase;
}
.feature-big { margin-bottom: 1.6rem; }
.feature-metric {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.6rem;
}
.feature-metric-from {
  color: var(--muted);
  text-decoration: line-through;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}
.feature-metric-arrow { font-size: 1.6rem; color: var(--pink); }
.feature-metric-to {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.feature-metric-to em { font-style: normal; font-size: 0.4em; }
.feature-markets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mkt {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  transition: all 0.25s;
}
.mkt:hover {
  border-color: var(--pink);
  color: var(--pink);
  transform: translateY(-3px);
}
.feature-link {
  display: inline-block;
  margin-top: 1.6rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.feature-link:hover { color: var(--pink); border-color: var(--pink); }
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}
@media (max-width: 860px) { .feature-row { grid-template-columns: 1fr; } }

/* Transformation accordion */
.transform { margin-top: 5rem; }
.transform-lead { margin-top: 0; margin-bottom: 5.5rem; }
.transform-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  letter-spacing: -0.01em;
  max-width: 50rem;
  margin-bottom: 2.4rem;
}
.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); transition: background 0.3s; }
.acc-item:hover { background: rgba(255, 255, 255, 0.025); }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-body);
  padding: 1.6rem 0.5rem;
  cursor: pointer;
  text-align: left;
}
.acc-fn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  flex: 1;
}
.acc-metric { color: var(--cyan); letter-spacing: 0.12em; }
.acc-plus {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform 0.4s ease, color 0.3s;
  line-height: 1;
}
.acc-item.open .acc-plus { transform: rotate(45deg); color: var(--pink); }
/* Static default: accordion content readable. JS collapses it ('anim'). */
.acc-body { height: auto; }
.anim .acc-body { height: 0; overflow: hidden; }
.anim .acc-item.open .acc-body { overflow: hidden; }
.acc-body p { color: #b9b6ae; padding: 0 0.5rem 1.6rem; max-width: 44rem; }
@media (max-width: 640px) { .acc-metric { display: none; } }

/* ============ Skills ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.skill-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transform-style: preserve-3d;
}
.skill-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: #b9b6ae;
  transition: all 0.25s;
}
.chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}
@media (max-width: 980px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .skills-grid { grid-template-columns: 1fr; } }

/* ============ Contact ============ */
.contact { padding-bottom: 2rem; }
.contact-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9.5vw, 9rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}
.contact-actions {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 6rem;
}
.contact-meta { display: flex; gap: 1rem; color: var(--muted); font-size: 0.85rem; }
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

/* Reduced motion: show everything, kill loops */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
