:root {
  --ink: #071b15;
  --forest: #0c3b2e;
  --leaf: #22b56d;
  --lime: #baf36c;
  --orange: #ff6b2c;
  --cream: #f4f0e7;
  --paper: #fffdf7;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { overflow-x: hidden; }
[x-cloak] { display: none !important; }
a, button { -webkit-tap-highlight-color: transparent; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  transition: opacity .7s ease, visibility .7s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__inner { width: min(480px, calc(100vw - 48px)); }
.preloader__mark { font-family: 'Space Grotesk', sans-serif; font-size: clamp(4rem, 13vw, 8rem); font-weight: 700; line-height: .8; letter-spacing: -.08em; }
.preloader__track { height: 2px; margin-top: 34px; overflow: hidden; background: rgba(255,255,255,.14); }
.preloader__track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--orange)); }
.preloader__meta { display: flex; justify-content: space-between; margin-top: 12px; font: 500 10px/1 'DM Mono', monospace; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.45); }

.scroll-progress { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; }
.scroll-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--orange)); }

.cursor-dot, .cursor-ring { position: fixed; z-index: 90; top: 0; left: 0; pointer-events: none; border-radius: 999px; transform: translate(-50%, -50%); }
.cursor-dot { width: 7px; height: 7px; background: var(--orange); }
.cursor-ring { width: 38px; height: 38px; border: 1px solid rgba(255,107,44,.62); transition: width .25s ease, height .25s ease, background-color .25s ease, border-color .25s ease; }
body.cursor-active .cursor-ring { width: 58px; height: 58px; background: rgba(255,107,44,.12); border-color: var(--orange); }

.hero-grid, .contact-grid {
  background-image: linear-gradient(rgba(255,255,255,.075) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .6; }
.orb--green { width: 430px; height: 430px; right: 6%; top: 18%; background: radial-gradient(circle, rgba(34,181,109,.38), transparent 68%); }
.orb--orange { width: 300px; height: 300px; left: -8%; bottom: 8%; background: radial-gradient(circle, rgba(255,107,44,.28), transparent 68%); }

.hero-title { font-size: clamp(3.35rem, 5.8vw, 5.4rem); }
.text-outline { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.38); }

.portrait-stage {
  --portrait-height: 102%;
  position: relative;
  z-index: 2;
  width: min(96%, 560px);
  height: min(76vh, 720px);
  overflow: hidden;
  border-radius: 46% 46% 2rem 2rem / 30% 30% 2rem 2rem;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 45px 100px rgba(0,0,0,.35);
}
.portrait-stage::before { content: ''; position: absolute; inset: auto 8% 3% 8%; height: 36%; border-radius: 50%; background: rgba(0,0,0,.42); filter: blur(36px); }
.portrait-stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,27,21,.5), transparent 38%); pointer-events: none; z-index: 12; }
.portrait-glow { position: absolute; inset: 9% 8% 10%; border-radius: 50%; background: radial-gradient(circle at 55% 40%, rgba(186,243,108,.5), rgba(34,181,109,.13) 42%, transparent 67%); filter: blur(3px); }
.portrait-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); }
.portrait-ring--one { width: 570px; height: 570px; right: -6%; top: 9%; }
.portrait-ring--two { width: 430px; height: 430px; left: 3%; bottom: 5%; border-color: rgba(255,107,44,.24); }

.floating-card { position: absolute; z-index: 15; min-width: 210px; border: 1px solid rgba(255,255,255,.14); border-radius: 1.25rem; background: rgba(7,27,21,.74); padding: 1rem 1.1rem; box-shadow: 0 20px 55px rgba(0,0,0,.25); backdrop-filter: blur(16px); }
.floating-card--role { left: -2%; bottom: 8%; }
.floating-card--focus { right: -1%; top: 28%; }

.marquee-track { display: flex; width: max-content; align-items: center; gap: 1.1rem; animation: marquee 28s linear infinite; white-space: nowrap; }
.marquee-track b { font-weight: 400; color: var(--cream); }
@keyframes marquee { to { transform: translateX(-50%); } }

