/* ===========================
   warkall.de — styles.css
   clean · responsive · glass
   =========================== */

/* ===== Variables / Base ===== */
:root{
  --max:1080px;
  --pad:1rem;
  --radius:16px;

  /* Dark as default */

  --fg:#eaeaea;
  --bg:#0b0d12;

  /* Glass cards */
  --card:rgba(17,19,25,0.22);     /* transparency: 0.15–0.35 works well */
  --line:rgba(255,255,255,0.12);

  /*--fg: #f0f3ff;           /* heller Grundtext */
  --card-title: #ffffff;   /* Titel (h2) */
  --card-text: #d7e1ff;    /* Fließtext */
}


/* ===== Reset-ish ===== */
*{ box-sizing:border-box; }
html{ font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Noto Sans",Arial,sans-serif; background:#0b0d12; }
body{
  margin:0;
  color:var(--fg);
  background:transparent;        /* must be transparent so bg shows through */
  position:relative;             /* stacking context for ::before */
}

.wrap{ max-width:var(--max); margin:0 auto; padding:0 var(--pad); }

/* ===== Header / Nav ===== */
.site-header{ position:sticky; top:0; z-index:2; background:transparent; }
/* === Navigation im Glas-Stil === */
.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: .75rem 1rem;
  justify-content: flex-start;
  background: rgba(20, 24, 32, 0.45);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Navigation Links */
.nav a {
  color: #eaf0ff;
  text-decoration: none;
  padding: .45rem .85rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
}

.nav a:hover,
.nav a:focus {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Die "Brand" (warkall.de) leicht stärker betonen */
.nav .brand {
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
  color: #ffffff;
}


/* ===== Hero ===== */
.hero{ padding:2.5rem 0 1rem; }
.lead{ max-width:70ch; opacity:.9; }

/* ===== 2×2 Matrix ===== */
.grid4{
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
  margin:1.5rem 0 2.5rem;
}
@media (min-width:720px){
  .grid4{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

/* ===== Glass Cards ===== */
.card{
  background: rgba(8,10,14,0.12);             /* sehr leichtes, neutrales Grau */
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px) brightness(1.15) contrast(1.05);
  -webkit-backdrop-filter: blur(8px) brightness(1.15) contrast(1.05);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  padding: 2rem 2.5rem; /* mehr Raum */
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--card-title);
}
.card:hover{
  background:rgba(17,19,25,0.30);
  transform:translateY(-1px);
}

.card p {
  margin: 0.5rem 0 1.2rem;
  color: var(--card-text);
}

.card a {
  color: var(--card-text);
}


/* Links / CTAs in cards */

/* ===== Footer ===== */
.site-footer{
  border-top:1px solid var(--line);
  margin:2rem 0 0;
  padding:1rem 0;
  opacity:.85;
}

/* ===== Background image + subtle overlays =====
   - one file for all sizes
   - keep filename exactly as on disk
*/
body::before{
  content:"";
  position:fixed; inset:0; z-index:0;
  background: url("assets/background_without_math.png") center/cover no-repeat;
}

/* If you create a true 4K version, uncomment and point to it
@media (min-width:1600px){
  body::before{
    background:
      radial-gradient(1300px 650px at 20% 20%, rgba(0,0,0,.18), transparent 60%),
      linear-gradient(to bottom, rgba(0,0,0,.18), rgba(0,0,0,.18)),
      url("assets/bg-test@2x.webp") center/cover no-repeat;
  }
}
*/

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  body::before{ position:absolute; }
}

/* Ensure all visible sections sit above the background */
.site-header, main, footer, .wrap { position:relative; z-index:1; }

/* ===== Hero-Text sichtbar machen ===== */
.hero h1 {
  color: #ffffff;              /* klares Weiß */
  text-shadow: 0 1px 4px rgba(0,0,0,0.6); /* leichter Glow für Lesbarkeit */
}

.hero .lead {
  color: #e6ebff;              /* etwas sanfteres Weiß für Fließtext */
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ===== Footer besser sichtbar ===== */
.site-footer {
  color: #c8d0ff;              /* helles, aber nicht grelles Blauweiß */
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  border-top: 1px solid rgba(255,255,255,0.15); /* dezent, sichtbar */
}

/* === Fix: Text in Cards + "Mehr"-Link klar sichtbar === */

/* Grundtext in Cards konsequent hell, ohne versteckte Opacity */
.card h2,
.card p,
.card li,
.card small {
  color: var(--card-text) !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}

/* Alle Links in Cards (auch :visited) heller */
.card a,
.card a:link,
.card a:visited {
  color: var(--card-text) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}


/* Force dark palette auch wenn das System Light meldet */
@media (prefers-color-scheme: light){
  :root{
    --fg:#f0f3ff;
    --bg:#0b0d12;
    --card:rgba(8,10,14,0.12);
    --line:rgba(255,255,255,0.12);
    --card-title:#ffffff;
    --card-text:#d7e1ff;
  }
}

/* Navi sicher sichtbar */
.nav a{
  color: var(--fg) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* === Schimmer-Effekt über der Karte === */
.card {
  position: relative;          /* nötig, damit ::before sich daran orientiert */
  overflow: hidden;            /* verhindert, dass der Effekt über die Ränder geht */
}

.card::before {
  content: "";                 /* erzeugt das virtuelle Layer */
  position: absolute;
  inset: 0;                    /* füllt die ganze Karte aus */
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255,255,255,0.25),
    transparent 70%
  );
  opacity: 0;                  /* unsichtbar im Normalzustand */
  transition: opacity 0.4s ease;
  pointer-events: none;        /* verhindert, dass es Klicks blockiert */
}

.card:hover::before {
  opacity: 1;                  /* beim Hover sanft sichtbar */
}

/* Schicht für Sternschnuppen (unter Content, über dem Hintergrund) */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;             /* Hintergrund = 0, Content = 1 (bei dir), passt */
  overflow: hidden;
}

