/* ============================================================================
   Algo IT Services FZCO — stylesheet
   Direction: a system section, drawn in depth. Four disciplines are four plates
   in one stack; the page is the drawing sheet they sit on. Hairlines, mono
   values, one teal accent spent only where something is actionable or live.
   ========================================================================= */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  /* colour ---------------------------------------------------------------- */
  --ink-0:      #08090B;   /* page */
  --ink-1:      #0B0E10;   /* raised surface */
  --ink-2:      #101519;   /* pressed / hover surface */
  --line:       rgba(255,255,255,0.10);   /* structural hairline */
  --line-soft:  rgba(255,255,255,0.06);   /* inside a block */
  --line-2:     rgba(255,255,255,0.18);
  --text:       #E9EDEF;
  --text-2:     #ADB8BD;
  --mute:       #8B969C;
  --accent:     #1FB79B;   /* brand teal, the only accent */
  --accent-hi:  #2ACFB0;
  --accent-ink: #04100D;
  --accent-06:  rgba(31,183,155,0.06);
  --accent-12:  rgba(31,183,155,0.12);
  --accent-34:  rgba(31,183,155,0.34);

  /* type ------------------------------------------------------------------ */
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-mono:  0.75rem;
  --fs-0:     1rem;
  --fs-sm:    0.9375rem;
  --fs-lede:  clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --fs-h3:    clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem);
  --fs-h2:    clamp(1.625rem, 1.3rem + 1.35vw, 2.375rem);
  --fs-h1:    clamp(2.125rem, 1.1rem + 3.2vw, 3.75rem);

  /* space ----------------------------------------------------------------- */
  --shell:   1180px;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --band:    clamp(4rem, 8vw, 7.5rem);
  --bar:     3.75rem;

  /* motion ---------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 0.68, 0.24, 1);
  --ease-io:  cubic-bezier(0.4, 0, 0.2, 1);

  /* z scale --------------------------------------------------------------- */
  --z-base: 0;
  --z-raise: 10;
  --z-head: 40;
  --z-menu: 50;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 1.5rem);
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-0);
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.022em; line-height: 1.06; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.mono {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-menu);
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.skip:focus { left: 1rem; top: 1rem; }

/* --------------------------------------------------------------- top bar */
.top {
  position: sticky;
  top: 0;
  z-index: var(--z-head);
  background: color-mix(in srgb, var(--ink-0) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.top__in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.625rem; margin-right: auto; }
.brand__mark { width: 22px; height: 22px; color: var(--text); }
.brand__name { font-weight: 600; letter-spacing: -0.015em; }

.nav { display: flex; gap: 1.5rem; }
.nav a {
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.nav a:hover { color: var(--text); border-bottom-color: var(--line-2); }

.toplink {
  font-size: var(--fs-sm);
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
  transition: color 120ms ease, border-color 120ms ease;
}
.toplink:hover { color: var(--accent-hi); border-bottom-color: var(--accent-hi); }

.menu { display: none; }

.top__rule { height: 1px; }
#progress {
  display: block;
  height: 1px;
  width: 0;
  background: rgba(255,255,255,0.34);
  transition: width 80ms linear;
}

.menu__panel { display: none; }

/* ---------------------------------------------------------------- layout */
main { display: block; }

.hero,
.sec,
.foot__in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: var(--band);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.sec {
  padding-top: var(--band);
  padding-bottom: var(--band);
  border-top: 1px solid var(--line);
}

.sec__head { max-width: 68ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  color: var(--mute);
  margin-bottom: 1.5rem;
}

h1 { font-size: var(--fs-h1); max-width: 17ch; letter-spacing: -0.032em; text-wrap: balance; }
.sec h2 { font-size: var(--fs-h2); max-width: 26ch; }

.lede {
  margin-top: 1.5rem;
  font-size: var(--fs-lede);
  color: var(--text-2);
  max-width: 56ch;
  text-wrap: pretty;
}
.lede--tight { margin-top: 1rem; }

.hero__acts {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

/* --------------------------------------------------------- 3D layer rig */
.rig { min-width: 0; position: relative; }

.rig__scene {
  position: relative;
  aspect-ratio: 1 / 0.94;
  max-width: 470px;
  margin-inline: auto;
  perspective: 1200px;
  perspective-origin: 50% 48%;
  overflow: clip;
}

.deck {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(60deg) rotateZ(-38deg);
  transition: transform 500ms var(--ease-out);
  will-change: transform;
}

.deck__base {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 78%;
  translate: -50% -50%;
  border: 1px solid var(--line);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 600ms ease 320ms;
}
body.is-ready .deck__base { opacity: 1; }

.plate {
  --z: 0px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68%;
  height: 68%;
  translate: -50% -50%;
  border: 1px solid rgba(31,183,155,0.5);
  background: rgba(31,183,155,0.07);
  transform: translateZ(var(--z));
  transform-style: preserve-3d;
  opacity: 1;
  transition:
    transform 700ms var(--ease-out),
    opacity 600ms var(--ease-out),
    border-color 200ms ease,
    background-color 200ms ease;
  will-change: transform;
}

.plate[data-plate="1"] { --z: 0px;   transition-delay: 60ms;  }
.plate[data-plate="2"] { --z: 48px;  transition-delay: 140ms; }
.plate[data-plate="3"] { --z: 96px;  transition-delay: 220ms; }
.plate[data-plate="4"] { --z: 144px; transition-delay: 300ms; }

body:not(.is-ready) .plate {
  transform: translateZ(calc(var(--z) - 110px));
  opacity: 0;
}

.plate[data-plate="2"] { width: 64%; height: 64%; background: rgba(31,183,155,0.09); }
.plate[data-plate="3"] { width: 60%; height: 60%; background: rgba(31,183,155,0.11); }
.plate[data-plate="4"] { width: 56%; height: 56%; background: rgba(31,183,155,0.13); border-color: rgba(31,183,155,0.7); }

.plate.is-hot {
  border-color: var(--accent);
  background: var(--accent-12);
  transform: translateZ(calc(var(--z) + 12px));
}

.plate__tick {
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  opacity: 0.7;
}
.plate__tick--tl { left: -1px;  top: -1px;    border-left-width: 1px; border-top-width: 1px; }
.plate__tick--tr { right: -1px; top: -1px;    border-right-width: 1px; border-top-width: 1px; }
.plate__tick--bl { left: -1px;  bottom: -1px; border-left-width: 1px; border-bottom-width: 1px; }
.plate__tick--br { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; }

.plate__cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1px;
  translate: -50% -50%;
  background: var(--accent);
  opacity: 0.55;
}
.plate__cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 14px;
  translate: -50% -50%;
  background: var(--accent);
}

