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

:root {
  --paper: #f1ece1;
  --paper-2: #e7e0d0;
  --ink: #16130e;
  --ink-soft: #6a6152;
  --accent: #2f43e0;      /* cobalt */
  --accent-2: #e8542a;    /* warm pop */
  --line: rgba(22, 19, 14, 0.15);
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Gabarito", system-ui, sans-serif; /* display face (Cal Sans-style) */
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

/* ===== Film grain ===== */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Custom cursor (desktop, fine pointer only) ===== */
/* Native cursor is hidden only once JS has created the custom one (adds .cursor-active),
   so a JS/caching failure can never leave you with no cursor at all. */
body.cursor-active,
body.cursor-active a,
body.cursor-active button,
body.cursor-active [data-magnetic],
body.cursor-active .venture-row { cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none; will-change: transform;
}
.cursor-dot { width: 7px; height: 7px; background: var(--accent); }
.cursor-ring {
  width: 34px; height: 34px; border: 1.5px solid var(--accent);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s;
}
.cursor-ring.hover { width: 60px; height: 60px; background: rgba(47, 67, 224, 0.12); }
.cursor-ring.down { width: 26px; height: 26px; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 60;
  background: var(--accent); transition: width 0.1s linear;
}

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  mix-blend-mode: normal; transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(239, 233, 221, 0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: 14px; padding-bottom: 14px;
}
.nav-logo { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; transition: color 0.25s; }
.nav-links a span { color: var(--accent); margin-right: 3px; }
.nav-links a:hover { color: var(--accent); }
.nav-toggle { display: none; font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; background: none; border: 0; color: var(--ink); cursor: pointer; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--max); margin: 0 auto;
  padding: 140px clamp(20px, 5vw, 56px) 60px;
}
.hero-eyebrow {
  font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent); margin-bottom: 30px;
}
.hero-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(3rem, 10.5vw, 9.5rem); line-height: 0.94; letter-spacing: -0.03em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-title .line-in {
  display: block; transform: translateY(105%);
  transition: transform 1s var(--ease);
}
.hero-title .line-in.in { transform: none; }
.hero-title em { color: var(--accent); font-style: normal; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 30px 60px; align-items: flex-end;
  justify-content: space-between; margin-top: 46px;
  border-top: 1px solid var(--line); padding-top: 28px;
}
.hero-meta p { max-width: 440px; font-size: 1.05rem; color: var(--ink-soft); }

/* ===== Links ===== */
.arrow-link {
  font-family: var(--mono); font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.08em; display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px; white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, gap 0.25s var(--ease), transform 0.25s var(--ease);
}
.arrow-link span { transition: transform 0.3s var(--ease); }
.arrow-link:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }
.arrow-link:hover span { transform: translate(2px, 2px); }
.arrow-link.big { font-size: 1rem; }

/* ===== Marquee ===== */
.marquee {
  overflow: hidden; white-space: nowrap; padding: 15px 0; background: var(--accent);
  position: relative;
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--accent), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--accent), transparent); }
.marquee-track {
  display: inline-flex; gap: 40px; width: max-content; will-change: transform;
  animation: scrollx 34s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--serif); font-weight: 500; font-size: 1.35rem; color: #fff;
  letter-spacing: -0.01em;
}
.marquee-track span::after { content: ""; }
@keyframes scrollx { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(70px, 11vh, 130px) clamp(20px, 5vw, 56px);
}
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 54px;
}
.idx { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); letter-spacing: 0.04em; }
.section-kicker {
  font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--ink-soft);
}

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: start; }
.about-lead { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.7rem); line-height: 1.14; letter-spacing: -0.02em; }
.about-body p { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 18px; }
.about-body strong { color: var(--ink); font-weight: 500; }

/* ===== Roles ===== */
.rolelist { list-style: none; }
.role {
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 40px; align-items: start;
  padding: 32px 0; border-top: 1px solid var(--line);
  transition: padding 0.35s var(--ease);
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role:hover { padding-left: 12px; padding-right: 12px; }
.role-main h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.05; letter-spacing: -0.02em; }
.role-org { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; display: inline-block; margin-top: 8px; border-bottom: 1px solid transparent; transition: border-color 0.25s var(--ease); }
a.role-org:hover { border-color: var(--accent); }
.role-desc { color: var(--ink-soft); font-size: 1.02rem; }
.role-year { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

/* ===== Ventures ===== */
.ventures { list-style: none; }
.venture { border-top: 1px solid var(--line); }
.venture:last-child { border-bottom: 1px solid var(--line); }
.venture-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: baseline;
  padding: 30px 0; position: relative;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}
