/* =========================================================
   digitalallrounder.de — Denis Apel
   Bildsprache: Netzwerk-Leitstand. Instrumententafel statt Broschüre.
   Marke aus Logo.ai rekonstruiert: Buchstabe "d" in Bit-Darling10,
   Akzentquadrat #ed1e24. Rot ist der Markenakzent, Blau nur Signalfarbe
   innerhalb der technischen Zeichnungen.
   ========================================================= */

/* ---------- Tokens ----------
   Farben stammen aus Logo.ai: Akzentquadrat #ed1e24, Kontur #221f20.
   Blau dient nur innerhalb der Zeichnungen als Signalfarbe.            */
:root {
  --bg:        #050506;
  --bg-2:      #08090b;
  --panel:     #0d0e11;
  --panel-2:   #121419;

  --line:      rgba(230, 232, 235, 0.12);
  --line-soft: rgba(230, 232, 235, 0.055);

  --text:      #e6e8ea;
  --text-dim:  #a2a7ad;
  --muted:     #6b7178;

  --up:        #ed1e24;   /* Markenrot aus dem Logo — der Akzent */
  --up-hot:    #ff3b42;   /* etwas heller, für Text auf Schwarz */
  --up-glow:   rgba(237, 30, 36, 0.22);

  --signal:    #7cc4f5;   /* Link up in den Zeichnungen */
  --slate:     #8a88b0;
  --alert:     #ff3b42;
  --warn:      #f0b429;

  /* Schriften. --ff-pixel steht für Bit-Darling10 aus dem Logo;
     liegt die Originaldatei vor, hier eintragen.                       */
  --ff-pixel:   "Silkscreen", "Courier New", monospace;
  --ff-display: "IBM Plex Sans Condensed", "Helvetica Neue", sans-serif;
  --ff-mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --pad: clamp(1rem, 3.5vw, 3.5rem);
  --max: 1440px;

  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--up); color: var(--bg); }

/* ---------- Atmosphäre: Raster, Scanlines, Korn ---------- */
.bg-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.bg-layer::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-position: 0 0;
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 78%);
}
.bg-layer::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.22) 2px 4px);
  opacity: 0.5;
}
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 60;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04; mix-blend-mode: overlay;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%; max-width: var(--max);
  margin-inline: auto; padding-inline: var(--pad);
  position: relative; z-index: 2;
}
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; z-index: 2; }
.section + .section { border-top: 1px solid var(--line-soft); }

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
  font-family: var(--ff-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.01em;
  line-height: 0.92; margin: 0;
}
h1 { font-size: clamp(2.75rem, 10vw, 9rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 5.5vw, 4.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.125rem, 1.7vw, 1.5rem); letter-spacing: 0.01em; }
p  { margin: 0 0 1.1em; }

.lead {
  font-size: clamp(0.9375rem, 1.1vw, 1.0625rem); line-height: 1.75;
  color: var(--text-dim); max-width: 54ch;
}
.muted { color: var(--muted); }
.up    { color: var(--up-hot); }
.alert { color: var(--alert); }

/* Abschnittsmarke */
.eyebrow {
  display: flex; align-items: center; gap: 0.85rem;
  font-family: var(--ff-pixel);
  font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; background: var(--up);
  box-shadow: 0 0 10px var(--up); flex: none;
}
.eyebrow::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- Kopfzeile ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav[data-stuck="true"] { border-bottom-color: var(--line); background: rgba(5, 7, 10, 0.94); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 4rem; }

.logo { display: flex; align-items: center; gap: 0.7rem; }
.logo__mark { width: 26px; height: 26px; flex: none; }
.logo__txt {
  font-family: var(--ff-pixel); font-weight: 400; text-transform: uppercase;
  font-size: 0.8125rem; letter-spacing: 0.02em; line-height: 1.15;
}
.logo__txt span { color: var(--up); }
.logo__sub { font-size: 0.5625rem; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }

.nav__links { display: flex; gap: clamp(0.85rem, 2vw, 2rem); align-items: center; }
.nav__links a {
  font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); padding-block: 0.35rem; position: relative;
  transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--up); box-shadow: 0 0 8px var(--up); transition: width 0.35s var(--ease-out);
}
.nav__links a:hover { color: var(--up-hot); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  border: 1px solid var(--up); color: var(--up-hot) !important;
  padding: 0.45rem 0.95rem !important;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav__cta::after { display: none !important; }
.nav__cta:hover { background: var(--up-glow); box-shadow: 0 0 22px var(--up-glow); }
.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 2; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2rem, 5vw, 4rem); }
#mesh {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; opacity: 0.85;
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
  gap: clamp(1.75rem, 4vw, 3.5rem); align-items: end;
}
.hero h1 { margin: 0.35em 0 0.4em; }
.hero h1 .glow { color: var(--up-hot); text-shadow: 0 0 44px var(--up-glow); }

.badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  border: 1px solid var(--line); padding: 0.35rem 0.75rem;
  font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim);
}
.led {
  width: 6px; height: 6px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 10px var(--signal); animation: blink 2.4s infinite;
}
@keyframes blink { 0%, 70%, 100% { opacity: 1; } 82% { opacity: 0.25; } }

/* Terminal */
.term {
  border: 1px solid var(--line); background: rgba(11, 15, 21, 0.82);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.term__bar {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line-soft);
  font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.term__bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.term__bar i:nth-child(1) { background: var(--alert); }
.term__bar i:nth-child(2) { background: var(--warn); }
.term__bar i:nth-child(3) { background: var(--signal); }
.term__bar span { margin-left: auto; }
.term__body { padding: 0.95rem 1rem 1.15rem; font-size: 0.75rem; line-height: 1.85; min-height: 13.5rem; }
.term__body div { white-space: pre-wrap; word-break: break-word; }
.term__body .c { color: var(--signal); }
.term__body .g { color: var(--muted); }
.term__body .r { color: var(--alert); }
.cursor {
  display: inline-block; width: 0.5em; height: 1em; background: var(--up-hot);
  vertical-align: -0.13em; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Hinweis: Auftragsannahme geschlossen ---------- */
.notice-wrap { padding-block: clamp(2.5rem, 5vw, 4rem); position: relative; z-index: 2; }
.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--up);
  background: linear-gradient(100deg, rgba(237, 30, 36, 0.07), var(--panel) 42%);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  display: grid; gap: 0.9rem;
}
.notice__tag {
  display: flex; align-items: center; gap: 0.6rem; margin: 0;
  font-family: var(--ff-pixel); font-size: 0.5938rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--up-hot);
}
.notice h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.75rem); line-height: 1.02;
  max-width: 22ch; margin: 0.2rem 0 0.3rem;
}
.notice p { margin: 0; color: var(--text-dim); font-size: 0.875rem; max-width: 66ch; line-height: 1.8; }
.notice strong { color: var(--text); font-weight: 500; }
.notice .crosslink { margin-top: 0.75rem; justify-self: start; }
.led--warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

/* ---------- Telemetrie ---------- */
.telemetry {
  /* Feste Spaltenzahl statt auto-fit: sonst bleibt bei vier Kacheln eine
     leere Zelle stehen und der Containerhintergrund schimmert durch. */
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line-soft);
  border-block: 1px solid var(--line-soft); margin-top: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 900px) { .telemetry { grid-template-columns: repeat(4, 1fr); } }
.tele { background: var(--bg); padding: 1.1rem clamp(0.9rem, 2vw, 1.5rem); }
.tele dt { font-family: var(--ff-pixel); font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tele dd {
  margin: 0.35rem 0 0; font-family: var(--ff-display); font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1; color: var(--text);
}
.tele dd em { font-style: normal; font-size: 0.45em; color: var(--up-hot); margin-left: 0.2em; }

/* ---------- Leistungen ---------- */
.mods { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
@media (min-width: 900px) { .mods { grid-template-columns: repeat(2, 1fr); } }

.mod {
  background: var(--bg); padding: clamp(1.25rem, 2.4vw, 2.25rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
  gap: clamp(1rem, 2vw, 2rem); align-items: start;
  position: relative; transition: background 0.45s var(--ease);
}
.mod::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--up); box-shadow: 0 0 16px var(--up);
  transform: scaleY(0); transform-origin: top; transition: transform 0.5s var(--ease-out);
}
.mod:hover { background: var(--panel); }
.mod:hover::before { transform: scaleY(1); }
.mod__no { font-family: var(--ff-pixel); font-size: 0.625rem; letter-spacing: 0.18em; color: var(--up-hot); }
.mod h3 { margin: 0.55rem 0 0.55rem; }
.mod p { color: var(--muted); font-size: 0.8125rem; margin: 0; line-height: 1.8; }
.mod__tags { margin: 0.9rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mod__tags li {
  font-size: 0.5938rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line); padding: 0.2rem 0.5rem;
}
.mod__fig { align-self: center; }
.mod__fig svg { width: 100%; height: auto; overflow: visible; }
/* Zeichnungen: Linie = gedimmt, Akzent = Hellblau */
.dg      { stroke: var(--line); stroke-width: 1; fill: none; }
.dl      { stroke: var(--slate); stroke-width: 1.25; fill: none; }
.da      { stroke: var(--signal); stroke-width: 1.5; fill: none; }
.da-f    { fill: var(--signal); }
.db      { stroke: var(--up); stroke-width: 1.5; fill: none; }
.db-f    { fill: var(--up); }
.dr      { stroke: var(--alert); stroke-width: 1.25; fill: none; }
.dt      { fill: var(--muted); font-family: var(--ff-mono); font-size: 7px; letter-spacing: 0.1em; }
.dt-a    { fill: var(--signal); font-family: var(--ff-mono); font-size: 7px; letter-spacing: 0.1em; }
.dash    { stroke-dasharray: 3 3; }
.mod:hover .flow { animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -24; } }

