/* Flowhaus, dark tech, single accent, radius system: 14px soft */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0f16;
  --bg-raise: #111826;
  --line: #1e2735;
  --text: #e8edf5;
  --text-dim: #94a1b5;
  --accent: #62a0ff;
  --accent-ink: #081018;
  --radius: 14px;
  --maxw: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.12; font-weight: 640; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: 2rem; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { color: var(--text-dim); }
a { color: inherit; }

/* ---------- 3D canvas ---------- */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}
.wordmark .mark { width: 27px; height: 26px; flex: none; }

/* ---------- dropdown menu ---------- */
.menu { display: flex; gap: 1.8rem; margin-left: auto; align-items: stretch; }
.mi { position: relative; display: flex; align-items: center; }
.mi > a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 24px 0;
}
.mi > a .chev { font-size: 0.55rem; transition: transform 0.2s; opacity: 0.7; }
.mi:hover > a, .mi.open > a { color: var(--text); }
.mi:hover > a .chev, .mi.open > a .chev { transform: rotate(180deg); }
.dd {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: none;
  padding: 1.3rem 1.5rem 1.4rem;
  display: none;
  gap: 2.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.mi:hover > .dd, .mi.open > .dd { display: flex; }
.mi:last-child .dd { left: auto; right: 0; transform: none; }
.ddg { min-width: 168px; }
.ddh {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 0.55rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ddh:hover { color: var(--accent); }
.ddi {
  display: block;
  font-size: 0.84rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.26rem 0;
  white-space: nowrap;
}
.ddi:hover { color: var(--accent); }
.navburger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.mnav {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  z-index: 39;
  background: #0d1219;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1.2rem 1rem;
}
.mnav a {
  display: block;
  padding: 0.75rem 0.2rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
}
.mnav a:last-child { border-bottom: none; color: var(--accent); font-weight: 600; }
.nav.mopen ~ .mnav, .mnav.open { display: block; }
@media (max-width: 1020px) {
  .menu { display: none; }
  .navburger { display: block; }
  .btn-nav { margin-left: 0.8rem; }
}

/* ---------- subpages ---------- */
.page-hero { padding-top: calc(68px + clamp(3rem, 7vw, 5.5rem)); padding-bottom: 1rem; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.page-hero p { max-width: 58ch; font-size: 1.05rem; }
.svc-group { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.svc-group h2 .g-ico { font-size: 1.3rem; margin-right: 0.5rem; }
.svc-intro { max-width: 56ch; margin-bottom: 1.8rem; margin-top: -1rem; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.svc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 60%, transparent);
  padding: 1.4rem 1.5rem;
}
.svc-card h3 { font-size: 1rem; margin-bottom: 0.45rem; }
.svc-card p { font-size: 0.9rem; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .svc-grid { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.chips li {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raise) 70%, transparent);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
}
.cell { text-decoration: none; color: inherit; transition: border-color 0.2s; }
a.cell:hover { border-color: #2c3a50; }

/* ---------- floating chat bubble ---------- */
#fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, background 0.2s;
}
#fab:hover { background: #7cb0ff; transform: translateY(-2px); }
#fab:active { transform: scale(0.96); }
#fabPanel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 60;
  width: min(372px, calc(100vw - 24px));
  display: none;
}
#fabPanel.open { display: block; }
#fabPanel .chat {
  min-height: 0;
  background: #10151f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
#fabPanel .chat-log {
  min-height: 220px;
  max-height: min(340px, calc(100dvh - 260px));
}
.fab-close {
  margin-left: 0.9rem;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1;
}
.fab-close:hover { color: var(--text); }
@media (max-width: 480px) {
  #fab { right: 14px; bottom: 14px; }
  #fabPanel { right: 12px; bottom: 84px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.78rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, background 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #7cb0ff; }
.btn-nav { padding: 0.55rem 1.1rem; font-size: 0.88rem; }

/* ---------- layout base ---------- */
main { position: relative; z-index: 1; }
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) clamp(1rem, 4vw, 2.5rem); }

/* ---------- hero ---------- */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 68px;
}
.hero-inner { max-width: 620px; }
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  margin-bottom: 1.4rem;
}
.hero-sub {
  font-size: 1.13rem;
  max-width: 46ch;
  margin-bottom: 2.2rem;
}
.hero-cta { display: flex; gap: 1rem; }

/* ---------- manifesto ---------- */
.manifesto {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raise) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.manifesto > p {
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 56ch;
  font-weight: 460;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
.stat-n { display: block; font-size: 2rem; color: var(--accent); font-weight: 600; }
.stat-l { font-size: 0.88rem; color: var(--text-dim); }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; gap: 1.2rem; } }

