/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: #0b0b0a; color: #ece8de; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
}
@media (max-width: 768px) { body { cursor: auto; } }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }
img { display: block; max-width: 100%; }

::selection { background: #ff8030; color: #0b0b0a; }

/* ---------- Vars ---------- */
:root {
  --bg: #0b0b0a;
  --bg-2: #131210;
  --fg: #ece8de;
  --fg-dim: #a8a49a;
  --muted: #6b6862;
  --line: #26241f;
  --accent: #ff8030;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --max: 1440px;
  --pad: clamp(20px, 4vw, 56px);
}

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none;
  z-index: 9999; mix-blend-mode: difference;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ece8de;
}
.cursor-ring {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #ece8de;
  transition: width .25s ease, height .25s ease, opacity .25s ease;
}
.cursor-ring.hover { width: 80px; height: 80px; border-color: #ff8030; }
.cursor-ring.text { width: 10px; height: 10px; background: #ece8de; }
@media (max-width: 768px) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 22px var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #ece8de;
  transform: translateY(0);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.nav.is-hidden { transform: translateY(-110%); }
.nav-logo { 
  font-family: var(--mono); 
  font-weight: 500; 
  letter-spacing: 0; 
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.nav-logo:hover img { transform: rotate(12deg) scale(1.08); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { position: relative; opacity: 0.7; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }
.nav-links a.active::before {
  content: ""; position: absolute; left: -10px; top: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}
.nav-cta {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 7px 14px;
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
@media (max-width: 768px) { .nav-links { display: none; } }

/* ---------- Layout helpers ---------- */
.section {
  position: relative;
  padding: 120px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
}
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 48px;
}
.section-label::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.section-divider {
  border-top: 1px solid var(--line);
  margin: 0 var(--pad);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  padding: 140px var(--pad) 80px;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  position: relative;
}
.hero-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero-top .y-tag span { color: var(--fg); }

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(80px, 18vw, 280px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-top: 40px;
  display: flex; flex-direction: column;
}
.hero-name .row {
  display: flex; align-items: baseline; gap: 0.15em;
  overflow: hidden;
  padding-bottom: 0.05em;
}
.hero-name .row.right { justify-content: flex-end; }
.hero-name .letter {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-name .ital { font-style: italic; color: var(--accent); }
@keyframes rise { to { transform: translateY(0); } }

.hero-bottom {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  padding-top: 80px;
}
.hero-bio {
  max-width: 480px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--fg);
  text-wrap: pretty;
}
.hero-bio strong { color: var(--accent); font-weight: 500; }
.hero-scroll {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  justify-self: end;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.hero-scroll .line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, var(--fg-dim) 0%, transparent 100%);
  position: relative; overflow: hidden;
}
.hero-scroll .line::after {
  content: ""; position: absolute; top: -30%; left: 0; right: 0;
  height: 30%; background: var(--accent);
  animation: scrollLine 2s linear infinite;
}
@keyframes scrollLine { to { top: 130%; } }

/* ---------- Hero portrait (inline, replaces the O in DOMANIC) ---------- */
.hero-portrait-letter {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  vertical-align: baseline;
  /* visually align bottom of circle slightly above baseline to match cap-height */
  margin-bottom: -0.04em;
  border-radius: 50%;
  position: relative;
  cursor: none;
  /* match the letter rise-up animation timing */
  transform: translateY(110%);
  animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards, bob 5.5s ease-in-out 1.2s infinite;
}
.hero-portrait-letter .ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  border: 0.025em solid var(--accent);
  box-shadow:
    0 0.05em 0.15em rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 128, 48, 0.25),
    0 0 0.4em rgba(255, 128, 48, 0.35);
  transition: transform .4s ease;
  transform-origin: center;
}
.hero-portrait-letter .ring img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  /* shift face up slightly so eyes sit centered in the circle */
  transform: scale(1.15) translateY(4%);
  transition: transform .4s ease;
}
.hero-portrait-letter:hover .ring {
  animation: wiggle 0.8s cubic-bezier(.36,.07,.19,.97);
}
.hero-portrait-letter:hover .ring img {
  transform: scale(1.22) translateY(2%);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.06em); }
}
@keyframes wiggle {
  0%   { transform: rotate(0deg) scale(1); }
  15%  { transform: rotate(-12deg) scale(1.08); }
  30%  { transform: rotate(10deg)  scale(1.08); }
  45%  { transform: rotate(-7deg)  scale(1.08); }
  60%  { transform: rotate(6deg)   scale(1.08); }
  75%  { transform: rotate(-3deg)  scale(1.08); }
  100% { transform: rotate(0deg)   scale(1.04); }
}