.section-label { display: flex; align-items: center; gap: 14px; font: 500 10px/1 'DM Mono', monospace; letter-spacing: .2em; text-transform: uppercase; color: rgba(7,27,21,.55); }
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(7,27,21,.14); }
.section-label span:first-child { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(7,27,21,.18); border-radius: 50%; color: var(--orange); }
.section-label--light { color: rgba(255,255,255,.45); }
.section-label--light::after { background: rgba(255,255,255,.13); }
.section-label--light span:first-child { border-color: rgba(255,255,255,.15); color: var(--lime); }

.metric-card { position: relative; min-height: 190px; overflow: hidden; border: 1px solid rgba(7,27,21,.12); border-radius: 1.5rem; background: var(--cream); padding: 1.35rem; transition: transform .35s ease, border-color .35s ease; }
.metric-card:hover { transform: translateY(-7px); border-color: rgba(255,107,44,.65); }
.metric-card--dark { background: var(--ink); color: white; }

.noise-overlay { position: absolute; inset: 0; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }

.experience-card { overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 1.35rem; background: rgba(255,255,255,.035); transition: background .35s ease, border-color .35s ease, transform .35s ease; }
.experience-card:hover, .experience-card.is-open { border-color: rgba(34,181,109,.55); background: rgba(255,255,255,.06); transform: translateX(-5px); }
.experience-card.is-open .job-plus { transform: rotate(45deg); }
.experience-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s ease; }
.experience-detail > div { overflow: hidden; }
.experience-detail.is-open { grid-template-rows: 1fr; }

.skill-card { min-height: 330px; border: 1px solid rgba(7,27,21,.16); border-radius: 1.7rem; background: rgba(255,255,255,.28); padding: 1.5rem; transition: background .35s ease, transform .35s ease, box-shadow .35s ease; }
.skill-card:hover { transform: translateY(-8px); background: var(--paper); box-shadow: 0 30px 75px rgba(7,27,21,.14); }

.education-row { transition: padding .35s ease; }
.education-row:hover { padding-left: 1rem; padding-right: 1rem; }

