/* ==========================================================================
   GLASSMORPHISM & 3D THEME (DIALEDWEB STYLE APPLIED TO LAM NGUYEN)
   ========================================================================== */

:root {
  /* BACKGROUND FOUNDATION */
  --bg-dark: #010101;
  /* Extremely dark, nearly black */
  --bg-atmosphere: #050605;
  /* Deepest black-green */

  /* BRAND COLORS */
  --moss-light: #5d7a67;
  --moss-core: #3a5546;
  --moss-dark: #1e3027;
  --orange-accent: #ff8c00;
  --orange-glow: rgba(255, 140, 0, 0.4);

  /* GLASSMORPHISM CONSTANTS - Sharper & More Visible */
  --glass-bg: hsla(0, 0%, 100%, 0.05);
  /* Increased base opacity */
  --glass-bg-hover: hsla(0, 0%, 100%, 0.12);
  /* Brighter hover */
  --glass-border: hsla(0, 0%, 100%, 0.12);
  /* Sharper border */
  --glass-glow: hsla(0, 0%, 100%, 0.08);
  /* Stronger inner glow */
  --glass-blur: blur(24px);
  /* Higher blur for frosted feel */
  --glass-radius: 25px;

  /* TEXT COLORS */
  --text-primary: #ffffff;
  --text-secondary: hsla(0, 0%, 100%, 0.7);
  /* Improved contrast */
  --text-muted: hsla(0, 0%, 100%, 0.4);

  /* OVERRIDING STYLES.CSS TEXT VARIABLES */
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --moss-700: var(--moss-light);
  /* Make the "eyebrow" text readable */

  /* UTILITIES */
  --section-padding: 0 10vw;
}

/* ==========================================================================
   BASE RESETS & INJECTIONS
   ========================================================================== */
body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Manrope', sans-serif;
  overflow-x: clip;
}

::selection {
  background-color: var(--orange-accent);
  color: #fff;
}

/* Override existing background */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  background-color: var(--bg-dark) !important;
  background-image: none !important;
  z-index: -2;
}