@media (max-width: 768px) {
  .hero-bottom { grid-template-columns: 1fr; gap: 32px; }
  .hero-scroll { justify-self: start; }
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 28px 0;
  white-space: nowrap;
}
.marquee-inner {
  display: inline-flex;
  gap: 60px;
  animation: marquee 40s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1;
}
.marquee-inner span {
  display: inline-flex; align-items: center; gap: 60px;
}
.marquee-inner .dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.about-side {
  position: sticky; top: 100px;
}
.about-side h2 {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.about-side h2 em { color: var(--accent); }
.about-body p {
  font-size: 19px;
  line-height: 1.55;
  margin-bottom: 24px;
  text-wrap: pretty;
}
.about-body p:first-child { font-size: 22px; color: var(--fg); }
.about-body p { color: var(--fg-dim); }
.about-meta {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
}
.about-meta div { border-top: 1px solid var(--line); padding-top: 14px; }
.about-meta .label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; margin-bottom: 6px; }
.about-meta .val { color: var(--fg); }
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about-side { position: static; }
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.skill {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.skill-pct {
  font-family: var(--serif);
  font-size: clamp(60px, 8vw, 100px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  display: flex; align-items: baseline;
}
.skill-pct .num { font-style: normal; }
.skill-pct .sign { font-size: 0.5em; color: var(--accent); margin-left: 4px; }
.skill h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}
.skill p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.skill-bar {
  height: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.skill-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  width: 0;
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
}
@media (max-width: 900px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Experience ---------- */
.exp-list {
  border-top: 1px solid var(--line);
}
.exp-item {
  border-bottom: 1px solid var(--line);
  padding: 36px 0;
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr 200px 100px;
  gap: 32px;
  align-items: center;
  position: relative;
  transition: padding .3s ease;
  cursor: none;
}
.exp-item:hover { padding: 48px 0; }
.exp-item:hover .exp-role { color: var(--accent); }
.exp-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.exp-role {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  transition: color .3s ease;
}
.exp-company {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--fg-dim);
}
.exp-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  text-align: right;
}
.exp-arrow {
  justify-self: end;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background .25s, border-color .25s, transform .25s;
}
.exp-arrow svg { transition: transform .25s; }
.exp-item:hover .exp-arrow { background: var(--accent); border-color: var(--accent); }
.exp-item:hover .exp-arrow svg { transform: rotate(-45deg); }
.exp-item:hover .exp-arrow svg path { stroke: var(--bg); }
.exp-detail {
  grid-column: 2 / -1;
  max-height: 0;
  overflow: hidden;
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.55;
  transition: max-height .5s ease, margin-top .3s ease, opacity .3s ease;
  opacity: 0;
}
.exp-item:hover .exp-detail {
  max-height: 200px;
  margin-top: 24px;
  opacity: 1;
}
@media (max-width: 900px) {
  .exp-item { grid-template-columns: 40px 1fr 80px; gap: 16px; padding: 24px 0; }
  .exp-company, .exp-arrow { display: none; }
  .exp-item:hover { padding: 24px 0; }
}

/* ---------- Counters ---------- */
.counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 100px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.counter {
  text-align: left;
}
.counter-num {
  font-family: var(--serif);
  font-size: clamp(70px, 10vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  display: flex; align-items: baseline;
}
.counter-num .sign { color: var(--accent); margin-left: 8px; font-size: 0.6em; }
.counter-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  margin-top: 12px;
}
@media (max-width: 900px) {
  .counters { grid-template-columns: 1fr; gap: 32px; padding: 60px var(--pad); }
}

/* ---------- Projects ---------- */
.projects-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 60px;
  gap: 40px;
}
.projects-title {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.projects-title em { color: var(--accent); }
.projects-intro {
  max-width: 360px;
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.5;
}

.project-list {
  border-top: 1px solid var(--line);
  position: relative;
}
.project-item {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 160px 60px;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  transition: padding .3s ease;
  cursor: none;
  position: relative;
}
.project-item:hover { padding: 48px 0; }
.project-item:hover .project-title { color: var(--accent); }
.project-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.project-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color .3s ease;
}
.project-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.project-meta span {
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
}
.project-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  text-align: right;
}
.project-arrow {
  justify-self: end;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  display: grid; place-items: center;
  transition: background .25s, transform .25s;
}
.project-item:hover .project-arrow { background: var(--accent); }
.project-item:hover .project-arrow svg { transform: rotate(-45deg); }
.project-item:hover .project-arrow svg path { stroke: var(--bg); }

/* Floating image preview that follows cursor */
.project-preview {
  position: fixed;
  pointer-events: none;
  width: 340px; height: 420px;
  z-index: 50;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.85);
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1);
  border-radius: 6px;
  overflow: hidden;
  will-change: transform, left, top;
}
.project-preview.show {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1);
}
.project-preview-card {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.project-preview-card .label {
  position: absolute;
  bottom: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 2;
}
.project-preview-card .big {
  font-family: var(--serif);
  font-size: 88px;
  font-style: italic;
  line-height: 0.9;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.03em;
  text-align: center;
  z-index: 2;
  padding: 0 24px;
}
.project-preview-card .grain {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.18) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  mix-blend-mode: overlay;
  opacity: 0.5;
}

@media (max-width: 900px) {
  .projects-head { flex-direction: column; align-items: flex-start; }
  .project-item { grid-template-columns: 40px 1fr 60px; gap: 12px; padding: 24px 0; }
  .project-meta, .project-arrow { display: none; }
  .project-item:hover { padding: 24px 0; }
  .project-preview { display: none; }
}

/* ---------- Education ---------- */
.edu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.edu-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--bg-2);
  transition: border-color .25s, transform .25s;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 280px;
}
.edu-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.edu-card .top {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.edu-card h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.edu-card .school {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
}
.edu-card p {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.5;
  margin-top: auto;
}
@media (max-width: 900px) { .edu { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact {
  padding: 140px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.contact-headline {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.contact-headline em { color: var(--accent); }
.contact-side p {
  font-size: 17px;
  color: var(--fg-dim);
  margin-bottom: 32px;
  max-width: 380px;
  line-height: 1.5;
}
.magnetic {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 22px 40px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.magnetic:hover { background: #ece8de; }
.magnetic span { display: inline-block; transition: transform .25s; }
.contact-meta {
  margin-top: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
}
.contact-meta div { border-top: 1px solid var(--line); padding-top: 14px; }
.contact-meta .label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; margin-bottom: 6px; }
.contact-meta a:hover { color: var(--accent); }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; gap: 40px; padding: 80px var(--pad); } }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-wrap: wrap; gap: 16px;
}
.footer a:hover { color: var(--accent); }
.clock { color: var(--fg); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

/* ---------- Subtle grain on body ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
