/* =========================
   PROJECT PAGE
========================= */

.p-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding-bottom: 2px;
  margin-bottom: 1.6rem;
  color: var(--ink-dim);
  position: relative;
  width: fit-content;
}

.p-back::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink-dim);
  transition: width 0.3s var(--ease);
}

.p-back:hover { color: var(--ink); }
.p-back:hover::after { width: 100%; }

.p-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--gutter) 3rem;
  border-bottom: 1px solid var(--line-strong);
}

.p-hero__index { display: block; margin-bottom: 1.4rem; }

.p-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.p-hero__title .line { display: block; }

.p-hero__repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--accent);
  position: relative;
  width: fit-content;
  font-size: 0.85rem;
}

.p-hero__repo-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.p-hero__repo-link:hover::after { width: 100%; }

.p-hero__subtitle {
  margin-top: 1.6rem;
  max-width: 480px;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.p-section {
  max-width: 760px;
  padding: 6rem var(--gutter) 0;
  margin: 0 auto;
}

.p-section:last-of-type { padding-bottom: 6rem; }

.p-overview p {
  color: var(--ink-dim);
  font-size: 1.05rem;
  margin-bottom: 1.3rem;
  max-width: 640px;
}

.p-features, .p-process {
  list-style: none;
}

.p-features li, .p-process li {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.p-features li:last-child, .p-process li:last-child {
  border-bottom: 1px solid var(--line);
}

.p-features li span:first-child,
.p-process li span:first-child {
  color: var(--accent);
  min-width: 1.6rem;
}

.p-release {
  border-top: 1px solid var(--line-strong);
}

.p-release__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.p-release__version {
  color: var(--accent);
}

.p-release__lede {
  max-width: 640px;
  padding: 1.5rem 0;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.p-release__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
}

.p-release__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}

.p-release__list li:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.p-release__list li:nth-child(even) {
  padding-left: 1rem;
}

.p-release__list li > .mono {
  flex: none;
  color: var(--accent);
}

.p-release__link {
  display: inline-block;
  margin-top: 1.5rem;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.p-release__link:hover {
  color: var(--accent);
}

.p-explore {
  padding: 8rem var(--gutter);
  border-top: 1px solid var(--line-strong);
  text-align: center;
}

.p-explore__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.p-explore__link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}

.p-explore__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.p-explore__link:hover::after { transform: scaleX(1); }

.p-ending {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter) 6rem;
  text-align: center;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.p-section--wide { max-width: 820px; }

.nw-cli-intro {
  max-width: 620px;
  margin: 0 0 2rem;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.nw-cli-rail {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 0 1.4rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.nw-cli-rail.is-dragging { cursor: grabbing; }
.nw-cli-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.nw-cli-card img { pointer-events: none; -webkit-user-drag: none; }
.nw-cli-copy { pointer-events: none; }

.nw-cli-track {
  position: relative;
  display: flex;
  width: max-content;
  gap: 1.5rem;
  padding: 0 1.5rem 1rem;
  will-change: transform;
}

.nw-cli-card {
  --arc-y: 20px;
  --arc-scale: 0.88;
  flex: 0 0 240px;
  min-height: 285px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: rgba(12, 12, 14, 0.88);
  transform: translateY(var(--arc-y));
  transform-origin: center bottom;
  opacity: 1;
  border-top: 2px solid var(--accent);
}

.nw-cli-card.is-centered { border-color: var(--accent); }

.nw-cli-card__logo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 2.6rem;
  border: 1px solid var(--line-strong);
  background: #111114;
}

.nw-cli-card__logo img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.nw-cli-card__logo--mono img { filter: brightness(0) invert(1); }

.nw-cli-card > .mono {
  color: var(--accent);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.nw-cli-card h3 {
  margin: 0.45rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.nw-cli-card p {
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.55;
}

.nw-cli-progress {
  position: sticky;
  left: 0;
  width: 100%;
  height: 1px;
  margin-top: 1.8rem;
  background: var(--line);
}

.nw-cli-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--cli-progress, 0));
  transform-origin: left;
}

.nw-cli-hint {
  margin-top: 0.8rem;
  color: var(--ink-faint);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-align: right;
}

.nw-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.nw-flow li {
  min-height: 230px;
  padding: 1.2rem 1rem;
  border-right: 1px solid var(--line);
}

.nw-flow li:last-child { border-right: 0; }

.nw-flow .mono {
  display: block;
  margin-bottom: 2.4rem;
  color: var(--accent);
}

.nw-flow strong {
  display: block;
  margin-bottom: 0.8rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.nw-flow p {
  color: var(--ink-dim);
  font-size: 0.82rem;
  line-height: 1.55;
}

.p-terminal {
  border: 1px solid var(--line-strong);
  background: #0c0c0e;
  overflow: hidden;
}

.p-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line-strong);
}

.p-terminal__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.p-terminal__path {
  margin-left: 0.6rem;
  color: var(--ink-faint);
}

