/* 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;

  /* Brand */
  --ink: #13203a;          /* deep navy: hero and contact bands */
  --ink-raised: #1b2b4a;
  --trace: #d99a2b;        /* amber: the traced path, focus, key links */
  --trace-strong: #b97c12; /* amber with enough contrast on paper */

  /* Page */
  --paper: #f2f4f3;
  --paper-alt: #e7ebea;
  --text: #16233b;
  --muted: #536072;
  --rule: #cfd6da;

  /* On ink */
  --on-ink: #e8ecf1;
  --on-ink-muted: #a7b2c2;
  --edge: #33456a;
  --node: #4a5d83;

  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  /* Side padding that also clears a notch in landscape (viewport-fit=cover). */
  --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(4rem, 9vw, 7rem);

  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: #e3a83f;
    --paper: #111c30;
    --paper-alt: #16233b;
    --text: #e3e8ee;
    --muted: #9eaabb;
    --rule: #26344d;
    --edge: #2a3a5a;
    --node: #42557a;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: env(safe-area-inset-top, 0px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  /* Paper reaches the bottom of the screen on short pages like the 404. */
  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;
}

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

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

a:hover { text-decoration-color: var(--trace); }

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

.skip-link {
  position: absolute;
  left: var(--gutter-l);
  top: -3rem;
  padding: 0.5rem 0.9rem;
  background: var(--trace);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  z-index: 10;
}

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

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

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

.site-header {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.25rem 0;
  padding-inline: var(--gutter-l) var(--gutter-r);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  text-decoration: none;
}

.wordmark-mark { width: 1.75rem; height: 1.75rem; }

.mark-dim { fill: none; stroke: var(--edge); stroke-width: 2; }
.mark-route { fill: none; stroke: var(--trace); stroke-width: 2; }
.mark-node { fill: var(--trace); }
.mark-node-dim { fill: var(--node); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-family: var(--sans);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--on-ink-muted);
  text-decoration: none;
}

.site-nav a:hover { color: var(--on-ink); }

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6.5rem);
  padding-inline: var(--gutter-l) var(--gutter-r);
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* Text gets the wider column so the headline holds to about four lines. */
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}

.hero h1 {
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  max-width: 16em;
}

.hero-lede {
  margin-top: 1.5rem;
  max-width: 34em;
  color: var(--on-ink-muted);
  font-size: 1.125rem;
}

.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  font-family: var(--sans);
}

.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: var(--trace);
  color: #13203a;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
}

.button:hover { background: #e7ad46; }

/* The traced graph: the one memorable element on the page. */

.hero-graph { min-width: 0; }

/* The viewBox is cropped to the graph itself, so its first and last nodes
   line up with the column edges. */
.trace { display: block; width: 100%; height: auto; overflow: visible; }

.trace-edges path {
  fill: none;
  stroke: var(--edge);
  stroke-width: 1.25;
}

.trace-nodes circle { fill: var(--node); }

.trace-route {
  fill: none;
  stroke: var(--trace);
  stroke-width: 2.25;
  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: 2.0s; }
.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 (prefers-reduced-motion: reduce) {
  .trace-route { animation: none; stroke-dashoffset: 0; }
  .trace-hits circle { animation: none; opacity: 1; }
}

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

.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--section-space) 0;
  padding-inline: var(--gutter-l) var(--gutter-r);
}

/* Areas: three broad areas of work */

.areas {
  display: grid;
  gap: 2.5rem 3rem;
  padding-bottom: 2.5rem;
}

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

.areas > div {
  border-top: 2px solid var(--text);
  padding-top: 1.25rem;
}

.areas h2 { font-size: 1.25rem; }

.areas p {
  margin-top: 0.6rem;
  color: var(--muted);
  max-width: 26em;
}

/* Tablet: one area per row, heading beside its text, so the row is filled. */
@media (36rem <= width < 52rem) {
  .areas > div {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: 0 2rem;
    align-items: baseline;
  }

  .areas p { margin-top: 0; }
}

/* About */

.about { padding-top: 0; }

.about p {
  max-width: 40em;
  font-size: 1.125rem;
}

.about p:first-child {
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

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

.contact-band {
  background: var(--ink);
  color: var(--on-ink);
}

.contact {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  padding-inline: var(--gutter-l) var(--gutter-r);
}

.contact-email {
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: clamp(1.35rem, 3.4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact-email a { text-decoration-color: var(--trace); text-decoration-thickness: 2px; }

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

.site-footer {
  background: var(--ink);
  color: var(--on-ink-muted);
  border-top: 1px solid var(--ink-raised);
  font-family: var(--sans);
  font-size: 0.875rem;
  /* Full-width band, but the text lines up with the content column above. */
  padding: 1.5rem 0;
  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.5rem 2rem;
}

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

.not-found {
  min-height: 60vh;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--section-space) 0;
  padding-inline: var(--gutter-l) var(--gutter-r);
}

.not-found h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.not-found p { margin-top: 1rem; max-width: 34em; color: var(--muted); }
