/* AT Systems website: "Schematic" design.
   The site reads as an engineering drawing: a faint drawing grid, numbered sheets,
   mono labels, gold traces and board photos mounted on plates with crop marks.
   Brand colors and Nunito follow AT-Systems-Brand-Package/web/brand-tokens.css (v1.0);
   JetBrains Mono is the utility face for labels, numbers and specs.
   The site is dark only; every color below is a token. */

/* Fonts are self-hosted (variable woff2 from Google Fonts, latin + latin-ext for Serbian). */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/jetbrains-mono-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Brand */
  --ats-green:      #1E4D45;
  --ats-green-dark: #163A34;
  --ats-gold:       #D9A441; /* accent: traces, fills, text on dark only */
  --ats-mist:       #EEF1F0;
  --ats-ink:        #1A2523;

  /* Theme tokens */
  --bg:        #0E1917;
  --panel:     #13211F;
  --grid:      rgba(238, 241, 240, .045);
  --line:      rgba(238, 241, 240, .13);
  --line-soft: rgba(238, 241, 240, .07);
  --text:      #E4EAE8;
  --strong:    #FFFFFF;   /* headings */
  --muted:     #97A8A3;
  --ref:       #D9A441;   /* mono reference text: sheet numbers, U1, TP1 */
  --trace:     #D9A441;
  --plate:     url(/assets/img/grain-t1.png), radial-gradient(ellipse closest-side at 50% 50%, #22362F 0%, #1A2B27 45%, #13211F 100%); /* homepage: cut-out photos on a lit panel; closest-side so it fades fully into --panel before the plate edge */
  --plate-photo: #FFFFFF; /* project pages: photo backdrops are normalised to pure white so plate and photo meet seamlessly */
  --btn:       #D9A441;
  --btn-hi:    #E6B65A;
  --btn-text:  #0E1917;
  --header-bg: rgba(14, 25, 23, .88);
  --field:     #0E1917;
  --footer-bg: #091210;
  --error:     #F3C9C2;
  color-scheme: dark;

  /* Type */
  --ats-font: 'Nunito', 'Trebuchet MS', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ats-text-display: 2.5rem;
  --ats-text-h1:      2rem;
  --ats-text-h2:      1.75rem;
  --ats-text-h3:      1.25rem;
  --ats-text-body:    1rem;
  --ats-text-small:   .875rem;
  --ats-text-label:   .75rem;

  /* Layout */
  --ats-trace-width: 3px;
  --container: 1200px;
  --gutter: 16px;
  --band-pad: 72px;
  --header-h: 68px;
}

@media (min-width: 768px) {
  :root {
    --ats-text-display: 4rem;
    --ats-text-h1:      2.75rem;
    --ats-text-h2:      2.5rem;
    --ats-text-h3:      1.375rem;
    --ats-text-body:    1.0625rem;
    --gutter: 40px;
    --band-pad: 88px;
    --header-h: 76px;
  }
}
@media (min-width: 1200px) { :root { --ats-text-display: 4.5rem; } }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--ats-font);
  font-size: var(--ats-text-body);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { margin: 0; color: var(--strong); text-wrap: balance; }
