:root {
  --black: #0c0c0c;
  --black-2: #151513;
  --cream: #f2dab4;
  --cream-2: #b8b8b8;
  --orange: #d24f08;
  --muted: #b6afa4;

  --line: rgba(233, 225, 212, 0.17);
  --line-dark: rgba(8, 8, 7, 0.2);

  --max: 1280px;

  --display: "Space Grotesk", system-ui, sans-serif;
  --condensed: "Teko", "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}
/* Performance boost for off-screen elements */
.section {
  padding: 120px 0;
  position: relative;
  content-visibility: auto; 
  contain-intrinsic-size: 1000px;
}

/* Enhanced 3D Glassmorphism Glow */
.project-card.reveal.show:hover {
  --project-lift: -12px;
  transform: perspective(1000px) translateY(var(--project-lift)) rotateX(var(--project-tilt-x)) rotateY(var(--project-tilt-y));
  border-color: var(--orange);
  box-shadow: 0 30px 60px rgba(2, 2, 2, 0.45), 0 0 25px rgba(207, 85, 9, 0.15), inset 0 -6px 18px rgba(0,0,0,0.24);
}

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

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  font-family: var(--body);
  background: var(--black);
  color: var(--cream);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

::selection {
  background: var(--orange);
  color: var(--black);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.18;

  background-image:
    linear-gradient(
      rgba(0, 0, 0, 0.045) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px
    );

  background-size: 48px 48px;

  mask-image: linear-gradient(
    to bottom,
    rgb(29, 28, 28),
    transparent 92%
  );
}

.container {
  width: min(
    var(--max),
    calc(100% - 96px)
  );

  margin: 0 auto;
}

.section {
  padding: 120px 0;
  position: relative;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 105px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  font-weight: 700;

  color: var(--cream-2);
}

.section-title .orange {
  color: var(--orange);
}

.skills .section-title,
.project-head .section-title,
.education .section-title,
.about .section-title,
.contact .section-title {
  font-family: var(--condensed);
  font-size: clamp(58px, 5.8vw, 94px);
  font-weight: 700;
  line-height: 0.76;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 45px 0;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 78px;

  z-index: 50;

  border-bottom: 1px solid var(--line);

  background: rgba(8, 8, 7, 0.82);

  backdrop-filter: blur(14px);
}

.nav-inner {
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.logo .dot {
  color: var(--orange);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  font-weight: 700;
  color: #c9c1b6;
  position: relative;
}

.nav-links a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -9px;

  width: 0;
  height: 2px;

  background: var(--orange);

  transition: 0.25s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cream);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.menu {
  display: none;

  background: none;
  border: 0;

  color: var(--cream);

  font-size: 26px;

  cursor: pointer;
}

.hero {
  min-height: 100svh;

  padding-top: 78px;

  display: flex;
  align-items: center;

  position: relative;

  overflow: hidden;
}

.hero-grid {
  display: grid;

  grid-template-columns: 1.02fr 0.98fr;

  min-height: calc(100svh - 78px);

  align-items: center;
}

.hero-copy {
  padding: 80px 0;

  position: relative;

  z-index: 3;
}

.hero-kicker {
  display: flex;
  gap: 12px;

  align-items: center;

  margin-bottom: 30px;

  color: #c7bfb3;

  font-size: 13px;
  font-weight: 700;
}

.hero-kicker span {
  width: 36px;
  height: 2px;

  background: var(--orange);
}

.hero h1 {
  font-family: var(--display);

  font-size: clamp(
    76px,
    10vw,
    150px
  );

  line-height: 0.78;

  letter-spacing: -0.085em;

  font-weight: 700;

  margin-bottom: 30px;
}

.hero h1 .white {
  color: var(--cream-2);
}

.hero h1 .orange {
  color: var(--orange);
}

.letter-cascade {
  display: inline-flex;
  gap: 0;
  cursor: pointer;
}

.letter-cascade .cascade-letter {
  position: relative;
  display: inline-block;
  perspective: 800px;
}

.cascade-front,
.cascade-echo {
  display: inline-block;
  backface-visibility: hidden;
}

.cascade-front {
  transform: rotateX(0) translateY(0);
}

.cascade-echo {
  position: absolute;
  inset: 0;
  transform: rotateX(-90deg) translateY(6px) scale(0.8);
  opacity: 0;
  filter: blur(4px);
}

.hero-sub {
  font-size: 20px;

  font-weight: 700;

  max-width: 560px;

  line-height: 1.25;

  margin-bottom: 14px;
}

.hero-desc {
  font-size: 16px;

  line-height: 1.7;

  color: #bbb3a8;

  max-width: 590px;
}

.hero-actions {
  display: flex;

  gap: 14px;

  margin-top: 34px;

  flex-wrap: wrap;
}

.btn {
  display: inline-flex;

  align-items: center;

  gap: 14px;

  padding: 15px 20px;

  border: 1px solid var(--cream);

  font-size: 13px;

  font-weight: 700;

  transition: 0.25s;
}

.btn.primary {
  background: var(--cream);

  color: var(--black);
}

.btn:hover {
  transform: translateY(-3px);

  background: var(--orange);

  border-color: var(--orange);

  color: var(--black);
}

.arrow {
  font-size: 18px;
}

.hero-eyes {
  display: flex;
  align-items: center;
  gap: 5px;

  min-width: 85px;
  height: 49px;

  padding: 0 3px;

  animation: eyes-idle 4.8s ease-in-out infinite;
}

.eye {
  position: relative;

  width: 40px;
  height: 27px;

  overflow: hidden;

  border: 1px solid rgba(233, 225, 212, 0.65);
  border-radius: 54% 46% 52% 48% / 52% 48% 52% 48%;

  background: var(--cream-2);

  box-shadow:
    inset 0 -3px 7px rgba(8, 8, 7, 0.2),
    0 0 0 3px rgba(219, 87, 5, 0.08);
}

.eye-pupil {
  --pupil-x: 0px;
  --pupil-y: 0px;

  position: absolute;

  top: 50%;
  left: 50%;

  width: 14px;
  height: 14px;

  border: 2px solid #3b3935;
  border-radius: 50%;

  background: var(--black);

  box-shadow: 0 0 0 2px rgba(219, 87, 5, 0.32);

  transform:
    translate(
      calc(-50% + var(--pupil-x)),
      calc(-50% + var(--pupil-y))
    );

  transition: transform 120ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

.eye-highlight {
  position: absolute;

  top: 2px;
  left: 3px;

  width: 3px;
  height: 3px;

  border-radius: 50%;

  background: var(--cream);
}

.eye-lid {
  position: absolute;

  inset: -1px;

  z-index: 2;

  background: var(--black);

  transform: scaleY(0);
  transform-origin: center;

  animation: eye-blink 6.4s ease-in-out infinite;
}

.eye:nth-child(2) .eye-lid {
  animation-delay: 0.08s;
}

@keyframes eyes-idle {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes eye-blink {
  0%,
  89%,
  100% {
    transform: scaleY(0);
  }

  92%,
  95% {
    transform: scaleY(1);
  }
}

@media (hover: none), (pointer: coarse) {
  .hero-eyes {
    display: none;
  }
}

.socials {
  display: flex;

  gap: 8px;

  margin-top: 30px;

  position: relative;

  isolation: isolate;
}

.socials::before {
  content: "";

  position: absolute;

  top: 50%;
  left: -8px;
  right: -8px;

  height: 1px;

  background: var(--line);

  z-index: -1;
}

.social {
  --social-scale: 1;
  --social-lift: 0px;

  width: 42px;
  height: 42px;

  border: 1px solid var(--line);

  background: var(--black);

  display: grid;

  place-items: center;

  position: relative;

  font-size: 12px;

  font-weight: 700;

  transform:
    translateY(var(--social-lift))
    scale(var(--social-scale));

  transition:
    transform 0.28s cubic-bezier(0.22, 0.8, 0.25, 1),
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.social::after {
  content: attr(data-label);

  position: absolute;

  left: 50%;
  bottom: calc(100% + 12px);

  padding: 7px 9px;

  border: 1px solid var(--orange);

  background: var(--black-2);
  color: var(--cream);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;

  transform: translate(-50%, 6px);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.social:hover,
.social:focus-visible {
  border-color: var(--orange);

  color: var(--orange);

  box-shadow: 0 10px 24px rgba(219, 87, 5, 0.18);

  outline: none;
}

.social:hover::after,
.social:focus-visible::after {
  opacity: 1;

  transform: translate(-50%, 0);
}

.hero-art {
  height: 100%;

  position: relative;

  display: flex;

  align-items: flex-end;

  justify-content: flex-end;

  overflow: hidden;
}

.hero-art::before {
  content: "";

  position: absolute;

  inset: 0;

  z-index: 1;

  background:
    linear-gradient(
      90deg,
      var(--black) 0%,
      rgba(12, 12, 12, 0.92) 10%,
      rgba(12, 12, 12, 0.45) 25%,
      transparent 46%
    ),
    linear-gradient(
      180deg,
      transparent 52%,
      rgba(12, 12, 12, 0.28) 72%,
      var(--black) 100%
    );

  pointer-events: none;
}

.hero-art::after {
  content: "";

  position: absolute;

  top: 0;
  right: 0;
  bottom: 0;

  width: 42%;

  z-index: 2;

  pointer-events: none;

  background: linear-gradient(
    90deg,
    rgba(12, 12, 12, 0) 0%,
    rgba(12, 12, 12, 0.35) 45%,
    rgba(12, 12, 12, 0.65) 70%,
    var(--black) 100%
  );
}

.hero-art img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  object-position: 50% 22%;

  filter:
    grayscale(0.86)
    contrast(1.22)
    brightness(0.82);

  opacity: 0.96;

  transition: filter 0.6s ease;
}

.hero-art:hover img {
  filter: none;
  opacity: 1;
}

.torn-dark,
.torn-cream {
  position: relative;
}

.torn-dark::before,
.torn-cream::before {
  content: "";

  position: absolute;

  left: 0;
  right: 0;

  height: 20px;

  top: -10px;

  z-index: 4;

  background: inherit;

  clip-path:
    polygon(
      0 20%,
      3% 70%,
      6% 38%,
      9% 80%,
      12% 35%,
      15% 68%,
      18% 25%,
      21% 73%,
      24% 40%,
      27% 82%,
      30% 28%,
      33% 68%,
      36% 34%,
      39% 78%,
      42% 30%,
      45% 70%,
      48% 38%,
      51% 76%,
      54% 30%,
      57% 68%,
      60% 35%,
      63% 76%,
      66% 28%,
      69% 70%,
      72% 36%,
      75% 80%,
      78% 31%,
      81% 70%,
      84% 35%,
      87% 77%,
      90% 30%,
      93% 70%,
      96% 38%,
      100% 72%,
      100% 100%,
      0 100%
    );
}

.cream-section {
  background: var(--cream);

  color: var(--black);

  padding: 120px 0;
}

.cream-section .section-title {
  color: var(--black);
}

.cream-section .rule {
  background: var(--line-dark);
}

.project-head {
  display: grid;

  grid-template-columns: 320px 1fr;

  gap: 70px;

  align-items: end;

  margin-bottom: 52px;
}

.project-head p {
  font-size: 17px;

  line-height: 1.6;

  max-width: 650px;

  color: #3e3933;
}

.project-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 18px;

  align-items: stretch;
}

.project-card {
  --project-tilt-x: 0deg;
  --project-tilt-y: 0deg;
  --project-lift: 0px;

  background: linear-gradient(180deg, rgba(10,10,10,0.98), rgba(6,6,6,0.98));

  color: var(--cream);

  border: 1px solid rgba(233, 225, 212, 0.12);

  border-radius: 14px;

  min-height: 540px;

  display: flex;

  flex-direction: column;

  overflow: hidden;

  transform-style: preserve-3d;

  box-shadow: 0 10px 22px rgba(8, 8, 7, 0.20), inset 0 -4px 18px rgba(0,0,0,0.18);

  transition:
    transform 0.4s cubic-bezier(0.22, 0.8, 0.25, 1),
    border-color 0.25s ease,
    box-shadow 0.4s ease,
    background 0.35s ease;

  will-change: transform;
}

.project-card.reveal.show:hover {
  --project-lift: -12px;

  transform:
    perspective(1000px)
    translateY(var(--project-lift))
    rotateX(var(--project-tilt-x))
    rotateY(var(--project-tilt-y));

  border-color: var(--orange);

  box-shadow: 0 30px 60px rgba(2, 2, 2, 0.45), inset 0 -6px 18px rgba(0,0,0,0.24);
}

.project-art {
  height: 245px;

  background: var(--cream);

  position: relative;

  overflow: hidden;

  flex-shrink: 0;

  border-top-left-radius: 14px;
  border-top-right-radius: 14px;

  box-shadow: inset 0 -18px 40px rgba(0,0,0,0.06);
}

.project-art img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  display: block;

  border-top-left-radius: inherit;
  border-top-right-radius: inherit;

  filter:
    grayscale(1)
    contrast(1.3);

  transition:
    transform 0.5s ease,
    filter 0.5s ease;
}

.project-card:hover .project-art img {
  transform: scale(1.05);

  filter:
    grayscale(0.75)
    contrast(1.25);
}

.project-art::after {
  content: "";

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      180deg,
      transparent 50%,
      rgba(8, 8, 7, 0.2)
    );

  border-top-left-radius: inherit;
  border-top-right-radius: inherit;

  pointer-events: none;
}

.project-body {
  padding: 25px;

  display: flex;

  flex-direction: column;

  flex: 1;
}

.project-num {
  font-size: 11px;

  color: var(--orange);

  font-weight: 700;

  letter-spacing: 0.12em;
}

.project-card h3 {
  font-family: var(--display);

  font-size: 27px;

  line-height: 1.05;

  letter-spacing: -0.04em;

  margin: 12px 0 14px;

  color: var(--cream-2);

  transition:
    color 0.25s ease,
    transform 0.3s ease;
}

.project-card h3::after {
  content: "↗";

  display: inline-block;

  margin-left: 0.32em;

  color: var(--orange);

  opacity: 0;

  transform: translate(-5px, 2px);

  transition:
    opacity 0.2s ease,
    transform 0.3s ease;
}

.project-card:hover h3 {
  color: var(--cream);

  transform: translateX(3px);
}

.project-card:hover h3::after {
  opacity: 1;

  transform: translate(0, 0);
}

.project-card p {
  font-size: 14px;

  color: #bdb5aa;

  line-height: 1.55;
}

.tags {
  margin-top: auto;

  padding-top: 22px;

  display: flex;

  flex-wrap: wrap;

  gap: 7px;
}

.tag {
  font-size: 10px;

  border: 1px solid var(--line);

  padding: 6px 8px;

  color: #d0c8bc;

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.project-card:hover .tag {
  border-color: rgba(219, 87, 5, 0.65);

  background: rgba(219, 87, 5, 0.1);
  color: var(--cream);

  transform: translateY(-2px);
}

.project-card:hover .tag:nth-child(2) {
  transition-delay: 35ms;
}

.project-card:hover .tag:nth-child(3) {
  transition-delay: 70ms;
}

.project-card:hover .tag:nth-child(4) {
  transition-delay: 105ms;
}

.project-card {
  cursor: pointer;
}

.project-card:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

body.project-detail-open #portfolio-main > section:not(.project-detail) {
  display: none;
}

.project-detail {
  display: none;
  padding: 72px 0 100px;
  background: var(--black);
  color: var(--cream);
}

.project-detail.is-open {
  display: block;
}

.project-detail-shell {
  position: relative;
  border: 1px solid rgba(233, 225, 212, 0.14);
  background: linear-gradient(180deg, rgba(16,16,15,0.98), rgba(10,10,10,0.96));
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0,0,0,0.35);

  /* New animation properties */
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* This class will trigger the fade-in once the element is set to block */
.project-detail.is-animating .project-detail-shell {
  opacity: 1;
  transform: translateY(0);
}


.project-detail-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  border: 1px solid rgba(233, 225, 212, 0.2);
  background: rgba(10,10,10,0.55);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-detail-close:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}

