/* ============================================================
   GIANG PORTFOLIO — Refined Dark Edition
   Design tokens → base styles → layout → components → utilities
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg: #080808;
  --bg2: #101010;
  --bg3: #141414;

  /* Cards / surfaces */
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.065);

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-mid: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);

  /* Text */
  --text: #ececec;
  --muted: #9a9a9a;
  --muted2: #6a6a6a;
  --white: #ffffff;

  /* ── Signature accent: soft blue-violet ── */
  --accent: #7c6fcd;              /* base hue */
  --accent-light: #a89fe0;        /* lighter, for text uses */
  --accent-glow: rgba(124, 111, 205, 0.18);  /* diffuse glow */
  --accent-glow-strong: rgba(124, 111, 205, 0.32);

  /* Layout */
  --maxw: 1180px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s;
  --t-base: 0.28s;
  --t-slow: 0.45s;
  --transition: var(--t-base) var(--ease);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);

  /* Spacing scale (8px base) */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 2.5rem;
  --sp-6: 3rem;
  --sp-8: 4rem;
  --sp-10: 5rem;
  --sp-12: 6rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
  overflow-x: hidden;
}

/* ── Noise Overlay ── */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Custom Cursor ── */
.cursor {
  width: 7px;
  height: 7px;
  background: white;
  border-radius: 50%;
  position: fixed;
  top: -3.5px;
  left: -3.5px;
  pointer-events: none;
  z-index: 9999;
}

.cursor-follower {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  position: fixed;
  top: -16px;
  left: -16px;
  pointer-events: none;
  z-index: 9998;
  transition:
    width var(--t-base) var(--ease),
    height var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    top var(--t-base) var(--ease),
    left var(--t-base) var(--ease);
}

.cursor-follower.hovered {
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.55);
  top: -26px;
  left: -26px;
}

/* ── Layout Container ── */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ── Keyframes ── */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(74, 222, 128, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

/* Animated gradient shimmer for hero tag border */
@keyframes tagShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Marquee fade-edge utility */
@keyframes accentGlow {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}


/* ================================================================
   HEADER
   ================================================================ */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  background: rgba(8, 8, 8, 0.82);
  animation: slideDown 0.55s var(--ease) both;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--sp-4);
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

.subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
  position: relative;
  padding-bottom: 2px;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  /* Gradient underline with accent color */
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width var(--t-base) var(--ease);
}

.nav a:hover {
  color: white;
}

.nav a:hover::after {
  width: 100%;
}


/* ================================================================
   HERO
   ================================================================ */

.hero {
  display: grid;
  /* Right column expands to bleed to the viewport right edge */
  grid-template-columns: 1fr 42vw;
  min-height: calc(100vh - 57px);
  align-items: stretch;
  gap: 0;
  /*
   * Break out to the right edge: offset by (half-viewport - half-maxw - container-padding).
   * Clamped to 0 so it never goes positive on wide viewports.
   */
  margin-right: max(0px, calc(-1 * (50vw - var(--maxw) / 2) - var(--sp-4)));
  animation: fadeUp 0.75s 0.15s var(--ease) both;
  /* Subtle radial glow behind the hero text area — positioned to left column */
  position: relative;
}

/* Decorative radial orb glow behind the hero left column */
.hero::before {
  content: '';
  position: absolute;
  /* sits behind content */
  z-index: 0;
  /* centered in left column, slightly above midpoint */
  top: 20%;
  left: -8%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse at center,
    rgba(124, 111, 205, 0.12) 0%,
    rgba(124, 111, 205, 0.05) 40%,
    transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(40px);
}

/* Ensure hero children sit above the pseudo orb */
.hero-left,
.hero-right {
  position: relative;
  z-index: 1;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    margin-right: 0;
  }

  /* Remove the orb overhang on mobile */
  .hero::before {
    width: 100%;
    left: 0;
    top: 10%;
  }
}