h1, h2 { font-weight: 800; line-height: 1.12; letter-spacing: -0.01em; }
h1 { font-size: var(--ats-text-h1); }
h2 { font-size: var(--ats-text-h2); }
h3 { font-size: var(--ats-text-h3); font-weight: 800; line-height: 1.3; }
p  { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--ref); text-underline-offset: 3px; }
a:hover { color: var(--strong); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: .6em 1em; background: var(--btn); color: var(--btn-text); font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--btn-text); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Brand components ---------- */
.ats-label {
  font: 500 var(--ats-text-label)/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.ats-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 46px; padding: 0 1.4em;
  font: 700 .8125rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  background: var(--btn); color: var(--btn-text);
  border: 1px solid var(--btn);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ats-btn:hover { background: var(--btn-hi); border-color: var(--btn-hi); color: var(--btn-text); }
.ats-btn--secondary,
.ats-btn--outline-light { background: transparent; border-color: var(--line); color: var(--text); }
.ats-btn--secondary:hover,
.ats-btn--outline-light:hover { background: var(--line-soft); border-color: var(--muted); color: var(--strong); }
.ats-btn--light { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.ats-btn--light:hover { background: var(--btn-hi); border-color: var(--btn-hi); color: var(--btn-text); }
.ats-btn--small { min-height: 40px; padding: 0 1.1em; }
.hero .ats-btn:not(.ats-btn--secondary)::after,
.cta .ats-btn--light::after { content: "\2192"; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Photo plate: a cut-out board photo on a softly lit panel */
.plate { position: relative; display: block; background: var(--plate); border: 1px solid var(--line); padding: 12px; }
.plate img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.plate--marks::before, .plate--marks::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid var(--trace); pointer-events: none;
}
.plate--marks::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.plate--marks::after { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 8px;
  height: var(--header-h);
}

.brand { margin-right: auto; }
/* Logo: 34px tall on mobile (keeps it above the 140px minimum width), 40px on desktop */
.brand img { height: 34px; width: auto; }
@media (min-width: 768px) { .brand img { height: 40px; } }

.site-nav ul { display: flex; gap: 22px; counter-reset: nav; }
.site-nav li { counter-increment: nav; }
.site-nav a:not(.ats-btn) {
  display: block; padding: 8px 0;
  font: 500 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  text-decoration: none; color: var(--muted);
}
.site-nav a:not(.ats-btn)::before { content: counter(nav, decimal-leading-zero) " "; color: var(--ref); }
.site-nav a:not(.ats-btn):hover, .site-nav a[aria-current="page"] { color: var(--strong); }

.nav-toggle { display: none; }

@media (min-width: 900px) {
  .site-nav { display: flex; align-items: center; gap: 28px; }
}
@media (min-width: 900px) and (max-width: 1080px) {
  .site-nav ul { gap: 14px; }
  .site-nav a:not(.ats-btn)::before { content: none; }
}

@media (max-width: 899.98px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -8px;
    border: 0; background: transparent; cursor: pointer;
  }
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    display: block; width: 22px; height: 2px;
    background: var(--strong); transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle-bar { position: relative; }
  .nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bar::before { top: -7px; }
  .nav-toggle-bar::after  { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; margin-bottom: 16px; }
  .site-nav a:not(.ats-btn) { padding: 14px 0; font-size: .875rem; border-bottom: 1px solid var(--line-soft); }
  .site-nav .ats-btn { width: 100%; }
}

/* Language switch */
.lang-switch {
  display: inline-flex; flex: none; align-items: stretch;
  height: 40px; border: 1px solid var(--line);
}
.lang-switch a {
  display: grid; place-items: center; min-width: 38px; padding: 0 8px;
  font: 700 .75rem var(--mono); letter-spacing: .06em;
  text-decoration: none; color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.lang-switch a + a { border-left: 1px solid var(--line); }
.lang-switch a:hover { background: var(--line-soft); color: var(--strong); }
.lang-switch a[aria-current] { background: var(--btn); color: var(--btn-text); }
@media (max-width: 380px) {
  .lang-switch a { min-width: 32px; padding: 0 5px; }
  .header-inner { gap: 6px; }
}
@media (min-width: 900px) {
  .lang-switch { order: 1; margin-left: 20px; }
}

/* ---------- Hero ---------- */
/* The hero fills the first screen: the illustration takes whatever height the text and
   stats leave (flex-basis 0 + grow), down to a floor, after which the section just grows. */
.hero {
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  padding: 32px 0 0; border-bottom: 1px solid var(--line);
}
@supports (height: 100svh) { .hero { min-height: calc(100svh - var(--header-h)); } }
@media (min-width: 768px) { .hero { padding-top: 56px; } }
.hero > .container { flex: 1 0 auto; display: flex; flex-direction: column; }

.hero-grid { flex: 1 0 auto; display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 980px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
}

/* The tag sits inside the h1 so search engines read the main phrase as part of the heading */
.hero-tag { display: block; color: var(--ref); margin-bottom: 18px; }
.hero .display { margin-top: 0; }
.display {
  font-size: var(--ats-text-display);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 18px 0 22px;
}
.display em { font-style: normal; color: var(--ref); }
.lead { font-size: 1.0625rem; color: var(--muted); max-width: 54ch; }
@media (min-width: 768px) { .lead { font-size: 1.1875rem; } }
.hero .btn-row { margin-top: 32px; }
@media (min-width: 768px) { .proof-short { display: none; } }
@media (max-width: 767px) {
  /* Tighter on phones so the text, illustration and stats fit one screen */
  .hero { padding-top: 24px; }
  .hero .display { margin: 0 0 16px; }
  .hero-tag { margin-bottom: 14px; }
  .hero .lead { font-size: 1rem; line-height: 1.55; }
  .hero .btn-row { margin-top: 24px; flex-wrap: nowrap; gap: 8px; }
  /* Both hero buttons on one line, even on narrow phones */
  .hero .btn-row .ats-btn { flex: 1 1 auto; padding: 0 .8em; gap: .4em; letter-spacing: .04em; white-space: nowrap; }
  .hero-figure .dim { display: none; } /* repeats the "1 team from PCB to app" stat below */
  .proof-full { display: none; } /* phones get shorter stat labels */
  .hero-proof li { padding: 14px 8px 16px 0; }
  .hero-proof li + li { padding-left: 12px; }
  .hero-proof strong { margin-bottom: 4px; }
  .hero-art { min-height: 130px; }
}
@media (max-width: 359px) {
  .hero .btn-row .ats-btn { font-size: .75rem; padding: 0 .6em; }
}

.hero-figure { flex: 1 0 0; display: flex; flex-direction: column; justify-content: center; margin: 0; }
.hero-art {
  flex: 1 0 0; width: 100%; min-height: 150px; object-fit: contain;
  max-height: min(488px, calc((100vw - 2 * var(--gutter)) * .871)); /* natural height at full width */
  margin-inline: auto;
}
@media (min-width: 980px) {
  .hero-figure { align-self: stretch; }
  .hero-art { min-height: 260px; }
}
.dim {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  font: 500 .75rem var(--mono); color: var(--muted);
}
.dim::before, .dim::after { content: ""; flex: 1; height: 1px; background: var(--muted); opacity: .5; }

.hero-proof {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px; border-top: 1px solid var(--line);
}
@media (min-width: 768px) { .hero-proof { margin-top: 40px; } }
.hero-proof li {
  padding: 18px 12px 20px 0; border-right: 1px solid var(--line);
  color: var(--muted); font-size: .8125rem; line-height: 1.4;
}
.hero-proof li + li { padding-left: 14px; }
.hero-proof li:last-child { border-right: 0; }
@media (min-width: 768px) {
  .hero-proof li { padding: 28px 20px 32px 0; font-size: .9375rem; }
  .hero-proof li + li { padding-left: 24px; }
}
.hero-proof strong {
  display: block; margin-bottom: 8px;
  font: 700 clamp(1.5rem, 4vw, 2.75rem)/1 var(--mono); color: var(--strong);
}

/* ---------- Bands: each one is a numbered sheet ---------- */
main { counter-reset: sheet; }
.band { padding: var(--band-pad) 0; border-bottom: 1px solid var(--line); }

.section-head { display: grid; gap: 14px; margin-bottom: 40px; }
@media (min-width: 768px) { .section-head { margin-bottom: 48px; } }
.band .section-head { counter-increment: sheet; }
/* Sheet number, label and a short gold trace on one line: "01 WHAT WE DO ——" */
.band .section-head .ats-label { display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: var(--text); }
.band .section-head .ats-label::before {
  content: counter(sheet, decimal-leading-zero);
  font-size: .9375rem; font-weight: 700; letter-spacing: 0; color: var(--ref);
}
.band .section-head .ats-label::after { content: ""; flex: none; width: 56px; height: 2px; background: var(--trace); }
.section-head > p:not(.ats-label) { max-width: 62ch; }
.section-intro { font-size: 1.0625rem; color: var(--muted); }
@media (min-width: 768px) { .section-intro { font-size: 1.125rem; } }

/* Sheet number, label, heading and intro stack on one left edge, the same edge as the content */
.split { display: block; }
/* sections whose heading has no intro line keep their text close to it */
.section-head:not(:has(.section-intro)) { margin-bottom: 24px; }

/* ---------- Cards: datasheet columns ---------- */
.cards { display: grid; }
.cards--3, .cards--2 { counter-reset: part; border: 1px solid var(--line); background: var(--panel); }
@media (min-width: 900px) { .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { padding: 30px 26px 34px; border-bottom: 1px solid var(--line); min-width: 0; }
.card:last-child { border-bottom: 0; }
@media (min-width: 900px) {
  .cards--3 .card { border-bottom: 0; border-right: 1px solid var(--line); }
  .cards--3 .card:last-child { border-right: 0; }
}
@media (min-width: 760px) {
  .cards--2 .card { border-bottom: 0; border-right: 1px solid var(--line); }
  .cards--2 .card:last-child { border-right: 0; }
}
.card-icon { display: none; }
.cards--3 .card, .cards--2 .card { counter-increment: part; }
.card > .ats-label {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px dashed var(--line);
  text-transform: none; letter-spacing: .02em;
}
.card > .ats-label::before { content: "U" counter(part); color: var(--ref); font-weight: 700; }
.card h3 { margin-bottom: 10px; font-size: 1.5rem; }
.card > p:not(.ats-label) { color: var(--muted); }
/* "More about this service" link under the home-page service cards */
/* cards with a link stack as a column so the links line up at the bottom */
.card:has(> .project-more) { display: flex; flex-direction: column; }
.card > .project-more { align-self: flex-start; margin-top: auto; padding-top: 20px; text-decoration: none; }
.card > .project-more:hover, .card > .project-more:focus-visible { text-decoration: underline; }

.ticks { margin-top: 22px; font: 400 .8125rem/1.5 var(--mono); }
.ticks li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.ticks li::before { content: "\25B8"; color: var(--trace); }

/* ---------- Approach ---------- */
.points {
  display: grid; gap: 1px; counter-reset: point;
  background: var(--line); border: 1px solid var(--line);
}
@media (min-width: 640px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .points { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.point { background: var(--bg); padding: 26px 24px 30px; counter-increment: point; }
.point::before { content: "A." counter(point); display: block; margin-bottom: 14px; font: 500 .75rem var(--mono); color: var(--ref); }
.point h3 { font-size: 1.125rem; margin-bottom: 8px; }
.point p { color: var(--muted); font-size: .9688rem; }

/* ---------- Process: one gold trace through five test points ---------- */
.process-board {
  --rail: 17px;  /* dot row height; every dot size shares its centre line */
  --nx: 8px;     /* wide: dot x inside its column */
  --ny: 30px;    /* narrow: dot y inside its card, level with the step number */
  container: process / inline-size;
  position: relative;
}
.process-trace {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
}
.process-trace path {
  fill: none; stroke: var(--trace);
  stroke-width: var(--ats-trace-width);
  stroke-linecap: round; stroke-linejoin: round;
}

.steps { display: grid; gap: 14px; max-width: 720px; position: relative; }
.step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; }

.step-card { min-width: 0; padding: 18px 0 8px; }
.step-num { display: block; margin-bottom: 6px; font: 500 .75rem var(--mono); color: var(--ref); }
.step-num::before { content: "TP"; }
.step h3 { font-size: 1.25rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .9688rem; }

/* Dots: solid start, vias between, pad ring at the end (brand trace proportions, s = 3px) */
.trace-node {
  position: relative; z-index: 1;
  justify-self: center;
  width: var(--d); height: var(--d);
  margin-top: var(--ny); translate: 0 -50%;
  border-radius: 50%;
  transition: background-color .2s ease, border-color .2s ease;
}
.trace-node--start { --d: 11px; background: var(--trace); }
.trace-node--via   { --d: 16px; border: 3px solid var(--trace); background: var(--bg); }
.trace-node--end   { --d: 19px; border: 5px solid var(--trace); background: var(--bg); }

/* Draw-in: dots wait in line color until the trace reaches them */
.is-pending .trace-node:not(.is-lit),
.is-drawing .trace-node:not(.is-lit) { border-color: var(--line); }
.is-pending .trace-node--start:not(.is-lit),
.is-drawing .trace-node--start:not(.is-lit) { background: var(--line); }
.is-drawing .trace-node.is-lit { animation: node-pop .4s ease-out; }
@keyframes node-pop { 0% { scale: .6; } 60% { scale: 1.3; } 100% { scale: 1; } }

@container process (min-width: 900px) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; max-width: none; }
  .step { display: flex; flex-direction: column; gap: 22px; }
  .step-card { padding: 0; }
  .trace-node {
    justify-self: auto; translate: -50% 0;
    margin: calc((var(--rail) - var(--d)) / 2) 0 calc((var(--rail) - var(--d)) / 2) var(--nx);
  }
}

/* ---------- Projects: datasheet rows ---------- */
.cards--projects { border-top: 1px solid var(--line); }
.project {
  display: grid; gap: 14px; padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .project {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: 1fr auto auto auto auto 1fr;
    column-gap: 56px; row-gap: 12px;
  }
  .project .plate { grid-column: 1; grid-row: 1 / 7; }
  .project > :not(.plate) { grid-column: 2; }
  .project .tags { grid-row: 2; }
}
.project .plate { padding: 10px; transition: transform .3s ease; }
a.project:hover .plate { transform: translateY(-4px); }
.project h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.project > p { color: var(--muted); max-width: 52ch; }

.tags { display: flex; flex-wrap: wrap; gap: 4px 0; font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ref); }
/* The dot sits after each tag (not before the next), so a wrapped line starts flush with a tag name */
.tags li:not(:last-child)::after { content: "\00B7"; margin: 0 8px; }

a.project { text-decoration: none; color: inherit; }
.project-more { font: 700 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ref); }
.project-more::after { content: " \2192"; }


