/* Self-hosted webfonts (SIL Open Font License — free to embed/modify).
   Local files only, no external font-CDN request at runtime, consistent
   with the rest of this project's "no external dependencies" approach. */
@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/titilliumweb-400.woff2") format("woff2");
}

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/titilliumweb-600.woff2") format("woff2");
}

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/titilliumweb-700.woff2") format("woff2");
}

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/titilliumweb-900.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrainsmono-variable.woff2") format("woff2");
}

:root {
  --black: #0a0a0c;
  --black-soft: #0f0f13;
  --graphite: #17171b;
  --graphite-2: #20262e;
  --ink: #f2ede2;
  --muted: #a8afb8;
  --dim: #767f89;
  --red: #e8323d;
  --red-deep: #7a1e27;
  --red-soft: rgba(232, 50, 61, 0.14);
  --line: rgba(242, 237, 226, 0.14);
  --line-soft: rgba(242, 237, 226, 0.08);
  --max: 1180px;
  --pad: clamp(20px, 4vw, 44px);
  --chamfer: 16px;
  --chamfer-sm: 12px;
  --font-sans: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 130px;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(242, 237, 226, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(242, 237, 226, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(232, 50, 61, 0.12), transparent 28rem),
    linear-gradient(180deg, #0a0a0c 0%, #0d0d10 55%, #0a0a0c 100%);
  background-size: 84px 84px, 84px 84px, auto, auto;
  font-family: var(--font-sans);
  line-height: 1.5;
}

/* film-grain texture: a subtle tactile layer over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

p {
  color: var(--muted);
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  transform: translateY(-140%);
  padding: 10px 12px;
  color: var(--black);
  background: var(--ink);
  font-weight: 700;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  row-gap: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
}

.brand img {
  display: block;
  height: 76px;
  width: auto;
  mix-blend-mode: lighten;
}

.section-label,
.item-index,
.project-status,
.project-domain,
.framework-grid span,
.site-footer span {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: polygon(
    var(--chamfer-sm) 0,
    100% 0,
    100% calc(100% - var(--chamfer-sm)),
    calc(100% - var(--chamfer-sm)) 100%,
    0 100%,
    0 var(--chamfer-sm)
  );
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.hero,
.section,
.framework-section,
.site-footer {
  width: min(100% - var(--pad) * 2, var(--max));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(880px, calc(100vh - 73px));
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: clamp(42px, 7vw, 96px);
  padding: clamp(72px, 10vw, 128px) 0 clamp(68px, 8vw, 104px);
}

/* corner-register mark: a small atmospheric detail borrowed from the brand board */
.hero::after {
  position: absolute;
  top: clamp(28px, 4vw, 44px);
  right: 0;
  color: var(--red-deep);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  content: "+";
}

.section {
  position: relative;
  padding: clamp(76px, 9vw, 126px) 0;
  border-top: 1px solid var(--line-soft);
}

/* corner-bracket tag: the small ⌐ mark preceding every section label */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.section-label::before {
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
  content: "";
}

.hero h1,
.section h2,
.framework-section h2 {
  color: var(--ink);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-size: clamp(3rem, 6.35vw, 5.95rem);
  font-weight: 900;
}

.hero h1 em {
  color: var(--red);
  font-style: normal;
}

.hero-lede {
  max-width: 690px;
  margin-bottom: 34px;
  color: #c9ced5;
  font-size: clamp(1.08rem, 1.7vw, 1.34rem);
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  clip-path: polygon(
    var(--chamfer-sm) 0,
    100% 0,
    100% calc(100% - var(--chamfer-sm)),
    calc(100% - var(--chamfer-sm)) 100%,
    0 100%,
    0 var(--chamfer-sm)
  );
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--black);
}

.button-primary:hover {
  background: #ff4d57;
}

.button-secondary {
  color: var(--ink);
  background: rgba(23, 23, 27, 0.72);
}

.button-secondary:hover {
  border-color: rgba(242, 237, 226, 0.28);
  background: rgba(32, 32, 38, 0.84);
}

/* hero brand panel: mark + tagline lockup + system meta, replacing the old abstract diagram */
.hero-panel {
  position: relative;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(242, 237, 226, 0.05), transparent 45%),
    rgba(15, 15, 19, 0.85);
  clip-path: polygon(
    var(--chamfer) 0,
    100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%,
    0 var(--chamfer)
  );
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
}

