/* ============================================================
   FEATURES PAGE — Styles
   BlueKeys Design System Extension
   ============================================================ */

/* ---- Reset & Base ---- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f5f5f7cd;
  color: #1a1a1a;
  overflow-x: hidden;

  /* Layered ambient background — matches welcome page */
  background-image:
    radial-gradient(at 0% 10%, rgba(124, 209, 248, 0.69) 0px, transparent 50%),
    radial-gradient(at 100% 86%, rgba(77, 183, 232, 0.05) 0px, transparent 50%);
}

h1, h2, h3, h4, .font-headline {
  font-family: 'Manrope', sans-serif;
}

/* Material Symbols baseline */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}


/* ============================================================
   SHADER CANVAS
   ============================================================ */
#shader-canvas {
  will-change: transform;
  touch-action: none; /* Prevent scroll hijacking during touch interactions */
}

/* ============================================================
   AMBIENT GLOWS — Background depth
   ============================================================ */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(120px);
  contain: strict;
  transform: translateZ(0);
}

.ambient-orb--top {
  top: -15%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: rgba(142, 202, 230, 0.12);
}

.ambient-orb--bottom {
  bottom: -20%;
  right: -5%;
  width: 50vw;
  height: 50vw;
  background: rgba(142, 202, 230, 0.08);
}

.ambient-orb--center {
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  height: 40vw;
  background: rgba(142, 202, 230, 0.06);
}


/* ============================================================
   HERO SECTION
   ============================================================ */
.features-hero {
  min-height: 30vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.hero-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.35);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #1a1a1a 0%, #6b6b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  padding-right: 0.5rem;       /* Prevent bold clipping */
}

.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(26, 26, 26, 0.55);
  max-width: 540px;
  line-height: 1.7;
}


/* ============================================================
   BENTO GRID
   ============================================================ */
.features-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 8rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 2000px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  grid-auto-rows: minmax(260px, auto);
}

/* ---- Span Variants ---- */
.card--wide {
  grid-column: span 2;
}

.card--tall {
  grid-row: span 2;
}


/* ============================================================
   FEATURE CARDS
   ============================================================ */
.feature-card {
  position: relative;
  background: #f0fbff97;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.5rem;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
  contain: layout style paint;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(231, 241, 246, 0.06) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 220, 231, 0.774);
  box-shadow:
    0 20px 60px -15px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(142, 202, 230, 0.06);
}

.feature-card:hover::before {
  opacity: 1;
}

/* ---- Card Content ---- */
.card-icon {
  font-size: 2rem;
  color: #4d626a;           /* secondary */
  margin-bottom: 1.25rem;
  transition: 
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    font-variation-settings 0.4s ease;
}

/* Specific "Weighted Lift" animation for selected icons */
.feature-card:hover .icon-lift-fill,
.feature-card.mobile-animate .icon-lift-fill {
  transform: translateY(-5px);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

/* --- Special Component Animations --- */

/* 1. TrackPoint Elastic Wobble */
.icon-trackpoint {
  display: inline-block;
  transform-origin: center;
  transition: color 0.3s ease;
}

.feature-card:hover .icon-trackpoint,
.feature-card.mobile-animate .icon-trackpoint {
  animation: trackpointWobble 0.6s cubic-bezier(0.68, -0.6, 0.32, 1.6) 1;
  color: #ef4444 !important;
  font-variation-settings: 'wght' 700;
}

@keyframes trackpointWobble {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(3px, -2px) rotate(8deg); }
  50%  { transform: translate(-3px, 2px) rotate(-6deg); }
  75%  { transform: translate(1px, 1px) rotate(3deg); }
}

/* 2. Media Widget — Modular Tactile Bounce */
.icon-widget-glide {
  display: inline-block;
  transform-origin: center bottom;
  transition: color 0.3s ease;
}

.feature-card:hover .icon-widget-glide,
.feature-card.mobile-animate .icon-widget-glide {
  animation: 
    widgetSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1,
    widgetTactile 0.6s ease-in-out 1 0.8s; /* Spins then one quick bounce */
  color: #1a1a1a;
}

@keyframes widgetTactile {
  0%, 100% { transform: scale(1, 1) translateY(0); }
  33%      { transform: scale(1.15, 0.85) translateY(2px); } /* Squash */
  66%      { transform: scale(0.9, 1.1) translateY(-4px); }   /* Stretch & Lift */
}