/* ── Hero Left ── */
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-12) var(--sp-8) var(--sp-12) 0;
}

@media (max-width: 1024px) {
  .hero-left {
    padding: var(--sp-10) var(--sp-5) var(--sp-10) 0;
  }
}

@media (max-width: 860px) {
  .hero-left {
    padding: var(--sp-8) 0 var(--sp-5) 0;
  }
}

/* Availability badge — wrapped in a gradient-border shell via background-clip trick */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  margin-bottom: var(--sp-3);
  width: fit-content;
  /* Animated gradient border via background + padding + clip trick */
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(
      90deg,
      rgba(124, 111, 205, 0.5) 0%,
      rgba(255, 255, 255, 0.15) 40%,
      rgba(74, 222, 128, 0.4) 70%,
      rgba(124, 111, 205, 0.5) 100%
    ) border-box;
  background-size: 200% 100%;
  border: 1px solid transparent;
  animation: tagShimmer 4s ease infinite;
}

/* Pulsing green dot */
.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: pulseRing 2.8s ease-out infinite;
  /* Add a soft green glow around the dot */
  box-shadow: 0 0 6px 1px rgba(74, 222, 128, 0.5);
}

/* Hero headings */
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--white);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* "Hi :)" — treated as a softer greeting */
.hero-title.greeting {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.15em;
}

/* Main name line */
.hero-title.name {
  margin-bottom: var(--sp-3);
  /* Subtle luminous glow on the main heading */
  text-shadow:
    0 0 40px rgba(124, 111, 205, 0.25),
    0 0 80px rgba(124, 111, 205, 0.10);
}

.hero-title em {
  font-style: italic;
  /* Slightly brighter tint on the italic name */
  color: var(--accent-light);
  text-shadow:
    0 0 30px rgba(124, 111, 205, 0.35),
    0 0 60px rgba(124, 111, 205, 0.15);
}

.lead {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 430px;
  line-height: 1.82;
  font-weight: 300;
}

/* Social action row */
.hero-actions {
  margin-top: var(--sp-5);
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Social icon buttons (hero + contact) */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(25%);
  transition:
    filter var(--t-base) var(--ease),
    transform var(--t-base) var(--ease);
}

.social-icon:hover {
  border-color: rgba(124, 111, 205, 0.4);
  transform: translateY(-2px);
  box-shadow:
    var(--shadow-sm),
    0 0 12px 2px rgba(124, 111, 205, 0.15);
}

.social-icon:hover img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

/* ── Hero Right ── */
.hero-right {
  position: relative;
}

.hero-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(12%) brightness(0.9);
  transition:
    filter var(--t-slow) var(--ease),
    transform 0.7s var(--ease);
}

.hero-img:hover img {
  filter: grayscale(0%) brightness(1);
  transform: scale(1.025);
}

/* On mobile: image becomes a portrait box */
@media (max-width: 860px) {
  .hero-right {
    height: 65vw;
    min-height: 300px;
    max-height: 500px;
  }
}


/* ================================================================
   MARQUEE
   ================================================================ */

.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  margin-top: var(--sp-12);
  position: relative;
  /* Gradient fade masks on left and right edges for smooth bleed */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.marquee-track {
  display: flex;
  gap: var(--sp-3);
  width: max-content;
  animation: marquee 30s linear infinite;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Subtle accent tint on the marquee dots */
  color: var(--muted2);
}

/* Dots in the marquee get a faint accent tint */
.marquee-track span:nth-child(2n) {
  color: rgba(124, 111, 205, 0.45);
}

.marquee-track span {
  white-space: nowrap;
}

.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}


/* ================================================================
   SECTIONS — shared
   ================================================================ */

.section {
  margin-top: var(--sp-12);
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* Use the accent color for all section labels */
  color: var(--accent-light);
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.section h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.8vw, 2.7rem);
  font-weight: 700;
  color: white;
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
  line-height: 1.1;
  /* Position context for the watermark pseudo-element */
  position: relative;
}