.project-detail-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.project-detail-media {
  min-height: 420px;
  background: var(--cream);
}

.project-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail-copy {
  padding: 44px 34px 34px;
}

.project-detail-kicker {
  font-size: 11px;
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-detail-copy h2 {
  margin: 18px 0 16px;
  font-size: clamp(36px, 3vw, 52px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-family: var(--display);
  color: var(--cream-2);
}

.project-detail-summary {
  font-size: 17px;
  line-height: 1.65;
  color: #d8d1c7;
  margin-bottom: 22px;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.project-detail-tag {
  padding: 7px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(233, 225, 212, 0.16);
  color: var(--cream);
  background: rgba(255,255,255,0.02);
}

.project-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}

.project-detail-columns h3,
.project-detail-note h3 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.project-detail-columns p,
.project-detail-note p {
  font-size: 15px;
  line-height: 1.72;
  color: #b9b0a4;
}

.project-detail-note {
  border-top: 1px solid rgba(233,225,212,0.12);
  padding-top: 24px;
  margin-bottom: 20px;
}

.project-detail-metrics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
}

.project-detail-metrics li {
  padding: 12px 14px;
  border: 1px solid rgba(233,225,212,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--cream-2);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .project-detail-panel {
    grid-template-columns: 1fr;
  }

  .project-detail-copy {
    padding: 30px 22px 26px;
  }
}

@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {  .hero-eyes,
  .eye-lid {
    animation: none;
  }

  .hero-eyes,
  .eye-lid,
  .project-card,
  .project-art img,
  .project-card h3,
  .project-card h3::after,
  .tag,
  .skill-col,
  .skill-col * {
    transition: none;
    transform: none;
  }
}

/* =========================
   CERTIFICATIONS (UPDATED)
========================= */

.certifications {
  background: var(--black); /* Changed to dark theme */
  color: var(--cream);
}

.certifications .section-title {
  color: var(--cream-2);
}

.certifications .eyebrow {
  color: var(--orange);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px; /* Slightly wider gap */
  margin-top: 55px;
}

.cert-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;

  background: linear-gradient(180deg, rgba(16,16,15,0.98), rgba(10,10,10,0.98));
  color: var(--cream);
  border: 1px solid rgba(233,225,212,0.12);
  border-radius: 14px;
  
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Ensures the image respects rounded corners */
  
  box-shadow: 0 10px 22px rgba(8,8,7,.20);
  transition: transform .4s cubic-bezier(.22,.8,.25,1), border-color .25s ease, box-shadow .35s ease;
  will-change: transform;
}

