/* Flowstate Cyber site styles. No build step, no dependencies. */

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-opsz.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --ink: #13203a;
  --ink-raised: #1b2b4a;
  --trace: #e3ab4b;
  --trace-strong: #996615;
  --paper: #f2f4f3;
  --paper-alt: #e7ebea;
  --text: #16233b;
  --muted: #536072;
  --rule: #cfd6da;
  --on-ink: #f2f4f7;
  --on-ink-muted: #b0bccd;
  --edge: #33456a;
  --node: #607395;
  --focus: var(--trace-strong);
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  /* Shared content geometry keeps the header, graph, sections, and footer aligned. */
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --gutter-l: max(var(--gutter), env(safe-area-inset-left, 0px));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right, 0px));
  --section-space: clamp(3.5rem, 7vw, 6rem);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #0c1628;
    --ink-raised: #14213a;
    --trace-strong: #e3ab4b;
    --paper: #111c30;
    --paper-alt: #16233b;
    --text: #e3e8ee;
    --muted: #a9b5c6;
    --rule: #2d3d56;
    --edge: #2d3f60;
    --node: #5b7094;
  }
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 550;
  text-wrap: balance;
}

h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -0.025em; }
h3 { font-size: 1.125rem; line-height: 1.35; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--trace); }
::selection { background: var(--trace); color: #13203a; }

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

/* Programmatic anchor targets do not need a page-sized outline. */
main:focus, .contact-band:focus { outline: none; }

.skip-link {
  position: absolute;
  left: var(--gutter-l);
  top: 0;
  transform: translateY(-150%);
  padding: 0.65rem 1rem;
  background: var(--trace);
  color: #13203a;
  font-family: var(--sans);
  font-weight: 600;
  z-index: 10;
}

.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); transform: none; }

/* ---------- Shared layout and header ---------- */

.site-header, .hero, .section, .contact, .not-found {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter-l) var(--gutter-r);
}

.header-band, .hero-band, .contact-band, .site-footer {
  --focus: var(--trace);
  background: var(--ink);
  color: var(--on-ink);
}

.site-header {
  padding-block: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.wordmark-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.mark-dim { fill: none; stroke: var(--node); stroke-width: 1.5; }
.mark-route { fill: none; stroke: var(--trace); stroke-width: 1.5; }
.mark-node { fill: var(--trace); }
.mark-node-dim { fill: var(--node); }

.site-nav ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.875rem; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  /* Keep a comfortable hit area without enlarging the original header. */
  margin-block: -0.5rem;
  color: var(--on-ink-muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--on-ink); }
.link-arrow { width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }

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

.hero {
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6.5rem);
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-text { position: relative; z-index: 1; min-width: 0; }
/* Capped so the headline holds to four lines in the desktop column, which
   keeps the button well above the fold on laptop screens. */
.hero h1 {
  max-width: 16em;
  font-size: clamp(2.125rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}
.hero h1 span { color: var(--on-ink-muted); font-weight: 400; }
.hero-lede {
  max-width: 34em;
  margin-top: 1.75rem;
  color: var(--on-ink-muted);
  font-size: 1.125rem;
  line-height: 1.7;
}
.hero-actions { margin-top: 2.25rem; font-family: var(--sans); }
.button {
  display: inline-block;
  max-width: 100%;
  padding: 0.8rem 1.4rem;
  border-radius: 3px;
  background: var(--trace);
  color: #13203a;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 180ms ease;
}
.button:hover { background: #f0bd63; }

/* Stacked, the graph keeps to the text's left edge and a modest width so it
   does not fill the screen; side by side, it fills its column. */
.hero-graph { min-width: 0; max-width: 30rem; }
.trace { display: block; width: 100%; height: auto; overflow: visible; }
.trace-edges path { fill: none; stroke: var(--edge); stroke-width: 1.15; }
.trace-nodes circle { fill: var(--node); }
.trace-route {
  fill: none;
  stroke: var(--trace);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trace-draw 2.4s cubic-bezier(0.55, 0, 0.35, 1) 0.4s forwards;
}
.trace-hits circle {
  fill: var(--trace);
  stroke: var(--ink);
  stroke-width: 3;
  opacity: 0;
  animation: trace-hit 0.3s ease-out forwards;
}
.trace-hits .hit-0 { animation-delay: 0.3s; }
.trace-hits .hit-1 { animation-delay: 0.8s; }
.trace-hits .hit-2 { animation-delay: 1.2s; }
.trace-hits .hit-3 { animation-delay: 1.6s; }
.trace-hits .hit-4 { animation-delay: 2s; }
.trace-hits .hit-5 { animation-delay: 2.4s; }
.trace-hits .hit-6 { animation-delay: 2.8s; }
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
@keyframes trace-hit { to { opacity: 1; } }

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .hero-graph { max-width: none; }
}

/* ---------- Areas of work ---------- */

.section { padding-block: var(--section-space); }
.areas { display: grid; gap: 2.5rem; }
.areas > div { min-width: 0; border-top: 1px solid var(--rule); padding-top: 1.75rem; }
.area-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1.75rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.area-icon circle { fill: var(--paper); }
.areas h2 { font-size: 1.25rem; line-height: 1.35; letter-spacing: -0.025em; }
.areas p { margin-top: 0.85rem; color: var(--muted); max-width: 27em; }

@media (min-width: 52rem) {
  .areas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; }
}

