/* ==========================================================================
   MIDNIGHT GILT — Cinematic Dark Luxury
   Palette: #0A0A0F bg · #14141C surface · #F4EFE6 text · #A29DA8 muted
            #D4AF37 gold · #F2D98D champagne · #8C6A2F bronze (shadow stop only)
   ========================================================================== */

/* Self-hosted variable fonts (Google Fonts builds, latin + latin-ext subsets)
   served from /vendor/fonts with a one-year immutable cache; index.ejs
   preloads the two latin files. unicode-range mirrors Google's CSS, so the
   latin-ext files are fetched only when such a glyph actually appears. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/vendor/fonts/fraunces-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/vendor/fonts/fraunces-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: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/manrope-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/manrope-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;
}

:root {
  --bg: #0A0A0F;
  --surface: rgba(20, 20, 28, 0.55);
  --text: #F4EFE6;
  --text2: #A29DA8;
  --gold: #D4AF37;
  --champ: #F2D98D;
  --bronze: #8C6A2F;
  --gold-grad: linear-gradient(135deg, #F2D98D 0%, #D4AF37 45%, #8C6A2F 100%);
  --gold-border: rgba(212, 175, 55, 0.18);
  --wa-grad: linear-gradient(135deg, #2EE07A 0%, #25D366 55%, #1DA851 100%);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(120% 80% at 50% 0%, #12121A 0%, #0A0A0F 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(212, 175, 55, 0.35); color: var(--text); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--champ);
  outline-offset: 3px;
}
.card-link:focus-visible { border-radius: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

img { max-width: 100%; display: block; }

/* --------------------------------------------------------------------------
   Loading screen — gold wireframe cube, hologram monogram, tech grid
   -------------------------------------------------------------------------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#loader.done { pointer-events: none; }
body.is-loading { overflow: hidden; }

.loader-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background: #0A0A0F;
}
.loader-half-top { top: 0; }
.loader-half-bottom { bottom: 0; }

.loader-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}

/* perspective grid floor rushing toward the viewer */
.loader-grid {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 200vmax;
  height: 60vmax;
  transform: translateX(-50%) perspective(500px) rotateX(74deg);
  transform-origin: 50% 0%;
  background:
    repeating-linear-gradient(90deg, rgba(212, 175, 55, 0.13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(212, 175, 55, 0.13) 0 1px, transparent 1px 64px);
  -webkit-mask-image: radial-gradient(45% 55% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(45% 55% at 50% 0%, #000 30%, transparent 78%);
  animation: loaderGrid 2.4s linear infinite;
  pointer-events: none;
}
@keyframes loaderGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 0 64px; }
}

.loader-scene {
  position: relative;
  width: 150px;
  height: 150px;
  perspective: 700px;
  animation: loaderBob 3.6s ease-in-out infinite;
}
@keyframes loaderBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.loader-cube {
  position: absolute;
  inset: 27px;
  transform-style: preserve-3d;
  animation: loaderCube 5s linear infinite;
}
@keyframes loaderCube {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to { transform: rotateX(-22deg) rotateY(360deg); }
}
.cf {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(212, 175, 55, 0.85);
  background: rgba(212, 175, 55, 0.05);
  box-shadow: inset 0 0 26px rgba(212, 175, 55, 0.14);
}
.cf-front { transform: translateZ(48px); }
.cf-back { transform: rotateY(180deg) translateZ(48px); }
.cf-right { transform: rotateY(90deg) translateZ(48px); }
.cf-left { transform: rotateY(-90deg) translateZ(48px); }
.cf-top { transform: rotateX(90deg) translateZ(48px); }
.cf-bottom { transform: rotateX(-90deg) translateZ(48px); }

/* the monogram floats inside the cube like a hologram */
.loader-mono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 46px;
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.35);
  animation: loaderMono 2s ease-in-out infinite;
}
@keyframes loaderMono {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* orbiting arcs */
.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(242, 217, 141, 0.18);
  border-top-color: rgba(242, 217, 141, 0.9);
}
.loader-ring-1 {
  inset: -8px;
  animation: loaderRing1 2.2s linear infinite;
}
.loader-ring-2 {
  inset: -26px;
  border-top-color: rgba(212, 175, 55, 0.55);
  animation: loaderRing2 3.4s linear infinite reverse;
}
@keyframes loaderRing1 {
  from { transform: rotateX(64deg) rotateZ(0deg); }
  to { transform: rotateX(64deg) rotateZ(360deg); }
}
@keyframes loaderRing2 {
  from { transform: rotateX(-58deg) rotateY(12deg) rotateZ(0deg); }
  to { transform: rotateX(-58deg) rotateY(12deg) rotateZ(360deg); }
}

