/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-elevated: #f6f7f6;
  --bg-elevated-2: #edf0ee;
  --text: #10130f;
  --text-dim: #5b625e;
  --text-dimmer: #9aa19c;
  --accent: #0e8f57;
  --accent-soft: #e6f5ec;
  --accent-dim: #86b9a1;
  --mock: #dfe3e0;
  --border: rgba(16, 19, 15, 0.09);
  --border-strong: rgba(16, 19, 15, 0.16);

  --panel-bg: #10130f;
  --panel-border: rgba(255, 255, 255, 0.1);
  --panel-text: #cfd4d0;
  --panel-text-dim: #82877f;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1180px;
  --pad: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(.16,.84,.44,1);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.5;
  overflow-x: hidden;
  cursor: none;
}

@media (max-width: 860px) {
  body { cursor: auto; }
  .cursor { display: none; }
}

::selection { background: var(--accent); color: #fff; }

/* ---------- Logo crop (brand mark) ---------- */
.logo-crop {
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.logo-crop img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.7); }
.logo-crop { width: 32px; height: 32px; }
.logo-crop--md { width: 42px; height: 42px; }
.logo-crop--lg { width: 76px; height: 76px; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__bar {
  width: 200px; height: 2px; background: var(--border); overflow: hidden;
}
.preloader__bar-fill {
  height: 100%; width: 0%; background: var(--accent);
  transition: width .25s var(--ease);
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ---------- Custom cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 998; pointer-events: none; }
.cursor__dot {
  position: fixed; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%);
  transition: opacity .2s;
}
.cursor__ring {
  position: fixed; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.cursor.is-hover .cursor__ring {
  width: 56px; height: 56px; border-color: var(--accent); background: var(--accent-soft);
}
.cursor.is-hover .cursor__dot { opacity: 0; }

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 997;
}

/* ---------- Layout helpers ---------- */
section { padding: clamp(80px, 12vw, 160px) var(--pad); position: relative; }
.section-head { max-width: var(--container); margin: 0 auto clamp(40px, 6vw, 64px); }
.section-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 18px;
}
.tag-index {
  font-size: 11px; color: var(--text-dimmer); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 2px 6px;
}
.section-title {
  font-size: clamp(32px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08;
}
.section-note { margin-top: 14px; color: var(--text-dim); max-width: 480px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 28px; border-radius: 999px; font-weight: 500; font-size: 15px;
  border: 1px solid var(--border-strong); overflow: hidden;
  transition: border-color .3s var(--ease), transform .2s var(--ease), box-shadow .3s var(--ease);
}
.btn span { position: relative; z-index: 1; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(14,143,87,0.28); }
.btn--ghost { color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--small { padding: 10px 20px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 18px var(--pad);
  transition: background .35s var(--ease), border-color .35s var(--ease), padding .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled,
.nav.is-menu-open {
  background: rgba(255,255,255,0.86); backdrop-filter: blur(14px);
  border-color: var(--border); padding: 12px var(--pad);
}
.nav__inner { max-width: var(--container); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo { display: inline-flex; align-items: center; gap: 10px; }
.nav__logo-text { font-family: var(--font-mono); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.nav__logo--lg .nav__logo-text { font-size: 19px; }
.nav__links { display: flex; gap: 34px; }
.nav__links a { font-size: 14.5px; color: var(--text-dim); position: relative; padding: 4px 0; transition: color .25s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: auto; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; width: 26px; background: none; border: none; cursor: pointer; }
.nav__toggle span { display: block; height: 1.5px; background: var(--text); transition: transform .3s var(--ease), opacity .3s; }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav__mobile {
  display: none; flex-direction: column; gap: 4px; margin-top: 16px;
  max-height: 0; overflow: hidden; transition: max-height .4s var(--ease);
}
.nav__mobile a { padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 16px; }
.nav__mobile.is-open { max-height: 400px; }

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding-top: 120px; overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; }
.hero__grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 75%);
  opacity: 0.7;
}
.hero__inner { position: relative; max-width: var(--container); margin: 0 auto; width: 100%; padding: 0 var(--pad); z-index: 2; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 14px;
  margin-bottom: 28px;
}
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(14,143,87,0.5); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero__title {
  font-size: clamp(44px, 8vw, 92px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98;
  margin-bottom: 28px; max-width: 900px;
}
.hero__title em { font-style: normal; color: var(--accent); }
.reveal-line { display: block; overflow: hidden; }
.reveal-line__inner { display: block; transform: translateY(110%); }

.hero__sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--text-dim); max-width: 520px; margin-bottom: 40px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__panel {
  position: absolute; right: var(--pad); top: 130px; width: min(380px, 34vw); z-index: 2;
}
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(16,19,15,0.14);
}
.panel__bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--panel-border); }
.panel__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--panel-text-dim); }
.panel__name { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--panel-text-dim); }
.panel__code {
  padding: 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--panel-text);
  min-height: 190px; white-space: pre-wrap; word-break: break-word;
}
.panel__caret { display: inline-block; width: 6px; height: 1.1em; background: var(--accent); vertical-align: -2px; animation: blink .9s steps(1) infinite; }

@media (max-width: 1080px) { .hero__panel { display: none; } }

