/* brainyweb.io — shared stylesheet for /, /de/ and /es/
   Dark only: the logo is a white glow on transparency, there is no light
   variant of it, so there is no sensible light theme to switch to. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --void:   #05070d;
  --panel:  #0b0f1a;
  --line:   #18202f;
  --text:   #e6ecf5;
  --mute:   #8793a8;
  --cy:     #28befc;
  --vi:     #8261fb;

  --rail: linear-gradient(90deg, var(--cy), var(--vi));
  --measure: 62ch;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.shell { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* =============================================================== header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #05070d;
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(10px)) {
  .topbar {
    background: rgba(5, 7, 13, 0.82);
    backdrop-filter: blur(10px);
  }
}

/* Reading progress. The page is long and the imprint sits at the very end,
   so knowing how far down you are is worth a hairline. Scroll-driven, so
   nothing moves on its own; where the timeline is unsupported it is absent. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--rail);
  transform: scaleX(0);
  transform-origin: left center;
}
@supports (animation-timeline: scroll()) {
  .topbar::after {
    animation: progress linear both;
    animation-timeline: scroll(root block);
    animation-duration: auto;
  }
}
@keyframes progress { to { transform: scaleX(1); } }

.topbar .shell {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 56px;
}
.brand {
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 1.02rem;
}
.brand:hover { text-decoration: none; color: var(--cy); }

.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a {
  color: var(--mute);
  font-size: 0.9rem;
}
.topnav a:hover { color: var(--text); text-decoration: none; }

.langs {
  display: flex;
  gap: 10px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  font-size: 0.82rem;
}
.langs a { color: var(--mute); }
.langs a:hover { color: var(--text); text-decoration: none; }
.langs span[aria-current] { color: var(--cy); font-weight: 700; }

/* ================================================================= hero */
.hero {
  position: relative;
  overflow: hidden;
  background-color: #02040a;
  border-bottom: 1px solid var(--line);
}
/* the code photo is material, not wallpaper: it sits to the right and
   dissolves into the page before it reaches the text */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/hero.jpg");
  background-size: cover;
  background-position: 68% center;
  opacity: 0.5;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg,
      #05070d 0%, #05070d 34%,
      rgba(5, 7, 13, 0.86) 58%,
      rgba(5, 7, 13, 0.55) 100%);
}
.hero .shell { position: relative; z-index: 1; padding-top: 104px; padding-bottom: 96px; }

.logo {
  display: block;
  width: 100%;
  max-width: 188px;
  height: auto;
  margin: 0 0 34px -12px;   /* optical: the glow carries past the artwork */
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.15rem, 6.2vw, 5.2rem);
  font-weight: 700;
  font-stretch: 106%;
  line-height: 0.97;
  letter-spacing: -0.038em;
  text-wrap: balance;
  /* German compounds ("Medienunternehmen") would otherwise overflow at this
     size; <html lang> drives the hyphenation dictionary */
  hyphens: auto;
  overflow-wrap: break-word;
}

.lede {
  max-width: 52ch;
  margin: 32px 0 0;
  color: #b2bed0;
  font-size: 1.05rem;
}

.herocontact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.96rem;
}
.herocontact .tel { color: var(--mute); }
.herocontact .tel:hover { color: var(--text); }

/* ============================================================== sections */
.band { padding: 84px 0; border-bottom: 1px solid var(--line); }
.band > .shell > :first-child { margin-top: 0; }

[id] { scroll-margin-top: 72px; }

/* Editorial two-column: the heading sits in its own left rail so the body
   text keeps a readable measure instead of running the full width.
   Services opts out — it needs the whole width for the three stages. */
.split > .shell {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 20px 56px;
  align-items: start;
}


