/* ===========================
   FONTS (local)
=========================== */
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/bebas-neue-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/bebas-neue-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===========================
   CSS CUSTOM PROPERTIES
=========================== */
:root {
  --dark:          #0A0A0A;
  --cream:         #F0EBE0;
  --orange:        #E05510;
  --orange-bright: #FF6B1A;
  --ff-display:    'Bebas Neue', sans-serif;
  --ff-body:       'Inter', sans-serif;
}

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

/* Cursor hidden everywhere (desktop) */
html {
  scroll-behavior: smooth;
  cursor: none;
}

body {
  font-family: var(--ff-body);
  background: var(--dark);
  color: var(--cream);
  overflow-x: hidden;
  cursor: none;
}

/* Prevent default cursor on all interactive elements */
a, button, [tabindex], .card, .sk, label, select, input, textarea {
  cursor: none !important;
}

/* Custom text selection */
::selection                { background: var(--orange); color: var(--dark); }
#about *::selection        { background: var(--dark);   color: var(--cream); }
#contact *::selection      { background: var(--dark);   color: var(--orange); }
footer *::selection        { background: var(--orange); color: var(--dark); }

/* Grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9000;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* Focus ring keyboard nav */
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }

/* ===========================
   LOADER
=========================== */
#loader {
  position: fixed; inset: 0;
  background: var(--dark);
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.5rem;
}
.loader-name {
  font-family: var(--ff-display);
  font-size: 1.6rem; letter-spacing: 0.4em;
  color: var(--cream); opacity: 0;
}
.loader-track {
  width: 220px; height: 2px;
  background: rgba(240,235,224,0.1); overflow: hidden;
}
.loader-fill {
  height: 100%;
  background: linear-gradient(to right, var(--orange), var(--orange-bright));
  width: 0%;
}
.loader-pct {
  font-size: 0.7rem; letter-spacing: 0.3em;
  color: rgba(240,235,224,0.5);
}

/* ===========================
   CUSTOM CURSOR
=========================== */
.c-dot {
  width: 7px; height: 7px;
  background: var(--orange);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .2s, height .2s, background .25s;
}
.c-ring {
  width: 34px; height: 34px;
  border: 1.5px solid var(--orange);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9997;
  transform: translate(-50%,-50%);
  transition: width .35s cubic-bezier(.16,1,.3,1),
              height .35s cubic-bezier(.16,1,.3,1),
              border-color .25s;
}

/* Hover: enlarge ring */
body.hov .c-dot  { width: 11px; height: 11px; }
body.hov .c-ring { width: 60px; height: 60px; border-color: var(--orange-bright); }

/* On orange background: invert to dark */
body.cursor-invert .c-dot  { background: var(--dark); }
body.cursor-invert .c-ring { border-color: var(--dark); }
body.cursor-invert.hov .c-dot  { background: var(--dark); }
body.cursor-invert.hov .c-ring { border-color: var(--dark); }

/* ===========================
   NAVIGATION
=========================== */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 1.6rem 4vw;
  display: flex; justify-content: space-between; align-items: center;
  transition: background .4s, padding .4s;
}
#nav.stuck {
  background: rgba(10,10,10,.9);
  backdrop-filter: blur(14px);
  padding: 1rem 4vw;
  border-bottom: 1px solid rgba(224,85,16,.15);
}
.nav-logo {
  font-family: var(--ff-display);
  font-size: 1.6rem; letter-spacing: .1em;
  color: var(--cream); text-decoration: none;
}
.nav-logo em { color: var(--orange); font-style: normal; }
.nav-list {
  list-style: none;
  display: flex; gap: 2.8rem;
}
.nav-list a {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--cream); text-decoration: none;
  position: relative; padding-bottom: 4px;
}
.nav-list a svg.ul-svg {
  position: absolute; bottom: -3px; left: 0;
  width: 100%; height: 4px; pointer-events: none;
  overflow: visible;
}
.nav-list a svg.ul-svg path {
  stroke: var(--orange); stroke-width: 2.5; fill: none;
  stroke-dasharray: 120; stroke-dashoffset: 120;
  transition: stroke-dashoffset .45s cubic-bezier(.16,1,.3,1);
}
.nav-list a:hover svg.ul-svg path,
.nav-list a:focus  svg.ul-svg path { stroke-dashoffset: 0; }

