/* SPDX-License-Identifier: MPL-2.0 */

/* Local typography: Aspekta is distributed with its original OFL notice. */

@font-face {
  font-family: "Aspekta";
  src: url("../fonts/aspekta-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Shared palette and readable defaults. */

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

body, h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

:root {
  color-scheme: light;
  --black: #1e1e1e;
  --black-soft: #4d4d4d;
  --blue: #2020ff;
  --blue-hover: #4b4bff;
  --blue-tint: #f0f0ff;
  --orange: #ff3b1f;
  --orange-light: #ff9e91;
  --gray: #959595;
  --gray-light: #d9d9d9;
  --white: #ffffff;
  --paper: var(--white);
  --surface: #f5f5f5;
  --ink: var(--black);
  --muted: var(--black-soft);
  --accent: var(--blue);
  --line: var(--gray-light);
  --dark: var(--black);
  --font-sans: "Aspekta", "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  /* Crisp, offset shadows keep depth consistent across panels and controls. */
  --shadow-ink: var(--black);
  --shadow-control: 3px 3px 0 var(--shadow-ink);
  --shadow-card: 6px 6px 0 var(--shadow-ink);
  --shadow-panel: 10px 10px 0 var(--shadow-ink);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --site-header-height: 4.875rem;
}

html {
  scroll-padding-top: calc(var(--site-header-height) + 1rem);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

::selection {
  background: var(--blue);
  color: var(--white);
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  max-width: 14ch;
  font-size: clamp(3rem, 5.1vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -0.04em;
}

h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.container {
  width: min(74rem, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.eyebrow {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accent {
  color: var(--accent);
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
  color: white;
}

/* Full-width navigation stays visible while preserving its space in the layout. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  border-bottom: 2px solid var(--dark);
  background: var(--paper);
}

.header-layout, .brand, .nav-list, .footer-layout, .footer-layout nav {
  display: flex;
  align-items: center;
}

.header-layout {
  min-height: 4.75rem;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem 0;
}

.brand {
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 10rem;
  max-width: 100%;
  height: auto;
}

.brand-mark {
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--dark);
  border-radius: 0;
  background: var(--dark);
  color: var(--paper);
  line-height: 1;
}

.brand-mark span {
  color: var(--orange);
}

.nav-list {
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.nav-list a:hover, .nav-list a[aria-current="page"] {
  text-decoration: underline;
}

.nav-list .nav-start {
  padding-inline: 1rem;
  border: 1px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-control);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-list .nav-start:hover {
  background: var(--blue-hover);
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

/* The opening pairs the financial foundation message with the project logo. */

.hero {
  padding-top: clamp(3rem, 6vw, 5rem);
  background: var(--dark);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

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

.hero-copy h1 {
  max-width: none;
  font-size: clamp(2.75rem, 4.4vw, 4rem);
}

.hero-copy h1 > span {
  color: var(--orange);
}

.hero-copy > .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--surface);
  color: var(--accent);
}

.accent-marker {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 0;
  background: var(--accent);
}

h1 > span {
  color: var(--accent);
}

.hero-description {
  max-width: 33rem;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
}

.hero-ownership {
  max-width: 38rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

.button, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 3.1rem;
  font-size: 0.8125rem;
  font-weight: 750;
  text-decoration: none;
}

.button {
  padding: 0.75rem 1.15rem;
  border: 2px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-control);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  background: var(--blue-hover);
  color: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

.text-link:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  margin-top: 1.25rem;
  color: var(--accent);
  font-size: 0.75rem;
  text-decoration: none;
}

.hero-status:hover {
  text-decoration: underline;
}

.status-dot {
  flex: 0 0 0.4rem;
  height: 0.4rem;
  background: var(--accent);
}

/* The logo uses its PNG transparency directly over the hero background. */
.hero-artwork {
  min-width: 0;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.hero-artwork img {
  display: block;
  width: 100%;
  height: auto;
}

/* Dark sections share a palette; licensing, overview and founder stay light. */
.hero, .core-explorer, .partners, .site-footer {
  --ink: var(--white);
  --muted: var(--gray-light);
  --accent: var(--orange-light);
  --line: var(--black-soft);
  --surface: #2b2b2b;
  background: var(--dark);
  color: var(--ink);
}

.hero :focus-visible, .core-explorer :focus-visible, .partners :focus-visible, .site-footer :focus-visible {
  outline-color: var(--accent);
}

.licensing, #how-it-works, .founder {
  background: var(--paper);
  color: var(--ink);
}

.licensing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
}

.licensing .eyebrow {
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.licensing h2 {
  max-width: 20ch;
}

.licensing-description {
  max-width: 48ch;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
}

.licensing-copy > .button {
  margin-top: 1.75rem;
}

.licensing-benefits {
  display: grid;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.licensing-benefits li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.licensing-benefits p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Transparent partner logos sit directly on the dark section background. */
.partners-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.partners .section-heading h2, .partners .section-heading > p:not(.eyebrow) {
  width: 100%;
  max-width: none;
}

.partners .eyebrow {
  color: var(--accent);
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.partner-list li {
  max-width: 100%;
}

.partner-card {
  display: block;
}

.partner-card:hover {
  opacity: 0.8;
}

.partner-card img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
}

/* The founder profile uses the shared responsive grid on a light background. */
.founder {
  border-top: 1px solid var(--line);
}

.founder-profile, .founder-content {
  min-width: 0;
}

.founder-portrait {
  width: min(100%, 20rem);
  margin-top: 2rem;
}

.founder-portrait-placeholder, .founder-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.founder-portrait-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem;
}

.founder-initials {
  color: var(--accent);
  font-size: clamp(3.5rem, 6vw, 5rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.055em;
}

.founder-portrait-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.founder-identity h3 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.founder-identity p {
  margin-top: 0.5rem;
  color: var(--accent);
  font-size: 0.875rem;
}

.founder-bio {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.founder-bio p + p {
  margin-top: 1rem;
}

.founder-quote {
  margin: 1.75rem 0 0;
  padding: 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 1rem;
}

.founder-link {
  max-width: 100%;
  margin-top: 1.5rem;
}

.founder-link svg {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

/* The governing document comes first; the diagram follows the same order on mobile. */
.how-flow {
  margin-top: 3rem;
}

.how-flow svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
}

.how-flow .flow-narrow {
  display: none;
}

.flow-shadow { fill: var(--shadow-ink); }
.flow-node { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.flow-node-entry { stroke: var(--accent); }
.flow-step { fill: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.6px; }
.flow-icon { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.flow-title { fill: var(--ink); font-size: 27px; font-weight: 750; letter-spacing: -0.8px; }
.flow-copy { fill: var(--muted); font-size: 14px; }
.flow-arrow { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: square; stroke-linejoin: miter; }

.how-flow figcaption {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
}

.how-note-icon {
  display: grid;
  flex: 0 0 1.125rem;
  place-items: center;
  height: 1.125rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.how-flow + .resource-list { margin-top: 2rem; }

@media (max-width: 56rem) {
  .how-flow { max-width: 25rem; margin-inline: auto; }
  .how-flow .flow-wide { display: none; }
  .how-flow .flow-narrow { display: block; }
}

/* A published rounding example introduces the contract before its artifacts. */

.rounding-example {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 2px solid var(--dark);
  background: var(--blue-tint);
}

.rounding-example h3 {
  margin-top: 0.75rem;
  font-size: 1.5rem;
}

.rounding-example p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.rounding-example .text-link {
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.rounding-example table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.rounding-example caption {
  margin-bottom: 0.75rem;
  font-weight: 700;
  text-align: left;
}

.rounding-example th, .rounding-example td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.rounding-example table code {
  white-space: nowrap;
}

/* Three concrete artifacts: each has its own link and reading purpose. */

.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.overview-layout .section-heading h2 {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.section-heading h2 {
  margin-top: 1rem;
}

.section-heading > p:not(.eyebrow) {
  margin-top: 1.5rem;
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.overview-layout .section-heading > .section-subtitle {
  width: 100%;
  max-width: none;
  font-size: 1.125rem;
}

.resource-list {
  padding: 0;
  list-style: none;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.resource-list li {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 2px solid var(--dark);
  border-radius: 0;
  background: white;
  box-shadow: var(--shadow-card);
}

.resource-number {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--blue-tint);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.resource-list li:nth-child(2) .resource-number {
  background: var(--orange-light);
  color: var(--black);
  border-color: var(--orange);
}

.resource-list li:nth-child(3) .resource-number {
  background: var(--surface);
  color: var(--black-soft);
  border-color: var(--line);
}

.resource-list h3 a {
  display: inline-block;
  padding-block: 0.25rem;
  text-decoration: none;
}

.resource-list h3 a:hover {
  text-decoration: underline;
}

.resource-list h3 span {
  color: var(--accent);
  margin-left: 0.25rem;
}

.resource-list p {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.artifact-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.resource-kind {
  display: block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

/* Reading paths follow the diagram within the overview section. */

.start-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.start-panel .eyebrow, .start-panel p:not(.eyebrow) {
  color: var(--muted);
}

.start-heading h2 {
  margin-top: 1rem;
}

.start-heading > p:last-child {
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.reading-paths {
  display: grid;
  gap: 1.25rem;
}

.reading-paths a {
  display: block;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
  box-shadow: var(--shadow-control);
}

.reading-paths h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.reading-paths p {
  margin-top: 0.65rem;
  max-width: 40ch;
  font-size: 0.8125rem;
}

.reading-paths a:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--surface);
}

.reading-paths a:hover h3 {
  text-decoration: underline;
}

.site-footer {
  padding-bottom: 2rem;
}

.footer-layout {
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.footer-layout > .brand {
  gap: 0;
}

.footer-layout > p {
  color: var(--muted);
}

.footer-layout nav {
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-left: auto;
}

.footer-layout nav a {
  padding-block: 0.5rem;
}

/* Simplify the header and show the artwork first when the hero stacks. */

@media (max-width: 60rem) {
  .site-header .brand {
    display: none;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
  }

  .hero-copy, .hero-artwork {
    width: 100%;
    max-width: 44rem;
    justify-self: center;
  }

  .hero-artwork {
    order: -1;
  }
}

@media (max-width: 56rem) {
  .licensing-layout, .rounding-example {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-list {
    gap: 0.75rem;
  }

  .resource-list li {
    padding: 1.1rem;
  }

  .start-panel {
    gap: 2rem;
  }
}

@media (max-width: 45rem) {
  :root {
    --shadow-card: 4px 4px 0 var(--shadow-ink);
    --shadow-panel: 6px 6px 0 var(--shadow-ink);
  }

  .header-layout {
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 1rem 0;
  }

  .hero-layout, .resource-list, .start-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  h1 {
    max-width: 15ch;
    font-size: clamp(2.65rem, 8.5vw, 3.75rem);
  }

  .hero-layout {
    padding-bottom: 3rem;
  }

  .hero-description, .section-heading > p:not(.eyebrow) {
    max-width: 48ch;
  }

  .founder-portrait {
    width: min(100%, 16rem);
  }

  .resource-list {
    gap: 1rem;
    margin-top: 2rem;
  }

  .resource-list li {
    display: grid;
    grid-template-columns: 2.65rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.25rem;
  }

  .footer-layout nav {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 30rem) {
  .site-header nav {
    width: 100%;
  }

  .nav-list {
    justify-content: space-between;
    gap: 0.65rem;
    font-size: 0.7rem;
  }

  .nav-list .nav-start {
    padding-inline: 0.65rem;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none;
  }

  .button:hover, .nav-list .nav-start:hover {
    transform: none;
  }
}
