/* FloodGates International — site styles. Hand-written, no build step. */

:root {
  --ink: #07131c;
  --ink-2: #0d1e2b;
  --ink-3: #142a3a;
  --ink-line: rgba(255, 255, 255, 0.12);
  --on-ink: #eef3f7;
  --on-ink-muted: #9fb2c1;

  --paper: #f5f3ee;
  --paper-2: #ebe7de;
  --card: #fffdf9;
  --line: #d8d2c5;
  --text: #0e1b24;
  --muted: #53626e;

  --blue: #0a74c0;       /* brand blue, darkened a step for text contrast */
  --blue-deep: #075c99;
  --sky: #4eb2ff;        /* brand blue as it reads on dark surfaces */

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(72px, 10vw, 136px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.04;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--sky);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: 20px;
}
.eyebrow--sky { color: var(--sky); }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 0.9rem; }

.btn--sky { background: var(--sky); color: var(--ink); }
.btn--sky:hover { background: #7cc6ff; }

.btn--ghost { border-color: rgba(255, 255, 255, 0.28); color: var(--on-ink); }
.btn--ghost:hover { border-color: var(--on-ink); }

.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-deep); }

.btn--line { border-color: var(--text); color: var(--text); }
.btn--line:hover { background: var(--text); color: var(--paper); }

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

.link {
  display: inline-block;
  font-weight: 600;
  color: var(--blue-deep);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
}
.link:hover { color: var(--text); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 19, 28, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-line);
  color: var(--on-ink);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-ink);
  text-decoration: none;
}
.brand__word {
  font-family: var(--display);
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}
.brand__flow { fill: var(--sky); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.site-nav a:not(.btn) {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--on-ink-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.site-nav a:not(.btn):hover { color: var(--on-ink); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s;
}
.nav-toggle__bars { transform: translateY(-4px); }
.nav-toggle__bars::before { content: ""; transform: translateY(8px); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: rotate(-90deg); }

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

.hero {
  background: var(--ink);
  color: var(--on-ink);
  overflow: hidden;
}

.hero__text {
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: clamp(36px, 5vw, 64px);
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.7rem, 7.6vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.042em;
}
.hero .hl { color: var(--sky); }

.lede {
  max-width: 58ch;
  margin-top: clamp(22px, 3vw, 34px);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--on-ink-muted);
}

.hero .actions { margin-top: clamp(26px, 3.4vw, 40px); }

.flow { position: relative; }

.flow__canvas {
  width: 100%;
  height: clamp(210px, 30vw, 360px);
  background: var(--ink);
}

.flow__labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 26px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f95a6;
}
.flow__labels span:nth-child(2) { color: var(--sky); text-align: center; }
.flow__labels span:last-child { text-align: right; }

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

.stats { border-bottom: 1px solid var(--line); }

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: clamp(28px, 4vw, 48px) clamp(16px, 2.4vw, 32px);
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }

.stat__n {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.stat__l {
  max-width: 24ch;
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--ink); color: var(--on-ink); }

.section__head { margin-bottom: clamp(40px, 6vw, 76px); }
.section__lede {
  max-width: 52ch;
  margin-top: 20px;
  font-size: 1.12rem;
  color: var(--on-ink-muted);
}

/* ---------- Products ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.product--flip .product__body { order: 2; }

.tag {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.product h3 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.product__long {
  display: block;
  margin-top: 10px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.product__lede {
  max-width: 50ch;
  margin-top: 22px;
  font-size: 1.1rem;
}

.ticks {
  margin-block: 26px 28px;
  border-top: 1px solid var(--line);
}
.ticks li {
  position: relative;
  padding: 13px 0 13px 30px;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  line-height: 1.45;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 19px;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg);
}

.product__note {
  max-width: 50ch;
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Product illustrations */

.mock {
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  padding: 22px;
  border-radius: 22px;
}
.mock--dark {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 30px 60px -30px rgba(7, 19, 28, 0.55);
}
.mock--light {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -36px rgba(7, 19, 28, 0.35);
}

.mock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}
.mock__title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip--sky { border-color: rgba(78, 178, 255, 0.4); color: var(--sky); }

.checks li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--ink-line);
  font-size: 0.95rem;
}
.checks__dot {
  width: 9px;
  height: 9px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 4px rgba(78, 178, 255, 0.16);
}
.checks__state {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--on-ink-muted);
}

.mock__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--sky);
  color: var(--ink);
  font-weight: 600;
}