@media (36rem <= width < 52rem) {
  .areas > div { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 1.25rem 2rem; align-items: baseline; }
  .area-icon { grid-column: 1 / -1; margin: 0; }
  .areas p { margin-top: 0; }
}

/* ---------- Founder ---------- */

.about {
  position: relative;
  display: grid;
  gap: 2rem;
}
.about::before { content: ""; position: absolute; inset: 0 var(--gutter-r) auto var(--gutter-l); height: 1px; background: var(--rule); }
.about-mark { width: clamp(8rem, 12vw, 10rem); max-width: 100%; height: auto; justify-self: start; fill: none; stroke: var(--muted); stroke-width: 1; }
.about-mark circle { fill: var(--paper); }
.about p { max-width: 46em; font-size: clamp(1.3rem, 2.25vw, 1.875rem); line-height: 1.6; letter-spacing: -0.015em; }
/* About and contact share the three-column grid of the areas above, so their
   text starts on the same line as the second area. */
@media (min-width: 52rem) {
  .about { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 3rem; }
  .about p { grid-column: span 2; }
}

/* ---------- Contact and footer ---------- */

.contact-band { position: relative; }
.contact {
  display: grid;
  gap: 1.5rem;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 450; letter-spacing: -0.045em; }
.contact-email { min-width: 0; font-family: var(--sans); font-size: clamp(1.125rem, 2.3vw, 1.75rem); font-weight: 400; letter-spacing: -0.035em; }
.contact-email a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem; padding-block: 0.7rem; border-bottom: 1px solid var(--node); text-decoration: none; transition: border-color 180ms ease, color 180ms ease; }
.contact-email span { overflow-wrap: anywhere; }
.contact-email .link-arrow { width: 1.5rem; height: 1.5rem; color: var(--trace); }
.contact-email a:hover { border-color: var(--trace); color: var(--trace); }
@media (min-width: 52rem) {
  .contact { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 3rem; }
  .contact-email { grid-column: span 2; }
}
.site-footer {
  position: relative;
  color: var(--on-ink-muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.7;
  padding-block: 1.75rem;
  padding-inline:
    max(var(--gutter-l), calc((100% - var(--wrap)) / 2 + var(--gutter)))
    max(var(--gutter-r), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-footer::before { content: ""; position: absolute; inset: 0 max(var(--gutter-r), calc((100% - var(--wrap)) / 2 + var(--gutter))) auto max(var(--gutter-l), calc((100% - var(--wrap)) / 2 + var(--gutter))); height: 1px; background: var(--edge); }
.site-footer a { display: inline-block; padding-block: 0.25rem; }

/* ---------- Compact layouts ---------- */

@media (max-width: 35.999rem) {
  .hero-lede { font-size: 1.0625rem; }
  .areas { gap: 2rem; }
  .area-icon { margin-bottom: 1.25rem; }
  .about { gap: 1.5rem; }
  .about p { font-size: 1.1875rem; }
}

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

.not-found { min-height: 70vh; padding-block: var(--section-space); }
.not-found h1 { font-size: clamp(2.125rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -0.045em; }
.not-found p { margin-top: 1.5rem; max-width: 34em; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trace-route { animation: none; stroke-dashoffset: 0; }
  .trace-hits circle { animation: none; opacity: 1; }
  .button, .contact-email a { transition: none; }
}

@media (forced-colors: active) {
  .button, .site-nav a { border: 1px solid ButtonText; }
  .hero-graph { display: none; }
}
