:root {
  --bg: #0f1716;
  --bg-2: #141f1e;
  --panel: #182523;
  --panel-2: #1f2f2c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8efed;
  --muted: #9bb0ab;
  --teal: #52c2b1;
  --teal-deep: #2e8f81;
  --slate: #354b48;
  --radius: 18px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5.2rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* backgrounds */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at var(--mx, 70%) var(--my, 10%), rgba(82,194,177,0.16), transparent 70%),
    radial-gradient(900px 500px at 10% 100%, rgba(82,194,177,0.07), transparent 70%);
  transition: background-position 0.2s;
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(15,23,22,0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.brand img { border-radius: 9px; }
.brand b { color: var(--teal); font-weight: 600; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  background: var(--teal); color: #0b1413; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  box-shadow: 0 0 0 0 rgba(82,194,177,0.0);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(82,194,177,0.28); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.btn-small { padding: 0.6rem 1.1rem; font-size: 0.9rem; }

/* layout */
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.section { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head p:last-child { color: var(--muted); font-size: 1.1rem; }
.eyebrow {
  font-family: var(--font-head); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal); font-weight: 600; margin-bottom: 1rem;
}
.accent { color: var(--teal); }

/* hero */
.hero { padding: clamp(4rem, 10vw, 8rem) 0 3rem; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.hero .eyebrow, .hero h1, .hero .lede, .hero .hero-actions { grid-column: 1; }
.hero .lede { color: var(--muted); font-size: 1.2rem; max-width: 560px; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.5rem; }
.hero-visual { grid-column: 2; grid-row: 1 / span 4; position: relative; height: 440px; }

.window {
  position: absolute; left: 0; top: 0; width: 80%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: float 7s ease-in-out infinite;
}
.window-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.72rem; color: var(--muted); }
.window-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a3b38; }
.window-bar span { margin-left: 10px; }

.phone {
  position: absolute; right: 0; bottom: -30px; width: 170px; height: 320px;
  background: #0b1211; border: 1px solid var(--line); border-radius: 26px; padding: 10px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.55);
  animation: float 7s ease-in-out 1.5s infinite;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin: 2rem 0 0;
}
.stats div { background: var(--bg-2); padding: 1.4rem 1.5rem; display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-head); font-size: 2rem; color: var(--teal); }
.stats span { color: var(--muted); font-size: 0.9rem; }

