/* Landing page for the EnliteAI grid demos.
   Palette, typography and panel treatment are taken verbatim from the demos themselves
   (l2rpn-assistant / grid-day-ahead-planner tailwind.config.js, maze-flex-demo styles.css)
   so this page reads as their shared front door. */

:root {
  --ink: #18231d;
  --muted: #66736b;
  --line: #dce4dc;
  --paper: #f7f9f6;
  --panel: #fff;
  --green: #17845d;
  --lime: #b7e46d;
  --orange: #f59e0b;
  --red: #e85445;
  --navy: #173e37;

  --shadow-card: 0 1px 1px #173e3705;
  --shadow-elevated: 0 5px 16px #2643341a;
  --shadow-lift: 0 18px 40px -18px #17383029, 0 2px 6px #17383014;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* A faint engineering grid, faded out towards the edges so it never competes with the cards.
   Fixed rather than scrolled: the page is one screen on most displays anyway. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, #17383008 1px, transparent 1px),
    linear-gradient(to bottom, #17383008 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 80% at 50% 12%, #000 0%, #0009 45%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 12%, #000 0%, #0009 45%, transparent 78%);
}

/* A single soft lime bloom behind the headline, the one non-flat element on the page. */
.backdrop::after {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, #b7e46d33, #b7e46d00 72%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 32px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- intro ---------- */

.intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}

.logo img {
  height: 76px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.eyebrow {
  margin: 18px 0 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #66736bcc;
}

h1 {
  margin: 12px 0 0;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.accent {
  color: var(--green);
}

.lede {
  margin: 20px auto 0;
  max-width: 40rem;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- the three demos ---------- */

.demos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease,
    border-color 260ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: #17845d59;
  box-shadow: var(--shadow-lift);
  outline: none;
}

.card:focus-visible {
  border-color: var(--green);
}

/* The figure sits on the paper tone so the white body below reads as the card proper. */
.figure {
  padding: 26px 22px 6px;
  background:
    linear-gradient(180deg, #f7f9f6 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.index {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #66736b99;
  font-variant-numeric: tabular-nums;
}

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f59e0b1f;
  color: #b06f05;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.card h2 {
  margin: 10px 0 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.desc {
  margin: 10px 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* Pushed to the bottom of the body so the three call-to-action rows sit on one line across the
   cards, whatever a title or description wraps to. */
.go {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.go .arrow {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .go .arrow,
.card:focus-visible .go .arrow {
  transform: translateX(5px);
}

/* Not hosted yet: kept visually level with the others, but its call to action stays neutral. */
.is-stub .go {
  color: var(--muted);
}

.is-stub:hover .go .arrow {
  transform: none;
}

/* ---------- figures ---------- */

svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 01 — remedial action assistant */
.grid-lines path {
  stroke: var(--line);
  stroke-width: 2;
}

.congested {
  stroke: var(--red);
  stroke-width: 2.6;
  stroke-dasharray: 7 7;
  animation: flow 1.6s linear infinite;
}

.fan path {
  stroke: #17845d59;
  stroke-width: 1.6;
  stroke-dasharray: 3 5;
}

.nodes circle {
  fill: var(--panel);
  stroke: #66736b80;
  stroke-width: 2;
}

.leaves circle {
  fill: var(--panel);
  stroke: var(--green);
  stroke-width: 2;
}

.leaves .chosen {
  fill: var(--lime);
  stroke: var(--navy);
  stroke-width: 2.4;
}

.pivot {
  fill: var(--navy);
  stroke: #b7e46d;
  stroke-width: 2.4;
}

/* 02 — day-ahead planner */
.axis path {
  stroke: var(--line);
  stroke-width: 2;
}

.ticks path {
  stroke: var(--line);
  stroke-width: 1.6;
}

.area {
  fill: #17845d14;
  stroke: none;
}

.curve-cost {
  stroke: var(--green);
  stroke-width: 2.6;
}

.curve-switch {
  stroke: var(--navy);
  stroke-width: 2.6;
  stroke-dasharray: 5 5;
}

.dial path {
  stroke: #173e3733;
  stroke-width: 1.6;
}

.dial circle {
  fill: var(--lime);
  stroke: var(--navy);
  stroke-width: 2.4;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .dial circle {
  transform: translateY(-22px);
}

.alpha {
  fill: var(--navy);
  stroke: none;
  font-size: 15px;
  font-weight: 800;
  font-style: italic;
}

/* 03 — maze-flex */
.band rect {
  fill: #17845d0f;
  stroke: none;
}

.band path {
  stroke: #17845d4d;
  stroke-width: 1.6;
  stroke-dasharray: 4 4;
}

/* The same path as .trace-raw, with pathLength=100 making the dash values percentages of its
   length: the red run covers exactly the stretch that is above the band (34.2 % to 58.7 %), so the
   bold line rides the curve instead of approximating it. */
.violation {
  stroke: var(--red);
  stroke-width: 2.8;
  stroke-dasharray: 24.55 100;
  stroke-dashoffset: -34.16;
}

.trace-raw {
  stroke: #e854457a;
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.trace-held {
  stroke: var(--green);
  stroke-width: 2.6;
}

.feeder path {
  stroke: var(--line);
  stroke-width: 2;
}

.setpoints circle {
  fill: var(--lime);
  stroke: var(--navy);
  stroke-width: 2.2;
}

@keyframes flow {
  to {
    stroke-dashoffset: -28;
  }
}

/* ---------- footer ---------- */

.foot {
  margin-top: auto;
  padding-top: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: #66736bb3;
}

.foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot a:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.foot .dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
}

/* ---------- narrow screens ---------- */

@media (max-width: 940px) {
  .demos {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .shell {
    padding: 48px 20px 32px;
  }

  .intro {
    margin-bottom: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
