/* Stuttgart-IX — custom stylesheet
   Palette and motif derived from the Stuttgart-IX logo (black / #ECA748). */

/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: "Source Sans";
  src: url("/assets/fonts/source-sans-pro/source-sans-pro-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url("/assets/fonts/source-sans-pro/source-sans-pro-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url("/assets/fonts/source-sans-pro/source-sans-pro-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url("/assets/fonts/source-sans-pro/source-sans-pro-bold-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --ink: #171b21;
  --muted: #4a5462;
  --paper: #ffffff;
  --wash: #f5f6f8;
  --line: #e4e7ec;
  --brand: #eca748;
  --brand-deep: #8a5410;
  --sans: "Source Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --measure: 50rem;
  --wide: 71rem;
  color-scheme: light;
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main.content {
  flex: 1;
  width: 100%;
}

a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

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

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--wash);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* Stepped-squares glyph (from the logo mark) */

.sq-glyph {
  flex: none;
  display: inline-block;
  fill: var(--brand);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand-mark {
  height: 1.65rem;
  width: auto;
  display: block;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-name .ix {
  color: var(--brand);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  line-height: 0;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--brand);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--brand);
}

.site-nav .utility a {
  font-weight: 400;
  color: var(--muted);
}

.site-nav .utility a:hover {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

.site-nav .login a {
  background: var(--brand);
  color: var(--ink);
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
}

.site-nav .login a:hover {
  background: var(--ink);
  color: var(--paper);
}

.site-nav .lang a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
}

.site-nav .lang a:hover {
  border-color: var(--brand);
  color: var(--ink);
}

@media (max-width: 60rem) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(23 27 33 / 0.08);
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav li a {
    display: block;
    padding: 0.55rem 0;
    border-bottom: 0;
  }

  .site-nav a[aria-current="page"] {
    color: var(--brand-deep);
  }

  .site-nav .login a {
    display: inline-block;
    margin-top: 0.5rem;
  }
}

/* ---------- Page scaffolding ---------- */

.page-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 1.25rem 0;
}

.page-header .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.page-header .eyebrow .date {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.page-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin: 0 0 1.5rem;
}

.page-header::after {
  content: "";
  display: block;
  border-bottom: 1px solid var(--line);
}

.page-body {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page-body > * {
  max-width: var(--measure);
}

.page-body > table,
.page-body h1,
.page-body h2 {
  max-width: none;
}

.page-body h1 {
  font-size: 1.7rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.page-body h1:first-child,
.page-body h2:first-child {
  margin-top: 0;
}

.page-body h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.75rem;
}

.page-body h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

.page-body h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.page-body li {
  margin-bottom: 0.25rem;
}

.page-body img {
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------- Tables ---------- */

.page-body table {
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.25rem 0 2rem;
  font-variant-numeric: tabular-nums;
}

.page-body th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  padding: 0.5rem 1rem 0.5rem 0;
}

.page-body td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem 0.5rem 0;
  vertical-align: top;
}

.page-body tbody tr:hover {
  background: var(--wash);
}

.page-body td a {
  text-decoration: none;
}

.page-body td a:hover {
  text-decoration: underline;
}

/* Technical columns in monospace */

.page-peers td:nth-child(2),
.page-peers td:nth-child(4),
.page-routeserver td:first-child,
.page-offer td {
  font-family: var(--mono);
  font-size: 0.88rem;
}

.page-offer td:first-child {
  font-family: var(--sans);
  font-size: 0.95rem;
}

@media (max-width: 60rem) {
  .page-body table {
    display: block;
    overflow-x: auto;
  }
}

/* ---------- Locations carousel ---------- */

.page-body > .loc-carousel-wrap {
  max-width: none;
}

.loc-carousel-wrap {
  margin: 1.5rem 0 2.5rem;
}

.loc-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.loc-nav button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.loc-nav button:hover:not(:disabled) {
  border-color: var(--brand);
}

.loc-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.loc-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.loc-carousel::-webkit-scrollbar {
  height: 6px;
}

.loc-carousel::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.loc-card {
  flex: 0 0 min(20.5rem, 85vw);
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 1.25rem 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
}

.loc-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.8rem;
}

.loc-badge--core {
  background: var(--brand);
  color: var(--ink);
}

.loc-badge--backhaul {
  background: var(--wash);
  color: var(--muted);
  border: 1px solid var(--line);
}

.page-body .loc-name {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.loc-fields {
  margin: 0 0 1.25rem;
}

.loc-fields dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.7rem 0 0.15rem;
}

.loc-fields dt:first-child {
  margin-top: 0;
}

.loc-fields dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.loc-fields dd.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.loc-pdb {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #4b6063;
  background: #4b6063;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.loc-pdb img {
  height: 1.05rem;
  width: auto;
  display: block;
  border: 0;
  border-radius: 0;
  /* white version of the logo for the dark button */
  filter: brightness(0) invert(1);
}

.loc-pdb:hover {
  background: #3a4b4e;
  border-color: #3a4b4e;
}

/* Core / Backhaul legend below the carousel */

.loc-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 2rem;
}

.page-body > .loc-legend {
  max-width: none;
}

.loc-legend-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
  padding: 1.1rem 1.25rem;
}

.loc-legend-item p {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 60rem) {
  .loc-legend {
    grid-template-columns: 1fr;
  }
}

/* ---------- Price cards ---------- */

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.price-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 1.25rem;
  max-width: 18rem;
}

.page-body .price-name {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.price-monthly {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.price-amount {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
}

.price-card sup {
  font-size: 0.55em;
  line-height: 0;
  color: var(--muted);
}

.price-label,
.price-fields dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.price-fields {
  margin: 0;
}

.price-fields dt {
  margin: 0.6rem 0 0.15rem;
}

.price-fields dt:first-child {
  margin-top: 0;
}

.price-fields dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* ---------- News ---------- */

.news-entry {
  max-width: var(--measure);
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.news-entry:first-of-type {
  padding-top: 0;
}

.news-entry .meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.news-entry h2 {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
}

.news-entry h2 a {
  color: var(--ink);
  text-decoration: none;
}

.news-entry h2 a:hover {
  color: var(--brand-deep);
}

.news-entry > :last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Home ---------- */

.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 4rem 1.25rem 3rem;
  text-align: center;
}

.hero-logo {
  max-width: 34rem;
  width: 100%;
}

.hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin: 1.5rem 0 0;
}

.hero h1 strong {
  color: var(--ink);
}

.home-prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.home-prose h3 {
  font-size: 1.2rem;
  margin: 2.25rem 0 0.5rem;
}

.members {
  background: var(--wash);
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.25rem 3rem;
}

.members-inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.members h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.member-logos {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.member-logos img {
  height: 3.5rem;
  width: auto;
}

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

.site-footer {
  background: var(--ink);
  color: #c8cdd4;
  font-size: 0.9rem;
  margin-top: auto;
}

.site-footer .bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-footer .copyright {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.site-footer a {
  color: #c8cdd4;
}

.site-footer a:hover {
  color: var(--brand);
}

.site-footer .mastodon img {
  height: 1.4rem;
  width: auto;
  display: block;
  filter: grayscale(1) brightness(1.8);
  transition: filter 0.15s ease;
}

.site-footer .mastodon:hover img {
  filter: none;
}

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

.error-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 6rem 1.25rem;
  text-align: center;
}

.error-page h1 {
  font-size: 4rem;
  margin: 0 0 1rem;
}

/* ---------- Motion ---------- */

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