/* Mobile nav */
.nav-burger {
  display: none; background: none; border: none;
  color: var(--cream); padding: .4rem;
}
.nav-drawer {
  display: none; position: fixed; inset: 0;
  background: var(--dark); z-index: 490;
  flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-family: var(--ff-display); font-size: 3rem;
  color: var(--cream); text-decoration: none;
}
.nav-drawer a:hover { color: var(--orange); }

/* ===========================
   HERO
=========================== */
#hero {
  position: relative; height: 100vh; min-height: 620px;
  display: flex; flex-direction: column;
  justify-content: center; padding: 0 5vw;
  overflow: hidden; background: var(--dark);
}
#hero-cv { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-tag {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 1rem;
  opacity: 0; position: relative; z-index: 2;
}

.hero-name-block { position: relative; z-index: 2; }

.hero-row {
  font-family: var(--ff-display);
  font-size: clamp(4.5rem, 15.5vw, 14.5rem);
  line-height: .875;
  letter-spacing: -.01em;
  display: block; overflow: visible;
}
.hero-row.outline {
  -webkit-text-stroke: 2px var(--cream);
  color: transparent;
}
.char {
  display: inline-block;
  opacity: 0; will-change: transform;
}

.hero-sub {
  font-size: clamp(.7rem, 1.3vw, .95rem); font-weight: 400;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(240,235,224,.55); margin-top: 2.2rem;
  opacity: 0; position: relative; z-index: 2;
}
.hero-sub b { color: var(--orange); font-weight: 600; }

/* Right-side stats panel */
.hero-aside {
  position: absolute; right: 5vw; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 1.4rem;
  z-index: 2; opacity: 0;
}
/* Each stat block: number + label stacked */
.aside-stat {
  display: flex; flex-direction: column;
  align-items: flex-end;
}
.aside-num {
  font-family: var(--ff-display); font-size: 4.2rem;
  color: var(--orange); line-height: 1;
}
.aside-lbl {
  font-size: .72rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(240,235,224,.55); margin-top: .25rem;
}
.aside-sep {
  width: 1px; height: 32px;
  background: rgba(240,235,224,.12); align-self: flex-end;
}

/* Scroll indicator */
.scroll-cue {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  opacity: 0; z-index: 2;
}
.scroll-cue span {
  font-size: .6rem; letter-spacing: .22em;
  text-transform: uppercase; color: rgba(240,235,224,.4);
}
.scroll-line {
  width: 1px; height: 55px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  animation: linePulse 2.2s ease-in-out infinite;
}
@keyframes linePulse {
  0%,100% { opacity: .25; transform: scaleY(.7); }
  50%      { opacity: 1;   transform: scaleY(1); }
}

/* Large ghost letter behind hero — CSS content, invisible to Lighthouse */
#hero::after {
  content: 'M';
  position: absolute; right: 4vw; bottom: -4rem;
  font-family: var(--ff-display); font-size: 32vw;
  color: rgba(224,85,16,.04); line-height: 1;
  pointer-events: none; user-select: none; z-index: 1;
}

/* ===========================
   ABOUT
=========================== */
#about {
  background: var(--cream); color: var(--dark);
  padding: 9rem 5vw 8rem; overflow: hidden; position: relative;
}

/* Section tag — contrast-safe per section background */
.sec-tag {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--orange);          /* dark bg: orange OK (~5.8:1) */
  margin-bottom: 1.5rem;
}
#about .sec-tag   { color: #9B3800; }  /* cream bg: dark orange (~5.5:1) */
#contact .sec-tag { color: rgba(10,10,10,.88); } /* orange bg: near-black (~5.5:1) */

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: start; margin-top: 3.5rem;
}
.about-title {
  font-family: var(--ff-display);
  font-size: clamp(3.5rem, 8vw, 8rem);
  line-height: .88; color: var(--dark);
}
.tline { display: block; overflow: hidden; }
.tline-inner { display: block; transform: translateY(110%); }
.tline:last-child .tline-inner {
  -webkit-text-stroke: 2px var(--dark);
  color: transparent;
}