.cert-card:hover {
  transform: perspective(1000px) translateY(-12px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  border-color: var(--orange);
  box-shadow: 0 30px 60px rgba(2,2,2,.45), inset 0 -6px 18px rgba(0,0,0,.24);
}

/* New Media Container */
.cert-media {
  position: relative;
  height: 230px;
  background: #1a1a1a;
  overflow: hidden;
  border-bottom: 1px solid rgba(233,225,212,0.08);
}

.cert-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  /* Applies the blur effect */
  filter: blur(6px); 
  /* Scales it slightly so the blurred edges don't bleed inwards */
  transform: scale(1.05); 
  transition: opacity 0.3s ease, transform 0.5s ease, filter 0.5s ease;
}

.cert-card:hover .cert-media img {
  opacity: 1;
  /* Removes the blur when the user hovers over the card */
  filter: blur(0px); 
  transform: scale(1.1);
}

/* Badges and Buttons Overlay */
.cert-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(10, 10, 10, 0.75);
  border: 1px solid var(--orange);
  color: var(--cream);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  z-index: 2;
}

.cert-view-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(233, 225, 212, 0.2);
  color: var(--orange);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.cert-view-btn:hover {
  border-color: var(--orange);
  background: rgba(10, 10, 10, 0.95);
  transform: translateY(-2px);
}