/* Die Sternschnuppe selbst */
.shooting-star {
  --tx: 480px;            /* Endverschiebung X (per JS überschrieben) */
  --ty: 320px;            /* Endverschiebung Y (per JS überschrieben) */
  --dur: 1.6s;            /* Dauer (per JS überschrieben) */
  position: absolute;
  width: 2px; height: 2px;
  background: transparent;
  box-shadow: 0 0 6px 2px rgba(255,255,255,.95);  /* heller Kern */
  transform: translate3d(0,0,0);
  animation: fly var(--dur) ease-out forwards;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 3px rgba(180,200,255,.8));
}

/* Leuchtende Spur */
.shooting-star::after {
  content: "";
  position: absolute;
  top: 0; left: -140px;
  width: 140px; height: 2px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(180,200,255,.65) 60%,
    rgba(255,255,255,1) 100%);
}

/* Flugbahn/Verblassen */
@keyframes fly {
  from { opacity: 0; transform: translate3d(0,0,0) rotate(45deg); }
  10%  { opacity: 1; }
  to   { opacity: 0; transform: translate3d(var(--tx), var(--ty), 0) rotate(45deg); }
}

/* Accessibility: bei Bewegungsreduktion keine Animation */
@media (prefers-reduced-motion: reduce){
  .shooting-star{ animation: none !important; }
}

/* Meteor-UI: dezent, glasig, immer sichtbar aber nicht störend */
.meteor-ui{
  position: fixed;
  right: 1rem; bottom: 1rem;
  display: flex; gap: .5rem; align-items: center;
  z-index: 3;                   /* über Content, aber klein */
  font-size: .9rem;
  pointer-events: auto;
}
.meteor-ui button, .meteor-ui select{
  color: #eaf0ff;
  background: rgba(20, 24, 32, 0.45);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  border-radius: 12px;
  padding: .5rem .75rem;
}
.meteor-ui button:hover, .meteor-ui select:hover{
  background: rgba(20,24,32,0.6);
  border-color: rgba(255,255,255,.35);
}
.meteor-ui select{
  appearance: none;
}
@media (prefers-reduced-motion: reduce){
  .meteor-ui{ display:none; }  /* keine Animation -> keine Steuerung nötig */
}

/* === "Mehr"-Links im Stil der Meteor-Buttons === */
.ghost {
  display: inline-block;
  padding: .45rem .85rem;
  margin-top: .6rem;
  color: #eaf0ff;
  font-size: .9rem;
  border: none;
  border-radius: 12px;
  background: rgba(20, 24, 32, 0.45);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
  text-decoration: none;
  transition: all 0.25s ease;
}

.ghost:hover,
.ghost:focus {
  background: rgba(20, 24, 32, 0.65);
  box-shadow: 0 0 10px rgba(255,255,255,0.15);
  transform: translateY(-1px);
  outline: none;
}

.ghost:active {
  transform: translateY(0);
  box-shadow: 0 0 6px rgba(255,255,255,0.25);
}

