/* Project landings (projects/<name>/index.html).
   Loaded after ../../styles.css, whose palette, fonts, buttons and reveal effect they reuse.
   The parts here are generic, so the next project's landing starts from them:
     .pl-hero        title, lead, actions and a large framed media under them
     .pl-frame       a window around a screenshot or a screencast (.pl-frame--browser adds an address bar)
     .pl-split       text and media side by side (.pl-split--flip puts the media first)
     .pl-stage       a wide media with its text above it
     .pl-overlap     one media with a second, smaller one over its corner
     .pl-pair        two media side by side, each with its caption
     .pl-flow        a concept animation: boxes joined by arrows, a pulse travelling along them
     .pl-facts       a grid of short facts
     .pl-install     install commands and links
   Motion stops under prefers-reduced-motion (end of this file). */

.pl-nav-current {
  color: var(--white);
}

.pl-section {
  margin: 0 0 120px;
}

.pl-section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  margin: 8px 0 16px;
}

.pl-section p {
  color: var(--gray-200);
}

.pl-kbd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  white-space: nowrap;
}

/* ---- hero */
.pl-hero {
  text-align: center;
  padding: 24px 0 0;
  margin: 0 0 120px;
}

.pl-hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  margin: 0 auto 20px;
  display: block;
}

.pl-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1.05;
  margin: 8px auto 20px;
  max-width: 19ch;
}

.pl-hero .lead {
  max-width: 62ch;
  margin: 0 auto;
}

.pl-hero .hero-actions {
  justify-content: center;
  margin: 28px 0 0;
}

.pl-hero-note {
  margin: 16px 0 48px;
  font-size: 0.85rem;
  color: var(--gray-300);
}

/* ---- frames around screenshots and screencasts */
.pl-frame {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--navy-800);
  box-shadow: 0 30px 80px rgba(3, 7, 20, 0.55);
}

.pl-frame img,
.pl-frame video {
  display: block;
  width: 100%;
  height: auto;
}

.pl-frame figcaption,
.pl-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--gray-300);
  background: rgba(8, 13, 30, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pl-frame--browser .hv-bar {
  padding: 10px 14px;
}

.pl-glow {
  position: relative;
}

.pl-glow::before {
  content: "";
  position: absolute;
  inset: 8% 6% -6%;
  background: radial-gradient(closest-side, rgba(110, 134, 185, 0.45), transparent);
  filter: blur(40px);
  z-index: -1;
}

/* ---- layouts */
.pl-split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: center;
}

.pl-split--flip {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.pl-split--flip > :first-child {
  order: 2;
}

.pl-stage-head {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}

.pl-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.pl-steps li {
  padding: 18px 20px;
  border-radius: var(--radius-m);
  background: rgba(15, 25, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gray-200);
  font-size: 0.95rem;
}

.pl-steps li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--navy-900);
  font-weight: 600;
  font-size: 0.8rem;
}

.pl-overlap {
  position: relative;
  padding: 0 0 70px 0;
}

.pl-overlap-small {
  position: absolute;
  width: 52%;
  left: -6%;
  bottom: 0;
  transition: transform 0.4s ease;
}

.pl-overlap-small:hover {
  transform: translateY(-6px);
}

.pl-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}

.pl-pair .pl-frame {
  transition: transform 0.4s ease;
}

.pl-pair .pl-frame:hover {
  transform: translateY(-6px);
}

.pl-points {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 12px;
}

.pl-points li {
  padding-left: 26px;
  position: relative;
  color: var(--gray-200);
}

.pl-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent-soft);
  transform: rotate(45deg);
}

/* ---- concept animation: boxes and arrows */
.pl-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1.3fr) 56px minmax(0, 0.9fr);
  align-items: stretch;
  gap: 0;
}

.pl-flow-box {
  border-radius: var(--radius-m);
  background: rgba(10, 18, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pl-flow-box h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
}

.pl-flow-box h3 span {
  color: var(--gray-500);
  letter-spacing: 0.05em;
  text-transform: none;
}

.pl-flow-box pre {
  margin: 0;
  padding: 16px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--gray-200);
  white-space: pre;
  overflow-x: auto;
  flex: 1;
}

.pl-flow-box .t {
  color: var(--accent-soft);
}

.pl-flow-box .v {
  color: #e6edf8;
  font-weight: 600;
}

.pl-flow-line {
  display: block;
  margin: 0 -16px;
  padding: 0 16px;
  border-left: 2px solid transparent;
}