.hero-panel-mark {
  display: flex;
  justify-content: center;
  padding: 30px 10px 20px;
}

.hero-panel-mark img {
  width: 112px;
  height: auto;
  mix-blend-mode: lighten;
}

.lockup-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-bottom: 24px;
}

.lockup-tagline .rule {
  width: 32px;
  height: 1px;
  background: var(--red);
}

.lockup-tagline span {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.hero-panel-meta {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.hero-panel-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  background: rgba(15, 15, 19, 0.94);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.hero-panel-meta dt {
  color: var(--dim);
  text-transform: uppercase;
}

.hero-panel-meta dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
}

.section-intro {
  display: grid;
  max-width: 780px;
  gap: 0;
  margin-bottom: clamp(32px, 5vw, 54px);
}

.section h2,
.framework-section h2 {
  margin-bottom: 0;
  font-size: clamp(2.15rem, 4.6vw, 4.75rem);
  font-weight: 900;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
}

.about-grid p {
  max-width: 560px;
  color: #c3c8cf;
  font-size: clamp(1rem, 1.4vw, 1.14rem);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.capability-card {
  min-height: 290px;
  padding: 24px;
  background: rgba(15, 15, 19, 0.94);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer-sm)), calc(100% - var(--chamfer-sm)) 100%, 0 100%);
  transition: background-color 160ms ease;
}

.capability-card:hover {
  background: rgba(23, 23, 27, 0.96);
}

.item-index {
  display: block;
  margin-bottom: 42px;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.capability-card h3 {
  min-height: 58px;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.16;
  text-transform: uppercase;
}

.capability-card p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 0.7fr 1.2fr 0.45fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 38px) 0;
  border-bottom: 1px solid var(--line);
}

.project-status,
.project-domain {
  display: block;
  color: var(--dim);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.project-status {
  margin-bottom: 11px;
  color: var(--red);
}

.project-row h3 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.7vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
}

.project-row h3 a {
  transition: color 160ms ease;
}

.project-row h3 a:hover {
  color: var(--red);
}

.project-row p {
  max-width: 590px;
  margin-bottom: 0;
  color: #c5cad1;
}

.project-domain {
  justify-self: end;
  text-align: right;
}

.framework-section {
  position: relative;
  display: grid;
  grid-template-columns: 0.76fr 1fr;
  gap: clamp(30px, 6vw, 74px);
  align-items: start;
  padding: clamp(64px, 8vw, 104px) clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(232, 50, 61, 0.09), transparent 38%),
    rgba(15, 15, 19, 0.85);
  clip-path: polygon(
    var(--chamfer) 0,
    100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%,
    0 var(--chamfer)
  );
}