/* ---------- services bento ---------- */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: minmax(220px, auto);
  gap: 1rem;
}
.cell {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
}
.cell p { font-size: 0.95rem; }
.cell-img {
  grid-row: span 2;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.cell-img::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,15,22,0.92) 18%, rgba(11,15,22,0.15) 65%);
}
.cell-img h3, .cell-img p { position: relative; }
.cell-wide { grid-column: span 2; }
.cell-accent {
  grid-column: span 2;
  background: linear-gradient(130deg, #14243f 0%, var(--bg-raise) 70%);
  border-color: #27405f;
}
.cell-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.cell-tags li {
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .cell-wide, .cell-accent { grid-column: span 1; }
  .cell-img { grid-row: span 1; min-height: 280px; }
}

/* ---------- process ---------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  counter-reset: step;
}
.steps li { border-top: 2px solid var(--line); padding-top: 1.2rem; position: relative; }
.steps li::before {
  content: '';
  position: absolute;
  top: -2px; left: 0;
  width: 2.4rem; height: 2px;
  background: var(--accent);
}
.step-verb { display: block; font-weight: 640; font-size: 1.15rem; margin-bottom: 0.5rem; }
.steps p { font-size: 0.93rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- work ---------- */
.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.case-main {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: 3.5rem;
}
.case-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.case-copy h2 { margin-bottom: 1rem; }
.case-copy p { max-width: 52ch; }
.case-note { margin-top: 1rem; color: var(--text); font-weight: 520; font-size: 0.95rem; }
.case-rows { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.case-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem 1.8rem;
  background: color-mix(in srgb, var(--bg-raise) 60%, transparent);
}
.case-row h3 { margin-bottom: 1.1rem; font-size: 1.05rem; }

/* STAR method blocks */
.star { margin: 0; }
.star dt {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.star dd { margin: 0; font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; }
.star .metric {
  display: block;
  font-size: 1.45rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.star-h {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.star-h .star-result {
  border-left: 2px solid var(--accent);
  padding-left: 1.1rem;
  margin-left: -1.2px;
}
.star-v div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}
.star-v dt { margin-bottom: 0; padding-top: 0.15rem; }
.star-v dd { font-size: 0.92rem; }
.star-v .metric { display: inline; font-size: 1rem; margin-right: 0.35rem; }
@media (max-width: 900px) {
  .case-main { grid-template-columns: 1fr; }
  .star-h { grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  .star-h .star-result { border-left: 0; padding-left: 0; margin-left: 0; border-top: 2px solid var(--accent); padding-top: 0.7rem; }
}
@media (max-width: 560px) {
  .star-h { grid-template-columns: 1fr; }
  .star-v div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- pricing ---------- */
.price-rows { border-top: 1px solid var(--line); }
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.8rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.price-row p { font-size: 0.93rem; margin-top: 0.25rem; }
.price { font-size: 1.05rem; color: var(--accent); white-space: nowrap; }
.pricing-note { margin-top: 1.6rem; font-size: 0.92rem; }
@media (max-width: 620px) { .price-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; } }

/* ---------- contact / chat ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.contact-copy h2 { margin-bottom: 1rem; }
.contact-copy p { max-width: 48ch; }
.chat {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 460px;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.chat-title { font-weight: 600; font-size: 0.95rem; }
.chat-status { font-size: 0.72rem; color: #43d17c; }
.chat-log {
  flex: 1;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-y: auto;
  max-height: 420px;
}
.msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.94rem;
  line-height: 1.5;
}
.msg-bot {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-user {
  background: var(--accent);
  color: var(--accent-ink);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-typing { color: var(--text-dim); font-size: 0.85rem; }
.chat-input {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem;
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  padding: 0.7rem 1rem;
}
.chat-input input::placeholder { color: #6b7789; }
.chat-input input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem clamp(1rem, 4vw, 2.5rem) 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: baseline;
}
.footer p { font-size: 0.9rem; }
.footer a { color: var(--text-dim); font-size: 0.9rem; }
.footer a:hover { color: var(--text); }

/* ---------- reveal (JS adds .in) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
  .reveal.in { opacity: 1; transform: none; }
}
#fabPanel .chat-title { flex: 1; }
#fabPanel .chat-status { margin-right: 0.2rem; }
.lang-switch {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-left: 1.2rem;
  transition: color 0.2s, border-color 0.2s;
}
.lang-switch:hover { color: var(--text); border-color: #2c3a50; }
@media (max-width: 1020px) { .lang-switch { margin-left: auto; } }
