/* =========================================================================
   Ellis Victoria — Portfolio v2 (Dark / Motion)
   Interactive canvas · Editorial · Neon-on-black
   ========================================================================= */

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

:root {
  --black: #0a0a0a;
  --white: #f5f5f0;
  --cyan: #00ffb3;
  --blue: #2440ee;
  --mid: #141414;
  --muted: #8a8a82;
  --border: rgba(245,245,240,0.1);
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'General Sans', sans-serif;
  --radius: 10px;
}

/* ── LIGHT THEME ───────────────────────────────────────────────────── */
[data-theme="light"] {
  --black: #f4f4ef;
  --white: #14140f;
  --mid: #ffffff;
  --muted: #5c5c55;
  --border: rgba(10,10,10,0.14);
  --cyan: #0a8f63;
}
[data-theme="light"] .nav.scrolled { background: rgba(244,244,239,0.72); }
[data-theme="light"] .nav::before { background: linear-gradient(to bottom, rgba(244,244,239,0.85), transparent); }
[data-theme="light"] .marquee { background: rgba(244,244,239,0.6); }

/* ── THEME TOGGLE ──────────────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  pointer-events: auto;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(245,245,240,0.06);
  color: var(--white);
  cursor: none;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); transform: rotate(-15deg); }
[data-theme="light"] .theme-toggle { background: rgba(10,10,10,0.05); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (pointer: coarse) { .theme-toggle { cursor: pointer; } }

html { scroll-behavior: auto; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

@media (pointer: coarse) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

::selection { background: var(--cyan); color: var(--black); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 9999;
  background: var(--cyan);
  color: var(--black);
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up, .hero-title-line span, .hero-subtitle, .hero-meta { opacity: 1 !important; transform: none !important; }
  .loader { display: none !important; }
}

/* ── INTERACTIVE CANVAS BACKGROUND ─────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Everything above canvas */
.page { position: relative; z-index: 1; }

/* ── CUSTOM CURSOR ─────────────────────────────────────────────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px;
  height: 14px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
}
.cursor.hovering {
  width: 56px;
  height: 56px;
  background: rgba(0,255,179,0.1);
  border-color: var(--cyan);
}
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 4px;
  height: 4px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

/* ── GRAIN ─────────────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── LOADER ────────────────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}
.loader-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 500;
  color: var(--white);
  overflow: hidden;
}
.loader-bar {
  width: 200px;
  height: 1px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.loader-bar span {
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
}

/* ── NAV ───────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  pointer-events: none;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.nav::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(10,10,10,0.75), transparent);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.4s ease;
}
.nav.scrolled::before { opacity: 0; }
.nav > * { pointer-events: auto; }
.nav-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--white);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

/* ── HERO ──────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 3rem 4rem;
  position: relative;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 13vw, 13rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.04em;
}
.hero-title-line {
  display: block;
  overflow: hidden;
}
.hero-title-line span {
  display: inline-block;
  transform: translateY(110%);
}
.hero-title .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--white);
}
.hero-subtitle {
  margin-top: 2.5rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.7;
  opacity: 0;
}
.hero-meta {
  margin-top: 3rem;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  opacity: 0;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hero-meta-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
}
.hero-meta-value {
  font-size: 0.9rem;
  color: var(--white);
}
.hero-scroll {
  position: absolute;
  bottom: 3rem;
  right: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
}
.hero-scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: scroll-pulse 2s ease infinite;
  transform-origin: top;
}
@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.3); opacity: 0.3; }
}

/* ── MARQUEE ───────────────────────────────────────────────────────── */
.marquee {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(8px);
}
.marquee-track {
  display: inline-flex;
  gap: 3rem;
  will-change: transform;
}
.marquee-item {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 3rem;
}
.marquee-item::after {
  content: '✦';
  color: var(--cyan);
  font-size: 1rem;
}

/* ── PROJECTS ──────────────────────────────────────────────────────── */
.projects {
  padding: 10rem 3rem;
}
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6rem;
}
.projects-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
}
.projects-count { font-size: 0.8rem; color: var(--muted); }

.project {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 10rem;
}
.project:nth-child(even) {
  grid-template-columns: 0.8fr 1.2fr;
}
.project:nth-child(even) .project-visual { order: 2; }
.project:nth-child(even) .project-content { order: 1; }
.project-visual {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}
.project-visual img,
.project-visual-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s;
  filter: grayscale(0.3) brightness(0.85);
}
.project-visual-link {
  display: block;
  width: 100%;
  height: 100%;
}
.project:hover .project-visual img,
.project:hover .project-visual-placeholder {
  transform: scale(1.06);
  filter: grayscale(0) brightness(1);
}
.project-content { padding: 2rem 0; }
.project-number {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--cyan);
  margin-bottom: 1.5rem;
}
.project-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.project-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 38ch;
  margin-bottom: 2rem;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: background 0.3s, color 0.3s, border-color 0.3s, gap 0.3s;
}
.project-link:hover {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--cyan);
  gap: 1rem;
}

/* ── ABOUT (word reveal) ───────────────────────────────────────────── */
.about {
  padding: 10rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
.about-text {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.45;
}
.about-text .word {
  display: inline-block;
  opacity: 0.15;
  transition: opacity 0.4s;
}
.about-text .word.active { opacity: 1; }
.about-text em { font-style: normal; color: var(--cyan); }

/* ── EXPERIENCE ────────────────────────────────────────────────────── */
.experience {
  padding: 8rem 3rem;
  border-top: 1px solid var(--border);
}
.experience-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  margin-bottom: 4rem;
}
.role-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.4s;
}
.role-item:first-of-type { border-top: 1px solid var(--border); }
.role-item:hover { padding-left: 1rem; }
.role-date { font-size: 0.8rem; color: var(--muted); }
.role-current {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-top: 0.4rem;
}
.role-company {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.role-position { font-size: 0.85rem; color: var(--muted); }

/* ── CONTACT ───────────────────────────────────────────────────────── */
.contact {
  padding: 12rem 3rem 8rem;
  text-align: center;
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 9rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}
.contact-title .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--white);
}
.magnetic-wrap {
  display: inline-block;
  padding: 2rem;
}
.magnetic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--black);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.3s;
  will-change: transform;
}
.magnetic-btn:hover { background: var(--white); }
.contact-links {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.contact-links a { transition: color 0.3s; }
.contact-links a:hover { color: var(--cyan); }

/* ── FOOTER ────────────────────────────────────────────────────────── */
.footer {
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── FADE UP ───────────────────────────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(40px); }

/* ── RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav { padding: 1.5rem 1.5rem; }
  .nav-links { display: none; }
  .hero { padding: 6rem 1.5rem 4rem; }
  .hero-scroll { right: 1.5rem; }
  .projects { padding: 6rem 1.5rem; }
  .project { grid-template-columns: 1fr; gap: 2rem; margin-bottom: 6rem; }
  .project:nth-child(even) { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-visual { order: 1; }
  .project:nth-child(even) .project-content { order: 2; }
  .about { padding: 6rem 1.5rem; }
  .experience { padding: 6rem 1.5rem; }
  .role-item { grid-template-columns: 1fr; gap: 0.75rem; }
  .contact { padding: 6rem 1.5rem; }
  .footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; }
  .magnetic-btn { width: 150px; height: 150px; font-size: 0.85rem; }
  .marquee-item { font-size: 1.1rem; }
}

@media (max-width: 600px) {
  .hero-title { font-size: clamp(2.8rem, 15vw, 5rem); }
  .contact-title { font-size: clamp(2.5rem, 11vw, 4rem); }
  .hero-meta { gap: 1.5rem; }
}