/* Body Container */
.cert-body {
  padding: 26px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cert-org {
  font-size: 11px;
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cert-body h3 {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--cream-2);
  margin-bottom: 12px;
  transition: color 0.25s ease;
}

.cert-card:hover .cert-body h3 {
  color: var(--cream);
}

.cert-body p {
  font-size: 14px;
  color: #bdb5aa;
  line-height: 1.6;
  margin-bottom: 24px; /* Pushes the footer down */
}

/* Footer Container */
.cert-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 18px;
}

.cert-date {
  font-size: 12px;
  color: #9b9488;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cert-footer a {
  color: var(--orange);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.25s;
}

.cert-footer a:hover {
  transform: translateX(4px);
}

/* Mobile Responsiveness */
@media(max-width: 900px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

.skills {
  background: var(--black);
}

.skills-layout {
  display: grid;

  grid-template-columns: 320px 1fr;

  gap: 80px;

  align-items: start;
}

.skills-intro p {
  color: #aaa298;

  line-height: 1.7;

  max-width: 300px;

  margin-top: 25px;
}

.skills .rule + .skills-layout .eyebrow {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 60px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--cream-2);
  text-transform: none;
  margin-bottom: 12px;
}

.skill-cols {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 18px;
}

.skill-col {
  position: relative;

  overflow: hidden;

  padding: 20px 22px;

  min-height: 190px;

  background: linear-gradient(180deg, rgb(226, 205, 176), rgb(221, 179, 131));

  border: 1px solid rgba(21, 19, 15, 0.886);

  border-radius: 12px;

  box-shadow: 0 7px 15px rgba(0, 0, 0, 0.571), inset 0 -3px 14px rgba(255, 240, 240, 0.59);

  transition: transform 0.60s cubic-bezier(0.22,0.8,0.25,1), box-shadow 0.60s ease, border-color 0.25s ease;
}