.pl-flow-arrow {
  position: relative;
  align-self: center;
  height: 2px;
  margin: 0 8px;
  background: linear-gradient(90deg, rgba(169, 183, 208, 0.15), rgba(169, 183, 208, 0.6));
}

.pl-flow-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -5px;
  border: 6px solid transparent;
  border-left: 8px solid rgba(169, 183, 208, 0.7);
  border-right: 0;
}

.pl-flow-arrow i {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 12px rgba(169, 183, 208, 0.9);
  opacity: 0;
}

/* One cycle of 9 s: the model's fields light up, a pulse goes to the template, its loop lights up,
   a pulse goes to the code, and the code appears line by line. */
.pl-flow.is-playing .pl-flow-line.hl-model {
  animation: pl-hl-model 9s ease-in-out infinite;
}

.pl-flow.is-playing .pl-flow-line.hl-tpl {
  animation: pl-hl-tpl 9s ease-in-out infinite;
}

.pl-flow.is-playing .pl-flow-arrow.a1 i {
  animation: pl-pulse-1 9s ease-in-out infinite;
}

.pl-flow.is-playing .pl-flow-arrow.a2 i {
  animation: pl-pulse-2 9s ease-in-out infinite;
}

.pl-flow.is-playing .pl-flow-line.out {
  animation: pl-out 9s ease-in-out infinite;
  animation-delay: calc(var(--n, 0) * 0.25s);
}

@keyframes pl-hl-model {
  0%, 6%, 34%, 100% { background: transparent; border-left-color: transparent; }
  10%, 30% { background: rgba(169, 183, 208, 0.14); border-left-color: var(--accent-soft); }
}

@keyframes pl-hl-tpl {
  0%, 40%, 66%, 100% { background: transparent; border-left-color: transparent; }
  44%, 62% { background: rgba(169, 183, 208, 0.14); border-left-color: var(--accent-soft); }
}

@keyframes pl-pulse-1 {
  0%, 26% { left: 0; opacity: 0; }
  28% { opacity: 1; }
  38% { left: calc(100% - 10px); opacity: 1; }
  41%, 100% { left: calc(100% - 10px); opacity: 0; }
}

@keyframes pl-pulse-2 {
  0%, 60% { left: 0; opacity: 0; }
  62% { opacity: 1; }
  72% { left: calc(100% - 10px); opacity: 1; }
  75%, 100% { left: calc(100% - 10px); opacity: 0; }
}

@keyframes pl-out {
  0%, 72% { opacity: 0.12; }
  76%, 95% { opacity: 1; }
  100% { opacity: 0.12; }
}

.pl-flow-legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 0 56px;
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--gray-300);
}

.pl-flow-legend p {
  margin: 0;
}

/* the agents diagram uses the same arrows, in a smaller row */
.pl-flow--agents {
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr) 48px minmax(0, 1fr);
  margin: 26px 0 0;
}

.pl-flow--agents .pl-flow-box {
  padding: 14px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-200);
}

.pl-flow--agents .pl-flow-box strong {
  display: block;
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 2px;
}

.pl-flow--agents.is-playing .pl-flow-arrow.a1 i {
  animation: pl-pulse-a 3s ease-in-out infinite;
}

.pl-flow--agents.is-playing .pl-flow-arrow.a2 i {
  animation: pl-pulse-a 3s ease-in-out 0.9s infinite;
}

@keyframes pl-pulse-a {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  45% { left: calc(100% - 10px); opacity: 1; }
  55%, 100% { left: calc(100% - 10px); opacity: 0; }
}