/* 3D Ambient Grid & Glows */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(90deg, hsla(0, 0%, 100%, 0.02) 1px, transparent 0),
    linear-gradient(180deg, hsla(0, 0%, 100%, 0.02) 1px, transparent 0);
  background-size: 50px 50px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #010101 10%, #010101 90%, transparent),
    linear-gradient(180deg, transparent, #010101 10%, #010101 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #010101 10%, #010101 90%, transparent),
    linear-gradient(180deg, transparent, #010101 10%, #010101 90%, transparent);
}

/* Bloom Effect (The DialedWeb Glow Blob) */
.bloom-gradient {
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background-color: var(--bg-dark);
  filter: blur(80px);
  opacity: 0.8;
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.bloom-orange {
  background-color: var(--orange-glow);
  width: 20vw;
  height: 20vw;
  filter: blur(100px);
}

.bloom-moss {
  background-color: rgba(58, 85, 70, 0.4);
}

/* ==========================================================================
   GLASS COMPONENT SYSTEM (CARDS, NAV)
   ========================================================================== */

/* The Glass Card */
.glass-panel {
  background-color: var(--glass-bg);
  box-shadow: inset 0 0 0 calc(1px + 0px) var(--glass-border),
    inset 0 0 5vw var(--glass-glow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--glass-radius);
  transition: background-color 0.5s ease;
  overflow: hidden;
  position: relative;
}

.glass-panel:hover {
  background-color: var(--glass-bg-hover);
}

/* Isometric 3D Hover Effect for Cards */
.card-isometric-wrap {
  perspective: 2000px;
}

.card-isometric {
  transition: 0.75s ease;
  transform: translateZ(0);
}

.card-isometric:hover {
  transform: skewY(-2deg) rotateX(-5deg) rotateY(10deg) translateZ(50px);
}

/* ==========================================================================
   BUTTONS (All
0/50
Required
0/10
Recomended
0/15All
0/50
Required
0/10
Recomended
0/15 Pill Style)
   ========================================================================== */
.btn-glass {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  padding: 0.35rem 0.35rem 0.35rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  background-color: rgba(255, 255, 255, 0.12);
  /* Slightly more opaque */
  color: var(--text-primary);
  backdrop-filter: blur(32px);
  /* Increased blur (Frosted feel) */
  -webkit-backdrop-filter: blur(32px);
  box-shadow: inset 0 0 1vw hsla(0, 0%, 100%, 0.1);
  text-decoration: none;
  font-weight: 500;
  transition: 0.5s ease;
}

.btn-glass-circle {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 100%;
  background-color: var(--orange-accent);
  /* Custom Orange Accent */
  color: #010101;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
}

.btn-glass:hover .btn-glass-circle {
  background-color: #fff;
}

/* Arrow Hover Behaviors */
.btn-glass-circle svg {
  transition: transform 0.3s ease;
}

.btn-view-projects:hover .btn-glass-circle svg {
  transform: rotate(90deg);
  /* down */
}

.btn-contact:hover .btn-glass-circle svg {
  transform: rotate(-45deg);
  /* up-right */
}

.btn-download:hover .btn-glass-circle {
  background-color: transparent !important;
}

.btn-download:hover .btn-glass-circle svg {
  transform: translateY(3px);
}

/* Text inside Button */
.btn-text-wrap {
  position: relative;
  overflow: hidden;
  height: 1.2rem;
}

.btn-text-wrap span {
  display: block;
  transition: transform 0.75s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-text-wrap span:nth-child(2) {
  position: absolute;
  top: 100%;
}

.btn-glass:hover .btn-text-wrap span {
  transform: translateY(-100%);
}

/* ==========================================================================
   TYPOGRAPHY INJECTIONS
   ========================================================================== */
h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background-image: linear-gradient(180deg, #ffffff 0%, hsla(0, 0%, 100%, 0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

p {
  color: var(--text-secondary);
}

.eyebrow {
  color: var(--text-secondary);
  text-transform: none;
  font-family: 'Manrope', sans-serif;
  box-shadow: inset 0 0 0 calc(1px + 0px) hsla(0, 0%, 100%, 0.075), inset 0 0 1vw hsla(0, 0%, 100%, 0.2);
  padding: 0.5vh 1vw;
  border-radius: 999px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.5vw;
  background-color: var(--glass-bg);
}

/* Text Gradient for Orange */
.text-gradient {
  background-image: linear-gradient(135deg, var(--orange-accent), #fca311);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
  line-height: inherit;
}

.text-gradient-moss {
  background-image: linear-gradient(135deg, #719b80, #a8d5b5) !important;
}

/* Rotating Text Wrapper with Pill Border & Blur */
.rotating-text-wrapper {
  font-family: 'Space Grotesk', sans-serif;
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  border: 1px solid var(--orange-accent);
  /* Thinner border for elegance */
  border-radius: 999px;
  color: #ffffff !important;
  height: 1.15em;
  /* Match line height */
  overflow: hidden;
  box-sizing: content-box;
  margin-left: 5px;
  background-color: rgba(255, 140, 0, 0.15);
  /* Stronger inner tint */
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.3);
  /* Outer glow */
  backdrop-filter: blur(8px);
  /* Orange glass layer */
  -webkit-backdrop-filter: blur(8px);
}

.rotating-text-item {
  position: absolute;
  height: 100%;
  white-space: nowrap !important;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  align-items: center;
  padding: 0 0.5em;
  color: #ffffff;
}

/* Hero Hover Effect */
.hero-content h1 {
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.hero-content:hover h1 {
  transform: translateY(-5px);
}

.hero-content:hover .text-gradient {
  transform: scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 10px 20px var(--orange-glow));
}

/* ==========================================================================
   CARD & BUTTON OVERRIDES FOR DARK MODE CONTRAST
   ========================================================================== */
.project-card,
.about-panel {
  color: var(--text-secondary);
  /* Ensure text inside cards doesn't use old dark colors */
}

.project-body ul,
.timeline p,
.about-panel p {
  color: var(--text-secondary);
  font-weight: 500;
}

.project-card h3,
.timeline-title {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.skill-tags span {
  color: var(--text-primary);
  border-color: var(--glass-border);
  background-color: hsla(0, 0%, 100%, 0.05);
}

.timeline-item {
  border-left-color: var(--glass-border);
}

.project-card {
  border: 1px solid var(--glass-border);
  /* Fix flat dark border */
}

/* Card Button Hover Override */
.project-link-icon {
  transition: all 0.3s ease;
}

.project-link-icon svg {
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.project-card:hover .project-link-icon svg,
.project-card:focus-within .project-link-icon svg {
  transform: rotate(-45deg) !important;
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

/* --- Hero Section --- */
.hero.section {
  overflow: visible;
  /* Prevent internal clipping; body-level clip handles horizontal overflow */
  position: relative;
  z-index: 5;
  min-height: 90vh;
  display: flex;
  align-items: center;
}

/* Background Atmospheric Blur for Hero Only */
.hero.section::before {
  content: '';
  position: absolute;
  /* Mở rộng khung ra cực rộng để blur không bao giờ bị cắt cụt ở ranh giới hero */
  inset: -50vh -50vw;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 45% 50%, rgba(228, 111, 45, 0.22) 0%, transparent 70%),
    radial-gradient(circle at 75% 55%, rgba(93, 122, 103, 0.26) 0%, transparent 75%);
  filter: blur(200px);
  /* Tăng blur cực đại cho độ mịn tuyệt đối */
  mix-blend-mode: screen;
  opacity: 0.8;
}

/* Spline 3D background - Contained within hero */
.hero-spline-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 150vw;
  /* Wider to ensure no clipping within interaction area */
  z-index: 1;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /* Re-enabled for interaction */
}

/* Đẩy section kế tiếp (Works) xuống để không che phần hero interaction */
#works {
  position: relative;
  z-index: 3;
  margin-top: 15vh;
  /* Reduced from 30vh since hero bleed is gone */
  padding-top: 5vh;
}

#spline-canvas {
  width: 100% !important;
  height: 100% !important;
  outline: none;
  display: block;
  pointer-events: auto; /* Re-enabled for interaction */
  touch-action: pan-y; /* Allow vertical scroll on touch */
}

/* Text overlay container */
.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  pointer-events: none;
  /* Let clicks pass through to Spline... */
}

/* ...but re-enable clicks for interactive elements inside */
.hero-overlay .btn-glass,
.hero-overlay a,
.hero-overlay button {
  pointer-events: auto;
}

/* The content block itself */
.hero-content {
  width: 100%;
  max-width: 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --- Desktop & Tablet (Side-by-side): text left --- */
@media (min-width: 801px) {
  .hero-content {
    max-width: 50%;
  }

  /* Desktop: Centered balance + Expanded interaction area + Updated Global Scaling */
  .hero-spline-bg {
    top: -15vh;
    bottom: -15vh;
    transform: translateX(-55%) scale(0.92);
    /* Scaled down 8% as requested */
  }

  @media (min-width: 1024px) {
    .hero-spline-bg {
      transform: translateX(-52%) scale(0.92);
    }
  }

  /* Center Navbar Links */
  .site-header.glass-panel {
    position: sticky;
    top: 15px;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 999px;
    padding: 0.4rem 0.4rem 0.4rem 1.5rem;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .nav-drawer {
    flex-grow: 1;
    justify-content: flex-end;
  }

  .main-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   MOBILE & RESPONSIVE OVERRIDES FOR GLASS THEME
   ========================================================================== */
@media (max-width: 680px) {
  .site-header.glass-panel {
    position: sticky;
    top: 10px;
    z-index: 50;
    border-radius: 999px;
    padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  }

  /* Un-pill the header when the menu opens to fit the grid correctly */
  .site-header.glass-panel.menu-open {
    border-radius: 24px;
  }

  /* Mobile hero: re-balanced and updated Global Scaling */
  .hero-spline-bg {
    width: 200vw;
    max-width: 200vw;
    left: 50%;
    top: -60vh;
    bottom: 0;
    transform: translateX(-55%) scale(0.62);
    /* Move up ~5%, right 10%, scale reduced slightly */
    pointer-events: auto;
  }

  .hero-overlay {
    padding-top: 35vh;
    /* Kéo text lên một khoảng tương ứng để nhìn thoáng hơn */
  }

  .hero-content {
    align-items: center;
    text-align: center;
    max-width: 100%;
    pointer-events: auto;
    /* Enable touch interaction for scrolling over text */
  }

  .hero.section {
    min-height: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Align Section Headers globally on mobile */
  .section-head,
  .contact {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  /* Dark mode mobile menu drawer */
  .nav-drawer {
    background-color: var(--bg-atmosphere);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
  }

  /* Dark mode hamburger toggle */
  .nav-toggle {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 999px;
    /* Match pill vibe */
  }

  .nav-drawer .main-nav a {
    color: var(--text-secondary);
  }

  .nav-drawer .main-nav a:hover,
  .nav-drawer .main-nav a:focus-visible {
    color: var(--text-primary);
  }

  /* Enlarge mobile CTA buttons */
  .btn-glass {
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    font-size: 1rem;
  }

  .nav-drawer .nav-cta {
    width: 100%;
    justify-content: center;
    padding-left: 0.5rem;
    /* Ensures the icon+text group sits in the exact center */
  }

  .btn-glass-circle {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* ==========================================================================
   SIMPLE LOADING SCREEN
   ========================================================================== */
.simple-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  /* Top level */
  background-color: var(--bg-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1), visibility 1s linear;
}

.simple-loader.loaded {
  transform: translateY(-100%);
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
}

.loader-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.6rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: loaderPulse 2s ease-in-out infinite;
}

.loader-line {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.loader-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--orange-accent);
  transform: translateX(-100%);
  animation: loaderLineSlide 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes loaderPulse {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

@keyframes loaderLineSlide {
  to {
    transform: translateX(100%);
  }
}

/* ==========================================================================
   EXTENDED LAYOUT — Section-specific styles
   (Merged from casberry-layout.css for fewer HTTP requests)
   ========================================================================== */

/* ---------- SERIF ITALIC ACCENT ---------- */
.hero-serif-italic {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(135deg, var(--orange-accent, #ff8c00) 0%, #fca311 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
  line-height: inherit;
}

/* ==========================================================================
   ABOUT — 2-col split
   ========================================================================== */
.cb-about {
  padding: 8rem 0 6rem;
  position: relative;
}

.cb-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.cb-about-heading {
  font-size: clamp(2rem, 4vw, 3.5rem) !important;
  line-height: 1.15 !important;
  margin-bottom: 1.5rem;
}

.cb-about-roles {
  margin-top: 0.5rem;
}

.cb-about-roles .rotating-text-wrapper {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  height: 1.3em;
  margin-left: 0;
}

.cb-about-right {
  padding-top: 0.5rem;
}

.cb-about-right p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
}

.cb-about-right p em {
  color: var(--orange-accent);
  font-style: italic;
}

.cb-about::after {
  content: '';
  display: block;
  width: 100%;
  max-width: 1120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 5rem auto 0;
}

/* ==========================================================================
   PROCESS / HOW I WORK
   ========================================================================== */
.cb-process {
  padding: 6rem 0;
  position: relative;
}

.cb-process-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.cb-process-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 3rem) !important;
}

.cb-process-sub {
  max-width: 500px;
  margin: 0.5rem auto 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.cb-process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cb-process-grid::before {
  /* removed connecting line per user request */
  display: none;
}

.cb-process-step {
  padding: 1.8rem 1.4rem;
  border-radius: var(--glass-radius);
  transition: transform 0.4s cubic-bezier(0.2, 0.72, 0.2, 1);
}

.cb-process-step:hover {
  transform: translateY(-6px);
}

.cb-step-num {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--orange-accent) 0%, #fca311 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 1rem;
  line-height: 1;
}

.cb-process-step h4 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.cb-process-step p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* 3D Process Graphics */
.process-graphic {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  perspective: 800px;
}

.shape-sphere {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--orange-accent) 30%, #3a1c00 80%, #000000 100%);
  box-shadow: 0 10px 20px rgba(255, 140, 0, 0.4), inset -5px -5px 15px rgba(0, 0, 0, 0.5);
  animation: floaty 4s ease-in-out infinite;
}

.shape-pill {
  width: 50px;
  height: 20px;
  border-radius: 20px;
  background: linear-gradient(90deg, #ffffff 0%, var(--orange-accent) 50%, #8a4800 100%);
  box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4), inset -2px -2px 10px rgba(0, 0, 0, 0.5);
  transform: rotate(-15deg);
  animation: floaty 4s ease-in-out infinite reverse;
}

.shape-cube {
  position: relative;
  width: 35px;
  height: 35px;
  background: var(--orange-accent);
  transform-style: preserve-3d;
  box-shadow: 0 15px 25px rgba(255, 140, 0, 0.4);
  animation: floaty-spin-slow 8s linear infinite;
}

.shape-cube::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #ffb84d;
  transform: rotateX(90deg) translateZ(17.5px);
  transform-origin: center;
}

.shape-cube::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #cc7000;
  transform: rotateY(90deg) translateZ(17.5px);
  transform-origin: center;
}

.shape-target {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 8px solid var(--orange-accent);
  position: relative;
  box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
  animation: floaty-spin-slow 6s linear infinite;
}

.shape-target::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.shape-arrow {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #ffffff 0%, var(--orange-accent) 50%, #8a4800 100%);
  clip-path: polygon(50% 0%, 100% 100%, 50% 75%, 0% 100%);
  box-shadow: 0 10px 30px rgba(255, 140, 0, 0.5);
  animation: floaty 3s ease-in-out infinite alternate;
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0);
  }

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

@keyframes floaty-spin {
  0% {
    transform: rotateX(60deg) rotateY(20deg) rotateZ(0deg) translateY(0);
  }

  50% {
    transform: rotateX(60deg) rotateY(20deg) rotateZ(180deg) translateY(-10px);
  }

  100% {
    transform: rotateX(60deg) rotateY(20deg) rotateZ(360deg) translateY(0);
  }
}

@keyframes floaty-spin-slow {
  0% {
    transform: rotateX(45deg) rotateZ(0deg);
  }

  100% {
    transform: rotateX(45deg) rotateZ(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg) scale(0.9);
  }

  50% {
    transform: rotate(180deg) scale(1);
  }

  100% {
    transform: rotate(360deg) scale(0.9);
  }
}

.cb-process::after {
  content: '';
  display: block;
  width: 100%;
  max-width: 1120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 5rem auto 0;
}

/* ==========================================================================
   WORKS — Staggered alternating layout
   ========================================================================== */
.cb-work-date {
  display: none !important;
}

.cb-works {
  padding: 6rem 0 4rem;
  position: relative;
  z-index: 3;
}

.cb-works-header {
  text-align: center;
  margin-bottom: 5rem;
}

.cb-works-header h2 {
  font-size: clamp(2rem, 4.5vw, 4rem) !important;
  line-height: 1.1 !important;
}

.cb-works-sub {
  max-width: 560px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.cb-work-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 6rem;
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  content-visibility: auto;
  contain-intrinsic-size: 720px;
}

.cb-work-item--reverse {
  grid-template-columns: 1fr 1.2fr;
}

.cb-work-item--reverse .cb-work-visual {
  order: 2;
}

.cb-work-item--reverse .cb-work-info {
  order: 1;
}

.cb-work-image-wrap {
  border-radius: var(--glass-radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
}

.cb-work-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 0.72, 0.2, 1);
}

.cb-work-item:hover .cb-work-image-wrap img {
  transform: scale(1.05);
}

.cb-work-num {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  display: block;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.cb-work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.cb-work-tags span {
  background: rgba(255, 140, 0, 0.12);
  color: var(--orange-accent);
  border: 1px solid rgba(255, 140, 0, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cb-work-info h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem) !important;
  margin-bottom: 0.8rem;
  line-height: 1.15 !important;
}

.cb-work-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.cb-work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cb-work-date {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   MARQUEE / INFINITE SCROLL TEXT DIVIDER
   ========================================================================== */
.cb-marquee-section {
  padding: 4rem 0;
  overflow: hidden;
  position: relative;
}

.cb-marquee-section::before,
.cb-marquee-section::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.cb-marquee-section::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-dark, #010101), transparent);
}

.cb-marquee-section::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-dark, #010101), transparent);
}

.cb-marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 22s linear infinite;
}

.cb-marquee-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.15) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 2rem;
  user-select: none;
}