/* ---------- Projects: tile grid ---------- */
.tiles { display: grid; gap: 20px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile--wide { grid-column: span 2; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 10px 10px 22px; border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; color: inherit; transition: border-color .2s ease, transform .25s ease, box-shadow .25s ease;
}
.tile .plate { padding: 0; border: 0; margin-bottom: 8px; overflow: hidden; }
.tile .plate img { transition: transform .4s ease; }
a.tile:hover, a.tile:focus-visible { border-color: rgba(217, 164, 65, .75); transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8); }
a.tile:hover .plate img, a.tile:focus-visible .plate img { transform: scale(1.04) translateY(-4px); }
a.tile .project-more::after { content: "\2192"; display: inline-block; margin-left: .45em; transition: transform .2s ease; }
a.tile:hover .project-more::after { transform: translateX(4px); }
.tile > :not(.plate) { padding: 0 10px; }
.tile h3 { font-size: 1.1875rem; }
.tile > p { color: var(--muted); font-size: var(--ats-text-small); }
.tile .project-more { margin-top: auto; padding-top: 6px; font-size: .75rem; }
@media (min-width: 1000px) {
  .tile--wide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto auto 1fr; column-gap: 20px; row-gap: 10px; padding: 10px 24px 10px 10px; }
  .tile--wide .plate { grid-column: 1; grid-row: 1 / 7; margin: 0; }
  .tile--wide > :not(.plate) { grid-column: 2; padding: 0; }
  .tile--wide .tags { grid-row: 2; }
  .tile--wide h3 { grid-row: 3; }
  .tile--wide > p { grid-row: 4; }
  .tile--wide .project-more { grid-row: 5; }
  .tile--wide .plate { align-self: center; }
  .tile--wide .project-more { margin-top: 0; }
}