.chat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-block: 4px 18px;
}
.bubble {
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--paper-2);
  font-size: 0.93rem;
  line-height: 1.45;
}
.bubble--me {
  align-self: flex-end;
  border-radius: 16px 16px 4px 16px;
  background: var(--ink);
  color: var(--on-ink);
}
.chat__confirm {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}
.chat__modes {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.chat__modes span {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Foundation diagram ---------- */

.foundation {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}
.foundation__text p:last-child {
  max-width: 46ch;
  margin-top: 24px;
  font-size: 1.1rem;
  color: var(--muted);
}

.diagram { --col-gap: clamp(14px, 3vw, 40px); }

.diagram__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.diagram__row--ends,
.diagram__row--links {
  grid-template-columns: 1fr 1fr;
  column-gap: calc(var(--col-gap) + 80px);
}
.diagram__row--links span {
  width: 1.5px;
  height: 28px;
  margin-inline: auto;
  background: repeating-linear-gradient(to bottom, var(--blue) 0 5px, transparent 5px 9px);
}

.node {
  border-radius: 14px;
  text-align: center;
}
.node--end {
  width: fit-content;
  margin-inline: auto;
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.node--product {
  padding: 22px 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.node--product strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.node--product span {
  display: block;
  margin-top: 4px;
  font-size: 0.86rem;
  color: var(--muted);
}

.diagram__row:has(.node--product) { align-items: stretch; }
.node--product { display: grid; align-content: center; }

.diagram__bridge {
  position: relative;
  align-self: center;
  width: calc(var(--col-gap) + 80px);
  height: 1.5px;
  background: repeating-linear-gradient(to right, var(--blue) 0 5px, transparent 5px 9px);
}
.diagram__bridge span {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
  color: var(--blue-deep);
}

.node--base {
  padding: 24px 20px 22px;
  background: var(--ink);
  color: var(--on-ink);
}
.node--base strong {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.node--base ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.node--base li {
  padding: 4px 12px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
}

/* ---------- Infrastructure ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.pillar {
  padding-top: 22px;
  border-top: 1px solid var(--ink-line);
}
.pillar__n {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--sky);
}
.pillar h3 {
  min-height: 2.24em; /* two lines, so the paragraphs below line up */
  margin-top: 38px;
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.pillar p:last-child {
  margin-top: 12px;
  font-size: 0.97rem;
  color: var(--on-ink-muted);
}

/* ---------- Contact ---------- */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: end;
}
.contact h2 { font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: 0.98; letter-spacing: -0.042em; }
.contact__lede {
  max-width: 44ch;
  margin-block: 24px 30px;
  font-size: 1.12rem;
  color: var(--muted);
}

.contact__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.contact__details > div {
  padding: 20px 16px 20px 0;
  border-bottom: 1px solid var(--line);
}
.contact__details > div:first-child,
.contact__details > div:last-child { grid-column: 1 / -1; }
.contact__details dt {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact__details dd { font-size: 0.98rem; line-height: 1.5; overflow-wrap: anywhere; }
.contact__details a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.contact__details a:hover { color: var(--blue-deep); text-decoration-color: currentColor; }

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

.site-footer {
  background: var(--ink);
  color: var(--on-ink-muted);
  font-size: 0.9rem;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding-block: 34px;
}
.site-footer__line { margin-right: auto; }

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
}
.notfound h1 { font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1; letter-spacing: -0.04em; }
.notfound p { margin-block: 18px 30px; color: var(--on-ink-muted); }
.notfound .brand { margin-bottom: 44px; }

/* ---------- Reveal on scroll (only when the script is running) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .pillars { grid-template-columns: repeat(2, 1fr); row-gap: 44px; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .foundation, .contact__grid { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 820px) {
  .product { grid-template-columns: 1fr; }
  .product--flip .product__body { order: 0; }
  .mock { margin-inline: 0; }

  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 22px;
    background: var(--ink);
    border-bottom: 1px solid var(--ink-line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) {
    padding: 14px 0;
    border-bottom: 1px solid var(--ink-line);
    font-size: 1.05rem;
    color: var(--on-ink);
  }
  .site-nav .btn { margin-top: 18px; min-height: 48px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .flow__labels { grid-template-columns: 1fr 1fr; font-size: 0.62rem; }
  .flow__labels span:nth-child(2) { display: none; }
  .stat { padding-inline: 14px; }
  .pillars { grid-template-columns: 1fr; row-gap: 34px; }
  .pillar h3 { min-height: 0; margin-top: 18px; }
  .contact__details { grid-template-columns: 1fr; }
  .diagram__row--ends, .diagram__row--links { column-gap: calc(var(--col-gap) + 36px); }
  .diagram__bridge { width: calc(var(--col-gap) + 36px); }
  .diagram__bridge span { display: none; }
  .actions .btn { flex: 1 1 auto; }
}