.cb-marquee-dot {
  font-size: 0.6em;
  opacity: 0.7;
  color: var(--orange-accent);
  -webkit-text-fill-color: var(--orange-accent);
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }

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

/* ==========================================================================
   CONTACT — Full-width centered
   ========================================================================== */
.cb-contact {
  padding: 8rem 0;
  text-align: center;
  position: relative;
}

/* Contact must stay visible even when reveal state desyncs on mobile */
.cb-contact.reveal {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.cb-contact::before {
  content: '';
  position: absolute;
  inset: -20vh -20vw;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at 50% 60%, rgba(228, 111, 45, 0.1) 0%, transparent 55%);
  filter: blur(120px);
}

.cb-contact-inner {
  max-width: 700px;
  margin: 0 auto;
}

.cb-contact-heading {
  font-size: clamp(2.2rem, 5vw, 4rem) !important;
  line-height: 1.1 !important;
  margin-bottom: 1.5rem;
}

.cb-contact-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.cb-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.cb-contact-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.cb-contact-divider {
  opacity: 0.4;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.cb-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--glass-border);
}

.cb-footer-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cb-footer-tagline {
  font-style: italic;
  opacity: 0.6;
}

/* ==========================================================================
   EXTENDED RESPONSIVE — Section layouts
   ========================================================================== */