@keyframes widgetSpin {
  0%   { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* 3. Clipboard Tactile Tap */
.icon-clipboard-tap {
  display: inline-block;
  transform-origin: center;
  transition: color 0.3s ease;
}

.feature-card:hover .icon-clipboard-tap,
.feature-card.mobile-animate .icon-clipboard-tap {
  animation: clipboardTap 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1;
  color: #0ea5e9; /* Sky Blue */
}

@keyframes clipboardTap {
  0%   { transform: translateY(30px) scale(0.8); opacity: 0; }
  45%  { transform: translateY(-5px) scale(0.05); opacity: 1; } /* Overshoot Rise */
  75%  { transform: translateY(2px) scale(0.98); } /* Settle Down */
  100% { transform: translateY(0) scale(1); }
}



.card-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.card-description {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.92rem;
  color: rgba(26, 26, 26, 0.55);
  line-height: 1.65;
}

/* ---- Card Image Decoration ---- */
.card-visual {
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 55%;
  height: 70%;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.7s ease;
  border-radius: 1rem;
  overflow: hidden;
}

/* New Pattern: Background Overlay Visual */
.card-background-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 100%);
}

.feature-card:hover .card-background-visual {
  opacity: 0.65 !important;
  transform: scale(1.02);
}

/* --- Special Card Backgrounds --- */
.card-background-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. File Sharing Variant (Rising Positive Tilt) */
.card-background--share img {
  object-position: right center;
  object-fit: cover;
}
.feature-card:hover .card-background--share img {
  transform: rotate(1deg) translate(3%, 4%) translate3d(0,0,0);
}
/* 2. Clipboard Variant (Stacked Negative Tilt) */
.card-background--clipboard img {
  width: 100%;
  height: 105%;
  object-fit: contain;
  object-position: bottom right;
  transform: rotate(0deg) translate(0%, 0%); /* Moved slightly to the right */
}




/* 
.feature-card:hover .card-background--clipboard img {
} */


.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.feature-card:hover .card-visual {
  opacity: 0.6;
}

/* ---- Sync Visual Ring (File Sharing) ---- */
.sync-ring {
  position: relative;
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(142, 202, 230, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sync-ring__pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(142, 202, 230, 0.25) 0%, transparent 70%);
  animation: syncRingPulse 3s infinite ease-in-out;
  pointer-events: none;
}

.sync-icon {
  font-size: 28px !important;
  color: #4d626a;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover .sync-ring,
.feature-card.mobile-animate .sync-ring {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.928);
  border-color: rgba(132, 209, 244, 0.611);
}

.feature-card:hover .sync-icon,
.feature-card.mobile-animate .sync-icon {
  animation: syncExchange 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes syncRingPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.2; }
  50% { transform: scale(1.1); opacity: 0.5; }
}

@keyframes syncExchange {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(15deg) translateX(5px) scale(0.9); }
  50% { transform: rotate(-15deg) translateX(-5px) scale(1.1); }
  75% { transform: rotate(5deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}


.media-controls .material-symbols-outlined {
  color: #5f5e5e;
  cursor: pointer;
  transition: color 0.4s ease;
}

.media-controls .material-symbols-outlined:hover {
  color: #1a1a1a;
}

.media-controls .play-btn {
  font-size: 2rem;
  font-variation-settings: 'FILL' 1;
}

/* ---- Tag Chips (for Bluetooth Sync card) ---- */
.tag-chips {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tag-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #4d626a;
}

.tag-chip .material-symbols-outlined {
  font-size: 1rem;
}

.sync-ring .material-symbols-outlined { 
  font-size: 2.5rem; 
  color: #5f5e5e; 
  z-index: 1;
}


/* ============================================================
   SCROLL REVEAL ANIMATIONS — Tesla-style text reveal
   ============================================================ */

/* --- Base hidden state for all reveal elements --- */
[data-reveal] {
  opacity: 0;
  transition: 
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.19, 1, 0.4, 1);
}

/* --- Reveal variants --- */
[data-reveal="fade-up"] {
  transform: translateY(50px);
}

[data-reveal="fade-in"] {
  transform: none;
}

[data-reveal="fade-left"] {
  transform: translateX(40px);
}

[data-reveal="fade-right"] {
  transform: translateX(-40px);
}

[data-reveal="scale-up"] {
  transform: scale(0.92);
}