/* ===== Publishing layout ===== */
:root {
  --max: 1120px;
  --reading: 760px;
  --accent: #b9ccff;
  --muted: #bec9e3;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

main {
  flex: 1;
  min-width: 0;
}

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

/* Let grid and flex children shrink instead of widening the page. */
.wrap,
.nav,
.nav-links,
.card-grid,
.project-grid,
.card,
.article-shell,
.prose {
  min-width: 0;
}

a {
  color: #dbe5ff;
  text-underline-offset: .18em;
}

a:hover {
  color: #fff;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 3px solid #b9ccff;
  outline-offset: 3px;
}

.nav {
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a[aria-current="page"] {
  background: rgba(185, 204, 255, .19);
  border-color: rgba(185, 204, 255, .48);
  color: #fff !important;
}

.nav .brand[aria-current="page"] + .nav-links a[aria-current="page"] {
  background: rgba(185, 204, 255, .19);
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  margin: .15em 0 .25em;
}

h2 {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

h3 {
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero {
  padding: clamp(4rem, 13vw, 9rem) 0 clamp(3rem, 8vw, 6rem);
}

.hero .lead {
  max-width: 720px;
  font-size: clamp(1.18rem, 2.5vw, 1.55rem);
}

.section-block {
  margin: 0 0 clamp(3.5rem, 8vw, 6rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0;
}

.text-link {
  white-space: nowrap;
  font-weight: 650;
}

.card-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border-radius: var(--radius);
  transition: background .25s ease, transform .25s ease;
}

.post-card h3,
.post-entry h2,
.project-card h2 {
  margin: .2rem 0 .7rem;
}

.post-card h3 a,
.post-entry h2 a {
  color: #fff !important;
  text-decoration: none;
}

.post-card h3 a:hover,
.post-entry h2 a:hover {
  text-decoration: underline;
}

.meta,
.post-entry-meta,
.article-meta {
  color: var(--muted) !important;
  font-size: .9rem;
}

.project-summary {
  max-width: 820px;
}

.page-main {
  padding-top: clamp(3rem, 9vw, 6rem);
  padding-bottom: 2rem;
}

.page-header {
  max-width: 780px;
  margin-bottom: 2.25rem;
}

.page-header .lead {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-entry {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.post-entry-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
}

.project-card {
  min-height: 100%;
}

.project-status {
  padding-top: .8rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .93rem;
}

.article-shell {
  width: min(100%, var(--reading));
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 3.2rem);
  background: rgba(8, 10, 14, .32);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  backdrop-filter: blur(10px) brightness(1.08);
  -webkit-backdrop-filter: blur(10px) brightness(1.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .24);
}

.article-header {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.article-header h1 {
  font-size: clamp(2.25rem, 7vw, 4.2rem);
}

.standfirst {
  margin-top: 1.5rem;
  color: #e3eaff;
  font-size: 1.16rem;
}

.article-subtitle {
  max-width: 62ch;
  margin: .9rem 0 1.15rem;
  color: #d6e0f7;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

.prose {
  color: #e1e7f5;
}

.prose h2 {
  margin: 2.1em 0 .55em;
  color: #fff;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose cite {
  font-style: italic;
}

.math-block,
mjx-container[display="true"] {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .45rem 0;
  -webkit-overflow-scrolling: touch;
}

.math-block {
  color: #f4f7ff;
}

.task-list {
  display: grid;
  gap: .65rem;
  margin: 1.4rem 0 1.6rem;
  padding-left: 1.5rem;
}

.task-list li {
  padding-left: .35rem;
}

.article-figure {
  margin: 2.25rem 0;
}

.article-figure-grid {
  display: grid;
  gap: 1.25rem;
  margin: 2.25rem 0;
}

.article-figure-grid .article-figure {
  margin: 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 12px;
  background: #080b12;
}

.article-figure figcaption {
  padding-top: .65rem;
  color: var(--muted);
  font-size: .9rem;
}

.notice {
  margin: 2.5rem 0 0;
  padding: 1.1rem 1.25rem;
  background: rgba(120, 146, 205, .1);
  border: 1px solid rgba(185, 204, 255, .22);
  border-left: 3px solid #91aee9;
  border-radius: 0 12px 12px 0;
  color: #dce5fa;
  font-size: .92rem;
}

.notice h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

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

.comic-figure {
  margin: 0;
}

.comic-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 12px;
  background: #080b12;
}

.comic-figure figcaption {
  padding-top: .65rem;
  color: var(--muted);
  font-size: .9rem;
}

.visual-post {
  width: min(100%, 1040px);
}

.site-footer {
  width: calc(100% - 2rem);
  margin: 3rem auto 0;
}

@media (max-width: 719px) {
  .nav {
    align-items: flex-start;
    gap: .55rem;
  }

  .nav-links {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: .25rem;
  }

  .nav-links a {
    flex: 0 1 auto;
    padding: .45rem .65rem;
    text-align: center;
    font-size: .86rem;
  }

  .card-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .card {
    padding: 1.35rem;
  }
}

@media (max-width: 390px) {
  :root {
    --pad: .75rem;
  }

  .nav {
    padding-inline: .75rem;
  }

  .nav-links a {
    padding-inline: .5rem;
    font-size: .82rem;
  }

  .article-shell {
    padding-inline: 1rem;
  }

  .article-header h1 {
    overflow-wrap: anywhere;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