.achievement-card { position: relative; min-height: 510px; overflow: hidden; border-radius: 2rem; padding: 1.6rem; transition: transform .4s ease, box-shadow .4s ease; }
.achievement-card:hover { transform: translateY(-9px) rotate(-.3deg); box-shadow: 0 35px 85px rgba(7,27,21,.16); }
.achievement-card--green { color: white; background: var(--forest); }
.achievement-card--orange { color: var(--ink); background: var(--orange); }
.achievement-card--blue { color: white; background: #1769aa; }
.achievement-card--cream { color: var(--ink); background: #f8df9b; }
.achievement-card--wide { color: white; background: linear-gradient(135deg, #0c3b2e, #1769aa); }
@media (min-width: 1024px) { .achievement-card--wide { grid-column: 1 / -1; min-height: 430px; } }
.card-orbit { position: absolute; width: 330px; height: 330px; right: -130px; top: -120px; border: 1px solid currentColor; border-radius: 50%; opacity: .16; transition: transform .7s ease; }
.card-orbit::before, .card-orbit::after { content: ''; position: absolute; inset: 35px; border: 1px solid currentColor; border-radius: 50%; }
.card-orbit::after { inset: 82px; }
.achievement-card:hover .card-orbit { transform: scale(1.17) rotate(22deg); }

.contact-link { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(255,255,255,.14); padding: 1rem .25rem; transition: padding .3s ease, color .3s ease; }
.contact-link:hover { padding-left: .8rem; padding-right: .8rem; color: var(--lime); }
.contact-link small { display: block; margin-bottom: .4rem; font: 500 9px/1 'DM Mono', monospace; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.contact-link strong { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }

@media (max-width: 1023px) {
  .floating-card--role { left: 2%; }
  .floating-card--focus { right: 1%; }
  .portrait-ring--one { right: 4%; }
}

@media (max-width: 639px) {
  .hero-title { font-size: clamp(3.05rem, 15.5vw, 5rem); }
  .portrait-stage { width: min(100%, 520px); height: 620px; }
  .portrait-ring { display: none; }
  .floating-card { min-width: 0; max-width: 190px; padding: .8rem; }
  .floating-card--role { left: 0; bottom: 3%; }
  .floating-card--focus { right: 0; top: 24%; }
  .skill-card { min-height: 285px; }
  .achievement-card { min-height: 430px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

.personal-card {
  overflow: hidden;
  border: 1px solid rgba(7,27,21,.12);
  border-radius: 1.4rem;
  background: var(--cream);
  box-shadow: 0 18px 45px rgba(7,27,21,.07);
}
.personal-card > div {
  display: grid;
  gap: .35rem;
  border-bottom: 1px solid rgba(7,27,21,.1);
  padding: 1rem 1.1rem;
}
.personal-card > div:last-child { border-bottom: 0; }
.personal-card small {
  font: 500 9px/1 'DM Mono', monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(7,27,21,.45);
}
.personal-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.training-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 1rem;
  align-items: start;
  border: 1px solid rgba(7,27,21,.12);
  border-radius: 1.2rem;
  background: var(--cream);
  padding: 1rem 1.1rem;
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.training-row:hover {
  transform: translateX(6px);
  border-color: rgba(255,107,44,.6);
  background: white;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: start;
  padding: 1.15rem 0;
  transition: padding .3s ease, color .3s ease;
}
.activity-row:hover {
  padding-left: .65rem;
  color: var(--lime);
}

@media (max-width: 639px) {
  .training-row { grid-template-columns: 1fr; gap: .45rem; }
  .activity-row { grid-template-columns: 1fr; gap: .5rem; }
}


/* Motion enhancement */
#home::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 22%, rgba(255,107,44,.10), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(186,243,108,.10), transparent 24%),
    radial-gradient(circle at 52% 78%, rgba(255,255,255,.05), transparent 28%);
}
.hero-title {
  perspective: 1200px;
}
.hero-title .char {
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.hero-title .text-tangerine,
.text-tangerine {
  text-shadow: 0 0 32px rgba(255,107,44,.16);
}
.text-outline {
  filter: drop-shadow(0 18px 36px rgba(255,255,255,.06));
}
.hero-kicker {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-kicker::after {
  content: '';
  position: absolute;
  inset: -180% -45%;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.30) 50%, transparent 62%);
  transform: translateX(-120%) rotate(16deg);
  animation: kickerShine 5.8s linear infinite;
  z-index: -1;
}
@keyframes kickerShine {
  to {
    transform: translateX(120%) rotate(16deg);
  }
}
.portrait-stage,
.metric-card,
.skill-card,
.achievement-card,
.experience-card,
.training-row,
.activity-row,
.education-row,
.contact-link,
.floating-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}
.portrait-image {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 0;
  width: auto !important;
  height: var(--portrait-height) !important;
  max-width: none !important;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  transform-origin: center bottom;
  transition: transform .28s ease;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.metric-card::before,
.skill-card::before,
.achievement-card::before,
.experience-card::before,
.training-row::before,
.activity-row::before,
.education-row::before,
.contact-link::before,
.floating-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.24), transparent 46%);
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: none;
}
.metric-card:hover::before,
.skill-card:hover::before,
.achievement-card:hover::before,
.experience-card:hover::before,
.training-row:hover::before,
.activity-row:hover::before,
.education-row:hover::before,
.contact-link:hover::before,
.floating-card:hover::before {
  opacity: 1;
}
.training-row {
  position: relative;
  overflow: hidden;
  border-radius: 1.3rem;
  border: 1px solid rgba(7,27,21,.12);
  background: rgba(255,255,255,.42);
  padding: 1rem 1.15rem;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.training-row:hover {
  transform: translateY(-6px);
  border-color: rgba(255,107,44,.55);
  box-shadow: 0 24px 56px rgba(7,27,21,.10);
}
.activity-row {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.10);
  padding: 1.2rem 0;
  transition: transform .35s ease, padding-left .35s ease, border-color .35s ease;
}
.activity-row:hover {
  transform: translateX(6px);
  padding-left: .7rem;
  border-color: rgba(34,181,109,.45);
}
.contact-link,
.education-row,
.experience-card,
.metric-card,
.skill-card,
.achievement-card {
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease, padding .35s ease, color .35s ease;
}
.contact-link:hover,
.education-row:hover {
  box-shadow: 0 18px 48px rgba(7,27,21,.08);
}


/* Simple hero portrait: full image, no frame, no crop, no motion */
.portrait-ring,
.portrait-stage,
.portrait-glow,
.floating-card {
  display: none !important;
}
.portrait-simple {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(100%, 620px);
  height: min(78vh, 760px);
  align-items: flex-end;
  justify-content: center;
}
.portrait-simple img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: none !important;
  filter: none;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 1023px) {
  .portrait-simple {
    width: min(100%, 570px);
    height: 680px;
  }
}
@media (max-width: 639px) {
  .portrait-simple {
    width: 100%;
    height: 520px;
  }
}

/* In the hero, only the name uses automatic animation. */
#home .hero-kicker::after {
  display: none !important;
}
#home .animate-pulse {
  animation: none !important;
}