.loader-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loader-pct {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  color: var(--champ);
}
.loader-track {
  width: 180px;
  height: 2px;
  background: rgba(212, 175, 55, 0.15);
  overflow: hidden;
}
.loader-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8C6A2F, #D4AF37, #F2D98D);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}
.loader-label {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--text2);
}

@media (prefers-reduced-motion: reduce) {
  #loader { display: none; }
}

/* --------------------------------------------------------------------------
   Fixed chrome: progress bar, orbs, grain
   -------------------------------------------------------------------------- */

.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
  background: rgba(212, 175, 55, 0.08);
}
.progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #F2D98D, #D4AF37, #F2D98D);
  transform: scaleX(0);
  transform-origin: left center;
}

.orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb-layer { position: absolute; inset: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.orb-gold {
  width: 420px; height: 420px;
  left: 8%; top: 12%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.14), transparent 70%);
}
.orb-violet {
  width: 560px; height: 560px;
  right: -6%; top: 38%;
  background: radial-gradient(circle, rgba(108, 74, 182, 0.12), transparent 70%);
}
.orb-ember {
  width: 300px; height: 300px;
  left: 45%; top: 72%;
  background: radial-gradient(circle, rgba(214, 116, 60, 0.10), transparent 70%);
  filter: blur(70px);
}

#scene3d {
  position: fixed;
  inset: 0;
  width: 100%;
  /* large-viewport height so a phone's URL bar showing/hiding mid-scroll does
     not change the canvas size (scene3d.js sizes the renderer from clientHeight) */
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #scene3d { display: none; }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* --------------------------------------------------------------------------
   Shared: sections, headings, glass, ghost numerals
   -------------------------------------------------------------------------- */

main, .hero { position: relative; z-index: 1; }
/* Clip sideways overflow at <main> (ghost numerals bleed 14px past the edge, timeline and
   card entrances start translated sideways) so it never widens the document — mobile Chrome
   otherwise lays the page out to the overflow width (443px at a 390px phone). `clip`, not
   `hidden`: no scroll container is created and html/body overflow (and the drawer/lightbox
   scroll locks that rely on body→viewport propagation) are left untouched. */
main { overflow-x: clip; }

.section { position: relative; }

.section-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 160px 24px;
}

/* Giant editorial outlined numerals — headings sit on their lower third. */
.ghost-num {
  position: absolute;
  top: -24px;
  left: -14px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(9rem, 22vw, 18rem);
  line-height: 1;
  letter-spacing: -0.04em;
  z-index: -1;
  user-select: none;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(212, 175, 55, 0.22);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.10) 0%, rgba(212, 175, 55, 0.015) 78%);
  -webkit-background-clip: text;
  background-clip: text;
}
/* alternate sides, opposite each section's 3D station */
.about .ghost-num, .education .ghost-num { left: auto; right: -14px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 2rem;
}

/* split-character wrappers (added by JS) */
.char {
  display: inline-block;
  transform-style: preserve-3d;
  white-space: pre;
}

.body-copy {
  color: var(--text2);
  max-width: 62ch;
  margin-bottom: 1.25rem;
}

.micro {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
}

/* "Glass" without backdrop-filter: on this near-black theme a translucent
   solid reads the same and costs nothing while scrolling. */
.glass, .card {
  background: rgba(21, 21, 30, 0.88);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  overflow: hidden;
  padding: 48px 24px;
}

