/* ==========================================================================
   BACTIX Technology — main stylesheet
   Plain CSS, no build step. Sections:
   1. Font  2. Tokens  3. Base  4. Layout  5. Header  6. Buttons
   7. Hero  8. Sections  9. Services  10. Process  11. About
   12. Portfolio (ready, unused)  13. Contact  14. Footer
   15. Legal pages / 404  16. Motion
   ========================================================================== */

/* 1. Font — Archivo variable (weights 100–900, widths 62–125 %), self-hosted.
   Licence: /assets/fonts/OFL.txt */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-wdth-normal.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;
}

/* 2. Tokens */
:root {
  --navy: #0A1F3C;
  --navy-deep: #06152A;
  --navy-soft: #12305A;
  --turq: #1FC8C8;
  --turq-dark: #0B7E85;   /* turquoise for text on white (4.8:1) */
  --white: #FFFFFF;
  --ink: #0A1F3C;
  --muted: #4A5A70;       /* 7:1 on white */
  --muted-dark: #A9B8CC;  /* 8:1 on navy */
  --surface: #F6F9FB;     /* keeps --turq-dark text above 4.5:1 */
  --line: #DCE4EC;
  --line-dark: rgba(255, 255, 255, .12);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2rem);
  --max: 72rem;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 4.25rem;
  --shadow: 0 1px 2px rgba(10, 31, 60, .06), 0 8px 24px rgba(10, 31, 60, .08);

  /* colours that change on dark sections */
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--turq-dark);
  --focus: var(--turq-dark);
}

.dark {
  --text: var(--white);
  --text-muted: var(--muted-dark);
  --accent: var(--turq);
  --focus: var(--turq);
  background-color: var(--navy);
  color: var(--text);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-stretch: 100%;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0 0 .5em;
  font-stretch: 125%;
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.15rem, 1.1rem + 4.4vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

[tabindex="-1"]:focus { outline: none; }

::selection { background: var(--turq); color: var(--navy); }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--turq);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* 4. Layout */
.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.section { padding-block: clamp(4rem, 2.5rem + 6vw, 7rem); }
.section-alt { background: var(--surface); }

.section-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.section-head p:last-child { margin-bottom: 0; }
.section-head > p:not(.eyebrow) { color: var(--text-muted); font-size: 1.125rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  font-size: .8125rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.75rem; height: 2px;
  background: currentColor;
}

.lead { font-size: clamp(1.125rem, 1rem + .5vw, 1.3rem); color: var(--text-muted); }

/* 5. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 31, 60, .92);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line-dark);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  min-height: var(--header-h);
}

.brand { display: inline-flex; padding-block: .5rem; border-radius: 6px; }
.brand img { width: auto; height: 2.25rem; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a:not(.btn) {
  display: inline-block;
  padding-block: .5rem;
  color: var(--text);
  font-size: .975rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .2rem;
  height: 2px;
  background: var(--turq);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.site-nav a:not(.btn):hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle { display: none; }

/* Mobile menu (only when JavaScript runs; without it the links simply wrap) */
@media (max-width: 52rem) {
  .js .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.75rem; height: 2.75rem;
    margin-right: -.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--white);
    cursor: pointer;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 1.375rem; height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before,
  .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .js .site-nav {
    display: none;
    flex-basis: 100%;
    padding-bottom: 1.25rem;
  }
  .js .site-header.nav-open .site-nav { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav li { border-top: 1px solid var(--line-dark); }
  .js .site-nav a:not(.btn) { display: block; padding-block: .9rem; font-size: 1.0625rem; }
  .js .site-nav a:not(.btn)::after { display: none; }
  .js .site-nav li:last-child { padding-top: 1rem; }
  .js .site-nav .btn { width: 100%; }
}

/* 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 3rem;
  padding: .7rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn-primary { background: var(--turq); color: var(--navy); }
.btn-primary:hover { background: #4DD6D6; }

.btn-ghost { border-color: currentColor; color: var(--text); background: transparent; }
.btn-ghost:hover { color: var(--turq); }

.btn-sm { min-height: 2.5rem; padding: .45rem 1.1rem; font-size: .95rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  text-decoration: none;
}
.link-arrow::after { content: "\2192"; transition: transform .2s; }
.link-arrow:hover::after { transform: translateX(3px); }

/* 7. Hero */
.hero {
  position: relative;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  padding-block: clamp(4.5rem, 3rem + 7vw, 8.5rem) clamp(4.5rem, 3rem + 6vw, 7.5rem);
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgba(31, 200, 200, .14), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(29, 99, 255, .16), transparent 60%),
    var(--navy);
}

