/* ============================================================
   Exaqt — site stylesheet
   Implements Exaqt Brand Guidelines v1.0
   Navy ground · Paper surface · one red per surface · lattice
   with nodes on the vertices (intersections), never in centres.
   ============================================================ */

:root {
  --navy:      #0D1B3E;   /* Lattice Navy (kept for reference) */
  --ground:    #000000;   /* page ground: black */
  --red:       #DF0000;   /* Exact Red    */
  --paper:     #F3F1EC;   /* Paper        */
  --white:     #FFFFFF;   /* Cards/tables on Paper */
  --ink-grey:  #5A5F6E;   /* body text on Paper    */
  --line-grey: #8A8F9C;   /* labels, captions, rules */
  --text-soft: rgba(243, 241, 236, 0.80);  /* body text on navy */
  --hairline:  rgba(255, 255, 255, 0.16);  /* rules/borders on navy */

  --display: "Space Grotesk", Arial, sans-serif;
  --sans:    "IBM Plex Sans", Arial, sans-serif;
  --mono:    "IBM Plex Mono", Consolas, monospace;

  --cell: 28px;           /* lattice cell */
  --measure: 62ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-grey);
  background: var(--ground);
  text-align: left;                 /* left, always */
}

/* ---------- Lattice: navy surfaces only, full-bleed ----------
   Tile draws one cell: hairline top+left lines (13% white) and
   quarter-dots in all four corners (55% white) which assemble
   into full nodes ON THE INTERSECTIONS when tiled.            */
.lattice {
  background-color: var(--ground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M0 .5H28M.5 0V28' stroke='rgba(255,255,255,.13)' fill='none'/%3E%3Cg fill='rgba(255,255,255,.55)'%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='28' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='28' r='1.6'/%3E%3Ccircle cx='28' cy='28' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: var(--cell) var(--cell);
}

/* ---------- Typography ---------- */
h1, h2, .display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}
h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: 1.4rem;  line-height: 1.25; margin-bottom: 0.75rem; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1rem; color: var(--navy); margin-bottom: 0.25rem; }

p  { max-width: var(--measure); }
p + p { margin-top: 0.8em; }

.label {                      /* Plex Mono uppercase labels, +10% tracking */
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--line-grey);
}

.figure-mono {                /* large figures in Mono, unit in Sans beside */
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--navy);
}
.figure-mono .unit { font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--ink-grey); }

a { color: var(--navy); text-decoration-color: var(--line-grey); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }

/* ---------- Header ---------- */
.site-header {
  background: var(--ground);        /* flat black — lattice is for openers */
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
}
.site-header .wordmark { color: var(--paper); display: block; }
.site-header .wordmark svg { width: 118px; height: auto; display: block; }  /* ≥ 96px minimum */

.site-nav { display: flex; gap: 1.6rem; }
.site-nav a {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--paper);
  text-decoration: none;
}
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--paper); padding-bottom: 2px; }
.site-nav a:hover { color: var(--white); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-grey); color: var(--paper);
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.4rem 0.7rem; cursor: pointer; }

/* ---------- Hero (home) ---------- */
.hero-photo {                      /* artwork behind the animated lattice */
  background-color: var(--ground);
  background-image: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
                    url("../assets/img/about-hero.jpg");
  background-size: cover, cover;
  background-position: center, center;
}
.hero-photo.static-lattice {       /* reduced-motion fallback: static grid over the artwork */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M0 .5H28M.5 0V28' stroke='rgba(255,255,255,.13)' fill='none'/%3E%3Cg fill='rgba(255,255,255,.55)'%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='28' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='28' r='1.6'/%3E%3Ccircle cx='28' cy='28' r='1.6'/%3E%3C/g%3E%3C/svg%3E"),
                    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
                    url("../assets/img/about-hero.jpg");
  background-size: 28px 28px, cover, cover;
  background-position: 0 0, center, center;
}