/* Faded large watermark number behind each section title.
   The number is set via data-num on the <h3> in HTML. */
.section h3[data-num]::before {
  content: attr(data-num);
  position: absolute;
  /* Sit above the section label, behind the heading text */
  top: 50%;
  left: -0.05em;
  transform: translateY(-50%);
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 900;
  font-style: italic;
  color: rgba(124, 111, 205, 0.055);
  letter-spacing: -0.04em;
  line-height: 1;
  pointer-events: none;
  /* Keep it behind the text */
  z-index: -1;
  user-select: none;
  white-space: nowrap;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.65s var(--ease),
    transform 0.65s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================================
   ABOUT
   ================================================================ */

/* Subtle dot-grid background pattern behind the About section */
#about {
  position: relative;
}

#about::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--sp-6));
  bottom: calc(-1 * var(--sp-6));
  left: 0;
  right: 0;
  /* Radial-gradient dot grid — completely CSS, no image files */
  background-image: radial-gradient(
    circle,
    rgba(124, 111, 205, 0.12) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  background-position: center center;
  pointer-events: none;
  z-index: 0;
  /* Fade the grid out at edges so it doesn't look abrupt */
  -webkit-mask-image: radial-gradient(
    ellipse 80% 70% at 100% 50%,
    black 0%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 80% 70% at 100% 50%,
    black 0%,
    transparent 100%
  );
}

#about > * {
  position: relative;
  z-index: 1;
}

/* Skills section gets a very subtle darker background slab */
#skills {
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(16, 16, 16, 0.7) 0%,
    rgba(20, 20, 20, 0.4) 100%
  );
  padding: var(--sp-6) var(--sp-4);
  margin-left: calc(-1 * var(--sp-4));
  margin-right: calc(-1 * var(--sp-4));
}

@media (max-width: 580px) {
  #skills {
    margin-left: calc(-1 * var(--sp-2));
    margin-right: calc(-1 * var(--sp-2));
    padding: var(--sp-4) var(--sp-2);
  }
}

/* Experience gets a faint accent gradient slab to differentiate */
#experience {
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    rgba(124, 111, 205, 0.04) 0%,
    transparent 25%,
    transparent 75%,
    rgba(124, 111, 205, 0.02) 100%
  );
  padding: var(--sp-6) var(--sp-4);
  margin-left: calc(-1 * var(--sp-4));
  margin-right: calc(-1 * var(--sp-4));
}

@media (max-width: 580px) {
  #experience {
    margin-left: calc(-1 * var(--sp-2));
    margin-right: calc(-1 * var(--sp-2));
    padding: var(--sp-4) var(--sp-2);
  }
}

.about-grid {
  display: grid;
  gap: var(--sp-8);
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-6);
  }
}

.about-body {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.88;
  font-weight: 300;
}

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}

.about-pill {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  color: var(--muted);
  transition:
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    background var(--t-base) var(--ease);
}

.about-pill:hover {
  border-color: white;
  color: black;
  background: white;
}


/* ================================================================
   SKILLS
   ================================================================ */

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 620px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1060px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.skill-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--t-base) var(--ease),
    background var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

/* Top accent line — hidden by default, revealed on hover */
.skill-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 30%,
    var(--accent-light) 60%,
    transparent 100%
  );
  opacity: 0;
  transform: scaleX(0.6);
  transform-origin: left;
  transition:
    opacity var(--t-base) var(--ease),
    transform var(--t-slow) var(--ease);
}

.skill-block:hover {
  border-color: rgba(124, 111, 205, 0.25);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(124, 111, 205, 0.08) inset;
}

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

.skill-block h4 {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: white;
  margin-bottom: 0.45rem;
  line-height: 1.3;
  font-weight: 700;
}

.skill-block p {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: var(--sp-2);
  line-height: 1.6;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  transition:
    background var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease);
}

.pill:hover {
  background: white;
  color: black;
  border-color: white;
}