/* ---------- Referenzen ---------- */
.works { display: grid; gap: 1px; background: var(--line-soft); border-block: 1px solid var(--line-soft); }
.work {
  background: var(--bg); display: grid;
  grid-template-columns: 6rem minmax(0, 1.2fr) minmax(0, 1.6fr) 8rem;
  gap: clamp(0.75rem, 2.5vw, 2rem); align-items: center;
  padding: clamp(1.1rem, 2.4vw, 1.75rem) 0;
  transition: background 0.4s var(--ease), padding-inline 0.4s var(--ease);
}
.work:hover { background: var(--panel); padding-inline: 1.1rem; }
.work__no { font-size: 0.625rem; letter-spacing: 0.18em; color: var(--muted); }
.work h3 { font-size: clamp(1.0625rem, 2vw, 1.625rem); }
.work p { margin: 0; color: var(--muted); font-size: 0.8125rem; }
.work__go { font-family: var(--ff-pixel); font-size: 0.5625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--up-hot); text-align: right; transition: transform 0.35s var(--ease-out); }
.work:hover .work__go { transform: translateX(6px); }

/* ---------- Profil ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(1.75rem, 5vw, 4.5rem); align-items: start; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li {
  display: flex; justify-content: space-between; gap: 1.25rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.8125rem;
}
.facts b { font-weight: 400; font-size: 0.625rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); align-self: center; }

/* ---------- Kontakt ---------- */
.contact__mail {
  display: inline-block; font-family: var(--ff-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(1.35rem, 5.6vw, 4.5rem); line-height: 1.05;
  margin-block: 0.3em 0.55em; color: var(--text); word-break: break-word;
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}
.contact__mail:hover { color: var(--up-hot); text-shadow: 0 0 34px var(--up-glow); }
.contact__meta { display: flex; flex-wrap: wrap; gap: 1.5rem 3.5rem; }

/* ---------- Fußzeile ---------- */
.foot { border-top: 1px solid var(--line); padding-block: clamp(2rem, 4vw, 3.5rem); position: relative; z-index: 2; }
.foot__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 3rem; align-items: flex-start; }
.foot a { color: var(--muted); transition: color 0.25s var(--ease); }
.foot a:hover { color: var(--up-hot); }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase; }
.foot__note { font-size: 0.75rem; color: var(--muted); max-width: 36ch; }

.crosslink {
  display: inline-flex; align-items: center; gap: 0.55rem;
  border: 1px solid var(--line); padding: 0.4rem 0.85rem;
  font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.crosslink:hover { border-color: var(--up); color: var(--up-hot); }
.crosslink::before { content: ""; width: 5px; height: 5px; background: currentColor; flex: none; }

/* ---------- Inhaltsseiten ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.25rem, 2.6vw, 1.875rem); margin: 2.6em 0 0.7em; }
.prose h2:first-of-type { margin-top: 1em; }
.prose h3 { font-size: 1rem; margin: 1.8em 0 0.4em; }
.prose p, .prose li { color: var(--text-dim); font-size: 0.8125rem; line-height: 1.85; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: 0.35em; }
.prose a { color: var(--up-hot); text-decoration: underline; text-underline-offset: 3px; }
.prose address { font-style: normal; color: var(--text); }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out) var(--d, 0ms), transform 0.7s var(--ease-out) var(--d, 0ms);
}

:focus-visible { outline: 2px solid var(--up); outline-offset: 3px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mod { grid-template-columns: 1fr; }
  /* Zeichnung unter den Text. Mit order:-1 stand sie ueber dem Titel und
     las sich als Grafik des vorherigen Moduls. */
  .mod__fig { max-width: 20rem; margin-top: 1.25rem; }
  .work { grid-template-columns: 3.5rem 1fr; row-gap: 0.4rem; }
  .work p, .work__go { grid-column: 2; }
  .work__go { text-align: left; }
  .nav__links { display: none; }
  .nav__links[data-open="true"] {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem;
    position: absolute; top: 4rem; left: 0; right: 0;
    background: var(--panel); border-block: 1px solid var(--line);
    padding: 1.5rem var(--pad) 2rem;
  }
  .nav__toggle { display: block; font-family: var(--ff-pixel); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--up-hot); }
}

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  #mesh { display: none; }
}