.skill-col::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 2px;

  background: linear-gradient(90deg, var(--orange), #eb6e20);

  box-shadow: 0 0 12px rgba(94, 46, 15, 0.796);

  transform: scaleX(0);
  transform-origin: left;

  transition: transform 0.4s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.skill-col:hover::before {
  transform: scaleX(1);
}

.skill-col:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 48px rgba(2,2,2,0.36), inset 0 -8px 18px rgba(0,0,0,0.18);
  border-color: rgb(235, 119, 47);
}

.skill-cols .skill-col {
  opacity: 0;
  transform: translateY(18px);
}

.skill-cols.show .skill-col {
  opacity: 1;
  transform: translateY(0);

  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.22, 0.8, 0.25, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
}

.skill-cols.show .skill-col:nth-child(1) { transition-delay: 0ms; }
.skill-cols.show .skill-col:nth-child(2) { transition-delay: 90ms; }
.skill-cols.show .skill-col:nth-child(3) { transition-delay: 180ms; }
.skill-cols.show .skill-col:nth-child(4) { transition-delay: 270ms; }

.skill-cols.show .skill-col:hover {
  transition-delay: 0ms;
}

.skill-col:first-child {
  border-left: 0;
}

.skill-col h3 {
  color: var(--orange);

  font-size: 13px;

  margin-bottom: 22px;

  line-height: 1.3;
}

.skill-col li {
  list-style: none;

  font-size: 15px;

  margin-bottom: 13px;

  color: #000000;

  line-height: 1.35;
}

.education {
  background: var(--cream);

  color: var(--black);
}

.education .section-title {
  color: var(--black);
}

.education .eyebrow {
  color: var(--orange);
}

.edu-layout {
  display: grid;

  grid-template-columns: 300px 1fr;

  gap: 80px;

  align-items: start;
}

.edu-intro p {
  margin-top: 25px;

  line-height: 1.6;

  color: #514b43;
}

