/* EvoSoft Robotics — mobile-first. Layout follows copilot.evosoft.ie; colours follow evosoft.ie. */

:root {
  /* Evosoft brand */
  --clr-brand: #0d9bd8;          /* evosoft.ie sky blue */
  --clr-brand-dark: #0b7fb2;
  --clr-navy: #273272;           /* evosoft.ie navy */
  --clr-accent: #00c9a7;

  --clr-bg: #f8fafc;
  --clr-surface: #ffffff;
  --clr-border: #e2e8f0;
  --clr-text: #1e293b;
  --clr-text-muted: #64748b;

  --clr-dark-bg: #0f172a;
  --clr-dark-surface: #1e293b;
  --clr-dark-border: rgba(148, 163, 184, .18);
  --clr-dark-text: #e2e8f0;
  --clr-dark-muted: #94a3b8;

  --clr-warn: #f59e0b;
  --clr-danger: #ef4444;

  --grad-hero: linear-gradient(160deg, #0f172a 0%, #1b2a5c 55%, #0c2340 100%);
  --grad-accent: linear-gradient(120deg, #0d9bd8 0%, #00c9a7 100%);

  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;

  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: .375rem;
  --radius-md: .75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;

  --shadow-md: 0 4px 12px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, .35), 0 8px 20px rgba(0, 0, 0, .2);

  --container-max: 1200px;
  --gutter: 1rem;
  --nav-h: 3.75rem;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--clr-brand-dark); }
img, svg { max-width: 100%; }

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

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

.visually-hidden {
  position: absolute !important; 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(--space-4); top: -3rem; z-index: 100;
  background: var(--clr-surface); color: var(--clr-text); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.skip-link:focus { top: var(--space-2); }

.text-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- Buttons and badges ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 2.75rem; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--clr-brand); color: #fff; box-shadow: 0 6px 20px rgba(13, 155, 216, .35); }
.btn--primary:hover { background: var(--clr-brand-dark); }
.btn--ghost { color: var(--clr-dark-text); border-color: rgba(226, 232, 240, .3); background: rgba(255, 255, 255, .04); }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); }
.btn--sm { min-height: 2.5rem; padding: var(--space-2) var(--space-5); font-size: .875rem; }
.btn--lg { min-height: 3.25rem; padding: var(--space-4) var(--space-8); font-size: 1.05rem; }

.badge {
  display: inline-block; padding: .3rem .85rem; border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--clr-brand-dark); background: rgba(13, 155, 216, .1); border: 1px solid rgba(13, 155, 216, .25);
}
.badge--accent { color: var(--clr-accent); background: rgba(0, 201, 167, .1); border-color: rgba(0, 201, 167, .3); }

/* ---------- Navigation ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 23, 42, .88);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--clr-dark-border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-h); }

.nav__logo { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.nav__logo-mark {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: var(--radius-sm);
  background: var(--grad-accent); color: #fff; font-weight: 800; font-size: .85rem;
}
.nav__wordmark { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.nav__wordmark span { color: var(--clr-brand); }

.nav__toggle {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-right: -.5rem;
  background: none; border: 0; cursor: pointer; color: #fff;
}
.nav__toggle-bar, .nav__toggle-bar::before, .nav__toggle-bar::after {
  display: block; width: 1.25rem; height: 2px; background: currentColor; border-radius: 2px;
  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: -6px; }
.nav__toggle-bar::after { top: 6px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile: menu drops down under the bar. Without JavaScript it stays open (see .no-js rule in site.js). */
.nav__menu {
  position: absolute; inset: var(--nav-h) 0 auto 0;
  display: none; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4) var(--gutter) var(--space-6);
  background: rgba(15, 23, 42, .97); border-bottom: 1px solid var(--clr-dark-border);
}
.nav__menu.is-open { display: flex; }
html:not(.js) .nav__menu { position: static; display: flex; flex-direction: row; flex-wrap: wrap; padding: 0; background: none; border: 0; }
html:not(.js) .nav__toggle { display: none; }
html:not(.js) .nav__inner { flex-wrap: wrap; }

.nav__link {
  color: var(--clr-dark-text); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: var(--space-3) 0; border-bottom: 1px solid var(--clr-dark-border);
}
.nav__link:hover { color: #fff; }
.nav__menu .btn { margin-top: var(--space-3); }

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

.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero); color: var(--clr-dark-text);
  padding: var(--space-12) 0 var(--space-16);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.hero__grid { position: relative; display: grid; gap: var(--space-12); }