.hero-inner { position: relative; }
.hero-inner > * { max-width: 40rem; }
.hero-inner > h1,
.hero-inner > .hero-tags { max-width: 48rem; }
.hero h1 { margin-bottom: 1.5rem; }
.hero h1 .accent { color: var(--turq); }
.hero .lead { max-width: 34rem; margin-bottom: 2.25rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}
.hero-tags li {
  padding: .3rem .8rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--muted-dark);
  font-size: .875rem;
}

.hero-art {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -12rem;
  width: min(46rem, 90vw);
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 64rem) {
  .hero-art { right: -40vw; width: 110vw; opacity: .45; }
}
@media (max-width: 40rem) {
  .hero-art { top: 0; right: -55vw; width: 120vw; transform: none; opacity: .35; }
}

/* 8. Cards (shared) */
.grid-reset { margin: 0; padding: 0; list-style: none; }

/* 9. Services */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: #B7C6D6; box-shadow: var(--shadow); transform: translateY(-2px); }
.card p { color: var(--text-muted); }

.card-icon {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(31, 200, 200, .18), rgba(29, 99, 255, .12));
  color: var(--turq-dark);
}
.card-icon svg { width: 1.6rem; height: 1.6rem; }

.card-list {
  margin: auto 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: .95rem;
}
.card-list li { position: relative; padding-left: 1.25rem; }
.card-list li + li { margin-top: .35rem; }
.card-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: .45rem; height: .45rem;
  border-radius: 2px;
  background: var(--turq);
  transform: rotate(45deg);
}

.card-cta {
  justify-content: center;
  border-color: transparent;
  background: var(--navy);
  --text: var(--white);
  --text-muted: var(--muted-dark);
  --accent: var(--turq);
  --focus: var(--turq);
  color: var(--text);
}
.card-cta:hover { border-color: transparent; }
.card-cta h3 { font-size: 1.35rem; }

/* 10. Process */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step { position: relative; }
.step-num {
  display: grid;
  place-items: center;
  width: 3.25rem; height: 3.25rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--turq);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  font-weight: 800;
  font-stretch: 125%;
}
.step::before {
  content: "";
  position: absolute;
  top: 1.625rem;
  left: 3.25rem;
  right: -2rem;
  height: 2px;
  background: linear-gradient(90deg, var(--turq), var(--line));
}
.step:last-child::before { display: none; }
.step p { color: var(--text-muted); margin: 0; }

@media (max-width: 60rem) {
  .steps { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 2rem; }
  .step:nth-child(2n)::before { display: none; }
}

@media (max-width: 36rem) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { display: grid; grid-template-columns: 3.25rem 1fr; column-gap: 1.25rem; padding-bottom: 2rem; }
  .step:last-child { padding-bottom: 0; }
  .step-num { grid-row: span 2; margin: 0; }
  .step h3 { margin-top: .7rem; }
  .step::before,
  .step:nth-child(2n)::before {
    display: block;
    top: 3.25rem; bottom: 0; left: 1.56rem; right: auto;
    width: 2px; height: auto;
    background: linear-gradient(180deg, var(--turq), var(--line));
  }
  .step:last-child::before { display: none; }
}

/* 11. About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 2rem + 4vw, 6rem);
  align-items: start;
}
.about-text > p { color: var(--text-muted); font-size: 1.1rem; }
.about-text .section-head { margin-bottom: 1.5rem; }

.values { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.value {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-left: 3px solid var(--turq);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
}
.value svg { width: 1.5rem; height: 1.5rem; margin-top: .15rem; color: var(--turq-dark); }
.value h3 { margin-bottom: .3rem; font-size: 1.05rem; }
.value p { margin: 0; color: var(--text-muted); font-size: .98rem; }

@media (max-width: 52rem) {
  .about-grid { grid-template-columns: 1fr; }
}

/* 12. Portfolio — styles ready for when the section in index.html is enabled */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
}
.project {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.project img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface); }
.project-body { padding: 1.5rem; }
.project-body p { color: var(--text-muted); }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.project-tags li { padding: .15rem .6rem; border-radius: 999px; background: var(--surface); font-size: .8rem; color: var(--muted); }

