:root {
  --bg: #0b0f13;
  --bg-elev: #151b22;
  --ink: #f3efe6;
  --muted: #9aa3ad;
  --line: rgba(243, 239, 230, 0.12);
  --accent: #3ecf8e;
  --accent-dim: rgba(62, 207, 142, 0.16);
  --warm: #e8a87c;
  --panel: #171e27;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", sans-serif;
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-spring: cubic-bezier(0.28, 1.05, 0.4, 1);
  --max: 1120px;
  --mx: 0.5;
  --my: 0.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(62, 207, 142, 0.35);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 60;
  background: var(--accent);
  transform-origin: left;
  pointer-events: none;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  transition: transform 0.3s var(--ease);
}

.logo:hover {
  transform: rotate(-0.8deg);
}

.logo span {
  color: var(--accent);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 12px 14px 11px 13px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease), background 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--accent);
  color: #062016;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.28);
}

.btn-primary:hover {
  background: #58dfa0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: rgba(243, 239, 230, 0.35);
  background: rgba(243, 239, 230, 0.04);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  position: relative;
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: width 0.4s var(--ease);
}

.text-link:hover::after {
  width: calc(100% - 1.4rem);
}

.text-link:hover svg {
  transform: translateX(3px);
}

.text-link svg {
  transition: transform 0.25s var(--ease);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head {
  max-width: 36rem;
  margin-bottom: 3.5rem;
}

.section-head h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-head p:last-child {
  margin: 0;
  color: var(--muted);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(11, 15, 19, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, transform 0.4s var(--ease), padding 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav a span {
  position: relative;
  z-index: 1;
}

.nav a::after {
  content: "";
  position: absolute;
  left: -2%;
  bottom: -2px;
  width: 104%;
  height: 4px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.3) rotate(-1deg);
  transform-origin: left;
  border-radius: 40% 60% 55% 45%;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after {
  opacity: 0.28;
  transform: scaleX(1) rotate(-1deg);
}

.header-cta {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 11px 9px 12px 8px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(6.5rem, 12vh, 8rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  max-width: calc(var(--max) + 5rem);
  margin: 0 auto;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.hero-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(243, 239, 230, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 239, 230, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, black 0%, transparent 85%);
  opacity: 0.55;
  transform: rotate(-1deg);
}

.hero-scratch {
  position: absolute;
  width: 180px;
  height: 180px;
  top: 18%;
  right: 12%;
  border: 1.5px solid rgba(62, 207, 142, 0.14);
  border-radius: 42% 58% 55% 45%;
  transform: rotate(12deg);
  animation: wobble 14s ease-in-out infinite;
  pointer-events: none;
}

.brand-mark {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 6.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.brand-mark .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  animation: char-in 0.55s var(--ease) forwards;
}

.brand-mark .char:nth-child(n) {
  color: var(--ink);
}

.brand-mark .char.accent {
  color: var(--accent);
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.55s forwards;
}

.tagline-cursor {
  display: inline-block;
  width: 1.5px;
  height: 0.9em;
  margin-left: 0.15rem;
  background: var(--accent);
  opacity: 0.7;
  animation: blink 1.4s steps(1) infinite;
}

.lede {
  max-width: 30rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
  opacity: 0;
  animation: rise 0.85s var(--ease) 0.7s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  opacity: 0;
  animation: rise 0.85s var(--ease) 0.85s forwards;
}

.hero-stage {
  position: relative;
  min-height: 340px;
  opacity: 0;
  animation: rise 1s var(--ease) 0.5s forwards;
  perspective: 900px;
}

.stage-panel {
  background: rgba(23, 30, 39, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px 22px 14px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  transition: transform 0.45s var(--ease);
  will-change: transform;
}

.stage-panel-main {
  position: relative;
  z-index: 2;
  width: min(100%, 360px);
  padding: 0;
  overflow: hidden;
  transform: rotate(-2deg) translate3d(
    calc((var(--mx) - 0.5) * -10px),
    calc((var(--my) - 0.5) * -6px),
    0
  );
}

.stage-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.stage-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4450;
}

.stage-bar span:nth-child(1) { background: #e07a6a; }
.stage-bar span:nth-child(2) { background: #e8c07a; }
.stage-bar span:nth-child(3) { background: #6ecf8e; }

.stage-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stage-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-line {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px 16px 14px 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
}

.chat-line.show {
  animation: chat-pop 0.4s var(--ease) forwards;
}

.chat-line.in {
  align-self: flex-start;
  background: rgba(243, 239, 230, 0.06);
  border: 1px solid var(--line);
}

.chat-line.out {
  align-self: flex-end;
  background: var(--accent-dim);
  border: 1px solid rgba(62, 207, 142, 0.28);
  color: #c8f5dc;
  border-radius: 16px 12px 10px 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.metric-row.show {
  opacity: 1;
}

.metric-row div {
  text-align: center;
}

.metric-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.metric-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.stage-panel-side {
  position: absolute;
  right: 0;
  bottom: 8%;
  width: min(52%, 210px);
  padding: 1rem;
  z-index: 1;
  transform: rotate(5deg) translate3d(
    calc((var(--mx) - 0.5) * 14px),
    calc((var(--my) - 0.5) * 10px),
    0
  );
  animation: float-side 11s ease-in-out infinite;
}

.builder-block {
  height: 28px;
  margin-bottom: 0.55rem;
  border-radius: 7px 11px 8px 10px;
  background: linear-gradient(90deg, rgba(62, 207, 142, 0.35), rgba(232, 168, 124, 0.2));
  border: 1px dashed rgba(62, 207, 142, 0.35);
  transform-origin: left;
  animation: block-draw 1.2s var(--ease) both;
}

.builder-block.short {
  width: 62%;
  height: 18px;
  opacity: 0.75;
  animation-delay: 0.15s;
}

.builder-block.mid {
  width: 80%;
  height: 42px;
  opacity: 0.9;
  animation-delay: 0.3s;
}

.stage-panel-side p {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Products */
.products,
.approach,
.contact {
  padding: clamp(4.5rem, 10vh, 7rem) clamp(1.25rem, 4vw, 2.5rem);
  max-width: calc(var(--max) + 5rem);
  margin: 0 auto;
}

.products {
  border-top: 1px solid var(--line);
}

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.product + .product {
  border-top: 1px solid var(--line);
}

.product-bot {
  transform: rotate(-0.3deg);
}

.product-site {
  transform: rotate(0.25deg);
}

.product-copy h3 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.product-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
}

.mock {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px 24px 16px 22px;
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.mock.tilt:hover {
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.35);
}

.mock-bot header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.mock-bot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink-dot 4s ease-in-out infinite;
}

.mock-bot ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
}

.mock-bot li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: 10px 14px 11px 13px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, transform 0.25s var(--ease);
}

.mock-bot li:hover {
  background: rgba(62, 207, 142, 0.08);
  transform: translateX(2px);
}

.mock-bot em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--warm);
}

.mock-builder {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 280px;
}

.mock-builder aside {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.mock-builder aside i {
  display: block;
  height: 36px;
  border-radius: 8px 11px 7px 10px;
  background: rgba(243, 239, 230, 0.06);
  border: 1px dashed rgba(243, 239, 230, 0.14);
  transition: transform 0.25s var(--ease), border-color 0.2s ease;
}

.mock-builder:hover aside i {
  border-color: rgba(62, 207, 142, 0.4);
}

.mock-builder:hover aside i:nth-child(1) { transform: translateX(1px); }
.mock-builder:hover aside i:nth-child(2) { transform: translateX(-1px); }
.mock-builder:hover aside i:nth-child(3) { transform: translateX(2px); }
.mock-builder:hover aside i:nth-child(4) { transform: translateX(-1px); }

.mock-builder .canvas {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--panel);
}

.drop {
  border-radius: 11px 15px 10px 14px;
  border: 1px dashed rgba(62, 207, 142, 0.35);
  background: rgba(62, 207, 142, 0.08);
}

.drop.hero-block {
  height: 88px;
  animation: pulse-soft 5.5s ease-in-out infinite;
}

.drop.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  border: none;
  background: transparent;
}

.drop.row span {
  display: block;
  height: 72px;
  border-radius: 12px 9px 14px 10px;
  border: 1px dashed rgba(232, 168, 124, 0.35);
  background: rgba(232, 168, 124, 0.08);
}

.drop.footer-block {
  height: 40px;
  opacity: 0.7;
}

/* Approach */
.approach {
  border-top: 1px solid var(--line);
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.approach-item {
  padding: 1rem 0.75rem 1rem 0;
  border-top: 2px solid transparent;
  transition: border-color 0.35s ease, transform 0.3s var(--ease);
  transition-delay: calc(var(--i, 0) * 40ms);
}

.approach-item.reveal.visible {
  border-top-color: rgba(62, 207, 142, 0.45);
}

.approach-item:hover {
  transform: translateY(-2px);
}

.approach-item .num {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.approach-item h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.approach-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Contact */
.contact-inner {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  text-align: center;
}

.contact-inner h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}

.contact-inner > p {
  max-width: 32rem;
  margin: 0 auto 1.75rem;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  max-width: calc(var(--max) + 5rem);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes char-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes blink {
  0%,
  55% {
    opacity: 1;
  }
  60%,
  100% {
    opacity: 0;
  }
}

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

@keyframes chat-pop {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-side {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes block-draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.78;
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: rotate(12deg) scale(1);
  }
  50% {
    transform: rotate(14deg) scale(1.02);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 7rem;
  }

  .hero-stage {
    min-height: 300px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-scratch {
    display: none;
  }

  .product,
  .product-site {
    grid-template-columns: 1fr;
    transform: none;
  }

  .product-site .product-copy {
    order: 1;
  }

  .product-site .product-visual {
    order: 2;
  }

  .approach-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 720px) {
  .nav,
  .header-cta {
    display: none;
  }

  .nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(11, 15, 19, 0.96);
    border-bottom: 1px solid var(--line);
  }

  .nav.open a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle {
    display: flex;
  }

  .brand-mark {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .stage-panel-main {
    width: 100%;
    transform: none;
  }

  .stage-panel-side {
    display: none;
  }
}

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

  .reveal,
  .chat-line,
  .lede,
  .tagline,
  .hero-actions,
  .hero-stage,
  .brand-mark .char {
    opacity: 1 !important;
    transform: none !important;
  }
}