.hero__content { position: relative; text-align: center; display: grid; justify-items: center; gap: var(--space-5); }
.hero__title { color: #fff; font-size: clamp(2.1rem, 8.5vw, 3.6rem); font-weight: 800; }
.hero__lead { max-width: 36rem; font-size: 1.05rem; color: var(--clr-dark-muted); }
.hero__actions { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 22rem; }
.hero--compact { padding: var(--space-16) 0; min-height: 60vh; display: grid; align-items: center; }

/* ---------- Console with the floor map ---------- */

.console {
  margin: 0; width: 100%; max-width: 40rem; justify-self: center;
  background: #0b1222; border: 1px solid var(--clr-dark-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.console__bar { display: flex; align-items: center; gap: .4rem; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--clr-dark-border); }
.console__dot { width: .65rem; height: .65rem; border-radius: 50%; background: #ef4444; }
.console__dot:nth-child(2) { background: #f59e0b; }
.console__dot:nth-child(3) { background: #22c55e; }
.console__title { margin-left: auto; margin-right: auto; padding-right: 2rem; font-family: var(--font-mono); font-size: .72rem; color: var(--clr-dark-muted); }

.floor { display: block; width: 100%; height: auto; padding: var(--space-3); font-family: var(--font-mono); }
.floor__bg { fill: #0f1a30; }
.floor__hatch { stroke: rgba(239, 68, 68, .35); stroke-width: 2; }
.zone { stroke-width: 1; }
.zone--release { fill: rgba(245, 158, 11, .1); stroke: rgba(245, 158, 11, .55); stroke-dasharray: 4 3; }
.zone--speed { fill: rgba(13, 155, 216, .1); stroke: rgba(13, 155, 216, .5); stroke-dasharray: 4 3; }
.zone--blocked { fill: rgba(239, 68, 68, .06); stroke: rgba(239, 68, 68, .45); }
.zone__label { font-size: 8px; fill: var(--clr-dark-muted); letter-spacing: .04em; }
.zone__label--blocked { fill: #fca5a5; }
.edge { fill: none; stroke: rgba(148, 163, 184, .45); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.edge--forbidden { stroke: rgba(239, 68, 68, .5); stroke-dasharray: 3 5; stroke-width: 1.5; }
.node circle { fill: #0f1a30; stroke: #cbd5e1; stroke-width: 2; }
.node text { font-size: 9px; fill: #cbd5e1; text-anchor: middle; font-weight: 600; }
.node--forbidden circle { stroke: #f87171; }
.node--forbidden text { fill: #fca5a5; font-weight: 400; font-size: 8px; }
.robot__halo { fill: rgba(0, 201, 167, .18); }
.robot__body { fill: var(--clr-accent); stroke: #fff; stroke-width: 2; }
.robot__load { fill: var(--clr-warn); stroke: #0b1222; stroke-width: 1; }

.console__log {
  list-style: none; margin: 0; padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--clr-dark-border);
  font-family: var(--font-mono); font-size: .72rem; line-height: 1.9; color: var(--clr-dark-text);
}
.console__log li { opacity: 0; animation: log-in 14s infinite; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console__log li:nth-child(1) { animation-delay: 0s; }
.console__log li:nth-child(2) { animation-delay: .4s; }
.console__log li:nth-child(3) { animation-delay: .9s; }
.console__log li:nth-child(4) { animation-delay: 2.4s; }
.console__log li:nth-child(5) { animation-delay: 8.5s; }
.console__log .out { color: var(--clr-brand); }
.console__log .in { color: #c4b5fd; }
.console__log .ok { color: #4ade80; }
@keyframes log-in {
  0% { opacity: 0; transform: translateY(4px); }
  3%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; }
}

/* ---------- Stats ---------- */

.stats { background: var(--clr-surface); border-bottom: 1px solid var(--clr-border); }
.stats__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-4); padding-block: var(--space-8); text-align: center; }
.stat__value {
  font-size: clamp(1.35rem, 5.5vw, 2rem); font-weight: 800; letter-spacing: -.02em;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: .82rem; color: var(--clr-text-muted); line-height: 1.4; margin-top: .2rem; }

/* ---------- Sections and cards ---------- */

.section { padding: var(--space-16) 0; }
.section--alt { background: var(--clr-surface); border-block: 1px solid var(--clr-border); }
.section--dark { background: var(--clr-dark-bg); color: var(--clr-dark-text); }
.section__header { display: grid; justify-items: center; gap: var(--space-4); text-align: center; max-width: 44rem; margin: 0 auto var(--space-8); }
.section__header--left { justify-items: start; text-align: left; margin-inline: 0; }
.section__title { font-size: clamp(1.7rem, 6vw, 2.5rem); font-weight: 800; }
.section--dark .section__title { color: #fff; }
.section__lead { color: var(--clr-text-muted); font-size: 1.02rem; }
.section--dark .section__lead { color: var(--clr-dark-muted); }

.cards { display: grid; gap: var(--space-4); }
.card {
  display: grid; align-content: start; gap: var(--space-3);
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  border: 1px solid var(--clr-border);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(13, 155, 216, .35); }
.card h3 { font-size: 1.1rem; font-weight: 700; }
.card p { color: var(--clr-text-muted); font-size: .95rem; }
.card__icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md);
  background: rgba(13, 155, 216, .1); color: var(--clr-brand-dark);
}
.card__icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cards--dark .card { background: var(--clr-dark-surface); border-color: var(--clr-dark-border); border-left: 3px solid var(--clr-accent); }
.cards--dark .card:hover { border-color: rgba(0, 201, 167, .5); border-left-color: var(--clr-accent); }
.cards--dark .card h3 { color: #fff; }
.cards--dark .card p { color: var(--clr-dark-muted); }

/* ---------- Roadmap timeline ---------- */

.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 46rem; display: grid; gap: var(--space-6); position: relative; }
.timeline::before {
  content: ""; position: absolute; left: .55rem; top: .5rem; bottom: .5rem; width: 2px;
  background: linear-gradient(var(--clr-accent), var(--clr-brand) 40%, var(--clr-border) 70%, var(--clr-navy));
}
.timeline__item { position: relative; padding-left: var(--space-8); display: grid; gap: var(--space-2); }
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: .3rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--clr-bg); border: 3px solid var(--clr-border);
}
.timeline__item--done::before { background: var(--clr-accent); border-color: var(--clr-accent); }
.timeline__item--now::before { border-color: var(--clr-brand); box-shadow: 0 0 0 5px rgba(13, 155, 216, .18); }
.timeline__item--street::before { border-color: var(--clr-navy); background: var(--clr-navy); }
.timeline__item h3 { font-size: 1.2rem; font-weight: 700; }
.timeline__item p:not(.chip) { color: var(--clr-text-muted); }

.chip {
  justify-self: start; padding: .15rem .65rem; border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--clr-border); color: var(--clr-text-muted);
}
.chip--done { background: rgba(0, 201, 167, .14); color: #047a66; }
.chip--now { background: rgba(13, 155, 216, .14); color: var(--clr-brand-dark); }
.chip--street { background: rgba(39, 50, 114, .12); color: var(--clr-navy); }

/* ---------- Open standards ---------- */

.open { display: grid; gap: var(--space-6); }
.open .section__header { margin-bottom: 0; }
.open__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.open__list li { padding-left: var(--space-6); position: relative; color: var(--clr-text-muted); }
.open__list li::before {
  content: ""; position: absolute; left: 0; top: .55rem; width: .6rem; height: .6rem; border-radius: 2px;
  background: var(--grad-accent);
}
.open__list strong { color: var(--clr-text); }

/* ---------- Call to action ---------- */

.cta { background: var(--grad-hero); color: var(--clr-dark-text); padding: var(--space-16) 0; text-align: center; }
.cta__inner { display: grid; justify-items: center; gap: var(--space-5); }
.cta__title { color: #fff; font-size: clamp(1.8rem, 6.5vw, 2.75rem); font-weight: 800; max-width: 34rem; }
.cta__lead { color: var(--clr-dark-muted); max-width: 32rem; }

/* ---------- Footer ---------- */

.footer { background: #080f1a; color: var(--clr-dark-muted); padding: var(--space-12) 0 var(--space-8); font-size: .9rem; }
.footer__inner { display: grid; gap: var(--space-8); }
.footer__brand { display: grid; gap: var(--space-3); }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.footer a { color: var(--clr-dark-text); text-decoration: none; }
.footer a:hover { color: var(--clr-brand); }
.footer__legal { border-top: 1px solid var(--clr-dark-border); padding-top: var(--space-6); font-size: .8rem; }

/* ---------- Reveal on scroll (only when JavaScript runs) ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  :root { --gutter: 1.5rem; }
  .hero__actions { flex-direction: row; justify-content: center; max-width: none; }
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
  .footer__links { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: var(--space-8); }
}

@media (min-width: 900px) {
  :root { --nav-h: 4.25rem; }
  .nav__toggle { display: none; }
  .nav__menu, html:not(.js) .nav__menu {
    position: static; display: flex; flex-direction: row; align-items: center; gap: var(--space-6);
    padding: 0; background: none; border: 0;
  }
  .nav__link { border: 0; padding: 0; font-size: .9rem; }
  .nav__menu .btn { margin-top: 0; }

  .hero { padding: var(--space-16) 0 calc(var(--space-16) * 1.5); }
  .hero__grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: var(--space-12); }
  .hero__content { text-align: left; justify-items: start; }
  .hero__actions { justify-content: flex-start; }
  .hero--compact .hero__content { text-align: center; justify-items: center; }
  .hero--compact .hero__actions { justify-content: center; }

  .section { padding: calc(var(--space-16) * 1.5) 0; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards--dark { grid-template-columns: repeat(2, 1fr); }
  .open { grid-template-columns: 1fr 1.4fr; align-items: center; gap: var(--space-16); }
  .footer__inner { grid-template-columns: 1.2fr 2fr; align-items: start; }
  .footer__legal { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .console__log li { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
}
