:root {
  color-scheme: dark;
  --bg: #08090d;
  --surface: rgba(18, 22, 29, 0.78);
  --surface-strong: rgba(28, 34, 43, 0.92);
  --text: #f7f4ea;
  --muted: #aeb7bc;
  --line: rgba(255, 255, 255, 0.12);
  --green: #4ed6a8;
  --gold: #f2bf5b;
  --coral: #ff7664;
  --cyan: #68d8f7;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(78, 214, 168, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(255, 118, 100, 0.16), transparent 26rem),
    linear-gradient(135deg, #08090d 0%, #10131a 48%, #08090d 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

#motion-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.52;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.hero-actions,
.repo-toolbar,
.profile-pill,
footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--gold));
  color: #111;
  box-shadow: 0 14px 40px rgba(78, 214, 168, 0.24);
}

.nav-links {
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 17, 0.58);
}

.nav-links a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero,
.section-block,
.contact-section {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 54px 0 76px;
}

.hero-copy h1,
.section-heading h2,
.contact-copy h2 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 7.6rem);
}

.hero-copy p,
.section-heading p,
.contact-copy p,
.card-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy p {
  max-width: 630px;
  margin: 28px 0 0;
  font-size: 1.12rem;
}

.eyebrow,
.project-type,
.panel-label {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.secondary-action,
.card-copy a,
.contact-form button,
.github-contact,
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
}

.primary-action {
  background: var(--text);
  color: #10131a;
  font-weight: 800;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.primary-action:hover,
.secondary-action:hover,
.card-copy a:hover,
.contact-form button:hover,
.github-contact:hover,
.icon-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.hero-stage {
  perspective: 1200px;
}

.device-shell {
  min-height: 560px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    rgba(16, 19, 26, 0.7);
  box-shadow: var(--shadow);
  transform: rotateY(-10deg) rotateX(5deg);
  animation: floatDevice 7s ease-in-out infinite;
}

.device-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.device-toolbar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--coral);
}

.device-toolbar span:nth-child(2) {
  background: var(--gold);
}

.device-toolbar span:nth-child(3) {
  background: var(--green);
}

.stage-showcase {
  position: relative;
  height: 486px;
  overflow: hidden;
  border-radius: 8px;
}

.stage-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: stageCycle 18s ease-in-out infinite;
}

.video-slide {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(78, 214, 168, 0.16), rgba(104, 216, 247, 0.08)),
    #11161d;
}

.video-slide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  filter: saturate(1.08) contrast(1.05);
}

.video-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8, 9, 13, 0.82), rgba(8, 9, 13, 0.04) 34%, transparent 62%),
    linear-gradient(140deg, rgba(78, 214, 168, 0.08), transparent 48%);
}

.think-slide {
  animation-delay: 6s;
}

.panels-slide {
  animation-delay: 12s;
}

.slide-copy {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: inline-grid;
  width: fit-content;
  max-width: calc(100% - 36px);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 9, 13, 0.58);
  backdrop-filter: blur(10px);
}

.slide-copy strong,
.slide-copy small,
.slide-copy span {
  display: block;
}

.slide-copy strong {
  margin-top: 6px;
  font-size: clamp(1.45rem, 4vw, 2.5rem);
  line-height: 1;
}

.slide-copy small {
  margin-top: 6px;
  color: var(--muted);
}

.live-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  height: 100%;
}

.live-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(104, 216, 247, 0.18), rgba(242, 191, 91, 0.08));
}

.live-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, transparent, black 30%, black);
}

.live-panel.tall {
  grid-row: span 2;
}

.live-panel strong,
.live-panel small,
.live-panel span {
  position: relative;
  z-index: 1;
}

.live-panel strong {
  margin-top: 8px;
  font-size: clamp(1.18rem, 2.55vw, 2.05rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.live-panel small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.stats-strip div {
  padding: 22px;
  background: rgba(12, 14, 19, 0.76);
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.stats-strip span {
  margin-top: 6px;
  color: var(--muted);
}

.section-block,
.contact-section {
  padding: 86px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.contact-copy h2 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.preview-card,
.repo-card,
.contact-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.23);
  backdrop-filter: blur(18px);
}

.preview-card {
  overflow: hidden;
}

.preview-frame,
.generated-preview {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: #11161d;
}

.preview-frame iframe {
  width: 1280px;
  height: 820px;
  border: 0;
  transform: scale(0.26);
  transform-origin: 0 0;
  pointer-events: none;
}

.preview-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  filter: saturate(1.08) contrast(1.06);
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 13, 0.28), transparent 55%);
  pointer-events: none;
}

.preview-fallback {
  position: absolute;
  inset: auto 14px 14px auto;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 13, 0.78);
  color: var(--text);
  font-size: 0.86rem;
}

.card-copy {
  padding: 22px;
}

.card-copy h3,
.repo-card h3 {
  margin: 8px 0 0;
  font-size: 1.45rem;
}

.card-copy a {
  margin-top: 12px;
  color: var(--green);
  font-weight: 800;
}

.generated-preview {
  background:
    linear-gradient(160deg, rgba(78, 214, 168, 0.2), transparent 55%),
    linear-gradient(30deg, rgba(255, 118, 100, 0.2), transparent),
    #11161d;
}

.factory-line {
  position: absolute;
  inset: 46% 8% auto;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--coral));
  box-shadow: 0 0 32px rgba(78, 214, 168, 0.48);
  animation: scanLine 2.5s ease-in-out infinite alternate;
}