.tags {
  margin: 1.5rem auto 0;
  max-width: 460px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.tags li { display: flex; align-items: baseline; gap: 0.5rem; cursor: default; transition: color 160ms ease; }
.tags .n { color: var(--accent); font-weight: 500; }
.tags li:hover { color: var(--text); }

.rig__note {
  margin: 1.25rem auto 0;
  max-width: 460px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-top: 1px solid var(--line);
  padding-top: 0.875rem;
}
.rig__note .mono { margin-right: 0.5rem; }

/* ------------------------------------------------------------ fact table */
.facts {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  margin-top: clamp(1rem, 3vw, 2rem);
}
.facts > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  color: var(--mute);
}
.facts dd { color: var(--text); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1.2;
  transition: background-color 140ms ease, border-color 140ms ease, transform 80ms ease;
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn:active { transform: translateY(1px); }
.btn--lg { padding: 0.9rem 1.5rem; font-size: 1.0625rem; }

.textlink {
  padding: 0.5rem 0;
  margin: -0.5rem 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.textlink:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ------------------------------------------------------- discipline cards */
.cards {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --sy: 50%;
  position: relative;
  background: var(--ink-0);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 260ms var(--ease-out), background-color 200ms ease, box-shadow 260ms var(--ease-out);
  isolation: isolate;
}

.card__in {
  position: relative;
  height: 100%;
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.card__dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.card:hover .card__dot { opacity: 1; }

.card h3 { font-size: var(--fs-h3); letter-spacing: -0.018em; }
.card p { margin-top: 0.75rem; color: var(--text-2); max-width: 46ch; text-wrap: pretty; }

.chips {
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--mute);
  margin-top: 1.75rem;
}
.chips li { display: flex; align-items: baseline; gap: 0.5rem; }
.chips li::before {
  content: "";
  flex: none;
  width: 3px;
  height: 3px;
  background: var(--line-2);
  translate: 0 -2px;
}

/* the measurement line answers the pointer: it is the only thing that moves
   inside a card, so the card reads as a placed object, not a floating tile */
.card__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--sy);
  height: 1px;
  background: var(--accent);
  opacity: 0;
  scale: 0 1;
  transform-origin: left center;
  transition: opacity 160ms ease, scale 320ms var(--ease-out);
  pointer-events: none;
}
.card:hover .card__scan, .card:focus-within .card__scan { opacity: 0.5; scale: 1 1; }
.card:hover { background: var(--ink-1); box-shadow: 0 30px 70px -40px rgba(0,0,0,0.95), 0 0 0 1px rgba(31,183,155,0.12); z-index: var(--z-raise); }

/* ------------------------------------------------------- delivery rail */
.rail { position: relative; margin-top: clamp(2rem, 4vw, 3rem); }

.rail__track {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--line);
}
.rail__fill {
  display: block;
  width: 1px;
  height: 0;
  background: var(--accent);
  transition: height 120ms linear;
}

.steps { display: grid; gap: 0; padding-left: 1.75rem; }
.steps li {
  position: relative;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 3px);
  top: 1.85rem;
  width: 7px;
  height: 7px;
  background: var(--ink-0);
  border: 1px solid rgba(31,183,155,0.55);
}
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps .mono { display: block; margin-bottom: 0.5rem; }
.steps h3 { font-size: var(--fs-h3); }
.steps p { margin-top: 0.5rem; color: var(--text-2); max-width: 54ch; }