/* Projects: featured row on top, the rest in a compact grid (image, tags and title only) */
.tiles--compact { margin-top: 20px; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .tiles--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tiles--compact .tile { padding: 8px 8px 14px; gap: 6px; }
.tiles--compact .tile > p, .tiles--compact .tile .project-more { display: none; }
.tiles--compact .tile h3 { font-size: 1rem; }
/* boards sit small in their 16:10 cut-out frame; zoom in so they read on small cards */
.tiles--compact .plate img { transform: scale(1.3); }
.tiles--compact a.tile:hover .plate img, .tiles--compact a.tile:focus-visible .plate img { transform: scale(1.35) translateY(-3px); }
@media (min-width: 1000px) {
  .tiles--compact .plate img { transform: scale(1.12); }
  .tiles--compact a.tile:hover .plate img, .tiles--compact a.tile:focus-visible .plate img { transform: scale(1.17) translateY(-3px); }
}
.tiles--compact .tile .tags { font-size: .7rem; flex-wrap: nowrap; }
.tags abbr { text-decoration: none; }

/* ---------- Project pages ---------- */
.project-hero { padding: 40px 0 72px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .project-hero { padding: 64px 0 96px; } }

.back-link {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  font: 700 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none;
}
.back-link::before { content: "\2190"; }
.project-hero .tags { margin-bottom: 16px; }
.project-title { font-size: var(--ats-text-h1); max-width: 22ch; }
@media (min-width: 768px) { .project-title { font-size: var(--ats-text-display); line-height: 1.06; letter-spacing: -0.02em; } }
.project-hero .lead { margin-top: 20px; max-width: 46em; }

.project-figure { position: relative; margin: 48px 0 0; background: var(--plate-photo); border: 1px solid var(--line); padding: 14px; }
.project-figure::before, .project-figure::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--trace); pointer-events: none;
}
.project-figure::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.project-figure::after { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }
.project-figure img { width: 100%; height: auto; }

