:root {
  --ink: #0b1220;
  --paper: #f7f4ef;
  --muted: #6b7280;
  --line: rgba(255, 255, 255, 0.14);
  --card: rgba(255, 255, 255, 0.92);
  --accent: #e85d04;
  --sky: #0284c7;
  --good: #059669;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ink);
  overflow-x: hidden;
}

.stage {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.stage__media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  color: #fff;
}

.stage__bg {
  position: absolute;
  inset: 0;
  background-color: #0b1220;
  background-image:
    linear-gradient(125deg, rgba(8, 15, 30, 0.72) 0%, rgba(8, 15, 30, 0.45) 45%, rgba(8, 15, 30, 0.78) 100%),
    var(--hero-media, url("media-default.jpg"));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.08);
  animation: bgDrift 28s ease-in-out infinite alternate;
  transition: background-image 0.45s ease, filter 0.35s ease;
}
.stage__media[data-project="b2c"] { --hero-tint: #0284c7; }
.stage__media[data-project="d2c"] { --hero-tint: #e85d04; }
.stage__media[data-project="return"] { --hero-tint: #059669; }
.stage__media.is-switching .hero-copy,
.stage__media.is-switching .flow {
  opacity: 0;
  transform: translateY(8px);
}
.hero-copy,
.flow {
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.stage__media .orb--a { background: var(--hero-tint, #0284c7); }
.stage__media .orb--b { background: color-mix(in srgb, var(--hero-tint, #e85d04) 70%, #fff); }

.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: floatY 10s ease-in-out infinite;
}
.orb--a { width: 280px; height: 280px; background: #0284c7; top: 12%; left: 8%; }
.orb--b { width: 220px; height: 220px; background: #e85d04; bottom: 18%; right: 12%; animation-delay: -3s; }
.orb--c { width: 160px; height: 160px; background: #059669; top: 48%; left: 42%; animation-delay: -6s; }

.stage__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand__tag {
  font-size: 0.8rem;
  opacity: 0.75;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  max-width: 14ch;
  animation: riseIn 0.8s ease both;
}
.hero-copy p {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  animation: riseIn 0.9s ease 0.08s both;
}

.flow {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1.25rem;
  animation: riseIn 1s ease 0.16s both;
}
.flow__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-bottom: 0.85rem;
}
.flow__track {
  position: relative;
  padding: 18px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  overflow: visible;
}
.flow__steps {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 4%;
}
.flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.flow__rail {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 18px;
  height: 3px;
  margin-top: 15.5px; /* center on 34px nodes */
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  z-index: 0;
  pointer-events: none;
}
.flow__node {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  box-sizing: border-box;
  flex-shrink: 0;
}
.flow-step {
  font-size: 0.62rem;
  line-height: 1.2;
  opacity: 0.85;
  white-space: nowrap;
  text-align: center;
}

.packet {
  position: absolute;
  top: 18px;
  width: 12px;
  height: 12px;
  margin-top: 11px; /* center on 34px nodes */
  border-radius: 3px;
  background: linear-gradient(135deg, #fbbf24, #e85d04);
  box-shadow: 0 0 10px rgba(232, 93, 4, 0.55);
  animation: runPacket 4.8s linear infinite;
  z-index: 1;
  pointer-events: none;
}
.packet:nth-child(2) { animation-delay: -1.6s; background: linear-gradient(135deg, #7dd3fc, #0284c7); }
.packet:nth-child(3) { animation-delay: -3.2s; background: linear-gradient(135deg, #6ee7b7, #059669); }

.live-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
}
.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulseDot 1.6s ease-out infinite;
}

.stage__panel {
  position: relative;
  background: var(--paper);
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}
.panel-inner {
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.panel-head h2 {
  font-family: var(--font-display);
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-box {
  background: #fff;
  border: 1px solid #e7e2da;
  border-radius: 18px;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}
.fields {
  display: grid;
  gap: 0.85rem;
}
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #374151;
}
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 1px solid #ddd6cb;
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font: inherit;
  background: #fffdf9;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  outline: none;
  border-color: #e85d04;
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}
.remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}
.remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #e85d04;
  cursor: pointer;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #e85d04, #c2410c);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.msg { min-height: 1.2rem; margin: 0.55rem 0 0; font-size: 0.88rem; color: #b91c1c; }
.msg.ok { color: #047857; }

.projects-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.projects-label h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}
.projects-label span {
  font-size: 0.78rem;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.75rem;
}
.project {
  position: relative;
  text-align: left;
  border: 1.5px solid #e4ddd3;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font: inherit;
  color: inherit;
  width: 100%;
  text-decoration: none;
}
.project::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--project-accent, var(--accent));
  opacity: 0.85;
}
.project:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--project-accent, var(--accent)) 45%, #e4ddd3);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.project.is-selected {
  border-color: var(--project-accent, var(--accent));
  background: color-mix(in srgb, var(--project-accent, var(--accent)) 8%, #fff);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--project-accent, var(--accent)) 18%, transparent);
}
.project__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--project-accent, var(--accent)) 14%, #fff);
  color: var(--project-accent, var(--accent));
  flex-shrink: 0;
}
.project__icon svg { width: 24px; height: 24px; }
.project h4 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
}
.project p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.project__flow {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--project-accent, var(--accent));
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}
.userbar a {
  color: #c2410c;
  font-weight: 700;
  text-decoration: none;
}

@keyframes bgDrift {
  from { transform: scale(1.05) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-2%, -1%, 0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes runPacket {
  0% { left: 8%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 90%; opacity: 0; }
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .stage__media { min-height: 48vh; }
  .stage__content { min-height: 48vh; }
  .stage__panel { min-height: auto; }
  .hero-copy h1 { max-width: none; }
}

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