.hero-stage, .hero-tilt {
  transform-style: preserve-3d;
}
.hero-tilt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.portrait-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 2.25rem;
  transform-style: preserve-3d;
}
.portrait {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(242, 217, 141, 0.9);
  box-shadow: 0 0 80px rgba(212, 175, 55, 0.25);
}
.portrait-ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(#F2D98D, #D4AF37, #8C6A2F, #D4AF37, #F2D98D);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  will-change: transform; /* spins continuously (main.js) */
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7.5rem);
  letter-spacing: -0.02em;
  line-height: 0.95;
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.25rem;
}
/* when split into chars, each char carries the gradient (JS aligns background-position) */
.hero-name .char {
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Once a heading is split into .char spans the heading's own text-clipped gradient is
   redundant — and Chrome paints that clip mask with the transformed chars' glyphs piled
   onto the first letter (garbled "A"/"L" after the entrance). Unsplit headings
   (no JS, or before the split) keep the gradient rules above. */
.hero-name:has(.char), .contact-title:has(.char) {
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.375rem);
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--champ);
  text-decoration: none;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#101016, #101016) padding-box,
    var(--gold-grad) border-box;
  transition: translate 0.25s ease, scale 0.25s ease, box-shadow 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    translate: 0 -2px;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.25);
  }
}
.btn-ghost:active { scale: 0.97; }

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cue-line {
  position: relative;
  width: 1px;
  height: 48px;
  background: rgba(212, 175, 55, 0.35);
  overflow: hidden;
  display: block;
}
.cue-dot {
  position: absolute;
  top: 0; left: -1.5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--champ);
  will-change: transform; /* loops down the cue line (main.js) */
}
.cue-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text2);
}

/* --------------------------------------------------------------------------
   01 · ABOUT
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 5fr 4fr;
  gap: 64px;
  align-items: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.5rem;
  perspective: 800px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--gold-border);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}
.chip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.about-visual { perspective: 1000px; }
.quote-panel {
  padding: 48px 40px;
  transform-style: preserve-3d;
}
.gold-rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--gold-grad);
  margin-bottom: 1.5rem;
}
.pull-quote {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   SKILLS — gold bars that draw in on scroll
   -------------------------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 56px;
  max-width: 900px;
}
@media (max-width: 768px) {
  .skills-grid { grid-template-columns: 1fr; gap: 24px; }
}

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.skill-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.skill-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.14);
  overflow: hidden;
}
.skill-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8C6A2F, #D4AF37 60%, #F2D98D);
  transform-origin: left center;
}

/* --------------------------------------------------------------------------
   CERTIFICATES
   -------------------------------------------------------------------------- */

/* auto-fill (not auto-fit) keeps cards compact — a row with only one or two
   certificates no longer stretches them across the whole page */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
  max-width: 1000px;
}
.cert-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
}
.cert-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--gold-border);
  flex-shrink: 0;
  padding: 6px;
}
.cert-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  flex-shrink: 0;
}
.cert-body { display: flex; flex-direction: column; gap: 6px; }
/* file-backed certificates open a lightbox — whole card is a click target */
.cert-card.has-file {
  cursor: pointer;
  transition: border-color 0.25s ease, translate 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .cert-card.has-file:hover {
    border-color: rgba(212, 175, 55, 0.5);
    translate: 0 -4px;
  }
  .cert-card.has-file:hover .cert-zoom { opacity: 1; scale: 1; }
}
.cert-thumb-btn {
  position: relative;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  line-height: 0;
}
.cert-thumb-btn:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.55);
  outline-offset: 3px;
}
.cert-zoom {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-grad);
  color: #0A0A0F;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.25s ease, scale 0.25s ease;
}
@media (hover: none) {
  .cert-zoom { opacity: 1; scale: 1; } /* touch: always show the affordance */
}
.cert-view-btn {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.cert-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  line-height: 1.3;
}
.cert-meta { color: var(--text2); }
.cert-body .card-link { font-size: 0.875rem; margin-top: 4px; }

/* --------------------------------------------------------------------------
   Download CV
   -------------------------------------------------------------------------- */

.btn-cv { gap: 9px; }
.cv-line { margin-top: -3rem; margin-bottom: 4rem; }
.cv-link {
  color: var(--champ);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .cv-link:hover { color: var(--gold); }
}

/* --------------------------------------------------------------------------
   02 · PROJECTS — the Golden Deal
   -------------------------------------------------------------------------- */

.project-grid {
  position: relative; /* offset parent for the cards (main.js reads card.offsetTop) */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px;
  perspective: 1400px;
}

.project-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
}

.thumb {
  aspect-ratio: 16 / 9;
  border-radius: 19px 19px 0 0;
  position: relative;
  overflow: hidden;
}
/* real cover photo: fills the 16:9 box under the gradient overlay and the badge */
.thumb-pic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* clickable thumbnail (opens the gallery, or the project website) */
.thumb-link {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  border-radius: 19px 19px 0 0;
  overflow: hidden;
}
.project-card.has-gallery { cursor: pointer; }