/* Facts: a spec table */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 40px 0 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts div { padding: 16px 16px 18px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.facts dt { font: 500 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-weight: 700; color: var(--strong); }

.prose { display: grid; gap: 16px; max-width: 42em; }
.prose p { color: var(--muted); }
@media (min-width: 960px) { .prose { font-size: 1.0625rem; } }

.gallery { display: grid; gap: 24px; }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery-item { margin: 0; }
.gallery-item img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: var(--plate-photo); border: 1px solid var(--line); padding: 10px; }
.photo-placeholder {
  display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 20px; text-align: center;
  border: 1px dashed var(--line); color: var(--muted); font: 500 .8125rem var(--mono);
}
.gallery-item figcaption { margin-top: 10px; font: 400 .75rem var(--mono); color: var(--muted); }
.gallery-item figcaption::before { content: "FIG. "; color: var(--ref); }
:lang(sr) .gallery-item figcaption::before { content: "SL. "; }

.outcomes { display: grid; max-width: 46em; border-top: 1px solid var(--line); }
.outcomes li { position: relative; padding: 16px 0 16px 26px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.outcomes li::before { content: "\25B8"; position: absolute; left: 0; color: var(--trace); }
.outcomes strong { color: var(--strong); }

.band--tight { padding-top: 0; }

/* ---------- FAQ ---------- */
.faq { counter-reset: q; }
.faq details { border-top: 1px solid var(--line); counter-increment: q; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: baseline; gap: 18px; padding: 20px 0;
  cursor: pointer; list-style: none;
  font-weight: 800; font-size: 1.125rem; color: var(--strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q" counter(q); flex: none; width: 28px; font: 500 .8125rem var(--mono); color: var(--ref); }
.faq summary::after { content: "+"; margin-left: auto; font: 400 1.5rem/1 var(--mono); color: var(--ref); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline-offset: 2px; }
.faq details p { padding: 0 40px 22px 46px; color: var(--muted); max-width: 70ch; }

/* ---------- About ---------- */
#about .section-head { margin-bottom: 0; }

/* ---------- Contact ---------- */
#contact { border-bottom: 0; }
.cta { display: grid; gap: 40px; }
@media (min-width: 960px) { .cta { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 64px; } }
.cta .ats-label { color: var(--ref); }
.cta h2 { margin: 14px 0 18px; font-size: clamp(2rem, 4vw, 3rem); }
.cta p:not(.ats-label) { color: var(--muted); max-width: 34em; }
.cta .cta-contact { margin-top: 16px; }
.cta a:not(.ats-btn) { font-weight: 700; }

.cta--compact { align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 32px 26px; }
@media (min-width: 768px) { .cta--compact { padding: 48px; } }
.cta--compact h2 { font-size: var(--ats-text-h2); }
.cta--compact .cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 960px) { .cta--compact .cta-actions { justify-content: flex-end; } }

.contact-form { display: grid; gap: 18px; border: 1px solid var(--line); background: var(--panel); padding: 24px; }
@media (min-width: 768px) { .contact-form { padding: 32px; } }
.field-row { display: grid; gap: 18px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend {
  padding: 0;
  font: 500 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.field legend { margin-bottom: 8px; }
.optional { text-transform: none; letter-spacing: 0; opacity: .8; }

.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  font: 400 1rem/1.4 var(--ats-font); color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 0;
}
.field textarea { resize: vertical; min-height: 132px; }
.field select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2397A8A3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.field select option { color: var(--text); background: var(--panel); }
.field input::placeholder { color: var(--muted); opacity: .7; }
.form-note { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.form-note a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--ats-gold); outline-offset: -1px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line); font: 500 .8125rem var(--mono); color: var(--text);
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.choice span::before { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--muted); }
.choice:hover span { border-color: var(--muted); }
.choice input:checked + span { border-color: var(--trace); color: var(--strong); background: rgba(217, 164, 65, .1); }
.choice input:checked + span::before { background: var(--trace); border-color: var(--trace); }
.choice input:focus-visible + span { outline: 2px solid var(--ats-gold); outline-offset: 2px; }

.contact-form .ats-btn { justify-self: start; min-height: 50px; padding: 0 1.8em; margin-top: 4px; }
.contact-form .ats-btn::after { content: "\2192"; }
.contact-form .ats-btn[disabled] { opacity: .7; cursor: progress; }

.form-status { min-height: 1.6em; font-weight: 600; color: var(--text); }
.form-status.is-error { color: var(--error); }

/* ---------- Footer: brand banner over a drawing title block ---------- */
.site-footer {
  background: var(--footer-bg);
  color: rgba(238, 241, 240, .72);
  padding: 64px 0 32px;
  font-size: var(--ats-text-small);
}
.site-footer a { color: var(--ats-mist); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* Footer banner: logo + "CONNECTING THE DOTS", joined by a PCB trace.
   The slogan is an SVG built from the same Nunito outlines as the logo's wordmark,
   so shown at the logo's height (H) it matches AT SYSTEMS exactly. Baseline = 0.6198 H.
   main.js draws the trace from the rendered positions. */
.footer-banner {
  --logo-h: 34px;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding-bottom: calc(var(--logo-h) * 0.3 + 14px);
}
.footer-trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.footer-trace path { fill: none; stroke: var(--ats-gold); stroke-width: var(--ats-trace-width); stroke-linecap: round; stroke-linejoin: round; }
.footer-trace .t-start { fill: var(--ats-gold); }
.footer-trace .t-pad { fill: var(--footer-bg); stroke: var(--ats-gold); stroke-width: 5.1; }

.site-footer .footer-logo { height: var(--logo-h); width: auto; }
.footer-slogan { justify-self: end; margin-right: 22px; }
.footer-slogan img { display: block; height: var(--logo-h); width: auto; }

/* Phones: no trace; one line reading  [logo] AT SYSTEMS · CONNECTING THE DOTS */
@media (max-width: 767.98px) {
  .footer-banner {
    --logo-h: min(34px, calc((100vw - 32px) / 10.6));
    display: flex; padding-bottom: 0;
  }
  .footer-trace { display: none; }
  .site-footer .footer-logo { flex: none; }
  .footer-slogan { position: relative; flex: none; margin: 0; padding-left: calc(var(--logo-h) * 0.56); }
  .footer-slogan::before {
    content: ""; position: absolute;
    left: calc(var(--logo-h) * 0.234); top: calc(var(--logo-h) * 0.4445);
    width: calc(var(--logo-h) * 0.092); height: calc(var(--logo-h) * 0.092);
    border-radius: 50%; background: var(--ats-gold);
  }
}
@media (min-width: 768px) { .footer-banner { --logo-h: 40px; } }
@media (min-width: 1024px) { .footer-banner { --logo-h: 44px; } }

.footer-nav { margin-top: 40px; }
.site-footer nav ul {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid rgba(238, 241, 240, .16);
  font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em;
}
.site-footer nav li { border-bottom: 1px solid rgba(238, 241, 240, .1); }
.site-footer nav a { display: block; padding: 12px 14px; }
@media (min-width: 768px) {
  .site-footer nav ul { display: flex; flex-wrap: wrap; }
  .site-footer nav li { flex: 1 1 0; border-bottom: 0; border-right: 1px solid rgba(238, 241, 240, .16); }
  .site-footer nav li:last-child { border-right: 0; }
}

.footer-bottom {
  margin-top: 24px; font: 400 .75rem/1.6 var(--mono);
}

/* ---------- Privacy policy ---------- */
.legal { max-width: 46rem; }
.legal .ats-label { color: var(--ref); }
.legal h1 { margin: 14px 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.legal-updated { margin: 0 0 40px; font: 400 .75rem var(--mono); color: var(--muted); }
.legal-body h2 { margin: 40px 0 12px; font-size: 1.25rem; }
.legal-body p, .legal-body li { color: var(--text); line-height: 1.7; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { padding-left: 1.2em; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100vh - var(--header-h) - 260px); display: grid; align-content: center; padding-block: 96px; }
.notfound .ats-label { color: var(--ref); }
.notfound .lead { margin-bottom: 32px; }

/* ---------- Motion ---------- */
/* Scroll-in effects. main.js adds .anim to <html> only when motion is allowed,
   so without JS or with reduced motion everything simply shows. */
@media (prefers-reduced-motion: no-preference) {
  /* Section label: the short gold trace grows out of the label */
  .anim .band .section-head .ats-label::after { transform-origin: left; transform: scaleX(0); transition: transform .7s cubic-bezier(.3, .7, .2, 1) .15s; }
  .anim .band .section-head.is-in .ats-label::after { transform: scaleX(1); }

  /* Cards, points and project tiles rise in, a few at a time */
  .anim .rv { opacity: 0; translate: 0 14px; transition: opacity .6s ease, translate .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
  .anim .rv.is-in { opacity: 1; translate: 0 0; }

  /* About graphic: traces draw out of the board, then each callout appears */
  .anim .about-art .a-draw { transition: stroke-dashoffset .7s ease-out var(--d, 0ms); }
  .anim .about-art .a-fade { opacity: 0; transition: opacity .45s ease var(--d, 0ms); }
  .anim .about-art.is-in .a-draw { stroke-dashoffset: 0 !important; }
  .anim .about-art.is-in .a-fade { opacity: 1; }

  /* Footer: the trace draws from the logo to the slogan, then the pad ring appears */
  .anim .footer-trace path { transition: stroke-dashoffset 1.3s cubic-bezier(.45, 0, .2, 1); }
  .anim .footer-banner:not(.is-in) .footer-trace .t-pad { opacity: 0; }
  .anim .footer-trace .t-pad { transition: opacity .3s ease 1.25s; }
}
/* Hero illustration: the three layers stack up, traces, code and chart draw in,
   then a small signal now and then runs up the links from the board to the app. */
.hero-art .art-ref { font-family: var(--mono); }
.hero-art .art-name { font-family: var(--ats-font); }
.hero-art .signal, .hero-art .ping { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .layer { animation: layer-in .75s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-art .layer-hw { --from: 26px; }
  .hero-art .layer-fw { --from: -46px; animation-delay: .2s; }
  .hero-art .layer-sw { --from: -70px; animation-delay: .4s; }
  .hero-art .vias, .hero-art .label circle, .hero-art .label text, .hero-art .pad { animation: art-fade .5s ease both; }
  .hero-art .vias { animation-delay: 1s; }
  .hero-art .draw { stroke-dasharray: 1; animation: art-draw .6s ease-out both; }
  .hero-art .layer-hw .draw { animation-delay: calc(.75s + var(--k, 0) * 50ms); }
  .hero-art .d1 { --k: 1; } .hero-art .d2 { --k: 2; } .hero-art .d3 { --k: 3; } .hero-art .d4 { --k: 4; }
  .hero-art .d5 { --k: 5; } .hero-art .d6 { --k: 6; } .hero-art .d7 { --k: 7; } .hero-art .d8 { --k: 8; }
  .hero-art .layer-hw .pad { animation-delay: 1.2s; }
  .hero-art .layer-fw .draw { animation-delay: calc(1s + var(--k, 0) * 60ms); }
  .hero-art .c1 { --k: 1; } .hero-art .c2 { --k: 2; } .hero-art .c3 { --k: 3; } .hero-art .c4 { --k: 4; }
  .hero-art .c5 { --k: 5; } .hero-art .c6 { --k: 6; } .hero-art .c7 { --k: 7; } .hero-art .c8 { --k: 8; }
  .hero-art .chart { animation-duration: .9s; animation-delay: 1.4s; }
  .hero-art .pad-sw { animation-delay: 2s; }
  .hero-art .label.l2 > * { animation-delay: .6s; }
  .hero-art .label.l1 > * { animation-delay: .8s; }
  .hero-art .label.l0 > * { animation-delay: 1s; }
  .hero-art .label .draw { animation-duration: .5s; }

  .hero-art .signal { animation: art-signal 6s ease-in-out 2.6s infinite; }
  .hero-art .s1 { animation-delay: 4.6s; }
  .hero-art .s2 { animation-delay: 6.6s; }
  .hero-art .ping { transform-box: fill-box; transform-origin: center; animation: art-ping 6s ease-out 2.6s infinite; }
}
@keyframes layer-in { from { opacity: 0; transform: translateY(var(--from)); } to { opacity: 1; transform: none; } }
@keyframes art-fade { from { opacity: 0; } }
@keyframes art-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes art-signal {
  0% { opacity: 0; transform: none; }
  6% { opacity: 1; }
  34% { opacity: 1; }
  40%, 100% { opacity: 0; transform: translateY(-290px); }
}
@keyframes art-ping {
  0%, 36% { opacity: 0; transform: scale(1); }
  38% { opacity: .9; }
  60%, 100% { opacity: 0; transform: scale(3.2); }
}

/* Process: a short light runs once along the trace after it is drawn, and again on hover */
.process-trace .pulse {
  fill: none; stroke: #FFE3A3; stroke-width: 3; stroke-linecap: round; opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255, 210, 120, .9));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .is-drawing .trace-node.is-lit { animation: node-pop .4s ease-out !important; } /* process trace always plays */
}

/* Project pages built from studio renders: dark render backdrop instead of the white photo plate */
.project-figure--render { background: #0B1412; padding: 0; }
.project-figure--render img { display: block; }
.gallery--render .gallery-item img { background: #0B1412; padding: 0; object-fit: cover; }

/* ---------- Gallery lightbox (built by main.js) ---------- */
.js .gallery-item img { cursor: zoom-in; transition: border-color .2s ease; }
.js .gallery-item img:hover { border-color: rgba(217, 164, 65, .45); }
.gallery-item img:focus-visible { outline: 2px solid var(--ref); outline-offset: 3px; }
html.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(6, 12, 11, .94); display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox[hidden] { display: none; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; padding: 64px 16px 8px; overflow: hidden; min-height: 0; }
@media (min-width: 768px) { .lightbox-stage { padding: 56px 88px 8px; } }
.lightbox-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; transition: transform .25s ease; user-select: none; -webkit-user-drag: none; }
.lightbox.is-zoomed .lightbox-img { transform: scale(2.5); cursor: zoom-out; }
.lightbox-caption { display: flex; justify-content: center; gap: 14px; margin: 0; padding: 12px 16px 20px; font: 400 .75rem var(--mono); color: var(--muted); text-align: center; }
.lightbox-count { color: var(--ref); }
.lightbox-btn { position: absolute; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(19, 33, 31, .85); color: var(--strong); font: 400 1.25rem/1 var(--mono); cursor: pointer; }
.lightbox-btn:hover { border-color: var(--ref); color: var(--ref); }
.lightbox-btn:focus-visible { outline: 2px solid var(--ref); outline-offset: 2px; }
.lightbox-close { top: 12px; right: 12px; font-size: 1.6rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
@media (max-width: 767px) { .lightbox-prev, .lightbox-next { top: auto; bottom: 10px; transform: none; } }
.lightbox.is-single .lightbox-prev, .lightbox.is-single .lightbox-next { display: none; }
.lightbox.is-zoomed .lightbox-prev, .lightbox.is-zoomed .lightbox-next, .lightbox.is-zoomed .lightbox-caption { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .lightbox-img { transition: none; } }
@media (max-width: 767px) { .lightbox-caption { padding-bottom: 66px; } }
/* single-image gallery: one large figure instead of a lone grid cell */
@media (min-width: 760px) { .gallery--1 { grid-template-columns: minmax(0, 1fr); max-width: 960px; } }
/* render shots inside a mixed gallery (next to app screenshots) */
.gallery-item--render img { background: #0B1412; padding: 0; object-fit: cover; }
.gallery-item--shot img { background: #0B1412; padding: 0; object-fit: cover; }

/* Project pages: previous / next project links under the CTA */
.project-pager { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 600px) { .project-pager { grid-template-columns: 1fr 1fr; } }
.pager-link {
  display: grid; gap: 6px; padding: 20px 24px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none;
  transition: border-color .15s ease;
}
.pager-link:hover, .pager-link:focus-visible { border-color: var(--ats-gold); }
.pager-link--next { text-align: right; }
.pager-dir { font: 500 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ref); }
.pager-link--prev .pager-dir::before { content: "\2190\00a0"; }
.pager-link--next .pager-dir::after { content: "\00a0\2192"; }
.pager-title { font-weight: 700; font-size: 1.0625rem; color: var(--strong); }

/* Project pages: one gallery at the top, hero image first, arrows / swipe / dots to step through */
/* sized so image + caption line fit in the viewport below the header */
.project-gallery { margin: 48px auto 0; max-width: max(18rem, calc((100vh - var(--header-h) - 96px) * 4 / 3)); }
@supports (height: 100svh) { .project-gallery { max-width: max(18rem, calc((100svh - var(--header-h) - 96px) * 4 / 3)); } }
.project-gallery .project-figure { margin: 0; }
.carousel-track {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  touch-action: pan-x pan-y; /* a vertical swipe on the gallery scrolls the page */
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--ref); outline-offset: 3px; }
.carousel-slide { position: relative; flex: 0 0 100%; margin: 0; aspect-ratio: 4 / 3; scroll-snap-align: start; scroll-snap-stop: always; }
.project-figure .carousel-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.js .carousel-slide img { cursor: zoom-in; }
.carousel-slide figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 44px; height: 44px; display: none; place-items: center;
  border: 1px solid var(--line); background: rgba(19, 33, 31, .85); color: var(--strong);
  font: 400 1.25rem/1 var(--mono); cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.js .carousel-btn { display: grid; }
.carousel-btn:hover { border-color: var(--ref); color: var(--ref); }
.carousel-btn:focus-visible { outline: 2px solid var(--ref); outline-offset: 2px; }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
@media (max-width: 599px) { .carousel-btn { width: 38px; height: 38px; } .carousel-prev { left: 8px; } .carousel-next { right: 8px; } }
.carousel-meta { display: flex; align-items: center; gap: 14px; min-height: 20px; margin: 16px 0 0; font: 400 .75rem var(--mono); color: var(--muted); }
.carousel-count { color: var(--ref); flex: none; }
.carousel-caption { min-width: 0; }
.carousel-dots { display: flex; gap: 6px; margin-left: auto; flex: none; }
.carousel-dot { width: 10px; height: 10px; padding: 0; border: 1.5px solid var(--muted); background: transparent; cursor: pointer; }
.carousel-dot[aria-current="true"] { background: var(--ref); border-color: var(--ref); }
.carousel-dot:focus-visible { outline: 2px solid var(--ref); outline-offset: 2px; }
.project-gallery.is-single .carousel-btn, .project-gallery.is-single .carousel-dots { display: none; }

/* About: abstract board graphic (inline SVG) beside the text */
.about-art { display: block; width: 100%; height: auto; max-width: 520px; margin: 40px auto 0; }
@media (min-width: 1240px) {
  #about .container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 56px; align-items: center; }
  .about-art { margin: 0; }
}
@media (max-width: 599px) { .about-art .art-sub { display: none; } }

/* Transparent renders over a page-drawn backdrop: the gradient comes from CSS and a tiny grain tile
   breaks up its 8-bit steps, so lossy WebP can no longer band it */
.project-figure--render .carousel-slide,
.lightbox-img {
  background:
    url(/assets/img/grain-t1.png),
    radial-gradient(ellipse closest-side at 50% 50%, #1a2c29 0%, rgb(15 26 23) 45%, rgb(13 23 21) 55%, rgb(12 21 19) 65%, #0b1412 85%);
}
