/* Kent Mac Upgrades — Concept B Dark Hardware & Interactive Motion Polish */

:root {
  --bg-canvas: #0A0A0C;
  --bg-card: #121216;
  --bg-recessed: #0E0E12;
  --bg-screen: #0E121B;
  --border-header: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #F5F5F7;
  --text-secondary: #A1A1A6;
  --status-green: #30D158;
  --status-amber: #FF9F0A;
  --accent-focus: #2997FF;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* Focus & Link States */
a,
button {
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.inline-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: rgba(245, 245, 247, 0.28);
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--accent-focus);
  text-decoration-color: var(--accent-focus);
}

.header-link {
  color: var(--text-primary);
  text-decoration: none;
}

.header-link:hover {
  color: var(--accent-focus);
}

/* Sticky Translucent Glass Header & 1px Scroll Progress Line */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(10, 10, 12, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-header);
}

.scroll-progress-bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(245, 245, 247, 0.28) 0%,
    rgba(245, 245, 247, 0.78) 72%,
    #2997FF 100%
  );
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-progress, 0));
  pointer-events: none;
  will-change: transform;
}

/* Apple Pro Metallic H1 & Hero Entrance */
.hero-metallic-text {
  background: linear-gradient(180deg, #FFFFFF 0%, #ECECF1 48%, #A1A1A6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-price-text {
  color: #F5F5F7;
  -webkit-text-fill-color: #F5F5F7;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hero-enter {
  animation: heroFadeUp 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-enter--1 {
  animation-delay: 0ms;
}

.hero-enter--2 {
  animation-delay: 70ms;
}

.hero-enter--3 {
  animation-delay: 140ms;
}

.hero-enter--card {
  animation-delay: 110ms;
}

/* Slow-breathing ambient radial glow behind right-hand hero card */
@keyframes heroAmbientPulse {
  0% {
    opacity: 0.55;
    transform: scale3d(0.95, 0.95, 1);
  }
  100% {
    opacity: 0.95;
    transform: scale3d(1.06, 1.06, 1);
  }
}

.hero-ambient-glow {
  position: absolute;
  inset: -12% -8%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 48%,
    rgba(62, 88, 168, 0.22) 0%,
    rgba(78, 66, 148, 0.11) 40%,
    rgba(10, 10, 12, 0) 72%
  );
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  animation: heroAmbientPulse 7.5s ease-in-out infinite alternate;
}

/* Card Surfaces & Proximity Spotlight Borders */
.surface-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: border-color 180ms ease;
}

.recessed-surface {
  background-color: var(--bg-recessed);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.spotlight-card {
  --spot-x: -999px;
  --spot-y: -999px;
  --spot-opacity: 0;
  position: relative;
  overflow: hidden;
}

/* 1px metallic cursor-tracking radial border glow */
.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    320px circle at var(--spot-x) var(--spot-y),
    rgba(255, 255, 255, 0.34) 0%,
    rgba(182, 198, 236, 0.14) 38%,
    rgba(255, 255, 255, 0) 74%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: var(--spot-opacity, 0);
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: 2;
}

/* Very faint inner surface sheen */
.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--spot-x) var(--spot-y),
    rgba(255, 255, 255, 0.038) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  opacity: var(--spot-opacity, 0);
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card__content {
  position: relative;
  z-index: 3;
}

/* Scroll-Triggered Staggered Reveals (gracefully visible if JS fails) */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 480ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-motion [data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* 3D Hardware Card & Pointer-Tracking Specular Glare */
.hardware-stage {
  perspective: 1000px;
}

.hardware-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 0px;
  --my: 0px;
  --glare-opacity: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  transform: rotateX(var(--ry)) rotateY(var(--rx));
  will-change: transform;
  transition: border-color 180ms ease;
}

.hardware-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .hardware-card:hover {
    border-color: var(--border-card-hover);
  }
}

.hardware-card__glare {
  position: absolute;
  top: -280px;
  left: -280px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.095) 0%,
    rgba(255, 255, 255, 0.03) 34%,
    rgba(255, 255, 255, 0) 68%
  );
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  opacity: var(--glare-opacity, 0);
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 1;
}

.hardware-card__inner {
  position: relative;
  z-index: 3;
}

/* MacBook 16:10 Hardware Silhouette & Lit macOS Display */
.macbook-assembly {
  position: relative;
}

.macbook-assembly::before {
  content: "";
  position: absolute;
  inset: -8% 4% 2%;
  background: radial-gradient(
    ellipse 70% 60% at 50% 45%,
    rgba(88, 110, 168, 0.13) 0%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(18, 18, 22, 0) 76%
  );
  pointer-events: none;
  z-index: 0;
}

.macbook-lid-frame {
  position: relative;
  z-index: 1;
}

.macbook-lid {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 2px;
  border-radius: 14px 14px 3px 3px;
  background: linear-gradient(
    180deg,
    #9A9AA0 0%,
    #8E8E93 10%,
    #525257 52%,
    #2C2C2E 100%
  );
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.75);
}

.macbook-bezel {
  width: 100%;
  height: 100%;
  background-color: #050507;
  border-radius: 12px 12px 2px 2px;
  padding: 9px 7px 7px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .macbook-bezel {
    padding: 11px 9px 8px;
  }
}