/* --- Word-by-word text reveal (Tesla hero effect) --- */
[data-reveal="word"] {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: 
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Active (visible) state --- */
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}


/* ============================================================
   STAGGER DELAYS — For grid cards
   ============================================================ */
[data-delay="1"] { transition-delay: 0.05s; }
[data-delay="2"] { transition-delay: 0.10s; }
[data-delay="3"] { transition-delay: 0.15s; }
[data-delay="4"] { transition-delay: 0.20s; }
[data-delay="5"] { transition-delay: 0.25s; }
[data-delay="6"] { transition-delay: 0.30s; }
[data-delay="7"] { transition-delay: 0.35s; }
[data-delay="8"] { transition-delay: 0.40s; }
[data-delay="9"] { transition-delay: 0.45s; }
[data-delay="10"] { transition-delay: 0.50s; }
[data-delay="11"] { transition-delay: 0.55s; }
[data-delay="12"] { transition-delay: 0.60s; }


/* ============================================================
   BACK BUTTON — Minimal floating nav
   ============================================================ */
.back-nav {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
}

.back-nav:hover {
  color: rgba(26, 26, 26, 0.8);
}

.card-description {
  color: rgba(26, 26, 26, 0.6);
  line-height: 1.6;
  font-size: 0.95rem;
  font-weight: 300;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.feature-card:hover .card-description {
  color: rgba(26, 26, 26, 0.9);
  text-decoration:solid;
}


.back-nav .material-symbols-outlined {
  font-size: 1.1rem;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-nav:hover .material-symbols-outlined {
  transform: translateX(-4px);
}


/* ============================================================
   FOOTER
   ============================================================ */
.features-footer {
  text-align: center;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.features-footer p {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.3);
}


.card--full {
  grid-column: span 3;
}

/* ============================================================
   RESPONSIVE — Tablet, Flips & Mobile
   ============================================================ */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .card--wide,
  .card--full {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .bento-grid {
    gap: 1rem;
  }
  .features-hero {
    min-height: 40vh;

  }
  .sync-ring {
    width: 100px;
    height: 100px;
  }
  .sync-ring .material-symbols-outlined {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    grid-auto-rows: auto;
  }
  
  .card--wide,
  .card--tall,
  .card--full {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .feature-card {
    padding: 1.75rem;
    border-radius: 1.25rem;
    min-height: 240px;
  }

  /* Asymmetrical rhythm for mobile */
  .feature-card:nth-child(1) { 
    min-height: 450px; 
  }
  .feature-card:nth-child(1) > .relative.z-10 {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
  }



  .feature-card:nth-child(4) { min-height: 350px; }
  .feature-card:nth-child(10) { min-height: 390px; }


  .card-title {
    font-size: 1.25rem;
  }

  .card-description {
    font-size: 0.88rem;
  }

  /* Enhanced visual for the 480px tall Trackpad card */
  .feature-card:nth-child(1) .card-visual {
    opacity: 0.45 !important; 
    width: 80%;
    height: 65%;
    right: -15%;
    bottom: -2%;
    transform: rotate(-5deg);
 
  }
  .feature-card:nth-child(1) .card-visual img {
    object-position: bottom right;
  }


  /* Don't hide visuals, retain the aesthetic on mobile */
  .card-visual {
    opacity: 0.25 !important; 
    width: 75%;
    height: 65%;
    right: -8%;
    bottom: -5%;
  }

  .features-hero {
    min-height: 30vh;
  }

  .back-nav {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(240, 251, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  }

  .features-section {
    padding: 0.5rem 1.25rem 5rem;
  }
  
  .media-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }
}

/* Specific optimizations for Flips / extra narrow screens (Galaxy Z Flip wrapper etc) */
@media (max-width: 380px) {
  .feature-card {
    padding: 1.25rem ;

    min-height: auto;
  }
  
  .hero-title {
    font-size: 2.5rem;
    word-break: break-word;
  }
  
  .card-title {
    font-size: 1.15rem;
  }

  .tag-chips {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .back-nav span:not(.material-symbols-outlined) {
    display: none; /* Hide 'Back to Home' text, show only icon on flips */
  }
  
  .back-nav {
    padding: 0.6rem;
  }
  
  .card-visual {
    display: block; /* Show as subtle peek instead of hiding entirely */
    width: 80%;
    height: 60%;
    bottom: -10%;
    right: -5%;
  }
}