.thumb-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid var(--gold-border);
  color: var(--champ);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* "View Photos" is a button but must look identical to .card-link */
.card-open {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}
.thumb-link .thumb { transition: transform 0.5s ease; }
@media (hover: hover) and (pointer: fine) {
  .thumb-link:hover .thumb { transform: scale(1.05); }
}
.thumb-link:focus-visible { outline-offset: -3px; }
/* cover photos are set per project in /admin; projects without one get a gradient */
.thumb-img { background: #101018; } /* shown until the lazy cover photo arrives */
.thumb-1 { background: linear-gradient(135deg, #1c1a2e 0%, #2a2440 55%, rgba(212,175,55,0.28) 130%); }
.thumb-2 { background: linear-gradient(135deg, #101d24 0%, #1c3038 55%, rgba(212,175,55,0.28) 130%); }
.thumb-3 { background: linear-gradient(135deg, #241722 0%, #3a2033 55%, rgba(212,175,55,0.28) 130%); }
.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.55), transparent 60%);
}

.card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--text);
}

.card-desc {
  color: var(--text2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-link {
  color: var(--champ);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .card-link:hover { color: var(--gold); }
}

/* specular sheen swept across a card as it lands */
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(242, 217, 141, 0.18) 50%, transparent 60%);
  transform: translateX(-130%);
  opacity: 0;
}

/* card hover glow (pre-rendered, revealed by opacity) */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.18), inset 0 0 0 1px rgba(212, 175, 55, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover::after { opacity: 1; }
}
.project-card:active { scale: 0.98; }

/* --------------------------------------------------------------------------
   03/04 · TIMELINES (education + experience)
   -------------------------------------------------------------------------- */

.timeline {
  position: relative;
  padding: 24px 0;
  perspective: 1000px;
}

.spine {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(212, 175, 55, 0.12);
  overflow: hidden;
}
.spine-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #F2D98D, #D4AF37);
  transform: scaleY(0);
  transform-origin: top center;
}

.t-entry {
  position: relative;
  width: 50%;
  padding: 24px 48px;
  transform-style: preserve-3d;
}
.t-entry.left { left: 0; text-align: left; }
.t-entry.right { left: 50%; }

.t-dot {
  position: absolute;
  top: 46px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--champ);
  box-shadow: 0 0 24px 6px rgba(212, 175, 55, 0.45);
  z-index: 2;
}
.t-entry.left .t-dot { right: -5px; }
.t-entry.right .t-dot { left: -5px; }

.t-card {
  padding: 28px 30px;
  max-width: 440px;
  transform-style: preserve-3d;
}
.t-entry.left .t-card { margin-left: auto; }

.t-card .card-title { font-size: 1.25rem; margin: 6px 0 2px; }
.t-card .role { color: var(--text2); letter-spacing: 0.1em; margin-bottom: 8px; }
.t-card .card-desc { margin-top: 4px; }

/* small social/app link icons on project + experience cards */
.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--text2);
  background: rgba(20, 20, 28, 0.55);
  border: 1px solid var(--gold-border);
  transition: color 0.25s ease, border-color 0.25s ease, translate 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .mini-link:hover {
    color: var(--champ);
    border-color: rgba(212, 175, 55, 0.5);
    translate: 0 -2px;
  }
}
.mini-link:active { scale: 0.92; }
.t-card .mini-links { margin-top: 14px; }

.present-pill {
  display: inline-block;
  background: var(--gold-grad);
  color: #0A0A0F;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
}
.t-card.current {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 32px rgba(212, 175, 55, 0.12);
}

.bullets {
  list-style: none;
  margin-top: 8px;
}
.bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text2);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 8px;
}
.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* --------------------------------------------------------------------------
   05 · CONTACT
   -------------------------------------------------------------------------- */

.contact {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.contact-inner {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1000px;
}
.contact .ghost-num { left: 24px; }

.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.05;
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}
.contact-title .char {
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contact-sub {
  color: var(--text2);
  letter-spacing: 0.08em;
  margin-bottom: 3rem;
}

.contact-ctas {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 5rem;
}

.btn-whatsapp, .btn-email {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 64px;
  padding: 0 40px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  overflow: hidden;
}

.btn-whatsapp {
  background: var(--wa-grad);
  color: #06130B;
  box-shadow: 0 12px 44px rgba(37, 211, 102, 0.35);
  transition: scale 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-whatsapp:hover { scale: 1.04; }
}
.btn-whatsapp:active { scale: 0.97; }

.btn-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 60px rgba(37, 211, 102, 0.55);
  opacity: 0;
  pointer-events: none;
}
.btn-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-130%);
}