/* 13. Contact */
.contact {
  background:
    radial-gradient(50rem 26rem at 100% 0%, rgba(31, 200, 200, .14), transparent 60%),
    var(--navy);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 2rem + 4vw, 5rem);
  align-items: center;
}
.contact-grid .section-head { margin-bottom: 1.5rem; }

.checklist { margin: 0; padding: 0; list-style: none; color: var(--text-muted); }
.checklist li { position: relative; padding-left: 1.9rem; }
.checklist li + li { margin-top: .5rem; }
.checklist svg { position: absolute; left: 0; top: .2em; width: 1.25rem; height: 1.25rem; color: var(--turq); }

.contact-card {
  padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  border: 1px solid var(--line-dark);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}
.contact-card .card-icon { background: rgba(31, 200, 200, .14); color: var(--turq); }
.contact-label { margin: 0 0 .25rem; color: var(--text-muted); font-size: .9rem; }
.contact-email {
  display: inline-block;
  margin-bottom: 1.75rem;
  color: var(--white);
  font-size: clamp(1.4rem, 1rem + 2vw, 2rem);
  font-weight: 750;
  font-stretch: 115%;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-email:hover { color: var(--turq); text-decoration: underline; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.copy-status { min-height: 1.6em; margin: .9rem 0 0; color: var(--turq); font-size: .925rem; }

@media (max-width: 52rem) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* 14. Footer */
.site-footer {
  padding-block: 3.5rem 2rem;
  background: var(--navy-deep);
  font-size: .95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
}
.footer-brand img { width: auto; height: 2.25rem; margin-bottom: 1rem; }
.footer-brand p { color: var(--text-muted); max-width: 22rem; }
.footer-title {
  margin-bottom: .9rem;
  font-size: .8125rem;
  font-stretch: 112%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--white);
}
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li + li { margin-top: .45rem; }
.footer-links a { color: var(--muted-dark); text-decoration: none; }
.footer-links a:hover { color: var(--turq); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-dark);
  color: var(--muted-dark);
  font-size: .875rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--muted-dark); }
.footer-bottom a:hover { color: var(--turq); }
.site-footer > .footer-bottom:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 52rem) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* 15. Legal pages and 404 */
.page-hero {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem);
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(31, 200, 200, .14), transparent 60%),
    var(--navy);
}
.page-hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); margin-bottom: .75rem; }
.page-hero p:last-child { margin-bottom: 0; }

.prose > * { max-width: 46rem; }
.prose h2 {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 1.75rem; font-size: 1.1rem; }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: .35rem; }
.prose address { font-style: normal; }

.info-list { margin: 0 0 1em; }
.info-list div {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: .25rem 1.5rem;
  padding-block: .6rem;
  border-bottom: 1px solid var(--line);
}
.info-list dt { font-weight: 700; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 36rem) {
  .info-list div { grid-template-columns: 1fr; }
}

.note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--turq);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  color: var(--muted);
}

.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding-block: 4rem;
  text-align: center;
}
.error-code {
  margin: 0 0 .5rem;
  font-size: clamp(5rem, 3rem + 12vw, 10rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  background: linear-gradient(120deg, #1D63FF, var(--turq));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page .lead { max-width: 30rem; margin-inline: auto; margin-bottom: 2rem; }
.error-page .hero-actions { justify-content: center; }

/* 16. Motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero-globe .node { animation: pulse 4s ease-in-out infinite; }
  .hero-globe .n1 { animation-delay: -1s; }
  .hero-globe .n2 { animation-delay: -2s; }
  .hero-globe .n3 { animation-delay: -3s; }

  /* reveal on scroll — only hidden when JS is present to show them again */
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .hero-art, .nav-toggle, .contact-actions { display: none !important; }
  .dark { background: none; color: #000; --text: #000; --text-muted: #333; }
}