/* Hero loop effects: keep photo normal, animate ambience and name */
#home {
  isolation: isolate;
}
.hero-grid {
  animation: heroGridDrift 26s linear infinite;
}
.hero-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(7,27,21,.28) 100%);
}
.orb {
  mix-blend-mode: screen;
}
.orb--green {
  animation: orbFloatGreen 10s ease-in-out infinite;
}
.orb--orange {
  animation: orbFloatOrange 12s ease-in-out infinite;
}
.hero-title .reveal-line {
  display: block;
  will-change: transform, opacity, filter;
}
.hero-title .char {
  display: inline-block;
  backface-visibility: hidden;
}
.portrait-simple {
  overflow: visible;
}
.portrait-simple::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  width: 74%;
  height: 22%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34,181,109,.22) 0%, rgba(255,107,44,.12) 40%, rgba(7,27,21,0) 72%);
  filter: blur(34px);
  animation: portraitAura 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.portrait-simple::after {
  content: '';
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -1px;
  height: 28%;
  background: linear-gradient(to top, rgba(7,27,21,1) 0%, rgba(7,27,21,.94) 22%, rgba(7,27,21,.68) 48%, rgba(7,27,21,.28) 70%, rgba(7,27,21,0) 100%);
  pointer-events: none;
  z-index: 3;
}
.portrait-simple img {
  position: relative;
  z-index: 2;
}
#home .hero-kicker {
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 28px rgba(0,0,0,.12);
}
#home::after {
  content: '';
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
  opacity: .5;
  animation: heroSweep 7.5s linear infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes heroGridDrift {
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-18px, -14px, 0); }
  100% { transform: translate3d(0,0,0); }
}
@keyframes orbFloatGreen {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(18px,-20px,0) scale(1.06); }
}
@keyframes orbFloatOrange {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-16px,18px,0) scale(1.08); }
}
@keyframes portraitAura {
  0%,100% { transform: translateX(-50%) scale(1); opacity: .82; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 1; }
}
@keyframes heroSweep {
  0% { transform: translateX(-12%); opacity: 0; }
  15% { opacity: .42; }
  50% { opacity: .6; }
  85% { opacity: .42; }
  100% { transform: translateX(12%); opacity: 0; }
}
@media (max-width: 639px) {
  .portrait-simple::after {
    height: 32%;
  }
  .portrait-simple::before {
    width: 88%;
    bottom: 8%;
  }
}