.p-terminal__body {
  padding: 1.4rem 1.2rem 1.6rem;
  min-height: 460px;
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--ink-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.p-terminal__body .caret {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: caret-blink 1s step-end infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.p-terminal__body .out { color: var(--ink); }
.p-terminal__body .ok { color: var(--accent); }

@media (max-width: 640px) {
  .p-terminal__body { font-size: 0.74rem; min-height: 520px; }
  .p-hero { padding-top: 6rem; }
  .p-section { padding-top: 4rem; }
  .p-release__list { grid-template-columns: 1fr; }
  .p-release__list li:nth-child(odd) { border-right: 0; }
  .p-release__list li:nth-child(even) { padding-left: 0; }
  .nw-flow { grid-template-columns: 1fr; }
  .nw-flow li { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .nw-flow li:last-child { border-bottom: 0; }
  .nw-flow .mono { margin-bottom: 1rem; }
  .nw-cli-card { flex-basis: min(240px, 72vw); }
}

.nw-connections { max-width: 1180px; }
.nw-cli-rail.is-static .nw-cli-track { width: 100%; flex-wrap: wrap; will-change: auto; }
.nw-cli-rail.is-static .nw-cli-card { flex: 1 1 240px; transform: none; }
.nw-cli-rail.is-static .nw-cli-copy { display: none; }
.nw-cli-rail.is-static { cursor: auto; user-select: auto; }
.nw-cli-rail.is-static + .nw-cli-hint { display: none; }

@media (prefers-reduced-motion: reduce) {
  .nw-cli-card { transition: none; }
}

/* =========================
   GELATO STOCK — faithful recreation of the real app UI
   Colors/typography sampled directly from the live product
   (getComputedStyle against the running instance), not guessed.
========================= */

.gs-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.gs-hero-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.gs-view-live {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  animation: gs-live-pulse 2.4s infinite;
}

.gs-view-live:hover {
  background: #ffc270;
  transform: translateY(-1px);
}

@keyframes gs-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,171,64,0.45); }
  70% { box-shadow: 0 0 0 10px rgba(255,171,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,171,64,0); }
}

.gs-view-source {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.gs-view-source:hover {
  background: var(--accent);
  color: #0a0a0a;
}

.gs-view-source .status-dot { background: currentColor; }

.gs-caption {
  margin-top: 1rem;
  color: var(--ink-faint);
  text-align: center;
}

.gs-app {
  --real-bg: #101214;
  --real-surface: #171a1d;
  --real-border: #2d3339;
  --real-text: #f0f2f4;
  --real-muted: #a7afb7;
  --real-brand: #a8b0ba;
  --real-normal-bg: #0f2a21;
  --real-normal-text: #86efac;
  --real-low-bg: #30240e;
  --real-low-text: #fcd34d;
  --real-out-bg: #34171b;
  --real-out-text: #fda4af;

  background: var(--real-bg);
  color: var(--real-text);
  font-family: "Segoe UI", Arial, sans-serif;
  padding: 1.4rem;
}

.gs-app__previewtag {
  display: inline-block;
  background: var(--real-low-bg);
  color: var(--real-low-text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.gs-app__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.gs-app__stat {
  background: var(--real-surface);
  border: 1px solid var(--real-border);
  border-radius: 16px;
  padding: 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.gs-app__num {
  font-size: 1.5rem;
  font-weight: 600;
}

.gs-app__label {
  font-size: 0.68rem;
  color: var(--real-muted);
}

.gs-app__stat--normal .gs-app__num { color: var(--real-normal-text); }
.gs-app__stat--low .gs-app__num { color: var(--real-low-text); }
.gs-app__stat--out .gs-app__num { color: var(--real-out-text); }

.gs-app__alert {
  background: var(--real-low-bg);
  border: 1px solid #52401a;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.gs-app__alert strong {
  display: block;
  font-size: 0.85rem;
  color: var(--real-low-text);
}

.gs-app__alert span {
  font-size: 0.72rem;
  color: var(--real-muted);
}

.gs-app__alert .gs-app__btn {
  background: var(--real-brand);
  color: #101214;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  white-space: nowrap;
}

.gs-app__panel {
  background: var(--real-surface);
  border: 1px solid var(--real-border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.gs-app__panel + .gs-app__panel { margin-top: 0.9rem; }

.gs-app__panelhead {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--real-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gs-app__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--real-border);
  flex-wrap: wrap;
}

.gs-app__row:first-of-type { border-top: none; }

.gs-app__rowname { font-size: 0.82rem; }
.gs-app__rowname small {
  display: block;
  font-size: 0.68rem;
  color: var(--real-muted);
  font-weight: 400;
}

.gs-app__rowmeta {
  font-size: 0.72rem;
  color: var(--real-muted);
  text-align: right;
}

.gs-app__rowmeta b { color: var(--real-text); font-weight: 600; }
.gs-app__rowmeta b.low { color: var(--real-low-text); }
.gs-app__rowmeta b.out { color: var(--real-out-text); }

.gs-app__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.gs-app__badge--normal { background: var(--real-normal-bg); color: var(--real-normal-text); }
.gs-app__badge--low { background: var(--real-low-bg); color: var(--real-low-text); }
.gs-app__badge--out { background: var(--real-out-bg); color: var(--real-out-text); }

.gs-app__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.gs-app__chip {
  background: var(--real-surface);
  border: 1px solid var(--real-border);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 0.76rem;
}

.gs-app__note {
  margin-top: 0.9rem;
  font-size: 0.76rem;
  color: var(--real-normal-text);
}

@media (max-width: 640px) {
  .gs-app__stats { grid-template-columns: repeat(2, 1fr); }
  .gs-app__row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .gs-app__rowmeta { text-align: left; }
}
