/* ============================================================
   The First Descendant (HDR10+ Gaming) — page-specific styles
   Builds on css/case-study.css. Classes are prefixed .fd-.
   Spectrum accent is a plain CSS gradient (no brand assets).
   ============================================================ */

.fd-page {
  --cs-gradient: linear-gradient(90deg, #ff2d55 0%, #ff8a00 25%, #ffd400 50%, #7ed957 75%, #1fc8b4 100%);
  --cs-accent: #ff8a00;
  --fd-spectrum: var(--cs-gradient);
}

/* ------ Hero ------ */
.fd-hero h1.large { white-space: normal; overflow-wrap: break-word; }
.fd-spectrum {
  width: min(42rem, 100%);
  height: 3px;
  margin: 2.4rem 0 2rem;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.fd-spectrum span {
  display: block;
  height: 100%;
  background: var(--fd-spectrum);
  transform-origin: left center;
}
.fd-hero-media .cs-media__frame {
  box-shadow: 0 40px 90px -50px rgba(255, 45, 85, 0.5), 0 30px 80px -50px rgba(31, 200, 180, 0.45);
}

/* ------ Intro copy beside manifests ------ */
.fd-intro { max-width: 48rem; margin-top: 2rem; }
@media only screen and (min-width: 1200px) { .fd-intro { margin-top: 5.4rem; } }

/* ------ World's first ------ */
.fd-facts { margin-top: 3rem; }
.fd-source {
  margin-top: 2.4rem;
  color: var(--t-medium);
  font: normal 600 1.2rem/1.5 var(--_font-accent);
  text-transform: uppercase;
}
.fd-source a {
  color: var(--t-bright);
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}
.fd-source a:hover { color: var(--cs-accent); }

/* ------ Modules ------ */
.fd-modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0; padding: 0;
  list-style: none;
}
@media only screen and (min-width: 768px) { .fd-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media only screen and (min-width: 1200px) { .fd-modules { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fd-module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 16rem;
  padding: 2.2rem;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: var(--base-tint);
  overflow: hidden;
}
.fd-module::before {          /* spectrum edge, grows in with --fd-edge */
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: var(--fd-spectrum);
  transform-origin: left center;
  transform: scaleX(var(--fd-edge, 1));
}
.fd-module__num {
  color: var(--t-medium);
  font: normal 600 1.2rem/1 var(--_font-accent);
}
.fd-module__name {
  margin-top: auto;
  color: var(--t-bright);
  font: normal 600 2rem/1.2 var(--_font-default);
  letter-spacing: -0.04rem;
}
.fd-module__desc {
  color: var(--t-medium);
  font: normal 400 1.5rem/1.45 var(--_font-default);
}

/* ------ Benefits (7 cards: 4 + 3 on desktop) ------ */
.fd-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 0; padding: 0;
  list-style: none;
}
@media only screen and (min-width: 768px) { .fd-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media only screen and (min-width: 1200px) { .fd-benefits { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fd-benefit {
  position: relative;
  padding: 2.4rem;
  border-radius: var(--cs-radius);
  background: var(--base-tint);
  isolation: isolate;
}
.fd-benefit::before {         /* 1px gradient border via mask */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: var(--fd-spectrum);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.55;
  transition: opacity 0.4s ease;
}
.fd-benefit:hover::before { opacity: 1; }
.fd-benefit__title {
  margin: 0 0 1rem;
  color: var(--t-bright);
  font: normal 600 2rem/1.25 var(--_font-default);
  letter-spacing: -0.04rem;
}
.fd-benefit__text {
  margin: 0;
  color: var(--t-medium);
  font: normal 400 1.5rem/1.5 var(--_font-default);
}

/* ------ Device switcher ------ */
.fd-devices__tabs {
  display: inline-flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
  padding: 0.4rem;
  border: 1px solid var(--cs-line);
  border-radius: 99px;
  background: var(--base-tint);
}
.fd-devices__tab {
  min-height: 4.4rem;
  padding: 0 2rem;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--t-medium);
  font: normal 600 1.3rem/1 var(--_font-accent);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.fd-devices__tab:hover { color: var(--t-bright); }
.fd-devices__tab[aria-selected="true"] { background: var(--t-bright); color: var(--base); }
.fd-devices__tab:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
.fd-devices__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30rem;
  padding: 2.4rem;
  border-radius: var(--cs-radius);
  background: #0b0b0b;
}
@media only screen and (max-width: 767px) {
  .fd-devices__stage { min-height: 0; padding: 1.2rem; }
}
.fd-devices__panel[hidden] { display: none; }
.fd-devices__panel { width: 100%; animation: fd-panel-in 0.45s var(--cs-ease); }
.fd-devices__panel:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 4px; }
.fd-devices__panel img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 1.2rem;
}
.fd-devices__panel--scroll {
  max-height: min(78vh, 90rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 1.2rem;
  scrollbar-width: thin;
}
.fd-devices__panel--tablet { max-width: 72rem; margin: 0 auto; }
.fd-devices__panel--mobile { max-width: 32rem; margin: 0 auto; }
.fd-devices__panel--tablet img { max-width: 72rem; }
.fd-devices__panel--mobile img { max-width: 30rem; border-radius: 2.4rem; }
@keyframes fd-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------ Full-page screenshot: pans on scroll; scrollable without motion ------ */
.fd-longpage {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0b0b0b;
}
.fd-longpage img { display: block; width: 100%; height: auto; }
.fd-longpage.is-panning { overflow: hidden; }
.fd-longpage.is-panning img { will-change: transform; }
.fd-longpage:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 4px; }
.fd-longpage-note { align-self: center; }
@media only screen and (max-width: 1199px) { .fd-longpage-note { display: none; } }

/* ------ Phones row ------ */
.fd-phones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.4rem;
  margin: 0; padding: 0;
  list-style: none;
}
@media only screen and (min-width: 768px) { .fd-phones { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fd-phones li { max-width: 36rem; width: 100%; justify-self: center; }
.fd-phone { border-radius: 2.4rem; }

/* ------ Previous project link ------ */
.fd-prev { display: flex; margin-bottom: 4rem; }
.fd-prev__link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 1.8rem;
  border-left: 2px solid transparent;
  border-image: var(--fd-spectrum) 1;
}
.fd-prev__label {
  color: var(--t-medium);
  font: normal 600 1.2rem/1.4 var(--_font-accent);
  text-transform: uppercase;
}
.fd-prev__name {
  color: var(--t-bright);
  font: normal 600 2.8rem/1.1 var(--_font-default);
  letter-spacing: -0.06rem;
  transition: color 0.3s ease;
}
.fd-prev__link:hover .fd-prev__name { color: var(--cs-accent); }

/* ------ Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  .fd-devices__panel { animation: none; }
  .fd-benefit::before { transition: none; }
}

/* ------ Hero decoration: targeting reticle and spectrum shards ------ */
.fd-hero { position: relative; overflow: hidden; }
.fd-hero > .mxd-container { position: relative; z-index: 1; }
.fd-hud { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fd-reticle {
  position: absolute; top: 10%; right: 7%;
  width: 24rem; height: 24rem;
  animation: fd-breathe 6s ease-in-out infinite;
}
.fd-reticle i { position: absolute; width: 3.6rem; height: 3.6rem; border: 2px solid rgba(255, 255, 255, 0.35); }
.fd-reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.fd-reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.fd-reticle i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.fd-reticle i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.fd-reticle::before, .fd-reticle::after {   /* crosshair */
  content: ""; position: absolute; left: 50%; top: 50%;
  background: var(--fd-spectrum);
}
.fd-reticle::before { width: 4rem; height: 1px; margin: 0 0 0 -2rem; }
.fd-reticle::after  { width: 1px; height: 4rem; margin: -2rem 0 0 0; background: rgba(255, 255, 255, 0.5); }
.fd-shard {
  position: absolute; display: block;
  background: var(--fd-spectrum);
  clip-path: polygon(50% 0, 100% 100%, 0 78%);
  opacity: 0.5; filter: blur(0.5px);
}
.fd-shard--a { top: 30%; right: 26%; width: 7rem; height: 9rem; transform: rotate(18deg); }
.fd-shard--b { top: 6%;  right: 34%; width: 3.6rem; height: 4.6rem; transform: rotate(-24deg); opacity: 0.4; }
.fd-shard--c { top: 44%; right: 4%;  width: 4.4rem; height: 5.4rem; transform: rotate(140deg); opacity: 0.35; }
@keyframes fd-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media only screen and (max-width: 767px) {
  .fd-reticle { width: 14rem; height: 14rem; right: -2rem; }
  .fd-reticle i { width: 2.4rem; height: 2.4rem; }
  .fd-shard--b, .fd-shard--c { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fd-reticle { animation: none; } }