h2 {
  margin: 0 0 24px;
  font-size: clamp(1.48rem, 2.6vw, 2.05rem);
  font-weight: 700;
  font-stretch: 106%;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.split h2 { margin-bottom: 0; }

p { margin: 0 0 16px; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

/* the opening sentence carries the weight; the rest steps back */
.lead {
  margin: 0 0 22px;
  font-size: clamp(1.14rem, 1.9vw, 1.42rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--text);
  max-width: 44ch;
  text-wrap: pretty;
}
.prose p { color: #c3ccda; }
.subtle { color: var(--mute); }

/* ---- the person behind it: no panel, the page has no boxes anywhere ---- */
.profile {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.pname {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  font-size: 1.3rem;
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: -0.015em;
  max-width: none;
}
.pname span {
  font-size: 0.84rem;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
  color: var(--mute);
}
.pbio { margin: 0 0 24px; color: #c3ccda; font-size: 0.96rem; max-width: 58ch; }

.creds { margin: 0; padding: 0; list-style: none; }
.creds li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.87rem;
}
.creds li:last-child { border-bottom: 1px solid var(--line); }

/* the portrait lives in the heading column, which was otherwise empty */
.headcol { position: relative; }
.portrait {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin-top: 26px;
}

/* ---- grounds: the page changes texture rather than repeating itself ---- */
.ground { position: relative; background: #080b13; isolation: isolate; }
/* faint circuit grid — the same idea the logo draws, at a whisper */
.ground::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle at 1px 1px,
                    rgba(136, 170, 220, 0.16) 1px, transparent 0);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.cta { padding: 96px 0 100px; background: #03050b; }

/* ======================================================= services rail */
.stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 34px;
  margin-top: 54px;
}
/* one gradient in the whole page, and it carries meaning: left to right is
   the order the work actually happens in */
.stages::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  right: 7px;
  height: 2px;
  background: var(--rail);
  transform-origin: left center;
  animation: rail 1100ms cubic-bezier(0.22, 0.75, 0.2, 1) both;
}
@keyframes rail { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* The rail sits well below the fold, so a load animation is never seen.
   Where scroll-driven timelines exist, tie it to the viewport instead. */
@supports (animation-timeline: view()) {
  .stages::before {
    animation-timeline: view();
    animation-range: entry 15% cover 40%;
    animation-duration: auto;
  }
}

.stage { position: relative; padding-top: 0; }
.stage::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid var(--cy);
}
.stage:nth-child(2)::before { border-color: #5a90fb; }
.stage:nth-child(3)::before { border-color: var(--vi); }

.phase {
  display: block;
  margin-bottom: 2px;
  color: var(--mute);
  font-size: 0.82rem;
}
.stage h3 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: -0.01em;
}
.stage > p {
  margin: 0 0 26px;
  max-width: 34ch;
  color: var(--mute);
  font-size: 0.91rem;
  line-height: 1.6;
}

.stage ul { margin: 0; padding: 0; list-style: none; }
.stage li {
  margin-left: -14px;
  padding: 16px 0 16px 14px;
  border-top: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: border-left-color 140ms ease, background-color 140ms ease;
}
.stage li:last-child { border-bottom: 1px solid var(--line); }
.stage li h4 {
  margin: 0 0 5px;
  font-size: 0.97rem;
  font-weight: 700;
}
.stage li p {
  margin: 0;
  max-width: none;
  color: var(--mute);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* a service line reacts to the visitor, nothing moves on its own */
.stage li:hover {
  border-left-color: var(--cy);
  background: rgba(40, 190, 252, 0.04);
}

/* ============================================================== contact */
.mailto {
  display: inline-block;
  margin: 6px 0 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  border-bottom: 2px solid var(--cy);
  padding-bottom: 3px;
}
.mailto:hover { color: var(--cy); text-decoration: none; }
.telbig { display: inline-block; margin-top: 20px; color: var(--mute); }
.telbig:hover { color: var(--text); }

/* ============================================================== imprint */
.imprint { background: var(--panel); padding: 72px 0 60px; }
.imprint h2 { font-size: 1.3rem; margin-bottom: 30px; }

.impgrid {
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 48px;
}

dl { margin: 0; font-size: 0.9rem; }
dt {
  margin-top: 18px;
  color: var(--mute);
  font-size: 0.85rem;
}
dt:first-child { margin-top: 0; }
dd { margin: 1px 0 0; }
dd a { color: var(--text); border-bottom: 1px solid var(--line); }
dd a:hover { color: var(--cy); border-bottom-color: var(--cy); text-decoration: none; }

/* native disclosure — no JavaScript anywhere on this site */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 700;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  width: 0.9em;
  flex: none;
  color: var(--cy);
}
details[open] > summary::before { content: "\2212"; }
summary:hover { color: var(--cy); }
details p {
  margin: 0 0 12px 1.9em;
  max-width: 76ch;
  color: var(--mute);
  font-size: 0.85rem;
  line-height: 1.7;
}
details p:last-child { margin-bottom: 18px; }

.odr { margin-top: 26px; max-width: 76ch; color: var(--mute); font-size: 0.85rem; }
.note { margin-top: 26px; color: #7a8699; font-size: 0.8rem; }

/* =========================================================== responsive */
/* ---- large displays: open the frame, keep the measure ---- */
@media (min-width: 1500px) {
  .shell { max-width: 1320px; }
  .split > .shell { grid-template-columns: minmax(230px, 310px) minmax(0, 1fr); gap: 20px 72px; }
  .portrait { max-width: 300px; }
  .cards { gap: 22px; }
  .hero .shell { padding-top: 124px; padding-bottom: 112px; }
  /* prose does not get wider — p keeps --measure, .lead keeps 44ch */
}

@media (max-width: 940px) {
  .stages { grid-template-columns: 1fr; gap: 0; margin-top: 44px; }
  .stages::before {
    top: 7px; bottom: 7px; left: 6px; right: auto;
    width: 2px; height: auto;
    background: linear-gradient(180deg, var(--cy), var(--vi));
    transform-origin: top center;
    animation-name: railv;
  }
  @keyframes railv { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  .stage { padding-left: 34px; padding-bottom: 40px; }
  .stage::before { position: absolute; left: 0; top: 0; margin-bottom: 0; }
  .stage > p { max-width: var(--measure); }
  .impgrid { grid-template-columns: 1fr; gap: 40px; }
  .portrait { max-width: 200px; }
  .split > .shell { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 720px) {
  .shell { padding: 0 20px; }
  .topbar .shell { gap: 14px; min-height: 52px; }
  .topnav { gap: 16px; font-size: 0.86rem; }
  .topnav a:not(.keep) { display: none; }   /* keep Impressum reachable */
  .langs { padding-left: 14px; gap: 8px; }
  .hero .shell { padding-top: 56px; padding-bottom: 54px; }
  .hero::before { background-position: 78% center; opacity: 0.38; }
  .logo { max-width: 168px; margin-left: -10px; margin-bottom: 24px; }
  h1 { max-width: none; }
  .band { padding: 56px 0; }
  .imprint { padding: 54px 0 46px; }
  .portrait { max-width: 168px; margin-top: 20px; }
  .profile { margin-top: 34px; padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stages::before { animation: none; transform: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ================================================= cross-document fade
   The three languages are three documents. Where the browser supports it,
   switching between them cross-fades instead of flashing white, so they
   read as one site rather than three pages. */
@view-transition { navigation: auto; }

/* brand-coloured selection: a detail, but it is the kind people feel */
::selection { background: rgba(40, 190, 252, 0.28); color: #fff; }

/* ========================================================= print
   The imprint is the one part of this page people actually print, usually
   because someone asked them to put it on file. Give them a document. */
@media print {
  :root { --ink: #000; --mute: #333; --line: #bbb; }

  html, body { background: #fff; color: #000; }

  /* navigation, hero and decoration have no business on paper */
  .topbar, .hero, .portrait, .stages::before, .ground::before { display: none; }

  .band, .imprint, .cta { padding: 0 0 18pt; background: #fff; border: 0; }
  .shell, .split > .shell, .impgrid, .pgrid {
    display: block; max-width: none; padding: 0;
  }

  h2 { font-size: 15pt; margin: 0 0 8pt; color: #000; page-break-after: avoid; }
  h2::after { display: none; }
  h3, h4, .pname { color: #000; page-break-after: avoid; }
  p, li, dd, dt { color: #000; font-size: 10pt; line-height: 1.45; }
  .lead { font-size: 12pt; }

  /* a printed link is useless unless the address comes with it */
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; }
  a[href^="mailto:"]::after, a[href^="tel:"]::after { content: none; }

  /* the folded legal text has to be on the page, not behind a triangle */
  details > *:not(summary) { display: block !important; }
  summary { list-style: none; font-weight: 700; }
  summary::before { content: none; }
  details { border: 0; page-break-inside: avoid; }
  details p { margin-left: 0; }

  .creds li, .stage li { border-color: #ccc; page-break-inside: avoid; }
  section, footer { page-break-inside: auto; }
}
