/* ==========================================================
   EMRIC – Onepager
   Farben aus dem Logo: Blau #0033CC, Gelb/Orange-Quadrate
   ========================================================== */

:root {
  --blue: #0033cc;
  --blue-hover: #1f4fe6;
  --blue-soft: #e8eeff;
  --sun: #ffe04d;
  --yellow: #ffc400;
  --orange: #ff9933;
  --ink: #0e1630;
  --muted: #5a6380;
  --bg: #ffffff;
  --bg-alt: #f5f7fc;
  --card: #ffffff;
  --line: #e2e7f3;
  --shadow: 0 1px 2px rgba(14, 22, 48, .06), 0 8px 24px rgba(14, 22, 48, .06);
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #7d9bff;
    --blue-hover: #a3b8ff;
    --blue-soft: #1a2448;
    --ink: #e8ecf8;
    --muted: #9aa4c2;
    --bg: #0b1020;
    --bg-alt: #10172c;
    --card: #141c34;
    --line: #232c48;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #7d9bff;
  --blue-hover: #a3b8ff;
  --blue-soft: #1a2448;
  --ink: #e8ecf8;
  --muted: #9aa4c2;
  --bg: #0b1020;
  --bg-alt: #10172c;
  --card: #141c34;
  --line: #232c48;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

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

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand img { width: 150px; height: auto; }
@media (min-width: 720px) { .brand img { width: 180px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img { background: #fff; border-radius: 8px; padding: 4px 8px; }
}
:root[data-theme="dark"] .brand img { background: #fff; border-radius: 8px; padding: 4px 8px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 10px; border-radius: 8px;
}
.nav a:hover { background: var(--blue-soft); color: var(--blue); }
.nav a.nav-cta { background: var(--blue); color: #fff; padding: 8px 14px; }
.nav a.nav-cta:hover { background: var(--blue-hover); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav a.nav-cta { color: #0b1020; }
}
:root[data-theme="dark"] .nav a.nav-cta { color: #0b1020; }
@media (max-width: 599px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 650; font-size: 1rem;
  padding: 12px 22px; border-radius: 10px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .btn-primary:hover { color: #0b1020; }
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover { color: #0b1020; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 104px;
  background:
    radial-gradient(60rem 30rem at 85% 10%, color-mix(in srgb, var(--sun) 35%, transparent), transparent 60%),
    radial-gradient(40rem 24rem at 10% 100%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 70%),
    var(--bg);
}
@media (min-width: 720px) { .hero { padding: 112px 0 128px; } }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; align-items: center; gap: 48px; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.hero-text { max-width: 760px; }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); }

/* Quadrat-Treppe aus dem Logo, rechtsbündig im Inhaltsraster */
.hero-squares {
  display: none;
  grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 12px;
}
@media (min-width: 900px) { .hero-squares { display: grid; } }
@media (min-width: 1100px) { .hero-squares { grid-template-columns: repeat(3, 80px); grid-template-rows: repeat(3, 80px); gap: 14px; } }
.hero-squares span { border-radius: 12px; }
.hero-squares span:nth-child(1) { grid-area: 1 / 3; background: var(--sun); }
.hero-squares span:nth-child(2) { grid-area: 2 / 2; background: var(--yellow); }
.hero-squares span:nth-child(3) { grid-area: 2 / 3; background: var(--yellow); }
.hero-squares span:nth-child(4) { grid-area: 3 / 1; background: var(--orange); }
.hero-squares span:nth-child(5) { grid-area: 3 / 2; background: var(--orange); }
.hero-squares span:nth-child(6) { grid-area: 3 / 3; background: var(--orange); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
@media (min-width: 720px) { .section { padding: 104px 0; } }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-intro { color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; gap: 24px; }
.grid-projects { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-archive  { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}

.project { display: flex; flex-direction: column; position: relative; border-top: 4px solid var(--yellow); }
.project:nth-child(3n+2) { border-top-color: var(--orange); }
.project:nth-child(3n+3) { border-top-color: var(--blue); }
.project h3 { font-size: 1.3rem; }
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a:hover { color: var(--blue); }
.project p { color: var(--muted); flex: 1; }
.card-link { font-weight: 650; text-decoration: none; margin-top: 8px; }
.card-link span { display: inline-block; transition: transform .15s; }
.card-link:hover span { transform: translateX(4px); }

.tags { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.tags li {
  font-size: .76rem; font-weight: 650; padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  background: var(--blue-soft); color: var(--blue);
}

.archive-item { display: flex; gap: 18px; align-items: flex-start; padding: 18px; }
.archive-item img {
  width: 104px; flex: none; border-radius: 8px; border: 1px solid var(--line);
  filter: saturate(.85);
}
.archive-item h3 { margin-bottom: .3em; }
.archive-item p { color: var(--muted); font-size: .95rem; margin: 0; }

.more { margin-top: 40px; }
.more h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.more ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.more li {
  padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); font-size: .92rem;
}

.about { display: grid; gap: 8px; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 2fr; gap: 48px; } }
.about-text { font-size: 1.1rem; max-width: 40em; }

/* ---------- Kontakt ---------- */

.form { display: grid; gap: 18px; max-width: 760px; }
@media (min-width: 720px) { .form { grid-template-columns: 1fr 1fr; } }
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }
.req { color: var(--orange); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { max-width: 760px; padding: 16px 20px; border-radius: 10px; margin-bottom: 20px; font-weight: 600; }
.notice p { margin: 0; }
.notice-ok { background: color-mix(in srgb, #22a06b 14%, var(--card)); border: 1px solid color-mix(in srgb, #22a06b 40%, transparent); }
.notice-error { background: color-mix(in srgb, #e5484d 12%, var(--card)); border: 1px solid color-mix(in srgb, #e5484d 40%, transparent); }

/* ---------- Unterseiten (Impressum, Datenschutz) ---------- */

.legal { padding: 56px 0 88px; }
.legal .wrap { max-width: 800px; }
.legal h2 { font-size: 1.25rem; margin-top: 2em; }

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

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--blue); }

/* ---------- Entwurfs-Markierung (bis Texte freigegeben sind) ---------- */

.is-draft { position: relative; outline: 2px dashed color-mix(in srgb, var(--orange) 70%, transparent); outline-offset: 4px; }
.is-draft::after {
  content: "Entwurf"; position: absolute; top: -11px; right: 12px;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--orange); color: #fff; padding: 2px 8px; border-radius: 99px;
}

/* ---------- Zeitleiste (Gründungen) ---------- */

.timeline { list-style: none; margin: 0; padding: 0; max-width: 820px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--sun), var(--yellow), var(--orange), var(--blue));
  border-radius: 2px;
}
.timeline-item { position: relative; padding: 0 0 32px 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px;
  border-radius: 5px; background: var(--yellow); box-shadow: 0 0 0 4px var(--bg-alt);
}
.timeline-item:nth-child(n+3)::before { background: var(--orange); }
.timeline-item:nth-child(n+4)::before { background: var(--blue); }
.timeline-year { display: block; font-weight: 800; font-size: .9rem; letter-spacing: .06em; color: var(--blue); margin-bottom: 2px; }
.timeline-body h3 { margin-bottom: .25em; }
.timeline-body p { color: var(--muted); margin: 0; }
@media (min-width: 720px) {
  .timeline::before { left: 127px; }
  .timeline-item { display: grid; grid-template-columns: 100px 1fr; gap: 0 56px; padding-left: 0; }
  .timeline-item::before { left: 120px; }
  .timeline-year { text-align: right; font-size: 1.05rem; padding-top: 1px; }
}
.timeline-item.is-draft { outline-offset: 8px; }

/* ---------- Projekt-Logos ---------- */

.project-logo {
  display: flex; align-items: center; justify-content: center;
  height: 112px; margin: -8px -8px 20px; padding: 20px 24px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.project-logo img { max-height: 64px; max-width: 100%; width: auto; object-fit: contain; }
.timeline-note { max-width: 820px; margin: 72px 0 0; color: var(--muted); font-style: italic; }
@media (min-width: 720px) { .timeline-note { padding-left: 156px; } }