.framework-grid {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.framework-grid div {
  padding: 22px;
  background: rgba(10, 10, 12, 0.82);
}

.framework-grid span {
  display: block;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.framework-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
  text-transform: uppercase;
}

.framework-grid p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.principles-grid div {
  padding: 22px 24px;
  background: rgba(15, 15, 19, 0.85);
}

.principles-grid p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.contact-section {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.contact-copy p {
  max-width: 650px;
  margin-bottom: 28px;
  color: #c5cad1;
}

/* spec-panel / spec-row: a bordered dt/dd fact sheet. Originally built for
   the EDS/HERA project pages, reused here for the PGP key details — shared
   in this file rather than duplicated per page-specific stylesheet. */
.spec-panel {
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(15, 15, 19, 0.85);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}

/* The PGP block nests an unclassed <dl> inside .spec-panel (the class sits
   on the wrapping div there, not the dl itself as in the plain spec-panel
   usage) — reset its UA-default margin explicitly so it doesn't open a gap
   the plain spec-panel dl never has. */
.spec-panel dl {
  margin: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row dt {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spec-row dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

/* PGP contact block */
/* PGP is real but intentionally secondary — collapsed by default, quiet
   dim-gray label rather than the bright red section-label treatment used
   for primary content. */
.pgp-details {
  margin-top: 24px;
}

.pgp-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  list-style: none;
  transition: color 160ms ease;
}

.pgp-summary::-webkit-details-marker {
  display: none;
}

.pgp-summary::before {
  color: var(--dim);
  content: "+";
}

.pgp-details[open] .pgp-summary::before {
  content: "\2212";
}

.pgp-summary:hover {
  color: var(--muted);
}

.pgp-details[open] .pgp-summary {
  margin-bottom: 14px;
}

.pgp-block {
  margin-top: 0;
}

.pgp-row-fingerprint dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pgp-row-fingerprint code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.pgp-copy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(23, 23, 27, 0.72);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.pgp-copy:hover {
  color: var(--ink);
  border-color: rgba(242, 237, 226, 0.28);
}

.pgp-copy[data-copied="true"] {
  color: var(--red);
  border-color: rgba(122, 30, 39, 0.45);
}

.pgp-spec {
  margin-bottom: 20px;
}

.pgp-key-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.pgp-key-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pgp-key-block {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line-soft);
}

.site-footer p {
  max-width: 660px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.site-footer span {
  color: var(--dim);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* closing brand strip: the icon + wordmark + tagline lockup as a final brand moment */
.brand-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(56px, 8vw, 92px) 0;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.brand-strip-icon {
  display: block;
  width: 68px;
  height: auto;
  margin: 0 auto;
  mix-blend-mode: lighten;
}

.brand-strip-logo {
  display: block;
  width: min(300px, 80vw);
  height: auto;
  margin: 0 auto;
  mix-blend-mode: lighten;
}

@media (max-width: 1060px) {
  .hero,
  .framework-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    max-width: 620px;
    margin: 0 auto;
  }

  .capability-grid,
  .principles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-row {
    grid-template-columns: 1fr;
  }

  .project-domain {
    justify-self: start;
    text-align: left;
  }
}

/* Dedicated header breakpoint, decoupled from the 1060/700 content
   breakpoints: the header's logo + 5-item nav run out of room earlier than
   the page content does, and without this tier the nav silently overflows
   and gets clipped by body{overflow-x:hidden} across most of the iPad
   portrait range (roughly 744-844px). */
@media (max-width: 900px) {
  .brand img {
    height: 56px;
  }

  .site-nav a {
    padding: 10px 10px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 700px) {
  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand img {
    height: 48px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    border: 1px solid var(--line-soft);
    background: rgba(15, 15, 19, 0.72);
  }

  .site-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 13px 4px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-align: center;
  }

  .pgp-row-fingerprint {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 11.2vw, 3.85rem);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .about-grid,
  .capability-grid,
  .principles-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    min-height: 230px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Short landscape viewports (phones rotated sideways) get none of the
   1060/700px width-based tiers' relief — the hero's padding/heading scale
   is tuned for tall portrait viewports and otherwise pushes most of the
   hero below the fold on a ~375-428px-tall screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding-top: clamp(28px, 6vh, 48px);
    padding-bottom: clamp(20px, 5vh, 32px);
  }

  .hero h1 {
    margin-bottom: 14px;
  }

  .hero-lede {
    margin-bottom: 18px;
  }

  /* The ≤700px-width tier stacks these to full-width for portrait phones,
     but a short landscape phone (e.g. 667px-wide SE) has ample horizontal
     room for them side by side — only the height is scarce there. */
  .hero-actions,
  .button {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
