:root {
  --bg: #f6f5f1;
  --bg-alt: #eeece6;
  --surface: #ffffff;
  --ink: #16181b;
  --ink-2: #4a4f57;
  --ink-3: #7b8089;
  --line: #d9d6cd;
  --line-soft: #e6e3db;
  --accent: #d9480f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(217, 72, 15, 0.09);
  --grid: rgba(22, 24, 27, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.06);

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315;
    --bg-alt: #16191c;
    --surface: #1b1e22;
    --ink: #eceae4;
    --ink-2: #b3b6bb;
    --ink-3: #868a91;
    --line: #2c3036;
    --line-soft: #23272c;
    --accent: #ff6a2b;
    --accent-ink: #111315;
    --accent-soft: rgba(255, 106, 43, 0.12);
    --grid: rgba(236, 234, 228, 0.045);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 30px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111315;
  --bg-alt: #16191c;
  --surface: #1b1e22;
  --ink: #eceae4;
  --ink-2: #b3b6bb;
  --ink-3: #868a91;
  --line: #2c3036;
  --line-soft: #23272c;
  --accent: #ff6a2b;
  --accent-ink: #111315;
  --accent-soft: rgba(255, 106, 43, 0.12);
  --grid: rgba(236, 234, 228, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 30px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
h2 { font-size: clamp(30px, 4.2vw, 46px); max-width: 18ch; }
h3 { font-size: 21px; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--radius);
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.eyebrow {
  font: 500 12.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: transparent; color: var(--accent); }
.btn--small { min-height: 38px; padding: 0 14px; font-size: 14.5px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__text strong { font-size: 15.5px; font-weight: 600; }
.brand__text span { font: 400 11.5px/1.3 var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  font-size: 15px; color: var(--ink-2); text-decoration: none; padding: 6px 0;
  border-bottom: 1.5px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); border-color: var(--accent); }

.topbar__actions { display: flex; align-items: center; gap: 10px; }
.lang {
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-2); font: 500 13px/1 var(--mono); padding: 0 10px; height: 38px; cursor: pointer;
}
.lang:hover { color: var(--ink); border-color: var(--ink-3); }

@media (max-width: 900px) {
  .nav { display: none; }
  .topbar__actions { margin-left: auto; }
}
@media (max-width: 520px) {
  .brand__text span { display: none; }
  .topbar__actions .btn { display: none; }
}

/* ---------- hero ---------- */

.hero { position: relative; padding: clamp(64px, 11vw, 132px) 0 clamp(64px, 9vw, 112px); overflow: hidden; }
.hero__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero__inner { position: relative; }
.hero__title { font-size: clamp(38px, 6.4vw, 76px); max-width: 17ch; letter-spacing: -0.035em; line-height: 1.02; }
.hero__lead { margin-top: 28px; max-width: 62ch; font-size: clamp(17px, 1.8vw, 20px); color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__note { margin-top: 18px; font-size: 14.5px; color: var(--ink-3); }

/* ---------- sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.section__head { margin-bottom: clamp(40px, 6vw, 64px); }
.section__lead { margin-top: 18px; max-width: 64ch; color: var(--ink-2); font-size: 18px; }

/* services */

.services { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1.5px solid var(--ink); }
.service { padding: 28px 32px 36px 0; border-bottom: 1px solid var(--line); }
.service:nth-child(odd) { border-right: 1px solid var(--line); }
.service:nth-child(even) { padding-left: 32px; padding-right: 0; }
.service__num { display: block; font: 500 12.5px/1 var(--mono); color: var(--accent); margin-bottom: 18px; }
.service p { margin-top: 12px; color: var(--ink-2); }
@media (max-width: 760px) {
  .services { grid-template-columns: 1fr; }
  .service, .service:nth-child(odd), .service:nth-child(even) { padding: 24px 0 28px; border-right: 0; }
}

/* ---------- projects ---------- */

.projects { display: grid; gap: clamp(56px, 8vw, 104px); }

.project {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px); align-items: start;
}
.project:nth-child(even) .project__media { order: 2; }
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project__media { order: 0; }
}

.media {
  position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.media--video { background: #000; }
.media--video video { object-fit: contain; }
.media figcaption {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px);
  padding: 6px 10px; font: 400 12px/1.3 var(--mono); color: #fff;
  background: rgba(17, 19, 21, 0.82); border-radius: 999px;
}

.media__badge {
  font: 500 12px/1 var(--mono); letter-spacing: 0.03em;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
}
.media__badge--corner { position: absolute; right: 12px; bottom: 12px; box-shadow: var(--shadow); }

.media__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.media__placeholder svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.media__placeholder .media__badge { position: relative; }

.project__text { padding-top: 4px; }
.project__num { font: 500 13px/1 var(--mono); color: var(--accent); margin-bottom: 12px; }
.project__title { font-size: clamp(26px, 3vw, 34px); }
.project__kicker { margin-top: 10px; font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.4; }

.tags { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font: 400 12px/1 var(--mono); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--surface);
}