/* ================================================================
   TIMELINE — EXPERIENCE
   ================================================================ */

.timeline {
  position: relative;
  padding-bottom: var(--sp-4);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 188px;
  top: 0;
  bottom: 0;
  width: 1px;
  /* Base timeline line with a faint accent glow layered on top */
  background: linear-gradient(to bottom,
      transparent 0%,
      var(--border-mid) 8%,
      var(--border-mid) 92%,
      transparent 100%);
  /* Faint accent glow via box-shadow on the 1px line */
  box-shadow:
    0 0 8px 2px rgba(124, 111, 205, 0.12),
    0 0 20px 4px rgba(124, 111, 205, 0.06);
}

.tl-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--sp-5);
}

.tl-item:last-child {
  margin-bottom: 0;
}

.tl-left {
  width: 188px;
  flex-shrink: 0;
  padding-right: var(--sp-4);
  padding-top: 1.35rem;
  text-align: right;
}

.tl-date {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--muted2);
  text-transform: uppercase;
  line-height: 1.4;
}

.tl-dot {
  width: 9px;
  height: 9px;
  background: white;
  border-radius: 50%;
  border: 2px solid var(--bg);
  flex-shrink: 0;
  margin-top: 1.5rem;
  margin-left: -4.5px;
  margin-right: var(--sp-4);
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: box-shadow var(--t-base) var(--ease);
}

.tl-item:hover .tl-dot {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 0 12px 3px rgba(124, 111, 205, 0.35);
}

.tl-right {
  flex: 1;
  min-width: 0;
}

.tl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  transition:
    border-color var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.tl-card:hover {
  border-color: var(--border-mid);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.tl-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: white;
  margin-bottom: 0.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tl-company {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: var(--sp-2);
}

.tl-card ul {
  padding-left: var(--sp-3);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.tl-card li {
  margin-bottom: 0.3rem;
}

.tl-card li:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .timeline::before {
    left: 0;
  }

  .tl-left {
    display: none;
  }

  .tl-dot {
    margin-left: -4.5px;
    margin-right: var(--sp-2);
  }
}


/* ================================================================
   PROJECTS
   ================================================================ */

.project-count {
  font-family: 'DM Mono', monospace;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--muted2);
  font-weight: 400;
  margin-left: 0.4rem;
}

.project-filters {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.filter-btn {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition:
    background var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease);
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: white;
}

.filter-btn.active {
  background: white;
  color: black;
  border-color: white;
  font-weight: 500;
}

.filter-count {
  font-size: 9.5px;
  opacity: 0.65;
}

.projects-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

@media (max-width: 1024px) {
  .projects-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .projects-gallery {
    grid-template-columns: 1fr;
  }
}

.pg-card {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  /* Gradient border via background-clip trick */
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.07) 0%,
      transparent 50%,
      transparent 100%
    ) border-box;
  border: 1px solid transparent;
  transition:
    background var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease),
    opacity 0.3s ease;
}

.pg-card:hover {
  /* On hover, gradient border shifts to reveal the accent color */
  background:
    linear-gradient(var(--card-hover), var(--card-hover)) padding-box,
    linear-gradient(
      135deg,
      rgba(124, 111, 205, 0.45) 0%,
      rgba(168, 159, 224, 0.2) 40%,
      transparent 70%
    ) border-box;
  transform: translateY(-6px);
  box-shadow:
    var(--shadow-lg),
    0 0 30px 0 rgba(124, 111, 205, 0.08);
}

.pg-img {
  position: relative;
  overflow: hidden;
  height: 196px;
}

.pg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(18%) brightness(0.88);
  transition:
    transform 0.55s var(--ease),
    filter 0.45s var(--ease);
}

.pg-card:hover .pg-img img {
  transform: scale(1.07);
  filter: grayscale(0%) brightness(1);
}

.pg-category {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
}

.pg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: white;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.pg-card:hover .pg-overlay {
  opacity: 1;
}