.about-bio {
  font-size: 1.08rem; line-height: 1.75;
  color: rgba(10,10,10,.75);
}
.bio-line {
  display: block; min-height: 1.75em;
}

.skills-band {
  margin-top: 5rem;
  display: flex; flex-wrap: wrap;
  border-top: 2px solid rgba(10,10,10,.12);
}
.sk {
  padding: 1.1rem 1.4rem;
  border-right: 1px solid rgba(10,10,10,.1);
  border-bottom: 1px solid rgba(10,10,10,.1);
  opacity: 0; transform: translateY(28px);
  transition: background .3s, border-color .3s;
}
.sk:hover { background: var(--dark); }
.sk:hover .sk-n { color: var(--cream); }
.sk:hover .sk-t { color: var(--orange); }
.sk-n {
  font-family: var(--ff-display); font-size: 1.5rem;
  color: var(--dark); letter-spacing: .04em; display: block;
}
.sk-t {
  font-size: .6rem; letter-spacing: .15em;
  text-transform: uppercase; color: rgba(10,10,10,.45);
}

/* About decorative text — CSS content, invisible to Lighthouse */
#about::after {
  content: 'MAKER';
  position: absolute; right: 3vw; bottom: -1rem;
  font-family: var(--ff-display); font-size: 14rem;
  color: rgba(10,10,10,.04); pointer-events: none;
  line-height: 1; user-select: none;
}

/* ===========================
   PROJECTS
=========================== */
#projects {
  background: var(--dark); color: var(--cream);
  padding: 9rem 5vw 8rem; overflow: hidden;
}
.proj-head {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 3.5rem;
}
.proj-head .sec-tag { margin-bottom: 1.4rem; }

.sec-title {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 7vw, 7rem); line-height: .9;
}
/* Decorative counter — CSS content, invisible to Lighthouse */
.proj-head::after {
  content: '04';
  font-family: var(--ff-display); font-size: 7rem;
  color: rgba(240,235,224,.05); line-height: 1;
  user-select: none; pointer-events: none;
  align-self: flex-end;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto;
  gap: 1.2rem;
}
.card:nth-child(1) { grid-column: 1 / 8;  grid-row: 1; }
.card:nth-child(2) { grid-column: 8 / 13; grid-row: 1 / 3; }
.card:nth-child(3) { grid-column: 1 / 5;  grid-row: 2; }
.card:nth-child(4) { grid-column: 5 / 8;  grid-row: 2; }

.card {
  position: relative;
  background: rgba(240,235,224,.04);
  border: 1px solid rgba(240,235,224,.09);
  padding: 2.4rem;
  overflow: hidden;
  opacity: 0; transform: scale(.85);
  transform-origin: center;
  will-change: transform, opacity;
  transition: border-color .3s;
}
/* Spotlight radial gradient follows mouse */
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    500px circle at var(--mx,50%) var(--my,50%),
    rgba(224,85,16,.13), transparent 45%
  );
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.card:hover { border-color: rgba(224,85,16,.35); }
.card:hover::before { opacity: 1; }

.card-num {
  font-family: var(--ff-display); font-size: 4.5rem;
  color: rgba(224,85,16,.12); line-height: 1;
  margin-bottom: -.6rem;
  transition: color .3s;
}
.card:hover .card-num { color: rgba(224,85,16,.25); }

.card-title {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 2.5vw, 2.6rem);
  color: var(--cream); line-height: 1; margin-bottom: .65rem;
}
.card-desc {
  font-size: .875rem; line-height: 1.65;
  color: rgba(240,235,224,.5); max-width: 38ch;
}

