/* Systemax AI website
   Direction: Swiss, bright and minimal (refs: Heart Aerospace, Postevand, Atlason, Bigpicture).
   Schibsted Grotesk for everything you read, Fragment Mono (a Helvetica-derived mono) for labels.
   The one loud moment is the demo phone number, set as big as the hero. */

:root {
  --paper: #ffffff;
  --ink: #0b0b0c;
  --fog: #edeef0;
  --graphite: #45474b;
  --rule: #0b0b0c;
  --rule-soft: #d3d5d9;
  --signal: #e5322d;
  --blue: #1f3fe0; /* from the business card */

  --pad: clamp(16px, 2.2vw, 32px);
  --gap-section: clamp(88px, 10vw, 168px);

  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Fragment Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.link:hover { text-decoration-thickness: 2px; }

/* ---------- Header: hairline cells, Postevand-style ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.mark {
  padding: 12px var(--pad);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.bar-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 36px);
  padding: 0 var(--pad);
  border-left: 1px solid var(--rule);
  font-size: 0.875rem;
}
.bar-nav a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.bar-cta {
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  border-left: 1px solid var(--rule);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
}
.bar-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */

.hero { padding: clamp(56px, 9vw, 140px) var(--pad) 0; }
.hero > .label { color: var(--graphite); margin-bottom: clamp(20px, 3vw, 40px); }
.hero-title {
  font-weight: 700;
  font-size: clamp(3rem, 11.2vw, 13.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
}
.hero-title span {
  display: block;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
.hero-title span + span { animation-delay: 0.08s; }
@keyframes rise { from { opacity: 0; transform: translateY(0.18em); } }

.hero-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--pad);
  margin-top: clamp(48px, 7vw, 112px);
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.hero-foot p { max-width: 34ch; }

/* ---------- Clients ---------- */

.clients { padding: var(--gap-section) var(--pad) 0; }
.client-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}
.client {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 32px 20px 4px;
  border-left: 1px solid var(--rule-soft);
}
.client:first-child { border-left: 0; padding-left: 0; }
.client-logo { height: 64px; display: flex; align-items: center; }
/* Each mark gets its own height (--h, set inline) so the four read as equal weight */
.client-logo img { width: auto; max-height: var(--h, 56px); max-width: min(100%, 210px); }
.client-name { font-weight: 600; font-size: 0.9375rem; }
.client-what { color: var(--graphite); margin-top: 2px; }

/* ---------- Demo line: the signature ---------- */

.demo {
  margin-top: var(--gap-section);
  padding: clamp(48px, 6vw, 96px) var(--pad);
  background: var(--fog);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

.demo-number {
  display: block;
  width: fit-content;
  margin: clamp(20px, 3vw, 44px) 0 clamp(40px, 5vw, 72px) -0.05em;
  font-weight: 700;
  font-size: clamp(3rem, 15vw, 18rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
  transition: color 0.2s;
}
.demo-number:hover { color: var(--graphite); }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--pad);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.demo-lede { grid-column: 1 / 7; }
.demo-try { grid-column: 7 / 10; }
.demo-call { grid-column: 10 / 13; }
.demo-lede {
  max-width: 26ch;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.try { margin-top: 10px; border-top: 1px solid var(--rule-soft); }
.try li { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.fineprint { color: var(--graphite); font-size: 0.875rem; margin-bottom: 20px; max-width: 36ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background-color 0.2s;
}
.btn:hover { background: #2b2c2f; }

/* ---------- Shared section frame ---------- */

.section { padding: var(--gap-section) var(--pad) 0; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--pad);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section-head p { max-width: 40ch; color: var(--graphite); font-size: 1.125rem; }
.title {
  font-weight: 700;
  font-size: clamp(2.5rem, 6.2vw, 6.25rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

/* ---------- Services ---------- */

.service-list { border-top: 1px solid var(--rule); }
/* 12 columns so the description lines up with the section intro above it */
.service {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--pad);
  align-items: baseline;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--rule-soft);
}
.service h3 { grid-column: 1 / 7; }
.service p { grid-column: 7 / 12; }
.service .tag { grid-column: 12 / 13; }
.service h3 {
  font-size: clamp(1.625rem, 2.8vw, 2.75rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
}
.service p { max-width: 48ch; }
.service .tag { justify-self: end; color: var(--graphite); }

/* ---------- Process ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pad);
}
.step { padding-top: 16px; border-top: 1px solid var(--rule); }
.step h3 {
  margin: clamp(32px, 4vw, 64px) 0 10px;
  font-size: clamp(1.625rem, 2.4vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1;
}
.step p { max-width: 30ch; color: var(--graphite); }

/* The return path from Train back to Look: runs from the centre of the last column to the first */
.loop-back { margin: 24px calc(12.5% - var(--pad) * 0.375) 0; }
.loop-path {
  position: relative;
  height: 36px;
  border: 1px solid var(--rule);
  border-top: 0;
}
.loop-path::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -5px;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-bottom: 8px solid var(--rule);
}
.loop-back .label {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  padding: 0 12px;
  background: var(--paper);
  color: var(--graphite);
  white-space: nowrap;
}

/* ---------- Quick wins ---------- */

.quick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--pad);
  border-top: 1px solid var(--rule);
}
.quick-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- Work ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) var(--pad);
}
.case-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--fog);
}
.case-media .shot {
  width: 38%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 24px 48px -24px rgba(11, 11, 12, 0.35);
}
.case-media .logo { width: auto; max-width: 34%; max-height: 26%; }
.case-media .logo-wide { max-width: 58%; }
.case-media .logo-round { max-height: 34%; }
/* Workflow panels stand in for screenshots: the steps are the picture */
.case-wide { grid-column: 1 / -1; }
.flow {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(20px, 2.6vw, 40px);
  background: var(--fog);
}
.flow > .label { color: var(--graphite); }
.flow ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--pad);
}
.flow li {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.flow li .label { display: block; margin-bottom: clamp(20px, 3vw, 44px); }
.flow-tall { aspect-ratio: 4 / 3; }
.flow-tall ol { grid-template-columns: minmax(0, 1fr); gap: 0; }
.flow-tall li,
.flow-tall li:last-child { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: baseline; padding: 12px 0; }
.flow-tall li:last-child { border-bottom: 1px solid var(--rule); }
.flow-tall li .label { margin: 0; }

.case-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.case-meta h3 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; }
.case-meta .label { color: var(--graphite); }
.case > p { max-width: 52ch; margin-top: 8px; color: var(--graphite); }
.case-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--pad);
  margin-top: 8px;
}
.case-body p:first-child { grid-column: 1 / 7; color: var(--graphite); }
.case-body p:last-child {
  grid-column: 8 / 13;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- Reviews (draft) ---------- */

.draft-note {
  max-width: 640px;
  padding: 24px;
  border: 1px dashed var(--graphite);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--pad);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.about-copy p {
  max-width: 30ch;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.015em;
}
.about-copy .about-more {
  max-width: 44ch;
  margin-top: 24px;
  color: var(--graphite);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

/* ---------- Contact and footer ---------- */

.contact {
  margin-top: var(--gap-section);
  padding: clamp(40px, 5vw, 72px) var(--pad) 0;
  border-top: 1px solid var(--rule);
}
.contact-title {
  display: inline-block;
  margin-left: -0.05em;
  font-weight: 700;
  font-size: clamp(3rem, 12.4vw, 15rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
}
.contact-title .arrow { display: inline-block; transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.1, 1); }
.contact-title:hover .arrow { transform: translateX(0.08em); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pad);
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.contact-grid .label { color: var(--graphite); margin-bottom: 6px; }
.contact-grid p:not(.label) { max-width: 28ch; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(64px, 8vw, 120px) var(--pad) 24px;
  color: var(--graphite);
  font-size: 0.8125rem;
}

/* ---------- Blue (option B, 27 Oct): the card's blue on small details, plus the demo band ---------- */

.hero-title .stop { display: inline; animation: none; color: var(--blue); }
.contact-title .arrow,
.step > .label,
.flow li .label,
.service .tag,
.case-meta .label,
.loop-back .label { color: var(--blue); }
.link { text-decoration-color: var(--blue); }
.btn { background: var(--blue); }
.btn:hover { background: #1832b8; }
.bar-cta:hover { background: var(--blue); }
.loop-path { border-color: var(--blue); }
.loop-path::before { border-bottom-color: var(--blue); }
::selection { background: var(--blue); color: #fff; }

.demo {
  --rule: #fff;
  --rule-soft: rgba(255, 255, 255, 0.32);
  --graphite: rgba(255, 255, 255, 0.82);
  background: var(--blue);
  color: #fff;
}
.demo .label { color: rgba(255, 255, 255, 0.85); }
.demo .live-dot { background: #fff; }
.demo .btn { background: #fff; color: var(--blue); }
.demo .btn:hover { background: rgba(255, 255, 255, 0.88); }
.demo-number:hover { color: rgba(255, 255, 255, 0.8); }

/* ---------- Scroll motion (only with JS; see main.js) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 1s cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Hairlines draw left to right instead of fading */
.js .draw {
  border-top-color: transparent;
  background-image: linear-gradient(var(--rule), var(--rule));
  background-repeat: no-repeat;
  background-origin: border-box;
  background-position: 0 0;
  background-size: 0% 1px;
  transition: background-size 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}
.js .draw.is-in { background-size: 100% 1px; }
.js [data-reveal].draw {
  transition: opacity 0.8s ease, transform 1s cubic-bezier(0.2, 0.7, 0.1, 1), background-size 1.2s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* The demo number dials in, digit by digit */
.js .demo-number span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 0.5s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: calc(var(--i) * 60ms);
}
.js .demo-number.is-in span { opacity: 1; transform: none; }

/* The loop's return path draws from Train back to Look.
   The clip sits on the inner .loop-path: a clipped element never counts as on screen for the observer. */
.js .loop-back[data-reveal] { opacity: 1; transform: none; }
.js .loop-back .loop-path {
  clip-path: inset(-12px -12px -12px 100%);
  transition: clip-path 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.4s;
}
.js .loop-back.is-in .loop-path { clip-path: inset(-12px); }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-nav { display: none; }

  .hero-foot,
  .demo-grid,
  .section-head,
  .about-grid,
  .steps,
  .quick-list,
  .work-grid { grid-template-columns: minmax(0, 1fr); }

  .client-list,
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client:nth-child(odd) { border-left: 0; padding-left: 0; }
  .client:nth-child(n + 3) { border-top: 1px solid var(--rule-soft); }

  .service { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .service h3,
  .service p,
  .service .tag,
  .demo-grid > * { grid-column: auto; }
  .service .tag { justify-self: start; grid-row: 1; }

  .step h3 { margin-top: 20px; }
  .flow ol { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flow li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: baseline; padding: 12px 0; }
  .flow li .label { margin: 0; }
  .flow-tall { aspect-ratio: auto; }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-body p:first-child,
  .case-body p:last-child { grid-column: auto; }
  .loop-back { margin: 20px 0 0; }
  .loop-path { height: auto; border: 0; }
  .loop-path::before { display: none; }
  .loop-back .label { position: static; transform: none; padding: 0; }
  .loop-back .label::before { content: "↺ "; }
  .demo-grid { gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal],
  .js .demo-number span { opacity: 1 !important; transform: none !important; }
  .js .draw { background-size: 100% 1px !important; }
  .js .loop-back .loop-path { clip-path: none !important; }
}