.pg-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.pg-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15.5px;
  color: white;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pg-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  flex: 1;
}

.pg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: var(--sp-1);
}

.pg-tags span {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  color: var(--muted2);
  transition:
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease);
}

.pg-card:hover .pg-tags span {
  border-color: var(--border-mid);
  color: var(--muted);
}


/* ================================================================
   CONTACT
   ================================================================ */

.contact-intro {
  color: var(--muted);
  margin-bottom: var(--sp-4);
  font-size: 15px;
  line-height: 1.75;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr 260px;
  }
}

.contact-style {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: var(--sp-2);
}

.contact-style input,
.contact-style textarea {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
  resize: vertical;
}

.contact-style input:focus,
.contact-style textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.contact-style input::placeholder,
.contact-style textarea::placeholder {
  color: var(--muted2);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--sp-2);
  flex-wrap: wrap;
}

.btn {
  background: white;
  color: black;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  border: 1px solid white;
  cursor: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  transition:
    transform var(--t-fast) var(--ease),
    background var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-mid);
}

.btn.ghost:hover {
  background: var(--card-hover);
  color: white;
  border-color: var(--border-strong);
}

/* Generic card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
}

/* Contact details card gets a frosted glass treatment */
.contact-details.card {
  background:
    linear-gradient(
      135deg,
      rgba(124, 111, 205, 0.06) 0%,
      rgba(255, 255, 255, 0.025) 50%,
      rgba(124, 111, 205, 0.03) 100%
    );
  border-color: rgba(124, 111, 205, 0.15);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  /* Soft inner glow at top */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(124, 111, 205, 0.06);
}

.contact-details p {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: var(--sp-2);
  line-height: 1.5;
}

.contact-details a {
  color: white;
  text-decoration: none;
  transition: opacity var(--t-base) var(--ease);
}

.contact-details a:hover {
  opacity: 0.6;
}

.contact-details strong {
  color: var(--muted2);
  display: block;
  margin-bottom: 0.2rem;
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}

/* Social row inside contact card */
.social-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  margin-top: var(--sp-2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Smaller icon buttons in contact card */
.social-row .social-icon {
  width: 40px;
  height: 40px;
}


/* ================================================================
   TOAST NOTIFICATION
   ================================================================ */

.toast {
  position: fixed;
  bottom: var(--sp-4);
  right: var(--sp-4);
  background: var(--bg3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.85rem var(--sp-3);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 10000;
  transform: translateY(80px);
  opacity: 0;
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}


/* ================================================================
   FOOTER
   ================================================================ */

.footer {
  margin-top: var(--sp-12);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}


/* ================================================================
   EDUCATION (referenced in commented-out HTML block)
   ================================================================ */

.edu-label {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  display: block;
  margin-bottom: 0.6rem;
}

.edu-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.edu-school {
  font-size: 14px;
  color: white;
  font-weight: 600;
}

.edu-detail {
  font-size: 13px;
  color: var(--muted);
}

.edu-meta {
  font-size: 11.5px;
  color: var(--muted2);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.03em;
}

.edu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

.gpa {
  color: white;
  font-weight: 600;
}


/* ================================================================
   RESPONSIVE — SMALL SCREENS
   ================================================================ */

@media (max-width: 580px) {
  .nav {
    gap: 1.2rem;
  }

  .nav a {
    font-size: 10px;
  }

  .header-inner {
    padding: 0.75rem var(--sp-2);
  }

  .container {
    padding: 0 var(--sp-2);
  }
}

@media (max-width: 420px) {

  /* Collapse two nav items on very narrow screens */
  .nav a:nth-child(3),
  .nav a:nth-child(4) {
    display: none;
  }
}


/* ================================================================
   ACCESSIBILITY — focus-visible & reduced motion
   ================================================================ */

/* Keyboard focus rings — only shown for keyboard nav, not mouse clicks */
.nav a:focus-visible,
.social-icon:focus-visible,
.filter-btn:focus-visible,
.pg-card:focus-visible,
.btn:focus-visible,
.contact-details a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Inputs already use a border + box-shadow on focus; add ring fallback */
.contact-style input:focus-visible,
.contact-style textarea:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 1px;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ================================================================
   SCROLL PROGRESS BAR
   ================================================================ */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.65) 100%);
  z-index: 10001;
  pointer-events: none;
  transition: width 0.08s linear;
}