.btn-email {
  color: var(--champ);
  border: 1.5px solid transparent;
  background:
    linear-gradient(#101016, #101016) padding-box,
    var(--gold-grad) border-box;
  transition: scale 0.2s ease, box-shadow 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-email:hover {
    scale: 1.04;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.25);
  }
}
.btn-email:active { scale: 0.97; }

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.socials { display: flex; gap: 20px; }
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--gold-border);
  transition: color 0.25s ease, border-color 0.25s ease;
  /* perpetual gentle hop — reduced-motion kills all animations globally */
  animation: social-hop 3.4s cubic-bezier(0.36, 0, 0.36, 1) infinite;
}
.social:nth-child(2) { animation-delay: 0.45s; }
.social svg { width: 28px; height: 28px; }
@keyframes social-hop {
  0%, 30%, 100% { translate: 0 0; scale: 1; }
  8%            { translate: 0 -14px; }
  16%           { translate: 0 0; scale: 1.04 0.94; } /* squash on landing */
  19%           { scale: 1; }
  24%           { translate: 0 -5px; }                /* small second bounce */
}
@keyframes social-hop-fast {
  0%, 100% { translate: 0 0; scale: 1.02 0.96; }
  45%      { translate: 0 -11px; scale: 1; }
}
@media (hover: hover) and (pointer: fine) {
  .social:hover {
    color: var(--champ);
    border-color: rgba(212, 175, 55, 0.55);
    animation: social-hop-fast 0.55s ease-in-out infinite;
  }
}
.social:active { animation: none; translate: 0 1px; scale: 0.94; }
.copyright { font-size: 0.75rem; color: var(--text2); letter-spacing: 0.06em; }

/* --------------------------------------------------------------------------
   Project case-study viewer (modal)
   -------------------------------------------------------------------------- */

.pm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 6, 10, 0.74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.pm {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: flex;
  justify-content: flex-end; /* right-side drawer */
}
.pm[hidden], .pm-backdrop[hidden] { display: none; }

.pm-panel {
  position: relative;
  width: min(880px, 100%);
  height: 100%;
  border-radius: 24px 0 0 24px;
  border-left: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(15, 15, 23, 0.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pm-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 28, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--champ);
  cursor: pointer;
  transition: border-color 0.25s ease, scale 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .pm-close:hover { border-color: rgba(212, 175, 55, 0.55); scale: 1.08; }
}
.pm-close:active { scale: 0.92; }

.pm-scroll {
  overflow-y: auto;
  height: 100%;
  padding: 52px clamp(20px, 6vw, 64px) 40px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
}
.pm-scroll::-webkit-scrollbar { width: 8px; }
.pm-scroll::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.pm-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  max-width: 62ch;
}
.pm-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: var(--text);
}
.pm-desc { color: var(--text2); }
.pm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pm-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  color: var(--champ);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: border-color 0.25s ease, translate 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .pm-pill:hover { border-color: rgba(212, 175, 55, 0.55); translate: 0 -2px; }
}
.pm-pill-primary { background: var(--gold-grad); color: #0A0A0F; border: 1px solid transparent; }

/* Horizontal photo slider — one standalone slide per photo, scroll-snap
   swiping plus looping arrow buttons. --pm-img-h keeps the arrows centered
   on the image regardless of caption height. */
.pm-slider-wrap {
  position: relative;
  --pm-img-h: min(56vh, 520px);
}
.pm-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pm-slider::-webkit-scrollbar { display: none; }
.pm-slider:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.55);
  outline-offset: 4px;
  border-radius: 16px;
}
.pm-slide {
  flex: 0 0 100%;
  min-width: 100%;
  margin: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always; /* fast swipes still advance one photo at a time */
}
.pm-img {
  display: block;
  width: 100%;
  height: var(--pm-img-h);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.14);
  background: #101018;
}
.pm-cap {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-top: 14px;
  padding: 0 4px;
  color: var(--text2);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 62ch;
}
.pm-idx {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  background-image: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pm-nav {
  position: absolute;
  top: calc(var(--pm-img-h) / 2);
  translate: 0 -50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 28, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--champ);
  cursor: pointer;
  transition: border-color 0.25s ease, scale 0.2s ease, background-color 0.25s ease;
}
.pm-prev { left: 12px; }
.pm-next { right: 12px; }
@media (hover: hover) and (pointer: fine) {
  .pm-nav:hover {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(28, 28, 40, 0.95);
    scale: 1.08;
  }
}
.pm-nav:active { scale: 0.9; }
.pm-nav[hidden] { display: none; }
.pm-pos {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: inline-flex;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--champ);
  letter-spacing: 0.12em;
}
.pm-pos[hidden] { display: none; }
.pm-pos-sep { opacity: 0.5; }