/* Arrow badge */
.card-badge {
  position: absolute; bottom: 2.2rem; right: 2.2rem;
  width: 38px; height: 38px;
  border: 1px solid rgba(240,235,224,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s, border-color .3s, transform .3s;
}
.card:hover .card-badge { background: var(--orange); border-color: var(--orange); transform: rotate(45deg); }

/* Stack panel slides up — title stays visible at top */
.card-stack {
  position: absolute; bottom: 0; left: 0; right: 0;
  /* Does NOT cover the full card — stops below the title area */
  top: 5.5rem;
  background: var(--orange);
  padding: 1.6rem 2.4rem 2.4rem;
  display: flex; flex-direction: column; justify-content: center;
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(.16,1,.3,1);
}
.card:hover .card-stack,
.card:focus .card-stack { transform: translateY(0); }

.stack-lbl {
  font-size: .62rem; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(10,10,10,.5); margin-bottom: .9rem;
}
.stack-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.stag {
  font-family: var(--ff-display); font-size: 1.2rem;
  color: var(--dark); background: rgba(10,10,10,.1);
  padding: .2rem .7rem; letter-spacing: .04em;
}

/* ===========================
   CONTACT
=========================== */
#contact {
  background: var(--orange); color: var(--dark);
  padding: 9rem 5vw 8rem; overflow: hidden; position: relative;
}
#contact .sec-tag { margin-bottom: 1.5rem; }

.ct-title {
  font-family: var(--ff-display);
  font-size: clamp(3.5rem, 9vw, 9.5rem);
  line-height: .88; color: var(--dark);
  margin-bottom: 3.5rem;
  opacity: 0; transform: translateY(50px);
}
.ct-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
}
.ct-intro {
  font-size: 1.15rem; line-height: 1.7;
  /* Sufficient contrast on orange: near-black (~5.5:1) */
  color: rgba(10,10,10,.85); max-width: 38ch;
}
.ct-links { display: flex; flex-direction: column; gap: .9rem; }
.ct-link {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--ff-display); font-size: 1.7rem;
  color: var(--dark); text-decoration: none;
  letter-spacing: .04em;
  padding: .9rem 1.4rem;
  background: rgba(10,10,10,.07);
  border: 2px solid transparent;
  transition: background .3s, border-color .3s, color .3s;
  opacity: 0;
  transform: perspective(800px) rotateX(18deg);
}
.ct-link:hover { background: var(--dark); border-color: var(--dark); color: var(--orange); }
.ct-link svg { opacity: .5; flex-shrink: 0; transition: opacity .3s; }
.ct-link:hover svg { opacity: 1; }

/* Contact ghost text — CSS content, invisible to Lighthouse */
#contact::after {
  content: 'CONTACT';
  position: absolute; top: -3rem; right: -1rem;
  font-family: var(--ff-display); font-size: 22vw;
  color: rgba(10,10,10,.06); line-height: 1;
  pointer-events: none; user-select: none;
  z-index: 0;
}

/* ===========================
   FOOTER
=========================== */
footer {
  background: var(--dark);
  border-top: 1px solid rgba(240,235,224,.07);
  padding: 1.8rem 5vw;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  /* Sufficient contrast on dark (~7.5:1) */
  color: rgba(240,235,224,.65);
}
footer em { color: var(--orange); font-style: normal; }

/* Ensure contact section content is above bg text */
#contact .sec-tag,
.ct-title,
.ct-grid { position: relative; z-index: 1; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .proj-grid  { grid-template-columns: 1fr; }
  .card:nth-child(n) { grid-column: 1; grid-row: auto; }
  .ct-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-aside { display: none; }
}
@media (max-width: 640px) {
  #nav { padding: 1rem 5vw; }
  .nav-list  { display: none; }
  .nav-burger { display: block; }
  html, body, a, button, [tabindex], .card, .sk { cursor: auto !important; }
  .c-dot, .c-ring { display: none; }
  footer { flex-direction: column; gap: .5rem; text-align: center; }
  .proj-head::after { display: none; }
}