/* ================================================================
   PAGE LOAD OVERLAY
   ================================================================ */

#page-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.55s var(--ease);
}

#page-overlay.out {
  opacity: 0;
}


/* ================================================================
   STAGGER-IN CHILDREN
   ================================================================ */

.pg-card,
.tl-item,
.skill-block {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease),
    border-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.about-pill,
.pill {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.38s var(--ease),
    transform 0.38s var(--ease),
    background var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease);
}

.pg-card.stagger-in,
.tl-item.stagger-in,
.skill-block.stagger-in,
.about-pill.stagger-in,
.pill.stagger-in {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================================
   NAV SCROLL-SPY ACTIVE STATE
   ================================================================ */

.nav a.nav-active {
  color: white;
}

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


/* ================================================================
   PROJECT CARD — CATEGORY BADGE SLIDE ON HOVER
   ================================================================ */

.pg-category {
  transition:
    transform var(--t-base) var(--ease),
    background var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease);
}

.pg-card:hover .pg-category {
  transform: translateY(4px);
  background: rgba(0, 0, 0, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}


/* ================================================================
   TIMELINE CARD — LEFT BORDER ACCENT ON HOVER
   ================================================================ */

.tl-card {
  border-left-width: 1px;
  transition:
    border-color var(--t-base) var(--ease),
    border-left-color var(--t-base) var(--ease),
    border-left-width var(--t-base) var(--ease),
    padding-left var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.tl-card:hover {
  border-left-color: rgba(255, 255, 255, 0.5);
  border-left-width: 3px;
  padding-left: calc(var(--sp-4) - 2px);
}


/* ================================================================
   SKILL PILLS — BOUNCE SCALE ON HOVER
   ================================================================ */

@keyframes pillBounce {
  0% {
    transform: scale(1) translateY(0);
  }

  40% {
    transform: scale(1.14) translateY(-2px);
  }

  70% {
    transform: scale(0.97) translateY(0);
  }

  100% {
    transform: scale(1.05) translateY(0);
  }
}

.pill:hover {
  animation: pillBounce 0.32s var(--ease) forwards;
  will-change: transform;
}


/* ================================================================
   SEND EMAIL BUTTON — SHIMMER ON HOVER
   ================================================================ */

@keyframes shimmer {
  from {
    background-position: 200% center;
  }

  to {
    background-position: -200% center;
  }
}

.btn:not(.ghost) {
  background-image: linear-gradient(
    105deg,
    white 0%,
    white 38%,
    rgba(200, 200, 200, 0.5) 50%,
    white 62%,
    white 100%
  );
  background-size: 200% auto;
  background-position: 200% center;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.btn:not(.ghost):hover {
  animation: shimmer 0.6s linear forwards;
}


/* ================================================================
   MARQUEE — SPEED UP ON HOVER
   ================================================================ */

.marquee-wrap:hover .marquee-track {
  animation-duration: 10s;
  animation-play-state: running;
}


/* ================================================================
   PROJECTS GALLERY — HEIGHT TRANSITION ON FILTER
   ================================================================ */

.projects-gallery {
  transition: height 0.38s var(--ease);
}


/* ================================================================
   PREFERS-REDUCED-MOTION — stagger override
   ================================================================ */

@media (prefers-reduced-motion: reduce) {

  .pg-card,
  .tl-item,
  .skill-block,
  .about-pill,
  .pill {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  #scroll-progress,
  #page-overlay {
    display: none;
  }
}