.chart-stack {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
}

.chart-stack span {
  width: 22px;
  height: var(--h);
  border-radius: 8px 8px 2px 2px;
  background: rgba(255, 255, 255, 0.72);
}

.status-node {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: var(--green);
  animation: pulse 1.9s ease-in-out infinite;
}

.status-node.one {
  left: 17%;
  top: 28%;
}

.status-node.two {
  left: 43%;
  top: 58%;
  animation-delay: 0.45s;
}

.status-node.three {
  right: 27%;
  top: 24%;
  animation-delay: 0.9s;
}

.repo-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-pill {
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.profile-pill img {
  width: 48px;
  height: 48px;
  border-radius: 999px;
}

.profile-pill strong,
.profile-pill span {
  display: block;
}

.profile-pill span {
  color: var(--muted);
  font-size: 0.88rem;
}

.icon-link {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  overflow: hidden;
}

.repo-visual {
  position: relative;
  min-height: 160px;
  padding: 18px;
  background: linear-gradient(135deg, var(--card-a), var(--card-b));
}

.repo-visual::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
}

.repo-visual span {
  position: relative;
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  font-weight: 800;
}

.repo-body {
  padding: 20px;
}

.repo-body p {
  min-height: 54px;
  color: var(--muted);
  line-height: 1.55;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.repo-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
}

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repo-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-weight: 800;
}

.case-section {
  scroll-margin-top: 86px;
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.case-copy,
.case-dashboard,
.case-panel,
.architecture-band,
.tech-matrix {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.case-copy {
  padding: clamp(24px, 4vw, 38px);
}

.case-copy h3,
.architecture-band h3,
.case-panel h3 {
  margin: 10px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.case-copy p,
.case-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.case-dashboard {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(78, 214, 168, 0.18), rgba(104, 216, 247, 0.06)),
    rgba(16, 19, 26, 0.78);
}

.case-dashboard::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.55;
}

.dashboard-topline,
.risk-meter,
.dashboard-grid {
  position: relative;
}

.dashboard-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-topline span,
.dashboard-grid small {
  color: var(--muted);
}

.dashboard-topline strong {
  color: var(--green);
}

.risk-meter {
  height: 14px;
  margin: 80px 0 28px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.risk-meter span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--coral));
  box-shadow: 0 0 34px rgba(78, 214, 168, 0.42);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dashboard-grid div {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 13, 0.52);
}

.dashboard-grid strong,
.dashboard-grid small {
  display: block;
}

.dashboard-grid strong {
  margin-top: 18px;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.case-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case-panel {
  padding: 24px;
}

.case-panel svg {
  width: 28px;
  height: 28px;
  color: var(--green);
}

.architecture-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 16px;
  padding: 26px;
}

.flow-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.flow-list span {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #08110e;
  font-size: 0.78rem;
  font-weight: 900;
}

.tech-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  background: var(--line);
}

.tech-matrix div {
  min-height: 132px;
  padding: 20px;
  background: rgba(12, 14, 19, 0.82);
}

.tech-matrix strong,
.tech-matrix span {
  display: block;
}

.tech-matrix span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.65fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  padding: 13px 14px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--green);
}

.contact-form button,
.github-contact {
  min-height: 48px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 800;
}

.contact-form button {
  background: var(--green);
  color: #08110e;
}

.github-contact {
  background: rgba(255, 255, 255, 0.08);
}

footer {
  justify-content: space-between;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

@keyframes floatDevice {
  0%,
  100% {
    transform: rotateY(-10deg) rotateX(5deg) translateY(0);
  }
  50% {
    transform: rotateY(-4deg) rotateX(2deg) translateY(-16px);
  }
}

@keyframes scanLine {
  from {
    transform: translateX(-8px);
  }
  to {
    transform: translateX(18px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(78, 214, 168, 0.35);
  }
  50% {
    transform: scale(1.22);
    box-shadow: 0 0 0 18px rgba(78, 214, 168, 0);
  }
}

@keyframes stageCycle {
  0%,
  29% {
    opacity: 1;
    transform: scale(1);
  }
  33%,
  96% {
    opacity: 0;
    transform: scale(1.025);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 940px) {
  .topbar {
    align-items: flex-start;
  }

  .nav-links {
    max-width: 100%;
    overflow-x: auto;
  }

  .hero,
  .contact-section,
  .case-hero,
  .architecture-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .device-shell {
    min-height: 440px;
    transform: none;
  }

  .live-grid {
    height: 366px;
  }

  .stage-showcase {
    height: 366px;
  }

  .featured-grid,
  .repo-grid,
  .case-columns,
  .tech-matrix {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    position: relative;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    justify-content: stretch;
    overflow: visible;
  }

  .nav-links a {
    display: block;
    min-width: 0;
    padding: 9px 6px;
    text-align: center;
    font-size: 0.8rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.55rem, 15vw, 4.2rem);
  }

  .stats-strip,
  .featured-grid,
  .repo-grid,
  .case-columns,
  .tech-matrix,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .preview-frame,
  .generated-preview {
    height: 230px;
  }

  .stage-showcase {
    height: 360px;
  }

  .slide-copy strong {
    font-size: clamp(2rem, 12vw, 3.35rem);
  }

  .preview-frame iframe {
    transform: scale(0.2);
  }

  .repo-toolbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