/* ---- facts and install */
.pl-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pl-fact {
  padding: 26px;
  border-radius: var(--radius-m);
  background: rgba(15, 25, 48, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.pl-fact:hover {
  transform: translateY(-4px);
  border-color: rgba(169, 183, 208, 0.3);
}

.pl-fact h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.pl-fact p {
  margin: 0;
}

.pl-fact a {
  color: var(--accent-soft);
}

.pl-install {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 32px;
}

.pl-install-card {
  padding: 22px;
  border-radius: var(--radius-m);
  background: rgba(10, 18, 35, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pl-install-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.pl-install-card p {
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.pl-install-card pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(3, 7, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--gray-100);
  white-space: pre-wrap;
  word-break: break-all;
}

.pl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- small screens */
@media (max-width: 980px) {
  .pl-split,
  .pl-split--flip,
  .pl-pair,
  .pl-facts,
  .pl-install,
  .pl-steps {
    grid-template-columns: 1fr;
  }

  .pl-split--flip > :first-child {
    order: 0;
  }

  .pl-flow,
  .pl-flow--agents {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pl-flow-arrow {
    width: 2px;
    height: 36px;
    margin: 6px auto;
    background: linear-gradient(180deg, rgba(169, 183, 208, 0.15), rgba(169, 183, 208, 0.6));
  }

  .pl-flow-arrow::after {
    right: -5px;
    top: auto;
    bottom: -2px;
    border: 6px solid transparent;
    border-top: 8px solid rgba(169, 183, 208, 0.7);
    border-bottom: 0;
  }

  .pl-flow-arrow i {
    display: none;
  }

  .pl-flow-legend {
    display: none;
  }

  .pl-overlap {
    padding: 0;
  }

  .pl-overlap-small {
    position: static;
    width: 100%;
    margin: 18px 0 0;
  }

  .pl-section {
    margin-bottom: 88px;
  }
}

/* ---- reduced motion: everything shown at once, nothing moves */
@media (prefers-reduced-motion: reduce) {
  .pl-flow-line.out {
    opacity: 1;
  }

  .pl-flow-arrow i {
    display: none;
  }
}

/* ---- pause buttons on screencasts and concept animations (added by script.js) */
.pl-frame,
.pl-flow-wrap {
  position: relative;
}

.pl-frame .motion-toggle {
  right: 12px;
  top: 12px;
}

.pl-frame--browser .motion-toggle {
  top: 50px;
}

.pl-flow-wrap .motion-toggle {
  right: 0;
  top: -44px;
}

/* ---- a gallery of screenshots, each with a title and a line of text */
.pl-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pl-gallery-item {
  margin: 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: rgba(10, 18, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.pl-gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(169, 183, 208, 0.3);
}

.pl-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.pl-gallery-item figcaption {
  padding: 14px 16px 16px;
  color: var(--gray-200);
  font-size: 0.92rem;
}

.pl-gallery-item figcaption strong {
  display: block;
  color: var(--white);
  margin-bottom: 2px;
}

/* ---- a small Turbo Vision screen drawn in HTML: menu bar, desktop, a menu that opens, status line.
   It shows what a few lines of code make, the same in a terminal and in a browser. */
.pl-flow--app {
  grid-template-columns: minmax(0, 1.1fr) 56px minmax(0, 1fr);
}

.pl-screens {
  display: grid;
  gap: 18px;
}

.pl-screen {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-card);
  background: #11131c;
}

.pl-screen-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #1b2440;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--gray-300);
}

.pl-screen-top em {
  font-style: normal;
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.pl-tv {
  position: relative;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #000;
}

.pl-tv-menu,
.pl-tv-status {
  background: #aaaaaa;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
}

.pl-tv-menu b,
.pl-tv-status b {
  color: #aa0000;
  font-weight: 400;
}

.pl-tv-desk {
  height: 96px;
  background-color: #8a8ab8;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 80, 0.18) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 4px);
}

.pl-tv-drop {
  position: absolute;
  left: 4px;
  top: 1.5em;
  padding: 3px 0;
  background: #aaaaaa;
  border: 1px solid #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform-origin: top left;
  transform: scaleY(0.6);
}

.pl-tv-drop span {
  display: block;
  padding: 0 12px;
  white-space: nowrap;
}

.pl-tv-drop i {
  font-style: normal;
  margin-left: 24px;
}

.pl-tv-file {
  padding: 0 4px;
}

.pl-flow--app.is-playing .pl-tv-drop {
  animation: pl-tv-drop 6s ease infinite;
}

.pl-flow--app.is-playing .pl-tv-file {
  animation: pl-tv-file 6s ease infinite;
}

.pl-flow--app.is-playing .pl-tv-drop span {
  animation: pl-tv-item 6s ease infinite;
}

.pl-flow--app.is-playing .pl-flow-arrow.a1 i {
  animation: pl-pulse-a 6s ease-in-out infinite;
}

@keyframes pl-tv-drop {
  0%, 30% { opacity: 0; transform: scaleY(0.6); }
  36%, 78% { opacity: 1; transform: scaleY(1); }
  84%, 100% { opacity: 0; transform: scaleY(0.6); }
}

@keyframes pl-tv-file {
  0%, 28%, 82%, 100% { background: transparent; color: inherit; }
  32%, 78% { background: #00aa00; color: #000; }
}

@keyframes pl-tv-item {
  0%, 48%, 100% { background: transparent; }
  52%, 78% { background: #00aa00; }
}

@media (max-width: 980px) {
  .pl-gallery {
    grid-template-columns: 1fr;
  }

  .pl-flow--app {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .pl-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-tv-drop {
    opacity: 1;
    transform: none;
  }
}

.pl-flow-legend--app {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0 56px;
}
