/* ==========================================================================
   DIGISCHOOL: the features page.

   Loaded on /features/ only, after lp.css (the shared heads, buttons, ticks
   and rise). Everything here is prefixed .ft-. Every picture on the page is
   a real capture of the application — see the note in features/index.php.
   ========================================================================== */

/* --- The chapters --------------------------------------------------------- */

.ft-scroll {
  padding-block: clamp(4rem, 9vw, 7rem);
  background: var(--ec-surface);
}

.ft-scroll__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }

.ft-scroll__steps { display: grid; gap: clamp(4rem, 10vw, 6rem); }

.ft-step { scroll-margin-top: var(--ec-space-6); }

.ft-step__shot { margin: 0 0 var(--ec-space-8); perspective: 1400px; }

.ft-step__shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--ec-bg);
  border: 1px solid var(--ec-border);
  border-radius: clamp(14px, 2vw, 22px);
  box-shadow: 0 30px 60px -30px rgb(6 32 46 / 35%);
}

/* On a narrow screen each chapter's picture is the phone capture, framed as
   a phone and leaning in 3D; it straightens as it rises into view. */
@media (max-width: 999.98px) {
  .ft-step__shot { display: flex; justify-content: center; }

  .ft-step__shot picture {
    width: min(78%, 320px);
    padding: 3.4%;
    background: var(--ec-chrome);
    border-radius: 13% / 6.2%;
    box-shadow: 0 30px 50px -24px rgb(6 32 46 / 50%);
    transform: rotateY(-10deg) rotateX(4deg);
  }

  .ft-step__shot img { border: 0; border-radius: 10.5% / 4.9%; box-shadow: none; }
}

.ft-step__ico {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-block-end: var(--ec-space-4);
  color: var(--ec-accent);
  background: var(--ec-accent-soft);
  border-radius: 15px;
}

.ft-step__ico--on { color: var(--ec-paper-0); background: rgb(255 255 255 / 14%); }

.ft-step__title {
  margin: 0 0 var(--ec-space-3);
  font-family: var(--ec-font-display);
  font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--ec-text);
}

.ft-step__body {
  max-width: 48ch;
  margin: 0 0 var(--ec-space-6);
  font-size: var(--ec-text-lg);
  line-height: 1.6;
  color: var(--ec-text-muted);
}

.ft-scroll__aside { display: none; }

/* Wide and scripted: the text column scrolls, the screen column sticks. */
@media (min-width: 1000px) {
  .ft-scroll.is-scrolly .ft-scroll__grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
  }

  .ft-scroll.is-scrolly .ft-scroll__steps { gap: 0; }

  .ft-scroll.is-scrolly .ft-step {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 82vh;
    opacity: 0.32;
    transition: opacity 0.5s ease;
  }

  .ft-scroll.is-scrolly .ft-step.is-on { opacity: 1; }
  .ft-scroll.is-scrolly .ft-step__shot { display: none; }

  .ft-scroll.is-scrolly .ft-scroll__aside {
    position: sticky;
    top: 5vh;
    display: grid;
    /* The screen (16:10, plus its bar) and the chapter row under it must fit
       the window, so on a short wide screen the width gives way. */
    width: 100%;
    max-width: calc((100svh - 13rem) * 1.6);
    justify-self: center;
    gap: var(--ec-space-5);
    order: 2;
  }
}

.ft-browser {
  overflow: hidden;
  background: var(--ec-chrome);
  border: 1px solid var(--ec-chrome-line);
  border-radius: 18px;
  box-shadow:
    0 2px 0 0 rgb(255 255 255 / 6%) inset,
    0 50px 90px -40px rgb(6 32 46 / 55%);
  transform: perspective(2000px) rotateY(-7deg) rotateX(3deg);
  transform-origin: 0 50%;
  transition: transform 0.8s var(--lp-ease);
}

.ft-browser:hover { transform: perspective(2000px) rotateY(0deg) rotateX(0deg); }

.ft-browser__bar {
  display: flex;
  gap: var(--ec-space-4);
  align-items: center;
  padding: 10px 14px;
}

.ft-browser__dots { display: inline-flex; gap: 6px; }

.ft-browser__dots i {
  width: 10px;
  height: 10px;
  background: rgb(255 255 255 / 18%);
  border-radius: 50%;
}

.ft-browser__url {
  flex: 1;
  max-width: 420px;
  padding: 5px 14px;
  overflow: hidden;
  font-size: var(--ec-label-md);
  color: rgb(255 255 255 / 55%);
  white-space: nowrap;
  text-overflow: ellipsis;
  background: rgb(255 255 255 / 7%);
  border-radius: var(--ec-radius-full);
}

.ft-browser__url b { font-weight: 500; color: rgb(255 255 255 / 85%); }

/* The captures sit stacked in one box. The current one is flat; the others
   wait turned away below it, and the one leaving turns away above — so a
   change of chapter reads as the screen flipping over, not a cut. */
.ft-browser__screen {
  position: relative;
  aspect-ratio: 1280 / 800;
  overflow: hidden;
  background: var(--ec-bg);
  perspective: 1600px;
}

.ft-browser__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transform: translateY(12%) rotateX(-16deg) scale(0.96);
  transform-origin: 50% 0;
  transition: opacity 0.5s ease, transform 0.8s var(--lp-ease);
}

.ft-browser__shot.is-on { opacity: 1; transform: none; }
.ft-browser__shot.is-past { transform: translateY(-10%) rotateX(14deg) scale(0.96); }

.ft-rail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ec-space-2);
}

.ft-rail__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--ec-space-4);
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-text-muted);
  text-decoration: none;
  background: var(--ec-bg);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-full);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.ft-rail__link:hover { color: var(--ec-text); border-color: var(--ec-accent); }

.ft-rail__link.is-on {
  color: var(--ec-accent-on);
  background: var(--ec-accent);
  border-color: var(--ec-accent);
}

.ft-rail__link:focus-visible { outline: 2px solid var(--ec-focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ft-browser,
  .ft-browser__shot,
  .ft-scroll.is-scrolly .ft-step { transition: none; }
}

/* --- GCE -------------------------------------------------------------------- */

.ft-gce-wrap { padding-block: clamp(4rem, 9vw, 6.5rem); }

.ft-gce {
  display: grid;
  gap: var(--ec-space-5);
  align-items: center;
  padding: var(--ec-space-3);
  color: var(--ec-paper-0);
  background: linear-gradient(170deg, var(--ec-primary-600), var(--ec-primary-800));
  border-radius: clamp(24px, 3vw, 36px);
}

[data-theme='dark'] .ft-gce { background: linear-gradient(170deg, var(--ec-primary-900), var(--ec-chrome-2)); }

@media (min-width: 860px) {
  .ft-gce { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
}

.ft-gce__img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: clamp(18px, 2.6vw, 28px);
}

.ft-gce__copy { padding: var(--ec-space-4) clamp(1rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem); }

.ft-gce__title {
  margin: 0 0 var(--ec-space-3);
  font-family: var(--ec-font-display);
  font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ec-paper-0);
}

.ft-gce__body {
  max-width: 46ch;
  margin: 0 0 var(--ec-space-8);
  font-size: var(--ec-text-lg);
  line-height: 1.6;
  color: color-mix(in srgb, var(--ec-paper-0) 88%, transparent);
}

@media print {
  .ft-scroll__aside { display: none; }
  .ft-gce { color: black; background: none; border: 1px solid var(--ec-border); }
}