.hero {
  position: relative;
  color: var(--paper);
  min-height: 66vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
  padding: clamp(3rem, 10vw, 6rem) clamp(1rem, 4vw, 3rem);
}
.hero .lattice-canvas {          /* animated lattice; top edge sits below the header */
  position: absolute;
  top: 68px;
  left: 0;
  width: 100%;
  height: calc(100% - 68px);
  z-index: 0;
}
.hero::after {                      /* soft navy pool behind the text for contrast */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 55% at 50% 52%,
              rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0) 70%);
  z-index: 1;
  pointer-events: none;
}
.hero h1 {
  position: relative;
  z-index: 2;
  color: var(--white);
  font-size: clamp(2.6rem, 7.5vw, 5.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 17ch;                  /* wraps to two display lines */
  text-align: center;
}

/* ---------- Page opener (about / contact) ---------- */
.opener {
  color: var(--paper);
  padding: clamp(3rem, 9vw, 5.5rem) clamp(1rem, 4vw, 3rem) clamp(2.2rem, 6vw, 4rem);
}
.opener h1 { color: var(--paper); max-width: 20ch; }
.opener-photo {                     /* photographic opener (About): image, no grid */
  background-image: linear-gradient(rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.38)),
                    url("../assets/img/about-hero.jpg");
  background-size: cover;
  background-position: center;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.opener .label { color: rgba(243, 241, 236, 0.65); display: block; margin-bottom: 0.9rem; }

/* ---------- Content sections on Paper ---------- */
main.paper { background: var(--paper); }   /* bright content sections; lattice/header/footer stay black */
.section { padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 4vw, 3rem); }
.section > .label { display: block; margin-bottom: 1.1rem; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.cols-compact { grid-template-columns: repeat(auto-fit, minmax(200px, 270px)); justify-content: space-evenly; }

.card {                             /* white cards on Paper; flat, hairline rule */
  background: var(--white);
  border: 1px solid rgba(138, 143, 156, 0.35);
  padding: 1.4rem;
}
.card p { font-size: 0.95rem; }
.card img { width: 100%; height: auto; display: block; margin-top: 0.85rem; }
.card img.portrait { width: min(150px, 55%); margin-left: auto; margin-right: auto; }   /* founder photos: small, centred */
.card svg.pictogram { width: 112px; height: 112px; display: block; margin-top: 0.85rem; color: var(--navy); }
.card svg.schematic { width: 100%; max-width: 320px; height: auto; display: block; margin: 0.85rem auto 0; color: var(--navy); }
.card img.usecase { width: 100%; max-width: 320px; height: auto; display: block; margin: 0.85rem auto 0; }
.usecase-card {                     /* image fills the whole panel, heading overlaid */
  position: relative;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 3 / 2;              /* matches the 630x420 tiles: no cropping */
}
.usecase-card img.usecase {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}
.usecase-card h3 {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1;
  margin: 0;
  padding: 0.9rem 1.1rem;
  color: var(--white);
  background: linear-gradient(rgba(8, 12, 34, 0.70), rgba(8, 12, 34, 0));
}

.rule { border: 0; border-top: 1px solid rgba(138, 143, 156, 0.35); margin: 0 clamp(1rem, 4vw, 3rem); }
.rule-red { border-top: 2px solid var(--red); width: 56px; margin: 0 0 1.2rem; } /* the one red on this surface */

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ground);        /* flat black */
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--hairline);
}
.site-footer .glyph { width: 32px; height: 32px; color: var(--paper); flex: none; }
.site-footer small {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(243, 241, 236, 0.75);
}
.site-footer a { color: var(--paper); }

/* ---------- Contact ---------- */
.contact-list { font-family: var(--mono); font-size: 0.95rem; color: var(--navy); display: grid; gap: 0.5rem; }
.contact-list .label { display: inline-block; width: 9ch; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; right: 1rem; top: 3.6rem; z-index: 10;
    flex-direction: column; gap: 0; background: var(--ground); border: 1px solid rgba(138,143,156,.4); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.8rem 1.4rem; }
  .site-header { position: relative; }
}

/* ---------- Photo pages: artwork behind a transparent header ---------- */
.header-overlay .site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  background: transparent;
}
.header-overlay .opener-photo { min-height: 420px; }