/* work */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tint) 45%, transparent); box-shadow: 0 24px 60px rgba(0,0,0,0.4); }
.card-wide { grid-column: span 2; flex-direction: row; }
.card-wide .card-visual { flex: 1.1; min-height: 320px; }
.card-wide .card-body { flex: 1; }
.card-visual {
  position: relative; min-height: 210px; padding: 1.6rem;
  background:
    radial-gradient(400px 220px at 80% 0%, color-mix(in srgb, var(--tint) 28%, transparent), transparent 70%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.card-body { padding: 1.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-body p { color: var(--muted); font-size: 0.97rem; }
.tag { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tint); font-weight: 600; margin: 0; }
.stack { list-style: none; padding: 0; margin: 0.3rem 0 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stack li { font-size: 0.75rem; padding: 0.25rem 0.65rem; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); }
.link { color: var(--teal); font-weight: 500; font-size: 0.95rem; }
.link::after { content: " ↗"; opacity: 0.7; }
.link:hover { text-decoration: underline; }

/* mock visuals */

.past { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.past-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.past-list li { display: flex; flex-direction: column; font-size: 0.95rem; }
.past-list b { font-family: var(--font-head); font-weight: 600; }
.past-list span { color: var(--muted); font-size: 0.88rem; }

/* services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.service { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; transition: border-color 0.2s, transform 0.2s; }
.service:hover { border-color: rgba(82,194,177,0.4); transform: translateY(-3px); }
.service p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(82,194,177,0.12); display: grid; place-items: center; margin-bottom: 1rem; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* process */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: step; }
.steps li { position: relative; padding: 1.6rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.steps span { font-family: var(--font-head); color: var(--teal); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; }
.steps h3 { margin-top: 0.6rem; }
.steps p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* about */
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: start; }
.about-grid p { color: var(--muted); font-size: 1.05rem; }
.about-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.2rem; align-items: center; }
.about-card .stack { grid-column: 1 / -1; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(140deg, var(--teal), var(--slate)); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: #0b1413; font-size: 1.3rem; }
.about-card strong { display: block; font-family: var(--font-head); }
.about-card span { display: block; color: var(--muted); font-size: 0.9rem; }

/* contact */
.contact-card {
  text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 2rem;
  border-radius: 28px; border: 1px solid rgba(82,194,177,0.3);
  background:
    radial-gradient(700px 300px at 50% 0%, rgba(82,194,177,0.18), transparent 70%),
    var(--panel);
}
.contact-card p { color: var(--muted); max-width: 520px; margin: 0 auto 1.6rem; }
.contact-card .hero-actions { justify-content: center; }

/* footer */
.footer { max-width: 1180px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer .brand { font-size: 0.95rem; color: var(--text); }
.footer p { margin: 0; flex: 1; }
.footer nav { display: flex; gap: 1.2rem; }
.footer nav a:hover { color: var(--text); }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .window, .phone { animation: none; }
}

/* responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { grid-column: 1; grid-row: auto; height: 400px; margin-top: 1rem; }
  .services, .steps { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .past-list { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-links, .nav .btn-small { display: none; }
  .nav-toggle { display: flex; margin-left: auto; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
  .nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }
  .nav.open .nav-links { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 0.5rem 1rem 1rem; }
  .nav.open .nav-links a { padding: 0.8rem 0; border-top: 1px solid var(--line); color: var(--text); }
  .work-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; flex-direction: column; }
  .services, .steps { grid-template-columns: 1fr; }
  .hero-visual { height: 360px; }
  .window { width: 92%; }
  .phone { width: 140px; height: 260px; }
  .stats div { padding: 1.1rem 1.2rem; }
  .stats strong { font-size: 1.6rem; }
}

/* contact form */
.contact-form { max-width: 620px; margin: 0 auto; text-align: left; display: flex; flex-direction: column; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.field em { font-style: normal; font-weight: 400; opacity: 0.7; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.8rem 0.95rem; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(82,194,177,0.18); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #e0806e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.3rem; }
.form-actions .btn[disabled] { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.form-status { margin: 0; min-height: 1.4em; font-size: 0.95rem; color: var(--muted); }
.form-status.ok { color: var(--teal); }
.form-status.err { color: #e0806e; }
.contact-form.sent .field-row, .contact-form.sent .field, .contact-form.sent .form-actions, .contact-form.sent .turnstile { display: none; }
.contact-form.sent .form-status { text-align: center; font-size: 1.1rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.turnstile { min-height: 65px; }
.turnstile iframe { border-radius: 10px; }

.form-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 0.5rem 0 0; }
.form-done p { color: var(--muted); max-width: 460px; margin: 0; }
.form-done a { color: var(--teal); }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: rgba(82,194,177,0.15); border: 1px solid rgba(82,194,177,0.4); display: grid; place-items: center; animation: pop 0.5s cubic-bezier(.2,.8,.2,1) both; }
.done-mark svg { width: 30px; height: 30px; fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* real screenshots in work cards */
.card-visual.has-shot { padding: 1.6rem 1.6rem 0; align-items: flex-end; overflow: hidden; }
.shot { position: relative; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; background: #0b1211; box-shadow: 0 20px 50px rgba(0,0,0,0.45); overflow: hidden; }
.shot-bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.14); }
.shot img { display: block; width: 100%; height: auto; }
.shot-phone { position: absolute; right: 1.2rem; bottom: -14px; width: 26%; max-width: 150px; border-radius: 18px; border: 4px solid #0b1211; box-shadow: 0 16px 40px rgba(0,0,0,0.55); overflow: hidden; background: #0b1211; }
.shot-phone img { display: block; width: 100%; height: auto; }
.card-wide .card-visual.has-shot { min-height: 0; }
.card-wide .shot { max-width: 100%; }
.card:hover .shot { transform: translateY(-3px); transition: transform 0.25s ease; }
@media (max-width: 720px) { .shot-phone { width: 32%; } }

/* app screenshots */
.app-visual { padding-bottom: 0 !important; }
.app-shots { display: flex; justify-content: center; align-items: flex-start; gap: 1.2rem; width: 100%; max-height: 330px; overflow: hidden; }
.app-phone { width: 44%; max-width: 190px; border-radius: 24px; border: 5px solid #0b1211; background: #0b1211; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.app-phone + .app-phone { margin-top: 2.2rem; }
.app-phone img { display: block; width: 100%; height: auto; }
.card:hover .app-phone { transform: translateY(-3px); transition: transform 0.25s ease; }
.phone > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 18px; }

.window > img { display: block; width: 100%; height: auto; }

.card-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.link-primary::after { content: " →"; }

/* case study pages */
.case { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.case-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 2.5rem; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: end; }
.case-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.case-hero .lede { color: var(--muted); font-size: 1.15rem; max-width: 600px; }
.case-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.case-meta div { background: var(--bg-2); padding: 1rem 1.2rem; }
.case-meta small { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.case-meta strong { font-weight: 600; font-size: 0.95rem; }
.case-meta a { color: var(--teal); }
.frame { border-radius: 14px; border: 1px solid var(--line); background: #0b1211; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.frame .shot-bar { padding: 10px 14px; }
.frame img { display: block; width: 100%; height: auto; }
.case-section { padding: clamp(3rem, 6vw, 5rem) 0; border-top: 1px solid var(--line); }
.case-section h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); max-width: 720px; }
.case-section > p, .prose p { color: var(--muted); font-size: 1.05rem; max-width: 720px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.two-col h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.feature { display: grid; grid-template-columns: 1fr 1.25fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0; }
.feature:nth-child(even) { grid-template-columns: 1.25fr 1fr; }
.feature:nth-child(even) .feature-text { order: 2; }
.feature h3 { font-size: 1.35rem; }
.feature p { color: var(--muted); }
.feature ul { color: var(--muted); padding-left: 1.1rem; margin: 0.8rem 0 0; }
.feature li { margin-bottom: 0.35rem; }
.phones { display: flex; justify-content: center; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; padding: 1rem 0 0; }
.phones .app-phone { width: 30%; max-width: 230px; }
.phones .app-phone:nth-child(2) { margin-top: 2.5rem; }
.stack-big { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stack-big li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.stack-big b { display: block; font-family: var(--font-head); margin-bottom: 0.25rem; }
.stack-big span { color: var(--muted); font-size: 0.9rem; }
.case-cta { margin: 1rem 0 4rem; }
.breadcrumb { font-size: 0.9rem; color: var(--muted); padding-top: 1.5rem; }
.breadcrumb a { color: var(--teal); }
@media (max-width: 900px) {
  .case-hero, .two-col, .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .stack-big { grid-template-columns: repeat(2, 1fr); }
  .phones .app-phone { width: 44%; }
}

.feature .phones { padding: 0; gap: 1rem; }
.feature .phones .app-phone { width: 42%; max-width: 200px; }
.feature .phones .app-phone:only-child { width: 55%; max-width: 230px; margin-top: 0; }

.tablet { max-width: 560px; margin: 0 auto; border-radius: 22px; border: 6px solid #0b1211; background: #0b1211; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.tablet img { display: block; width: 100%; height: auto; }
.phones.four .app-phone { width: 22%; max-width: 190px; }
.phones.four .app-phone:nth-child(2), .phones.four .app-phone:nth-child(4) { margin-top: 2.2rem; }
@media (max-width: 900px) { .phones.four .app-phone { width: 44%; } .phones.four .app-phone:nth-child(2), .phones.four .app-phone:nth-child(4) { margin-top: 0; } }