.project__facts { margin: 26px 0 0; }
.project__facts dt {
  font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
  margin-top: 18px;
}
.project__facts dt:first-child { margin-top: 0; }
.project__facts dt.accent { color: var(--accent); }
.project__facts dd { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.project__facts dt.accent + dd { color: var(--ink); }

.project__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.project__note { font: 400 13px/1.45 var(--mono); color: var(--ink-3); }

/* lab */

.lab {
  margin-top: clamp(72px, 10vw, 128px);
  padding: clamp(24px, 4vw, 44px);
  border: 1.5px dashed var(--ink-3); border-radius: var(--radius);
  background: var(--bg);
}
.lab__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lab__head .eyebrow { margin: 0; }
.pill {
  font: 500 12px/1 var(--mono); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.lab__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 4vw, 48px); align-items: start; }
.lab__text > p { margin-top: 18px; color: var(--ink-2); }
.lab__note { font-size: 15px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3) !important; }
.lab__media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lab__media .media { aspect-ratio: 4 / 3; }
.lab__media .media--video { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.lab__media img { object-position: center; }
@media (max-width: 900px) { .lab__inner { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .lab__media { grid-template-columns: 1fr; } }

/* ---------- process ---------- */

.process {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1.5px solid var(--ink);
}
.step { position: relative; padding: 28px 24px 8px 0; }
.step + .step { padding-left: 24px; border-left: 1px solid var(--line); }
.step__num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 20px;
  border: 1.5px solid var(--accent); border-radius: 50%;
  font: 500 14px/1 var(--mono); color: var(--accent);
}
.step__meta { font: 400 12.5px/1.4 var(--mono); color: var(--ink-3); margin-top: 6px; }
.step p:last-child { margin-top: 12px; color: var(--ink-2); font-size: 16px; }
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .process { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 24px 0 8px; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- about ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: end; }
.about__body p { margin-top: 18px; color: var(--ink-2); max-width: 60ch; font-size: 18px; }
.about__body p:first-child { margin-top: 28px; }
.about__facts { margin: 0; border-top: 1.5px solid var(--ink); }
.about__facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.about__facts dt { font: 500 12px/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.about__facts dd { margin: 0; font-size: 15.5px; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */

.contact { position: relative; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 70%);
}
.contact__inner { position: relative; }
.contact h2 { max-width: 20ch; font-size: clamp(32px, 5vw, 56px); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.copy-hint { font: 400 12px/1 var(--mono); color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line); }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font: 400 13px/1.5 var(--mono); color: var(--ink-3); }

/* ---------- explainer dialog ---------- */

.dialog {
  width: min(1100px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius);
  background: #000; overflow: visible;
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.dialog video { width: 100%; max-height: 85vh; }
.dialog__close {
  position: absolute; top: -44px; right: 0; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: #fff; color: #000; font-size: 22px; line-height: 1; cursor: pointer;
}
.section__lead:empty { display: none; }

/* workflow steps (service-type projects) */
.project__intro { margin-top: 22px; color: var(--ink); font-size: 17px; }
.workflow { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 0; }
.workflow li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding-bottom: 18px; }
.workflow li:not(:last-child)::before {
  content: ""; position: absolute; left: 16.5px; top: 34px; bottom: 0; border-left: 1.5px dashed var(--line);
}
.workflow__num {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1.5px solid var(--accent); border-radius: 50%;
  font: 500 14px/1 var(--mono); color: var(--accent); background: var(--bg-alt);
}
.workflow h4 { margin: 6px 0 0; font-size: 16.5px; font-weight: 600; }
.workflow p { margin-top: 4px; color: var(--ink-2); font-size: 15.5px; }
.workflow + .project__facts, .project__facts + .project__facts { margin-top: 18px; }

/* contact: text + details */
.contact__inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: end; }
.contact h2 { font-size: clamp(30px, 4vw, 46px); }
.contact__details { margin: 0; border-top: 1.5px solid var(--ink); }
.contact__details > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.contact__details dt { font: 500 12px/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.contact__details dd { margin: 0; font-size: 15.5px; min-width: 0; }
.contact__details a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact__details a:hover { color: var(--accent); border-color: var(--accent); }
.contact__copy {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.contact__copy #mailText { overflow-wrap: anywhere; }
.contact__copy:hover #mailText { color: var(--accent); }
@media (max-width: 900px) { .contact__inner { grid-template-columns: 1fr; } }
.hero__lead--second { margin-top: 14px; }

/* why custom software */
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.why h2 { max-width: 16ch; }
.why__body p { color: var(--ink-2); font-size: 18px; }
.why__body p + p { margin-top: 16px; }
.why__statement {
  margin-top: 28px !important; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent);
  color: var(--ink) !important; font-size: clamp(19px, 1.8vw, 22px) !important; font-weight: 600; line-height: 1.4;
}
@media (max-width: 900px) { .why { grid-template-columns: 1fr; } }

.project__paras { margin-top: 22px; }
.project__paras p { color: var(--ink-2); font-size: 16px; }
.project__paras p + p { margin-top: 12px; }
.project__paras + .project__facts { margin-top: 22px; }

.step h3 + p { margin-top: 12px; color: var(--ink-2); font-size: 16px; }
.contact__body { margin-top: 18px; max-width: 62ch; }
.contact__body p { color: var(--ink-2); font-size: 18px; }
.contact__body p + p { margin-top: 12px; }
.contact__statement { margin-top: 22px; font-size: clamp(19px, 1.8vw, 22px); font-weight: 600; color: var(--ink); }

/* screenshots keep their own proportions instead of being cropped to 16:10 */
.media--image { aspect-ratio: auto; }
.media--image img { height: auto; object-fit: initial; }
