/* ===== Farben: hier kannst du das Aussehen anpassen ===== */
:root {
  --bg: #eef1ec;        /* Hintergrund: helles Salbeigrau */
  --ink: #1d2b29;       /* Text */
  --muted: #5d6c68;     /* Nebentext */
  --line: #c8d2cb;      /* Linien */
  --accent: #3d6b52;    /* Moosgrün für Links und Akzente */
  --field: #ffffff;     /* Suchfeld */
  color-scheme: light;

  --font: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131b1a;
    --ink: #e2e9e4;
    --muted: #93a29d;
    --line: #2c3a37;
    --accent: #8fc3a1;
    --field: #1b2624;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131b1a;
  --ink: #e2e9e4;
  --muted: #93a29d;
  --line: #2c3a37;
  --accent: #8fc3a1;
  --field: #1b2624;
  color-scheme: dark;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== Kopfzeile ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  max-width: 60rem;
  width: 100%;
}

.mainnav { display: flex; gap: 1.5rem; }
.mainnav a { color: var(--muted); text-decoration: none; }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--ink); }
.mainnav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }

.theme-toggle {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* ===== Startseite ===== */
.home { flex: 1; max-width: 60rem; width: 100%; }

.hero { margin: clamp(2rem, 10vh, 6rem) 0 2.5rem; }

/* Das Herzstück: die große Uhr */
.clock {
  margin: 0;
  font-size: clamp(5rem, 22vw, 13rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.greeting {
  margin: 1rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
}
.greeting .date { color: var(--muted); }

/* Suche */
.search {
  display: flex;
  max-width: 36rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 3.5rem;
}
.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0.6rem 0;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent); }
.search button {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0 0 0 1rem;
  cursor: pointer;
}

/* Linkgruppen */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem 3rem;
  margin-bottom: 4rem;
}
.links h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.links ul { list-style: none; margin: 0; padding: 0; }
.links li { padding: 0.3rem 0; }
.links a { color: var(--ink); text-decoration: none; }
.links a:hover { color: var(--accent); text-decoration: underline; }
.links .soon { color: var(--muted); }
.links .soon span { font-size: 0.85rem; opacity: 0.8; margin-left: 0.35rem; }

/* ===== Blog ===== */
.page { flex: 1; max-width: 40rem; width: 100%; padding: clamp(1.5rem, 6vh, 4rem) 0 4rem; }

.page h1 {
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}
.page .intro { color: var(--muted); font-size: 1.15rem; margin: 0 0 3rem; }

.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts a { font-size: 1.3rem; text-decoration: none; color: var(--ink); }
.posts a:hover { color: var(--accent); text-decoration: underline; }
.posts time { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }
.posts p { margin: 0.4rem 0 0; color: var(--muted); }

/* Einzelner Beitrag */
.post time { color: var(--muted); }
.post h1 { margin-top: 0.4rem; }
.post h2 { font-size: 1.35rem; font-weight: 600; margin: 2.5rem 0 0.5rem; }
.post p, .post li { max-width: 68ch; }
.post code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.back { display: inline-block; margin-top: 3rem; }

/* ===== Fußzeile ===== */
.footer {
  max-width: 60rem;
  width: 100%;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer p { margin: 0; }

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