/* backloop.energy: one static page, read by scrolling. Minimal: big type,
   plain prose and simple line drawings, black like the mark. Pictograms
   from the Carbon Design System (assets/pictograms, Apache-2.0); the hero
   is the single-line diagram as the Console draws it. */

@font-face {
  font-family: "Lexend";
  src: url("fonts/lexend-5.3.0.woff2") format("woff2");
  font-weight: 100 900;
  size-adjust: 97%; /* the type sizes below assume a 0.51 em x-height */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-2.304.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Black, from the mark: near-black ground, light gray text, no hue. */
  --color-bg: #111111;
  --color-text: #f2f2f2;
  --color-text-muted: #c8c8c8;
  --color-faint: #8f8f8f;
  --color-line: #333333;
  --color-raise: #1a1a1a;
  --color-strong: #f2f2f2;
  --color-strong-hover: #c8c8c8;
  --color-on-strong: #111111;

  --font-sans: "Lexend", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --frame: min(1200px, 100% - 2 * clamp(16px, 5vw, 64px));
  --section: clamp(56px, 8vw, 112px);
}

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

html {
  background: var(--color-bg);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

.wrap {
  width: var(--frame);
  margin: 0 auto;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-faint);
}

.logo {
  display: block;
  fill: currentcolor;
}

.button {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--color-strong);
  color: var(--color-on-strong);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms, color 120ms;
}

.button:hover {
  background: var(--color-strong-hover);
}

/* Black with a white outline, for the contact email */
.button-outline {
  border: 1.5px solid var(--color-text);
  background: var(--color-bg);
  color: var(--color-text);
}

/* On hover a faint white fill shows through. */
.button-outline:hover {
  background: rgb(242 242 242 / 0.15);
}

.actions {
  margin-top: 40px;
}

/* Hero: the mark and the name on the left, the diagram on the right. It
   fills the first screen. */
/* Wider than the sections, so the diagram can be big */
.hero-grid {
  display: grid;
  width: min(1520px, 100% - 2 * clamp(16px, 5vw, 64px));
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 64px;
}

@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-block: 64px 32px;
  }
}

.hero .logo {
  display: block;
  width: clamp(56px, 6vw, 84px);
  height: auto;
  margin-bottom: 32px;
}

/* The logo and wordmark are one key. One filter extrudes both: each
   drop-shadow shadows the result of the one before, so seven 1px steps
   add up to a solid side, then a soft shadow under it. Whole pixels,
   because Firefox drops offsets under 1px.
   Pressed, the key moves down by its depth and the side collapses
   under it. */
.mark {
  --depth: 7px; /* seven steps of --step */
  --step: 1px;
  --extrude: #4a4a4a;
  width: fit-content;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter:
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 var(--step) 0 var(--extrude))
    drop-shadow(0 calc(var(--depth) * 1.2) calc(var(--depth) * 1.2) rgb(0 0 0 / 0.6));
  transition:
    transform 160ms cubic-bezier(0.3, 1.6, 0.5, 1),
    filter 160ms ease-out;
}

/* Same number of drop-shadows as above, so the change animates. */
.mark.is-pressed {
  transform: translateY(var(--depth));
  filter:
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 0 0 var(--extrude))
    drop-shadow(0 calc(var(--depth) * 0.3) calc(var(--depth) * 0.5) rgb(0 0 0 / 0.4));
  transition-duration: 60ms;
  transition-timing-function: ease-out;
}

.wordmark {
  font-size: clamp(64px, 8.4vw, 150px);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin-left: -0.05em;
}

/* Energizing the diagram when the mark is let go: the wires and symbols
   go dark, then the flow overlay draws them back in behind a bright
   pulse. Labels stay readable throughout. */
.sld-lines,
.sld-bus .sld-busbar,
.sld-node .sld-symbol {
  transition: opacity 240ms ease-out;
}

