/* ================================================================
   JIZR — Design Tokens
   ================================================================ */
:root {
  --bg:         oklch(9.5% 0.008 148);
  --surface:    oklch(13%  0.010 148);
  --elevated:   oklch(18%  0.012 148);
  --accent:     oklch(70%  0.17  146);
  --accent-dim: oklch(58%  0.11  146);
  --text-1:     oklch(91%  0.006 98);
  --text-2:     oklch(56%  0.010 148);
  --text-3:     oklch(36%  0.008 148);
  --border:     oklch(20%  0.011 148);
  --border-sub: oklch(15%  0.009 148);

  --display: 'Syne', system-ui, sans-serif;
  --sans:    'Space Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'Courier New', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mid: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ================================================================
   Reset
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: none; font: inherit; color: inherit; }

/* ================================================================
   Background canvas
   ================================================================ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ================================================================
   Root Journey — left-rail scroll-driven SVG
   ================================================================ */
.root-journey {
  position: fixed;
  left: 0;
  top: 0;
  width: 60px;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.root-journey path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================================================================
   Noise overlay
   ================================================================ */
.noise {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.028;
  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.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ================================================================
   Custom Cursor — square dot + spinning diamond ring
   ================================================================ */
.cursor {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 0;
  pointer-events: none;
  z-index: 9999;
  translate: -50% -50%;
  will-change: left, top;
  transition: width 200ms var(--ease-mid),
              height 200ms var(--ease-mid),
              opacity 200ms;
}
.cursor-ring {
  position: fixed;
  width: 26px;
  height: 26px;
  border: 1.5px solid oklch(70% 0.17 146 / 0.38);
  border-radius: 2px;
  pointer-events: none;
  z-index: 9998;
  translate: -50% -50%;
  will-change: left, top;
  animation: diamond-spin 11s linear infinite;
  transition: width 260ms var(--ease-mid),
              height 260ms var(--ease-mid),
              border-color 260ms;
}
@keyframes diamond-spin {
  from { transform: rotate(45deg); }
  to   { transform: rotate(405deg); }
}
.cursor.hovered {
  width: 3px;
  height: 3px;
  opacity: 0.4;
}
.cursor-ring.hovered {
  width: 48px;
  height: 48px;
  border-color: oklch(70% 0.17 146 / 0.65);
  animation-play-state: paused;
}

/* Cursor trail */
.cursor-trail {
  position: fixed;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  translate: -50% -50%;
  will-change: left, top;
}

/* ================================================================
   Nav
   ================================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(24px, 5vw, 72px);
  transition: background 400ms, backdrop-filter 400ms, border-color 400ms;
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: oklch(9.5% 0.008 148 / 0.88);
  backdrop-filter: blur(14px);
  border-color: var(--border-sub);
}
.nav-logo {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  font-style: normal;
  letter-spacing: -0.04em;
}
.nav-logo em { font-style: normal; }
.nav nav {
  display: flex;
  gap: 40px;
}
.nav nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 150ms, transform 300ms var(--ease-mid);
  display: inline-block;
}
.nav nav a:hover { color: var(--text-1); }

/* ================================================================
   Section label
   ================================================================ */
.label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ================================================================
   Hero
   ================================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Root SVG */
.root-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.root-svg {
  width: min(960px, 100vw);
  height: auto;
  opacity: 0.28;
  animation: root-breathe 6s ease-in-out 2.5s infinite;
}
@keyframes root-breathe {
  0%, 100% { opacity: 0.28; }
  50%       { opacity: 0.42; }
}
.r {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  /* pathLength trick: set via JS */
}
.r--thin { stroke-width: 0.9; }

/* Soft glow at root origin */
.root-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 480px;
  height: 480px;
  background: radial-gradient(ellipse at center,
    oklch(70% 0.17 146 / 0.11) 0%,
    oklch(70% 0.17 146 / 0.04) 38%,
    transparent 68%
  );
  pointer-events: none;
  animation: glow-breathe 5s ease-in-out 1.8s infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; transform: scale(0.94); }
  50%       { opacity: 1;    transform: scale(1.08); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 clamp(24px, 5vw, 80px);
  max-width: 960px;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.12em;
  margin-bottom: 36px;
  opacity: 0;
  translate: 0 16px;
  animation: up 600ms var(--ease-out) 300ms forwards;
}
.hero-heading {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.2vw, 5.8rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.04em;
  display: flex;
  flex-direction: column;
  gap: 0.05em;
  margin-bottom: 40px;
}
.hl {
  display: block;
  opacity: 0;
  translate: 0 28px;
  animation: up 640ms var(--ease-out) forwards;
}
.hl:nth-child(1) { animation-delay: 520ms; }
.hl:nth-child(2) {
  animation-delay: 660ms;
  font-family: var(--display);
  font-weight: 800;
  font-style: normal;
  font-size: 0.92em;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}

.hero-sub {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
  letter-spacing: 0.06em;
  margin-bottom: 52px;
  opacity: 0;
  translate: 0 16px;
  animation: up 600ms var(--ease-out) 800ms forwards;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.07em;
  opacity: 0;
  translate: 0 16px;
  animation: up 600ms var(--ease-out) 940ms forwards;
  transition: gap 150ms var(--ease-mid), transform 320ms var(--ease-mid);
}
.hero-cta:hover { gap: 14px; }
.hero-cta span { display: inline-block; transition: translate 150ms var(--ease-mid); }
.hero-cta:hover span { translate: 0 4px; }


/* ================================================================
   Shared reveal animation
   ================================================================ */
.reveal {
  opacity: 0;
  translate: 0 36px;
  transition: opacity 700ms var(--ease-out),
              translate 700ms var(--ease-out);
}
.reveal.in { opacity: 1; translate: 0 0; }

@keyframes up {
  to { opacity: 1; translate: 0 0; }
}

/* ================================================================
   Work
   ================================================================ */
.work { padding: clamp(80px, 12vw, 140px) 0; }

.section-intro {
  padding: 0 clamp(24px, 5vw, 72px);
  margin-bottom: clamp(48px, 8vw, 96px);
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-sub);
  transition-delay: 0ms;
}
.project:last-child { border-bottom: 1px solid var(--border-sub); }
.project--flip { direction: rtl; }
.project--flip > * { direction: ltr; }