.venture-row:hover { background: var(--paper-2); padding-left: 16px; padding-right: 16px; }
.v-arrow {
  display: inline-block; font-size: 0.5em; vertical-align: middle;
  opacity: 0; transform: translate(-8px, 4px); color: var(--accent);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.venture-row:hover .v-arrow { opacity: 1; transform: none; }
.v-num { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); padding-top: 10px; will-change: transform; }
.v-role {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); display: block; margin-bottom: 10px;
}
.v-body h3 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.98; letter-spacing: -0.03em; transition: color 0.3s;
}
.venture-row:hover .v-body h3 { color: var(--accent); }
.v-body p { color: var(--ink-soft); font-size: 1.02rem; max-width: 520px; margin-top: 12px; }
.v-tag { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }

/* ===== Client work ===== */
.clients-lead {
  font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.18; letter-spacing: -0.02em; max-width: 780px; margin-bottom: 56px;
}
.clients-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.client-card {
  padding: 34px 34px 34px 0; border-top: 1px solid var(--line);
}
.client-card:nth-child(odd) { padding-right: 48px; }
.client-card:nth-child(even) { padding-left: 48px; border-left: 1px solid var(--line); }
.client-num { font-family: var(--mono); color: var(--accent); font-size: 1rem; display: block; margin-bottom: 16px; }
.client-card h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.client-card p { color: var(--ink-soft); font-size: 1.02rem; max-width: 40ch; }
.clients-avail {
  font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); margin-top: 44px; display: flex; align-items: center; gap: 10px;
}
.clients-avail .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #3a9d5d;
  box-shadow: 0 0 0 0 rgba(58,157,93,0.6); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(58,157,93,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(58,157,93,0); }
  100% { box-shadow: 0 0 0 0 rgba(58,157,93,0); }
}

.clients-cta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px; margin-top: 44px;
}
.btn-solid {
  font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: #fff; background: var(--accent);
  padding: 15px 26px; border-radius: 100px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-solid span { transition: transform 0.3s var(--ease); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(47, 67, 224, 0.35); }
.btn-solid:hover span { transform: translate(2px, -2px); }

/* ===== Skills ===== */
.skills-section { text-align: center; }
.skills-section .idx {
  display: block; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-soft); margin-bottom: 22px;
}
.skills-line {
  font-family: var(--serif); font-weight: 500; font-size: clamp(1.3rem, 3.4vw, 2.4rem);
  line-height: 1.4; letter-spacing: -0.01em; max-width: 900px; margin: 0 auto;
}

/* ===== Contact ===== */
.contact-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 9vw, 7rem);
  line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 50px;
}
.contact-title em { color: var(--accent); font-style: normal; }
.contact-links { display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: center; }
.contact-discord { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }

/* ===== Footer ===== */
.footer {
  background: var(--accent); color: #fff; overflow: hidden;
  padding: 34px clamp(20px, 5vw, 56px) 0;
}
.footer-top {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px;
  font-family: var(--mono); font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.82);
  padding-bottom: 26px; border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.footer-top a { border-bottom: 1px solid transparent; transition: border-color 0.25s var(--ease); }
.footer-top a:hover { border-color: #fff; }
.footer-name { text-align: center; }
.footer-name.reveal { opacity: 1; transform: none; }
.foot-word {
  display: block; font-family: var(--serif); font-weight: 700; color: #fff;
  font-size: clamp(3rem, 18vw, 15rem); line-height: 0.92; letter-spacing: -0.04em;
  white-space: nowrap; transform-origin: bottom center;
  transform: translateY(30%) scaleY(0.6); opacity: 0;
  transition: transform 1.1s var(--ease), opacity 0.9s var(--ease);
}
.footer-name.visible .foot-word { transform: none; opacity: 1; }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 30px; }
  .role { grid-template-columns: 1fr; gap: 12px; }
  .role-year { order: -1; }
  .venture-row { grid-template-columns: auto 1fr; }
  .v-tag { grid-column: 2; }
  .clients-grid { grid-template-columns: 1fr; }
  .client-card:nth-child(odd) { padding-right: 0; }
  .client-card:nth-child(even) { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed; inset: 0 0 auto; top: 0; flex-direction: column;
    background: var(--paper); padding: 88px 32px 40px; gap: 20px;
    transform: translateY(-100%); transition: transform 0.45s var(--ease);
    border-bottom: 1px solid var(--ink);
  }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 1rem; }
  .nav-toggle { display: block; z-index: 50; }
  .hero-meta { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .foot-word { opacity: 1; transform: none; }
  /* Keep the marquee gently scrolling — it's the one motion that IS the content */
  .marquee-track { animation: scrollx 40s linear infinite !important; }
}