.sld.is-off .sld-lines,
.sld.is-off .sld-bus .sld-busbar,
.sld.is-off .sld-node .sld-symbol {
  opacity: 0.2;
  transition-duration: 100ms;
}

.sld-flow line {
  stroke: var(--color-text);
  stroke-width: 1.5;
}

.sld-flow .is-bus {
  stroke-width: 4;
}

.sld-flow .sld-flow-pulse {
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px var(--color-text));
}

.sld-flow .sld-flow-pulse.is-bus {
  stroke-width: 7;
}

.claim {
  margin-top: 32px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.claim span {
  color: var(--color-faint);
}

.lead {
  margin-top: 24px;
  max-width: 30rem;
  font-size: 18px;
  color: var(--color-text-muted);
}

/* The single-line diagram, with the Console's styles (sld.css) */

.sld {
  display: block;
  width: 100%;
  height: auto;
}

/* Phones get the narrow diagram, two feeders, so its labels stay at
   11 px or larger. */
.sld-narrow {
  display: none;
  max-width: 360px;
}

@media (max-width: 800px) {
  .sld-wide {
    display: none;
  }

  .sld-narrow {
    display: block;
  }
}

.sld text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--color-text-muted);
}

.sld-lines line {
  stroke: var(--color-text);
  stroke-width: 1.5;
}

.sld-busbar {
  stroke: var(--color-text);
  stroke-width: 4;
}

.sld-symbol {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.5;
}

.sld-symbol .sld-symbol-thick {
  stroke-width: 4;
}

.sld-symbol .sld-symbol-fill {
  fill: var(--color-text);
}

.sld .sld-symbol-text {
  fill: var(--color-text);
  stroke: none;
  font-size: 9px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Sections: a statement on the left, prose on the right */
.section {
  padding-block: var(--section);
  background: var(--color-bg);
  color: var(--color-text);
}


.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.section .label + h2 {
  margin-top: 16px;
}

.section h2 {
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 13ch;
}

.prose {
  max-width: 34rem;
  padding-top: 8px;
}

.prose p {
  font-size: 18px;
  color: var(--color-text-muted);
}

.prose p + p {
  margin-top: 20px;
}

.prose strong {
  font-weight: 600;
  color: var(--color-text);
}

.contact {
  text-align: center;
}

.contact h2 {
  max-width: none;
  font-size: clamp(44px, 7vw, 96px);
}


/* Diagrams: thin light lines, Carbon pictograms, monospace labels */
.figure {
  color: var(--color-text);
}

.ill {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ill .t,
.ill .t-faint,
.ill .t-on {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--color-text-muted);
}

.ill .t-faint {
  fill: var(--color-faint);
}

.ill .t-on {
  fill: var(--color-on-strong);
}

.ill .t-strong,
.ill .t-name {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  fill: var(--color-on-strong);
}

.ill .t-name {
  fill: var(--color-text);
}

.ill .w {
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.5;
}

.ill .bus {
  stroke: currentcolor;
  stroke-width: 4;
}

.ill .dash {
  stroke: var(--color-faint);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ill .node {
  fill: currentcolor;
}

.ill .box {
  fill: var(--color-raise);
  stroke: var(--color-line);
}

.ill .box-strong {
  fill: var(--color-strong);
}

.section .prose {
  margin-top: 28px;
}

.split > .prose {
  margin-top: 0;
}

/* Footer: the name, so big that the page cuts off
   their bottom */
.footer {
  overflow: hidden;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.footer-meta address {
  font-style: normal;
}

/* Legal pages: one column of plain prose */
.legal .prose {
  max-width: 40rem;
}

.legal .prose h2 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: none;
}

.legal .prose h2 + p {
  margin-top: 12px;
}

.footer-giant {
  margin-top: 40px;
  margin-bottom: -0.26em;
  font-size: clamp(80px, 24vw, 340px);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.07em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  opacity: 0.2;
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

.split:has(> .figure) {
  align-items: center;
}