.proj-visual { overflow: hidden; }
.proj-img {
  width: 100%;
  min-height: 420px;
  height: 100%;
  background: oklch(13% var(--c, 0.01) var(--h, 148));
  position: relative;
  overflow: hidden;
  transition: transform 600ms var(--ease-out);
}
.project:hover .proj-img { transform: scale(1.025); }

/* Subtle dot grid inside project placeholder images */
.proj-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, oklch(91% 0.006 98 / 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.proj-info {
  padding: clamp(40px, 6vw, 80px) clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.proj-num {
  font-family: var(--display);
  font-size: clamp(6rem, 14vw, 15rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  color: oklch(91% 0.006 98 / 0.045);
  position: absolute;
  bottom: -0.18em;
  right: -0.06em;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
.proj-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
}
.proj-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 48ch;
}
.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.proj-stack li {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.proj-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  transition: gap 150ms var(--ease-mid), transform 320ms var(--ease-mid);
}
.proj-link:hover { gap: 12px; }

/* Stagger reveal for projects */
.project:nth-child(2) { transition-delay: 80ms; }
.project:nth-child(3) { transition-delay: 160ms; }

/* ================================================================
   Marquee
   ================================================================ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border-sub);
  border-bottom: 1px solid var(--border-sub);
  padding: 13px 0;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 40px;
  width: max-content;
  animation: marquee-scroll 26s linear infinite;
}
.marquee-track span {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
}
.m-dot { color: var(--accent) !important; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ================================================================
   Capabilities — hover-reveal rows
   ================================================================ */
.capabilities {
  padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 72px);
}
.capabilities > .label { margin-bottom: clamp(48px, 7vw, 84px); }

.cap-row {
  display: grid;
  grid-template-columns: 52px 1fr 1.1fr 28px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--border-sub);
  gap: 28px;
  position: relative;
  overflow: hidden;
  transition: translate 380ms var(--ease-out);
}
.cap-row:last-child { border-bottom: 1px solid var(--border-sub); }
.cap-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface);
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}
.cap-row:hover { translate: 14px 0; }
.cap-row:hover::before { opacity: 1; }

.cap-num {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-3);
  letter-spacing: 0.14em;
  position: relative;
}
.cap-name {
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.8vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  position: relative;
  transition: color 200ms;
}
.cap-row:hover .cap-name { color: var(--accent); }

.cap-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 42ch;
  opacity: 0.55;
  transition: opacity 280ms;
  position: relative;
}
.cap-row:hover .cap-desc { opacity: 1; }

.cap-arr {
  font-size: 1rem;
  color: var(--text-3);
  text-align: right;
  position: relative;
  transition: color 200ms, transform 300ms var(--ease-out);
}
.cap-row:hover .cap-arr {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ================================================================
   About
   ================================================================ */
.about {
  padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 72px);
}
.about > .label { margin-bottom: clamp(40px, 6vw, 72px); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}
.about-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about-lead {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--text-1);
  line-height: 1.7;
  max-width: 52ch;
}
.about-text p:not(.about-lead) {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 52ch;
}
.about-quote {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.about-quote p {
  font-family: var(--display);
  font-weight: 800;
  font-style: normal;
  font-size: clamp(1.8rem, 3.3vw, 3.4rem);
  color: transparent;
  -webkit-text-stroke: 1px oklch(91% 0.006 98 / 0.45);
  line-height: 1.22;
  letter-spacing: -0.04em;
}

/* ================================================================
   Contact
   ================================================================ */
.contact {
  padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 72px) clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--border-sub);
}
.contact > .label { margin-bottom: clamp(36px, 5vw, 60px); }

.contact-email {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(2.2rem, 5.5vw, 5.2rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 28px;
  width: fit-content;
  transition: color 200ms, transform 320ms var(--ease-mid);
}
.contact-email:hover { color: var(--accent); }

.contact-where {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-2);
  letter-spacing: 0.06em;
  margin-bottom: 32px;
}
.contact-social {
  display: flex;
  gap: 36px;
}
.contact-social a {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 150ms;
}
.contact-social a:hover { color: var(--accent); }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: clamp(48px, 8vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--border-sub);
}
.site-footer span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

/* ================================================================
   Scrollbar
   ================================================================ */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg);
}
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 900px) {
  .project,
  .project--flip {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .proj-img { min-height: 280px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .cap-row {
    grid-template-columns: 40px 1fr 28px;
    gap: 16px;
  }
  .cap-desc { display: none; }
}

@media (max-width: 640px) {
  body { cursor: auto; }
  .cursor, .cursor-ring, .cursor-trail, .bg-canvas, .root-journey { display: none; }
  .nav nav { display: none; }
  .site-footer { flex-direction: column; gap: 12px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