@media (max-width: 1024px) {
  .cb-process-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) and (min-width: 681px) {
  .cb-about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cb-about-left {
    text-align: center;
  }

  .cb-about-roles {
    display: flex;
    justify-content: center;
  }

  .cb-process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cb-work-item,
  .cb-work-item--reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cb-work-item--reverse .cb-work-visual {
    order: 0;
  }

  .cb-work-item--reverse .cb-work-info {
    order: 0;
  }

  .cb-work-info {
    text-align: center;
  }

  .cb-work-tags {
    justify-content: center;
  }

  .cb-work-footer {
    justify-content: center;
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (max-width: 680px) {
  .cb-about {
    padding: 5rem 0 4rem;
  }

  .cb-about-heading {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
  }

  .cb-about::after {
    margin-top: 3rem;
  }

  .cb-process {
    padding: 4rem 0;
  }

  .cb-process-grid {
    grid-template-columns: 1fr;
  }

  .cb-process::after {
    margin-top: 3rem;
  }

  .cb-works {
    padding: 4rem 0 2rem;
  }

  .cb-works-header {
    margin-bottom: 3rem;
  }

  .cb-works-header h2 {
    font-size: clamp(1.8rem, 8vw, 2.8rem) !important;
  }

  .cb-work-item {
    margin-bottom: 4rem;
  }

  .cb-marquee-section {
    padding: 2.5rem 0;
  }

  .cb-marquee-content {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }

  .cb-contact {
    padding: 5rem 0;
  }

  .cb-contact-heading {
    font-size: clamp(1.8rem, 8vw, 2.8rem) !important;
  }

  .cb-contact-sub {
    font-size: 0.95rem;
  }

  .cb-contact-actions {
    flex-direction: column;
    align-items: center;
  }

  .cb-footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ==========================================================================
   OVERRIDE CONFLICTING OLD STYLES
   ========================================================================== */
.works-grid-staggered {
  display: none;
}

#works .section-head {
  display: none;
}

#works {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.card-isometric-wrap {
  display: none;
}

/* ==========================================================================
   NEW REQ FIXES: Mobile Layouts & How I Work Alignment
   ========================================================================== */

/* How I work Step Row */
.step-top-row {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  margin-bottom: 1.8rem;
}

.process-graphic {
  height: auto !important;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.cb-step-num {
  margin-bottom: 0 !important;
}

/* Mobile Media Query Fixes */
@media (max-width: 680px) {

  html,
  body {
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .capture-frame {
    overflow-x: clip;
  }

  /* Fix nav drawer blur */
  .nav-drawer,
  .site-header.glass-panel.menu-open .nav-drawer {
    background-color: hsla(0, 0%, 5%, 0.6) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  }

  /* About mobile layout reset */
  .cb-about-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .cb-about-left,
  .cb-about-right,
  .cb-about-left h2,
  .cb-about-right p {
    text-align: left;
  }

  .cb-about-roles {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.35rem;
  }

  .cb-about-roles .rotating-text-wrapper {
    margin-left: 0;
    max-width: 100%;
    font-size: clamp(1rem, 5.4vw, 1.3rem);
    height: 1.22em;
  }

  /* Works layout: use grid areas to prevent tags/meta/actions from jumping */
  .cb-work-item,
  .cb-work-item--reverse {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .cb-work-item--reverse .cb-work-visual,
  .cb-work-item--reverse .cb-work-info {
    order: 0;
  }

  .cb-work-info {
    text-align: left;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "num . cta"
      "title title title"
      "desc desc desc"
      "tags tags tags";
    column-gap: 0.7rem;
    row-gap: 0.68rem;
    align-items: start;
  }

  .cb-work-num {
    grid-area: num;
    margin: 0 !important;
    font-size: 1.18rem !important;
    line-height: 1;
    align-self: center;
  }

  .cb-work-tags {
    grid-area: tags;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 0.38rem;
    margin: 0.2rem 0 0 !important;
    min-width: 0;
  }

  .cb-work-tags span {
    margin: 0 !important;
    white-space: nowrap;
    line-height: 1.2;
    padding: 0.28rem 0.6rem;
    font-size: 0.68rem;
  }

  .cb-work-footer {
    grid-area: cta;
    margin: 0 !important;
    width: auto !important;
    justify-self: end;
    align-self: center;
    display: flex;
    justify-content: flex-end;
    flex-direction: row;
    gap: 0.4rem;
  }

  .cb-work-footer .btn-glass {
    padding: 0.35rem 0.35rem 0.35rem 0.9rem !important;
    font-size: 0.82rem !important;
    min-height: 36px;
  }

  .cb-work-footer .btn-glass-circle {
    width: 1.9rem;
    height: 1.9rem;
  }

  .cb-work-info h3 {
    grid-area: title;
    margin: 0.08rem 0 0.2rem;
    width: 100%;
    font-size: clamp(1.35rem, 6vw, 1.8rem) !important;
    line-height: 1.22;
  }

  .cb-work-info p {
    grid-area: desc;
    width: 100%;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
  }

  /* Contact Buttons Side-by-Side */
  .cb-contact-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
  }

  .cb-contact.reveal {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .cb-contact-inner {
    display: block;
  }

  .cb-contact-actions .btn-glass,
  .cb-contact-actions .btn {
    width: auto !important;
    flex: 0 0 auto;
  }
}

@media (hover: none),
(pointer: coarse) {
  .card-isometric:hover {
    transform: none;
  }

  .cb-work-item:hover .cb-work-image-wrap img {
    transform: none;
  }

  .btn-glass,
  .cb-work-image-wrap img,
  .project-card {
    transition-duration: 0.2s;
  }
}

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

  .cb-work-image-wrap img,
  .btn-glass,
  .project-card,
  .card-isometric,
  .card-isometric:hover {
    transition: none !important;
    transform: none !important;
  }
}

/* ABSOLUTE CENTERING SAFEGUARDS */
html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
}

.site-wrapper {
  width: 100vw !important;
  overflow-x: hidden !important;
}

main,
.site-header,
.site-footer {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-inline: auto !important;
}