.hero__scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dimmer);
  text-transform: uppercase; z-index: 2;
}
.hero__scroll-line { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); animation: scrollLine 1.8s ease-in-out infinite; }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Marquee ---------- */
.marquee { padding: 26px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.marquee__track {
  display: flex; gap: 22px; white-space: nowrap; width: max-content;
  font-family: var(--font-mono); font-size: 15px; color: var(--text-dimmer);
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span:nth-child(odd) { color: var(--text-dim); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Services ---------- */
.services__grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
}
.service-card {
  background: var(--bg); padding: 36px 28px; position: relative;
  transition: background .35s var(--ease);
}
.service-card:hover { background: var(--bg-elevated); }
.service-card__num { position: absolute; top: 28px; right: 28px; font-family: var(--font-mono); font-size: 12px; color: var(--text-dimmer); }
.service-card__icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: 26px; }
.service-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.service-card p { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; }

/* ---------- Process ---------- */
.process__list { max-width: 760px; margin: 0 auto; position: relative; padding-left: 56px; }
.process__line { position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; height: calc(100% - 16px); }
.process__line line { stroke: var(--border-strong); stroke-width: 2; }
.process__item { display: flex; gap: 28px; padding: 30px 0; border-bottom: 1px solid var(--border); position: relative; }
.process__item:last-child { border-bottom: none; }
.process__num {
  position: absolute; left: -56px; top: 30px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.process__body h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.process__body p { color: var(--text-dim); max-width: 480px; }

/* ---------- About ---------- */
.about__grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 80px; align-items: start; }
.about__lead { font-size: 19px; color: var(--text); margin: 22px 0 18px; line-height: 1.6; }
.about__copy > p { color: var(--text-dim); margin-bottom: 16px; line-height: 1.7; }
.about__stats { display: flex; gap: 40px; margin-top: 42px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--font-mono); font-size: 40px; font-weight: 600; color: var(--accent); }
.stat__label { font-size: 13px; color: var(--text-dimmer); margin-top: 4px; }

.founder-card {
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 32px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg));
}
.founder-card__frame {
  width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  background: var(--bg-elevated-2); overflow: hidden;
}
.founder-card__initials { font-family: var(--font-mono); font-size: 24px; color: var(--accent); }
.founder-card__name { font-size: 19px; font-weight: 600; }
.founder-card__role { font-size: 13px; color: var(--text-dimmer); margin-bottom: 20px; }
.founder-card__quote { font-size: 15px; color: var(--text-dim); font-style: italic; line-height: 1.6; border-left: 2px solid var(--accent); padding-left: 16px; }

@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; gap: 48px; } }

/* ---------- Work ---------- */
.work__grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.work-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--bg-elevated);
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.work-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.work-card__browser { background: var(--bg); }
.work-card__browser-bar { display: flex; gap: 6px; padding: 12px 14px; }
.work-card__browser-bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.work-card__mock { padding: 24px; height: 160px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.mock-line { height: 10px; border-radius: 4px; background: var(--mock); }
.mock-line--lg { width: 70%; }
.mock-line--sm { width: 40%; background: var(--accent-dim); }
.mock-blocks { display: flex; gap: 8px; margin-top: 6px; }
.mock-blocks span { flex: 1; height: 44px; border-radius: 6px; background: var(--bg-elevated-2); border: 1px solid var(--border); }
.mock-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 6px; }
.mock-grid span { aspect-ratio: 1; border-radius: 6px; background: var(--bg-elevated-2); border: 1px solid var(--border); }
.mock-circle { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--accent-dim); margin-top: 4px; }
.work-card h3 { padding: 22px 22px 6px; font-size: 18px; font-weight: 600; }
.work-card p { padding: 0 22px 24px; color: var(--text-dim); font-size: 14px; }

/* ---------- CTA / Contact ---------- */
.cta { text-align: center; }
.cta__inner { max-width: 640px; margin: 0 auto; }
.cta__title { font-size: clamp(32px, 5vw, 54px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 18px; }
.cta__sub { color: var(--text-dim); margin-bottom: 48px; }

.contact-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; max-width: 100%; }
.contact-info__item {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 20px 28px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--bg-elevated); max-width: 100%;
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.contact-info__item:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--accent-soft); }
.contact-info__icon { width: 40px; height: 40px; flex-shrink: 0; color: var(--accent); }
.contact-info__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-info__label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dimmer); }
.contact-info__value { font-size: 17px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .contact-info { flex-direction: column; align-items: stretch; }
  .contact-info__item { padding: 18px 20px; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px var(--pad) 36px; }
.footer__inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.footer__tag { color: var(--text-dimmer); font-size: 14px; }
.footer__links { display: flex; gap: 26px; margin: 10px 0; }
.footer__links a { color: var(--text-dim); font-size: 14px; transition: color .25s; }
.footer__links a:hover { color: var(--accent); }
.footer__copy { color: var(--text-dimmer); font-size: 13px; }

/* ---------- Reveal animation base states ---------- */
.reveal-up,
.service-card,
.work-card { opacity: 0; transform: translateY(28px); }
.reveal-panel { opacity: 0; transform: translateY(20px) scale(0.98); }