/* --------------------------------------------------------- approach grid */
.grid {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.cell { padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.cell h3 { font-size: var(--fs-h3); }
.cell p { margin-top: 0.5rem; color: var(--text-2); max-width: 50ch; }

/* ------------------------------------------------------------------- faq */
.faq { margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0;
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.016em;
  transition: color 120ms ease;
}
.faq summary::after {
  content: "";
  margin-left: auto;
  width: 11px;
  height: 11px;
  border-right: 1px solid var(--mute);
  border-bottom: 1px solid var(--mute);
  rotate: 45deg;
  translate: 0 -3px;
  transition: rotate 220ms var(--ease-out), border-color 160ms ease;
}
.faq details[open] summary::after { rotate: -135deg; translate: 0 3px; border-color: var(--accent); }
.faq summary:hover { color: #fff; }

.faq__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms var(--ease-out);
}
.faq details[open] .faq__body { grid-template-rows: 1fr; }
.faq__body > p {
  overflow: hidden;
  min-height: 0;
  color: var(--text-2);
  max-width: 64ch;
  padding-bottom: 0;
  transition: padding-bottom 260ms var(--ease-out);
}
.faq details[open] .faq__body > p { padding-bottom: 1.5rem; }

/* --------------------------------------------------------------- contact */
.contact__row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.copy {
  padding: 0.8rem 1.1rem;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}
.copy:hover { border-color: var(--accent); color: var(--text); background: var(--accent-06); }
.copy:active { transform: translateY(1px); }

.copy__note {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  color: var(--mute);
}

.copy__done {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  color: var(--accent);
  min-height: 1em;
}

.facts--contact { margin-top: clamp(2rem, 4vw, 3rem); }

/* ------------------------------------------------------------------ foot */
.foot { border-top: 1px solid var(--line); margin-top: clamp(2.5rem, 5vw, 4rem); }
.foot__in {
  padding-top: 2rem;
  padding-bottom: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  color: var(--mute);
  font-size: var(--fs-sm);
}
.foot__meta a { display: inline-block; padding-block: 0.25rem; margin-block: -0.25rem; border-bottom: 1px solid var(--line); transition: color 120ms ease, border-color 120ms ease; }
.foot__meta a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* --------------------------------------------------------- breakpoints */
@media (min-width: 720px) {
  .facts { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .facts > div { grid-template-columns: 11rem 1fr; gap: 0.25rem 1rem; }
  .grid { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
}

@media (min-width: 860px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: start; }
  .hero__copy { padding-top: 0.5rem; }
  .rig__scene { max-width: none; aspect-ratio: 1 / 1; }
  .rig__note { max-width: none; }
  .tags {
    position: absolute;
    inset: 0;
    margin: 0;
    max-width: none;
    display: block;
  }
  .tags li {
    position: absolute;
    padding-left: 15px;
    transform: translateY(-50%);
    white-space: nowrap;
  }
  .tags li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 9px;
    height: 1px;
    background: rgba(31,183,155,0.8);
  }
}

@media (min-width: 1080px) {
  .rail { padding-top: 1px; }
  .rail__track {
    left: 0;
    right: 0;
    top: 0;
    width: auto;
    height: 1px;
  }
  .rail__fill { width: 0; height: 1px; transition: width 120ms linear; }
  .steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 1.75rem;
    padding-left: 0;
  }
  .steps li {
    padding: 2.25rem 0 0;
    border-bottom: 0;
    border-top: 1px solid transparent;
  }
  .steps li::before { left: 0; top: -4px; }
}

@media (max-width: 719px) {
  .nav, .toplink { display: none; }
  .top__in { gap: 1rem; }

  .menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line-2);
    border-radius: 2px;
    cursor: pointer;
  }
  .menu__bar { display: block; width: 15px; height: 1px; margin: 0 auto; background: var(--text); transition: transform 200ms var(--ease-out), opacity 160ms ease; }
  .menu[aria-expanded="true"] .menu__bar:first-child { transform: translateY(3px) rotate(45deg); }
  .menu[aria-expanded="true"] .menu__bar:last-child { transform: translateY(-3px) rotate(-45deg); }

  .menu__panel {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: var(--z-menu);
    background: var(--ink-1);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .menu__panel[hidden] { display: none; }
  .menu__panel a {
    display: block;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-2);
    font-size: 1.0625rem;
  }
  .menu__panel a:last-child { border-bottom: 0; color: var(--accent); }

  .card { transform: none; }
  .card__scan { display: none; }
}

@media (max-width: 420px) {
  h1 { font-size: clamp(1.95rem, 8.6vw, 2.35rem); }
}

@media (hover: none) {
  .card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  body:not(.is-ready) .plate { transform: translateZ(var(--z)); opacity: 1; }
}