.timeline {
  position: relative;

  --timeline-progress: 0;

  counter-reset: edu-index;
}

.timeline::before {
  content: "";

  position: absolute;

  left: 118px;

  top: 8px;

  bottom: 8px;

  width: 2px;

  background: repeating-linear-gradient(
    180deg,
    rgba(8, 8, 7, 0.22) 0,
    rgba(8, 8, 7, 0.22) 5px,
    transparent 5px,
    transparent 11px
  );
}

.timeline::after {
  content: "";

  position: absolute;

  left: 117px;

  top: 8px;
  bottom: 8px;

  width: 3px;

  background: linear-gradient(
    180deg,
    var(--orange),
    #ff8438
  );

  box-shadow:
    0 0 10px rgba(207, 85, 9, 0.6),
    0 0 26px rgba(207, 85, 9, 0.28);

  transform: scaleY(var(--timeline-progress));
  transform-origin: top;

  transition: transform 80ms linear;
  will-change: transform;
}

.edu-row {
  display: grid;

  grid-template-columns:
    105px
    26px
    1fr;

  gap: 15px;

  position: relative;

  z-index: 1;

  padding-bottom: 55px;

  counter-increment: edu-index;
}

.edu-row:last-child {
  padding-bottom: 0;
}

.edu-year {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;

  font-size: 11px;

  font-weight: 700;

  letter-spacing: 0.04em;

  color: var(--orange);

  text-align: right;

  padding: 5px 8px;

  margin-top: 1px;

  border: 1px solid rgba(207, 85, 9, 0.35);

  background: rgba(207, 85, 9, 0.06);

  white-space: nowrap;

  justify-self: end;
}

.edu-dot {
  position: relative;

  width: 13px;
  height: 13px;

  border: none;

  border-radius: 50%;

  background: var(--orange);

  margin: 6px auto;

  z-index: 2;

  box-shadow:
    0 0 0 4px var(--cream),
    0 0 14px rgba(207, 85, 9, 0.75);
}

.edu-dot::before {
  content: "";

  position: absolute;

  inset: -9px;

  border: 1px solid rgba(207, 85, 9, 0.5);

  border-radius: 50%;

  animation: dot-pulse 2.6s ease-out infinite;
}

.edu-row:nth-child(2) .edu-dot::before {
  animation-delay: 0.5s;
}

.edu-row:nth-child(3) .edu-dot::before {
  animation-delay: 1s;
}

@keyframes dot-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }

  75%,
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}

.edu-content {
  position: relative;

  min-width: 0;

  padding: 26px 68px 26px 26px;

  background: linear-gradient(180deg, rgba(10, 10, 10, 0.98), rgba(6, 6, 6, 0.98));

  border: 1px solid rgba(233, 225, 212, 0.12);

  border-radius: 14px;

  box-shadow: 0 10px 22px rgba(8, 8, 7, 0.2), inset 0 -4px 18px rgba(0, 0, 0, 0.18);

  transition:
    transform 0.3s cubic-bezier(0.22, 0.8, 0.25, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.edu-content::before {
  content: "0" counter(edu-index);

  position: absolute;

  top: 12px;
  right: 20px;

  font-family: var(--display);

  font-size: 36px;

  font-weight: 700;

  letter-spacing: -0.03em;

  color: rgba(233, 225, 212, 0.1);

  pointer-events: none;

  z-index: 0;
}

.edu-row:hover .edu-content {
  transform: translateX(8px);

  border-color: rgba(207, 85, 9, 0.65);

  box-shadow: 0 22px 44px rgba(2, 2, 2, 0.35), inset 0 -4px 18px rgba(0, 0, 0, 0.22);
}

.edu-content h3 {
  position: relative;

  z-index: 1;

  font-family: var(--display);

  font-size: 22px;

  line-height: 1.15;

  letter-spacing: -0.03em;

  color: var(--cream-2);

  transition: color 0.25s ease;
}

.edu-row:hover .edu-content h3 {
  color: var(--cream);
}

.edu-content p {
  position: relative;

  z-index: 1;

  margin-top: 8px;

  font-size: 14px;

  line-height: 1.5;

  color: #bdb5aa;
}

.edu-content strong {
  font-weight: 700;

  color: var(--cream);
}

.about {
  background: var(--black);
}

.about-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 80px;

  align-items: start;
}

.about-copy p {
  font-size: 18px;

  line-height: 1.75;

  color: #bbb3a8;

  max-width: 650px;

  margin-top: 28px;
}

.about-facts {
  border-top: 1px solid var(--line);
}

.fact {
  display: flex;

  justify-content: space-between;

  gap: 30px;

  padding: 19px 0;

  border-bottom: 1px solid var(--line);

  font-size: 14px;

  line-height: 1.45;
}

.fact span:first-child {
  color: #8f887f;

  flex-shrink: 0;
}

.fact span:last-child {
  text-align: right;

  color: var(--cream);

  max-width: 65%;
}

.contact {
  background: var(--black);

  padding-bottom: 80px;
}

.contact-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 60px;

  align-items: stretch;
}

