/* Housing Automation Ai — site stylesheet
   Palette carries the navy and sky blue of the original brand.
   Type: Barlow Semi Condensed for display, Barlow for text (Google Fonts, with system fallbacks). */

:root {
  --ink: #0B2545;
  --ink-2: #13315C;
  --paper: #F4F7FA;
  --white: #FFFFFF;
  --text: #1E2A38;
  --muted: #5B6B7D;
  --rule: #C9D3DD;
  --sky: #3EA6DF;
  --sky-deep: #1B7CB5;
  --max: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --display: 'Barlow Semi Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Barlow', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
figure { margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--sky-deep); }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
}
.skip:focus { left: 8px; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 24px;
  position: relative;
}

.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  white-space: nowrap;
}
.brand small {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--sky);
  letter-spacing: 0;
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] { border-bottom-color: var(--sky); }
.nav .ext {
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 7px 14px;
  border-radius: 2px;
}
.nav .ext:hover {
  border-color: var(--sky);
  background: rgba(62, 166, 223, 0.12);
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 2px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .menu-btn { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--ink-2);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 12px 0;
    font-size: 1.1rem;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav a[aria-current="page"] { color: var(--sky); border-bottom-color: rgba(255, 255, 255, 0.1); }
  .nav .ext { border: 0; padding: 12px 0; margin-top: 4px; color: var(--sky); }
}

/* ---------- Heroes ---------- */

.hero,
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.hero { min-height: min(86vh, 820px); }
.page-hero { min-height: min(58vh, 540px); }

.hero > img,
.page-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after,
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 37, 69, 0.12) 0%, rgba(11, 37, 69, 0.35) 45%, rgba(11, 37, 69, 0.94) 100%);
}
.page-hero.plain { min-height: 0; }
.page-hero.plain::after { display: none; }

.hero .wrap,
.page-hero .wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 140px;
  padding-bottom: 64px;
}
.page-hero .wrap { padding-top: 110px; padding-bottom: 56px; }
.page-hero.plain .wrap { padding-top: 72px; padding-bottom: 56px; }

.hero h1,
.page-hero h1 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); max-width: 18ch; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 16ch; }

.hero p,
.page-hero p {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  max-width: 58ch;
  margin: 0 0 32px;
  color: rgba(255, 255, 255, 0.9);
}
.page-hero p { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 2px;
  border: 2px solid transparent;
  font-size: 1rem;
  line-height: 1;
}
.btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.btn-primary:hover { background: var(--sky); border-color: var(--sky); color: var(--ink); }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-2); border-color: var(--ink-2); }

.actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections and text ---------- */

.section { padding: clamp(56px, 8vw, 112px) 0; }
.section.paper { background: var(--paper); }
.section.ink { background: var(--ink); color: #fff; }
.section.ink a:not(.btn) { color: var(--sky); }

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 0 0 20px;
  max-width: 22ch;
}
h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0 0 8px;
}

.lead {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  max-width: 60ch;
  color: var(--muted);
}
.ink .lead { color: rgba(255, 255, 255, 0.86); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 28px; }
.stack h3 { margin-bottom: 6px; }
.stack p { max-width: 60ch; margin: 0; }
.stack p + p { margin-top: 1em; }

/* ---------- Image tiles ---------- */

.tiles {
  display: grid;
  gap: 32px 24px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 40px;
}
.tiles.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .tiles, .tiles.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles, .tiles.three { grid-template-columns: 1fr; } }

.tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--rule);
}
.tile figcaption {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}
.tile figcaption strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.tile figcaption span { color: var(--muted); font-size: 0.95rem; }

.mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mosaic img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--rule);
}

/* ---------- Bands (image beside text) ---------- */

.bands { display: grid; gap: clamp(40px, 6vw, 72px); margin-top: 40px; }
.band {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.band.flip .band-media { order: 2; }
.band-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--rule);
}
.band h2 { margin-top: 0; }
.bands h3 { font-size: 1.7rem; }
.band p { max-width: 54ch; }
@media (max-width: 820px) {
  .band { grid-template-columns: 1fr; }
  .band.flip .band-media { order: 0; }
}

/* ---------- Pipeline (dimension line) ---------- */

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 48px 0 40px;
}
.stage {
  position: relative;
  border-top: 2px solid var(--ink);
  padding: 18px 20px 0 0;
}
.stage::before,
.stage::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 2px;
  height: 16px;
  background: var(--ink);
}
.stage::before { left: 0; }
.stage::after { right: 0; }
.stage h3 { font-size: 1.1rem; margin-bottom: 8px; }
.stage p { font-size: 0.95rem; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.pipeline.compact .stage { padding-top: 14px; }
.pipeline.compact .stage h3 { font-size: 1.05rem; margin: 0; }

.role {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
}
.role::before {
  content: '';
  width: 9px;
  height: 9px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--sky);
  flex: none;
}
.role.direct::before { background: var(--ink); }
.role.human::before { background: var(--muted); }

@media (max-width: 1000px) {
  .pipeline { grid-template-columns: repeat(4, 1fr); row-gap: 40px; }
}
@media (max-width: 700px) {
  .pipeline {
    grid-template-columns: 1fr;
    row-gap: 0;
    border-left: 2px solid var(--ink);
    padding-left: 24px;
  }
  .stage { border-top: 0; padding: 0 0 28px; }
  .stage::before { left: -33px; top: 9px; width: 18px; height: 2px; }
  .stage::after { display: none; }
  .pipeline.compact .stage { padding-bottom: 18px; }
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--ink);
}
.timeline li { position: relative; padding: 0 0 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 13px;
  width: 18px;
  height: 2px;
  background: var(--ink);
}
.timeline .year {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.timeline p { margin: 0; max-width: 58ch; }

/* ---------- Platform list ---------- */

.stack-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 48px;
  margin-top: 40px;
}
@media (max-width: 700px) { .stack-list { grid-template-columns: 1fr; } }

.platform {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: start;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}
.platform .logo { min-height: 56px; display: flex; align-items: center; }
.platform .logo img { max-height: 56px; width: auto; max-width: 150px; object-fit: contain; }
.platform .logo .wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--ink);
}
.platform h3 { font-size: 1.2rem; }
.platform h3 a { color: var(--ink); text-decoration: none; }
.platform h3 a:hover { text-decoration: underline; }
.platform p { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .platform { grid-template-columns: 1fr; gap: 12px; } }

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

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.8);
  padding: 48px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 48px;
  align-items: start;
}
.site-footer p { margin: 12px 0 0; max-width: 42ch; }
.site-footer small { display: block; margin-top: 14px; color: rgba(255, 255, 255, 0.6); }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; padding-top: 6px; }
.site-footer nav a { color: #fff; text-decoration: none; }
.site-footer nav a:hover { color: var(--sky); }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }
