/* ==========================================================================
   Spectre Systems AB

   The palette is indigo-led, taken from the logo (#2D1D5E), with a single warm
   amber counterpoint. Dark only - there is no light variant and no switch.
   Display type is monospace on purpose: this is a company whose craft is
   command-line tooling, so the terminal is the house voice. Section frames
   mirror a Spectre.Console panel - a hairline box with the label set into the
   top rule.

   No webfonts are loaded. Everything here is served from the site's own
   origin, so it makes no third-party requests at all.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */

:root {
  --bg: #140e2e;
  --bg-raised: #1b1440;
  --bg-sunken: #0f0a24;
  --rule: #2e2559;
  --rule-strong: #453a80;
  --fg: #e9e7f5;
  --fg-muted: #a29cc6;
  --brand: #7a68c4;
  --accent: #f0b354;
  --accent-ink: #1a1236;
  --accent-text: #f2bc69;

  --font-display: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono",
    "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-gap: clamp(4rem, 9vw, 7rem);

  color-scheme: dark;
}

/* ----------------------------------------------------------------- base -- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

/* Blazor moves focus to the page heading after navigation. That is a screen
   reader affordance, not a keyboard position, so it should not draw a ring. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 0.8125rem/1 var(--font-display);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 120ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0.5rem);
}

/* ----------------------------------------------------------- typography -- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
  max-width: 62ch;
}

p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  font: 500 0.75rem/1 var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}

.lead {
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  color: var(--fg-muted);
}

/* --------------------------------------------------------------- layout -- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* -------------------------------------------------- panel (the signature) --
   A hairline frame with the section label set into the top rule, the way a
   Spectre.Console panel prints its header. The label carries the page
   background so it punches a gap in the border behind it.                   */

.panel {
  position: relative;
  border: 1px solid var(--rule);
  padding: clamp(2.5rem, 5vw, 3.75rem) clamp(1.25rem, 4vw, 3rem)
    clamp(2.25rem, 5vw, 3.5rem);
}

.panel__label {
  position: absolute;
  top: 0;
  left: clamp(1rem, 3vw, 2.25rem);
  transform: translateY(-50%);
  margin: 0;
  padding-inline: 0.75rem;
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.panel__label::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-inline-end: 0.6rem;
  background: var(--accent);
}

.section {
  scroll-margin-top: 6rem;
  padding-bottom: var(--section-gap);
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-inline-end: auto;
  color: var(--fg);
  text-decoration: none;
}

.brand__mark {
  width: 1.9rem;
  height: auto;
  flex: none;
}

.brand__name {
  font: 600 0.8125rem/1 var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
  font: 500 0.8125rem/1 var(--font-display);
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  text-decoration: none;
  padding-block: 0.5rem;
}

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

/* Four section links plus the wordmark stop fitting on one row well before
   phone widths, and the links matter more - they are the only navigation this
   page has. The mark alone still identifies the company. */
@media (max-width: 44rem) {
  .brand__name {
    display: none;
  }

  .site-nav {
    gap: 1.125rem;
  }
}

/* Below this even the links alone are too wide, so they take a row of their
   own. Nothing is hidden behind a menu button. */
@media (max-width: 30rem) {
  .site-header__inner {
    flex-wrap: wrap;
    min-height: 0;
    row-gap: 0.25rem;
    padding-block: 0.7rem;
  }

  /* The links moved to their own row, so the first one has space for the
     wordmark again. */
  .brand__name {
    display: inline;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    padding-block: 0.25rem;
  }
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 10vw, 7.5rem) var(--section-gap);
}

/* Anchors the ghost to the content column rather than the viewport, so it
   stays beside the text on very wide screens. */
.hero > .container {
  position: relative;
}

.hero__inner {
  position: relative;
  z-index: 1;
  /* Wide enough that the headline keeps its intended two-line break at the
     largest step of the type scale. */
  max-width: 54rem;
}

/* Monospace does not condense, so the headline is sized off the viewport
   directly. Anything wider and the longest word pushes the whole document
   past the screen edge on small phones. */
.hero__title {
  font-size: clamp(1.75rem, 7.6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  margin-block: 1.25rem 1.5rem;
}

/* The authored line break only holds where there is room for it; below that
   the headline wraps on its own. */
@media (max-width: 42rem) {
  .hero__break {
    display: none;
  }
}

.hero__caret {
  color: var(--accent);
  font-weight: 400;
}

.hero__lead {
  max-width: 40rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 2.25rem;
}

/* The logo mark sits behind the hero, like the apparition the company is
   named after. Hidden where it would crowd the text. */
.hero__ghost {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -2.5rem;
  width: min(22rem, 32vw);
  transform: translateY(-50%);
  opacity: 0.07;
  pointer-events: none;
}

@media (max-width: 62rem) {
  .hero__ghost {
    display: none;
  }
}

/* -------------------------------------------------------------- buttons -- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  font: 600 0.875rem/1 var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease, transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  background: color-mix(in srgb, var(--accent) 84%, var(--fg));
  color: var(--accent-ink);
}

.button--ghost {
  border-color: var(--rule-strong);
  color: var(--fg);
  background: transparent;
}

.button--ghost:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
  background: var(--bg-sunken);
}

/* ------------------------------------------------------------- services -- */

/* Two columns rather than auto-fit: there are four services, and a three-up
   grid strands the fourth on a row of its own. */
.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem);
}

@media (min-width: 42rem) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.service__rule {
  display: block;
  width: 1.75rem;
  height: 2px;
  background: var(--accent);
}

.service__title {
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  margin-block: 1rem 0.6rem;
}

.service p {
  color: var(--fg-muted);
  margin: 0;
}

/* ---------------------------------------------------------- open source -- */

.projects__lead {
  margin-bottom: 2.25rem;
  max-width: 46rem;
}

.projects {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.project {
  display: grid;
  gap: 0.35rem 2rem;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 46rem) {
  .project {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
}

.project__name {
  font-size: 1rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}

.project__desc {
  margin: 0;
  color: var(--fg-muted);
  max-width: 52ch;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0;
  max-width: none;
  font: 500 0.8125rem/1.5 var(--font-display);
}

.project__links a {
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

.project__links a:hover {
  border-bottom-color: currentColor;
}

/* Marks the link as leaving the site. */
.project__links a::after {
  content: "\2197";
  margin-inline-start: 0.3em;
  opacity: 0.65;
}

/* The closing argument for the section, so it gets the weight of a rule
   above it rather than reading as another list row. */
.usedby {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
  margin: 2.25rem 0 0;
  max-width: none;
}

.usedby__label {
  font: 600 0.75rem/1.5 var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.usedby__names {
  font: 500 0.9375rem/1.5 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* ---------------------------------------------------------------- about -- */

.about {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 54rem) {
  .about {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}

.about__facts {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.about__fact {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--rule);
  font: 500 0.8125rem/1.4 var(--font-display);
}

.about__fact > span:first-child {
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about__fact > span:last-child {
  text-align: right;
}

/* -------------------------------------------------------------- contact -- */

.contact {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 54rem) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.contact__email {
  display: inline-block;
  margin-top: 1.25rem;
  font: 600 clamp(1.0625rem, 0.86rem + 0.9vw, 1.375rem) / 1.3 var(--font-display);
  letter-spacing: -0.025em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.15rem;
}

.contact__email:hover {
  color: var(--accent-text);
}

.details {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem 1.5rem;
  font: 500 0.875rem/1.5 var(--font-display);
}

.details dt {
  align-self: center;
  color: var(--fg-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.details dd {
  margin: 0;
  color: var(--fg);
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 2.5rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font: 500 0.75rem/1.5 var(--font-display);
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

/* ------------------------------------------------------------ not found -- */

.notfound {
  padding-block: clamp(4rem, 12vw, 8rem);
}

.notfound__code {
  font: 600 clamp(3rem, 10vw, 5.5rem) / 1 var(--font-display);
  letter-spacing: -0.05em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

/* --------------------------------------------------------------- motion -- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.14;
  }
  50% {
    opacity: 0.5;
  }
}

.hero__inner > * {
  animation: rise 600ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero__inner > :nth-child(1) {
  animation-delay: 40ms;
}
.hero__inner > :nth-child(2) {
  animation-delay: 120ms;
}
.hero__inner > :nth-child(3) {
  animation-delay: 200ms;
}
.hero__inner > :nth-child(4) {
  animation-delay: 280ms;
}

.hero__caret {
  animation: blink 1.15s steps(1) infinite;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Drop the entry animation outright. Shortening it is not enough: the
     staggered delays combined with backwards fill would still leave the
     hero blank for a moment. */
  .hero__inner > * {
    animation: none;
  }

  .hero__caret {
    opacity: 1;
  }
}

/* ---------------------------------------------- blazor loading + errors -- */

.loading {
  display: grid;
  place-items: center;
  gap: 1.25rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.loading__mark {
  width: 4.5rem;
  animation: pulse 2.4s ease-in-out infinite;
}

.loading__text {
  font: 500 0.75rem/1 var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.9rem var(--gutter);
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 0.8125rem/1.5 var(--font-display);
}

#blazor-error-ui .dismiss {
  float: right;
  cursor: pointer;
}

#blazor-error-ui a {
  color: var(--accent-ink);
}