.contact-card {
  border-top: 1px solid var(--line);

  padding-top: 28px;

  margin-top: 35px;
}

.contact-item {
  display: flex;

  gap: 18px;

  padding: 18px 0;

  border-bottom: 1px solid var(--line);

  align-items: center;

  min-width: 0;
}

.contact-icon {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  border: 1px solid var(--line);

  display: grid;

  place-items: center;

  color: var(--orange);

  font-weight: 700;
}

.contact-item small {
  display: block;

  color: #888178;

  font-size: 11px;

  text-transform: uppercase;

  letter-spacing: 0.12em;

  margin-bottom: 5px;
}

.contact-item a,
.contact-item div {
  font-size: 15px;

  line-height: 1.45;
}

.contact-item a {
  overflow-wrap: anywhere;
}

.contact-item a:hover {
  color: var(--orange);
}

.cta {
  border: 1px solid var(--line);

  padding: 45px;

  background: #0e0e0d;

  position: relative;

  isolation: isolate;

  overflow: hidden;

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  min-height: 560px;
}

.cta > :not(.contact-ascii) {
  position: relative;

  z-index: 1;
}

.contact-ascii {
  position: absolute;

  inset: 0;

  z-index: 0;

  width: 100%;
  height: 100%;

  opacity: 0.3;

  pointer-events: none;

  mask-image:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(0, 0, 0, 0.22) 36%,
      #000 76%
    );
}

.cta h3 {
  font-family: var(--condensed);

  font-size: clamp(
    46px,
    4.6vw,
    68px
  );

  line-height: 0.76;

  letter-spacing: -0.035em;

  color: var(--cream-2);

  text-transform: uppercase;
}

.cta h3 span {
  color: var(--orange);
}

.cta p {
  color: #aaa298;

  line-height: 1.6;

  max-width: 430px;

  margin-top: 25px;
}

footer {
  border-top: 1px solid var(--line);

  padding: 25px 0;

  color: #777169;

  font-size: 11px;

  display: flex;

  justify-content: space-between;

  gap: 20px;
}