body.pm-open { overflow: hidden; }

@media (max-width: 640px) {
  .pm-panel { width: 100%; border-radius: 0; border-left: none; }
  .pm-scroll { padding-top: 72px; }
  .pm-slider-wrap { --pm-img-h: min(46vh, 420px); }
  .pm-nav { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   Certificate lightbox
   -------------------------------------------------------------------------- */

.cl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(6, 6, 10, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.cl {
  position: fixed;
  inset: 0;
  z-index: 131;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
}
.cl[hidden], .cl-backdrop[hidden] { display: none; }

.cl-panel {
  position: relative;
  width: min(940px, 100%);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(15, 15, 23, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.22);
}
.cl-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 28, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--champ);
  cursor: pointer;
  transition: border-color 0.25s ease, scale 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .cl-close:hover { border-color: rgba(212, 175, 55, 0.55); scale: 1.08; }
}
.cl-close:active { scale: 0.92; }

.cl-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #101018;
}
.cl-img {
  display: block;
  width: 100%;
  max-height: min(76vh, 820px);
  object-fit: contain;
}
.cl-frame {
  width: 100%;
  height: min(76vh, 820px);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cl-fallback {
  align-self: center;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  color: var(--text2);
}
.cl-fallback a { color: var(--champ); font-weight: 700; }

.cl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.14);
}
.cl-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cl-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
}
.cl-sub { color: var(--text2); }
.cl-newtab { flex-shrink: 0; }

body.cl-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Floating WhatsApp button (mobile)
   -------------------------------------------------------------------------- */

.whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--wa-grad);
  color: #06130B;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  opacity: 0;
  transform: translateY(80px);
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.45s;
}
.whatsapp-fab.visible {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.whatsapp-fab:active { scale: 0.94; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .section-inner { padding: 96px 20px; }
  .ghost-num { top: 10px; }

  .portrait-wrap { width: 128px; height: 128px; margin-bottom: 1.75rem; }

  .btn-ghost { height: 48px; padding: 0 24px; }

  /* timelines collapse to a left rail */
  .spine { left: 16px; margin-left: 0; }
  .t-entry, .t-entry.right { width: 100%; left: 0; padding: 20px 0 20px 48px; }
  .t-entry.left .t-dot, .t-entry.right .t-dot { left: 11px; right: auto; }
  .t-entry.left .t-card { margin-left: 0; }
  .t-card { max-width: none; }

  .contact-ctas { flex-direction: column; width: 100%; }
  .btn-whatsapp, .btn-email { width: 100%; }
  .btn-whatsapp { height: 60px; }

  .whatsapp-fab { display: inline-flex; }

  .orb { filter: blur(60px); opacity: 0.5; }
  .orb-violet { width: 380px; height: 380px; }
  .orb-gold { width: 300px; height: 300px; }
}

@media (max-width: 480px) {
  .quote-panel { padding: 36px 28px; }
}

@media (max-width: 360px) {
  .hero-ctas { flex-direction: column; width: 100%; }
  .btn-ghost { width: 100%; }
}

/* --------------------------------------------------------------------------
   Reduced motion: everything static, fully visible
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .whatsapp-fab { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
}

/* --------------------------------------------------------------------------
   Print: defeat JS-set inline hide states, drop screen-only chrome
   -------------------------------------------------------------------------- */

@media print {
  .char, .body-copy, .chip, .quote-panel,
  .project-card, .tag,
  .t-dot, .t-card, .bullets li,
  .contact-sub, .contact-ctas > a, .footer,
  .hero-stage, .portrait-wrap, .hero-tagline,
  .hero-ctas .btn-ghost, .contact-title {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .grain, .orbs, .progress-bar, .scroll-cue, #scene3d, #loader,
  .sheen, .btn-sheen, .btn-glow, .whatsapp-fab {
    display: none !important;
  }
}