.macbook-camera {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -5px;
  margin-bottom: 3px;
  height: 4px;
}

.macbook-camera__dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 35%, #3A4B6E 0%, #171922 65%, #0D0E12 100%);
  box-shadow: 0 0 0 0.75px rgba(255, 255, 255, 0.16);
}

/* Screen Base (Muted flat grey-dark when wallpaper fades out in Before mode) */
.macbook-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 4px 4px 1.5px 1.5px;
  background-color: #151518;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* GPU-composited After wallpaper glow layer */
.macbook-screen__wallpaper {
  position: absolute;
  inset: 0;
  background-color: #0E121B;
  background-image:
    radial-gradient(115% 95% at 16% 18%, rgba(66, 98, 162, 0.44) 0%, rgba(36, 54, 96, 0.2) 48%, rgba(14, 18, 27, 0) 82%),
    radial-gradient(105% 90% at 86% 85%, rgba(79, 70, 142, 0.38) 0%, rgba(40, 42, 78, 0.18) 52%, rgba(14, 18, 27, 0) 84%),
    linear-gradient(180deg, rgba(24, 32, 50, 0.4) 0%, rgba(11, 14, 22, 0.68) 100%);
  opacity: 1;
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: 1;
}

.macbook-screen.is-before .macbook-screen__wallpaper {
  opacity: 0;
}

/* Faint diagonal glass reflection sheen */
.macbook-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    122deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.022) 28%,
    rgba(255, 255, 255, 0) 48%
  );
  pointer-events: none;
  z-index: 2;
}

/* Translucent top macOS menu bar & Before / After toggle */
.macos-menubar {
  position: relative;
  z-index: 4;
  height: 23px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.065);
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

@media (min-width: 640px) {
  .macos-menubar {
    height: 26px;
  }
}

.screen-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-mode-btn {
  appearance: none;
  border: 0;
  border-radius: 9999px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  user-select: none;
}

@media (min-width: 640px) {
  .screen-mode-btn {
    padding: 2px 8px;
    font-size: 10.5px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .screen-mode-btn:not(.is-active):hover {
    color: var(--text-primary);
  }
}

.screen-mode-btn.is-active,
.screen-mode-btn[aria-pressed="true"] {
  background-color: var(--text-primary);
  color: var(--bg-canvas);
  font-weight: 600;
}

.macbook-screen__body {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Strictly 6px status indicator dot (Green in After, Subtle Amber in Before) */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--status-green);
  flex-shrink: 0;
  transition: background-color 180ms ease;
}

.status-dot.is-before {
  background-color: var(--status-amber);
}

.macbook-screen.is-before #year-note {
  color: var(--text-secondary);
}

/* Smooth 200ms opacity/transform crossfade on year or Before/After switch */
.year-live-content {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.year-live-content.is-updating {
  opacity: 0;
  transform: translate3d(0, 3px, 0);
}

/* Aluminium base chassis (~112% of lid width) + soft grounded shadow */
.macbook-base-wrap {
  position: relative;
  width: 112%;
  margin-left: -6%;
}

.macbook-shadow {
  height: 12px;
  margin-top: -3px;
  background: radial-gradient(
    ellipse 52% 100% at 50% 0%,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.42) 52%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

/* Segmented Year Selector Pills */
.year-selector {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 3px;
}

.year-pill {
  appearance: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .year-pill:not(.is-active):hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
  }
}

.year-pill.is-active,
.year-pill[aria-pressed="true"] {
  background-color: var(--text-primary);
  color: var(--bg-canvas);
  font-weight: 600;
}

/* Interactive "How it works" Vertical Hairline Timeline */
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-step {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.timeline-segment {
  position: relative;
  flex: 1;
  width: 1px;
  min-height: 16px;
  margin: 4px 0;
  background-color: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.timeline-segment::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 245, 247, 0.65) 0%, rgba(41, 151, 255, 0.35) 100%);
  opacity: 0;
  transform: scaleY(0.35);
  transform-origin: top;
  transition: opacity 220ms ease, transform 220ms ease;
}

.timeline-text {
  display: block;
  transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .timeline-step:hover .timeline-badge {
    border-color: rgba(245, 245, 247, 0.58);
    background-color: rgba(245, 245, 247, 0.11);
    color: #FFFFFF;
  }

  .timeline-step:hover .timeline-segment::after {
    opacity: 1;
    transform: scaleY(1);
  }

  .timeline-step:hover .timeline-text {
    color: var(--text-primary);
  }
}

/* Touch Device & Reduced Motion Fallbacks */
@media (hover: none), (pointer: coarse) {
  .hardware-card {
    transform: none !important;
    will-change: auto;
  }

  .hardware-card__glare,
  .spotlight-card::before,
  .spotlight-card::after {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-ambient-glow {
    animation: none !important;
    opacity: 0.65 !important;
    transform: none !important;
  }

  .js-motion [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hardware-card {
    transform: none !important;
    will-change: auto;
  }

  .hardware-card__glare,
  .spotlight-card::before,
  .spotlight-card::after {
    display: none !important;
  }

  .year-live-content,
  .year-live-content.is-updating {
    opacity: 1 !important;
    transform: none !important;
  }
}