.reveal {
  opacity: 0;

  transform: translateY(30px);

  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.reveal.show {
  opacity: 1;

  transform: none;
}

@media (max-width: 1050px) {
  .container {
    width: min(
      var(--max),
      calc(100% - 60px)
    );
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card:nth-child(odd):last-child {
    grid-column: 1 / -1;

    max-width: calc(
      50% - 9px
    );
  }

  .skills-layout,
  .edu-layout {
    grid-template-columns: 260px 1fr;

    gap: 45px;
  }

  .about-grid,
  .contact-grid {
    gap: 45px;
  }
}

@media (min-width: 951px) and (max-width: 1050px) {
  .skills .section-title,
  .education .section-title {
    font-size: 60px;
  }
}

@media (max-width: 950px) {
  .container {
    width: min(
      var(--max),
      calc(100% - 44px)
    );
  }

  .nav-links {
    display: none;

    position: absolute;

    top: 78px;

    left: 0;
    right: 0;

    background: #161614;

    border-bottom: 1px solid var(--line);

    padding: 24px;

    flex-direction: column;

    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .menu {
    display: block;
  }

  .hero {
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;

    min-height: auto;
  }

  .hero-copy {
    padding: 110px 0 55px;
  }

  .hero-art {
    height: min(62vw, 560px);

    min-height: 400px;

    justify-content: center;
  }

  .hero-art img {
    width: min(100%, 520px);
    height: 100%;

    object-position: 50% 20%;
  }

  .hero-art::before {
    background:
      linear-gradient(
        90deg,
        var(--black) 0%,
        rgba(12, 12, 12, 0.66) 15%,
        transparent 42%
      ),
      linear-gradient(
        180deg,
        transparent 50%,
        var(--black) 100%
      );
  }

  .project-head,
  .skills-layout,
  .edu-layout {
    grid-template-columns: 1fr;

    gap: 35px;
  }

  .project-head {
    align-items: start;
  }

  .skill-cols {
    grid-template-columns: 1fr 1fr;

    gap: 30px;
  }

  .skill-col {
    min-height: auto;

    padding: 0 0 0 20px;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;

    gap: 45px;
  }

  .cta {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  .container {
    width: calc(100% - 30px);
  }

  .section,
  .cream-section {
    padding: 82px 0;
  }

  .hero h1 {
    font-size: 19vw;

    line-height: 0.82;
  }

  .hero-sub {
    font-size: 17px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .hero-art {
    height: auto;

    min-height: 0;

    aspect-ratio: 0.94;
  }

  .hero-art img {
    width: 100%;

    object-position: 50% 18%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card:last-child {
    grid-column: auto;

    max-width: none;
  }

  .project-art {
    height: 220px;
  }

  .skill-cols {
    grid-template-columns: 1fr 1fr;

    gap: 25px 15px;
  }

  .skill-col {
    padding-left: 15px;
  }

  .skill-col li {
    font-size: 14px;
  }

  .edu-row {
    grid-template-columns:
      72px
      20px
      1fr;

    gap: 8px;
  }

  .timeline::before {
    left: 81px;
  }

  .timeline::after {
    left: 80px;
  }

  .edu-content {
    padding: 18px 50px 18px 18px;
  }

  .edu-content::before {
    font-size: 26px;
    top: 8px;
    right: 12px;
  }

  .edu-content h3 {
    font-size: 18px;
  }

  .edu-content p {
    font-size: 13px;
  }

  .edu-year {
    font-size: 10px;
    padding: 4px 6px;
  }

  .about-copy p {
    font-size: 16px;
  }

  .fact {
    flex-direction: column;

    gap: 5px;
  }

  .fact span:last-child {
    text-align: left;

    max-width: 100%;
  }

  .contact-item a,
  .contact-item div {
    font-size: 14px;
  }

  .cta {
    padding: 30px;

    min-height: 400px;
  }

  footer {
    flex-direction: column;

    gap: 8px;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(8, 8, 7, 0.72);
  backdrop-filter: blur(6px);

  opacity: 0;

  transition: opacity 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
}

.modal-overlay[hidden] {
  display: none;
}

.project-modal {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  padding: 0;
  overflow: hidden;
  background: var(--black-2);
}

.project-modal-media {
  position: relative;
  width: 100%;
  height: 320px;
  background: var(--cream);
  overflow: hidden;
}

.project-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-modal-body {
  padding: 26px 30px 30px;
}

.project-modal-eyebrow {
  margin-bottom: 10px;
}

.project-modal-title {
  margin-bottom: 14px;
}

.project-modal-copy {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.7;
}

.project-modal-tags {
  margin-top: 0;
  padding-top: 0;
}

.modal {
  position: relative;

  width: min(480px, 100%);
  max-height: min(640px, 90vh);

  overflow-y: auto;

  padding: 42px;

  background: var(--black-2);

  border: 1px solid var(--line);

  transform: translateY(14px) scale(0.98);

  transition: transform 0.22s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;

  top: 18px;
  right: 18px;

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  background: none;
  border: 1px solid var(--line);

  color: var(--cream);

  font-size: 14px;
  cursor: pointer;

  transition: border-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.modal-title {
  font-family: var(--condensed);
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;

  color: var(--cream-2);

  margin-bottom: 10px;
}

.modal-sub {
  font-size: 14px;
  line-height: 1.5;
  color: #aaa298;

  margin-bottom: 28px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;

  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9a9288;
}

.form-field input,
.form-field textarea {
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;

  padding: 12px 14px;

  background: var(--black);
  border: 1px solid var(--line);
  color: var(--cream);

  resize: vertical;

  transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-form .btn {
  justify-content: center;
  margin-top: 4px;
  cursor: pointer;
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  min-height: 18px;
  font-size: 13px;
  color: #aaa298;
}

.form-status.success {
  color: #8fd19e;
}

.form-status.error {
  color: #e08a6b;
}

.form-fallback {
  font-size: 13px;
  color: #8f887f;
  text-align: center;
}

.form-fallback a {
  color: var(--orange);
}

.form-fallback a:hover {
  text-decoration: underline;
}

@media (max-width: 620px) {
  .modal {
    padding: 30px 24px;
  }
}
.portrait-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* Prevents scrolling when touching the canvas */
  cursor: crosshair; /* Adds a cool interaction cursor */
  z-index: 5;
  position: relative;
}

/* Ensure the container doesn't block the canvas interactions */
.hero-art::after {
  pointer-events: none;
}

/* =========================
   3D HEADING EFFECTS (UPDATED)
========================= */

/* Letterpress Inset */
.hero h1,
.section-title,
.cta h3 {
  text-shadow:
    0px -1px 1px rgba(0, 0, 0, 0.9),
    0px 1px 1px rgba(150, 150, 200, 0.08),
    0px 4px 6px rgba(0, 0, 0, 0.7);
}

.section-title .orange,
.cta h3 span {
  text-shadow:
    0px -1px 1px rgba(0, 0, 0, 0.95),
    0px 1px 1px rgba(150, 100, 60, 0.25),
    0px 4px 6px rgba(0, 0, 0, 0.7);
}

#nameAnimation,
.cascade-front,
.cascade-echo {
  text-shadow: none !important;
}

.pixel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

#pixelTrailContainer {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
