/* Andruck — Basis-Styles */

:root {
  --papier: #faf7f2;
  --tinte: #1c1a17;
  --druck: #b3392b;      /* Druckfarbe-Rot, Akzent */
  --druck-soft: #e8d9d0;
  --grau: #6b655c;
  --linie: #e4ddd2;
  --feld: #ffffff;                     /* Eingabefelder/Footer */
  --kopf-bg: rgba(250, 247, 242, 0.92); /* Kopfzeile */
  --serif: Georgia, "Times New Roman", "Liberation Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--papier);
  color: var(--tinte);
  line-height: 1.6;
  font-size: 17px;
}

a { color: var(--druck); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 5vw;
  background: var(--kopf-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linie);
}

/* Logo: PNG dient nur als Maske, die Farbe kommt aus --logo-farbe (pro Seitenaufruf zufällig) */
.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: block;
  width: 132px;
  height: 30px;
  background-color: var(--logo-farbe, var(--tinte));
  -webkit-mask: url("img/andruck-logo.png") no-repeat center / contain;
  mask: url("img/andruck-logo.png") no-repeat center / contain;
}
.logo-dot { color: var(--druck); }

.nav a {
  margin-left: 26px;
  color: var(--tinte);
  font-size: 0.95rem;
}
.nav a:hover { color: var(--druck); text-decoration: none; }

/* Hero */
.hero {
  padding: 110px 5vw 90px;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--grau);
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 10vw, 6rem);
  line-height: 1;
  margin-bottom: 26px;
  font-weight: bold;
}
.dot { color: var(--druck); }
.hero-text {
  font-size: 1.15rem;
  max-width: 42ch;
  margin-bottom: 34px;
  color: var(--tinte);
}
.hero-text em { color: var(--grau); font-size: 0.85rem; display: block; margin-bottom: 6px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--druck);
  color: #fff;
  padding: 12px 26px;
  border: none;
  border-radius: 2px;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn:hover { background: #92291e; text-decoration: none; }

/* Sections */
.section {
  padding: 80px 5vw;
  max-width: 1080px;
  margin: 0 auto;
}
.section-title {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 10px;
}
.section-note { color: var(--grau); margin-bottom: 34px; max-width: 60ch; }
.section-tint { max-width: none; background: var(--druck-soft); }
.section-tint .section-title, .section-tint .section-note { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section-tint .section-title { margin-top: 0; }
.section-tint .section-note { margin-bottom: 24px; }
.section-tint .newsletter-form, .section-tint .form-note { max-width: 1080px; margin-left: auto; margin-right: auto; }

/* Portfolio ist der Einstieg: große Überschrift, direkt unter der Kopfzeile */
#arbeit {
  padding-top: 54px;
}
#arbeit .section-title {
  font-size: clamp(2.8rem, 7.5vw, 4.6rem);
  line-height: 1.02;
  margin-bottom: 6px;
}
#arbeit .section-note {
  margin-bottom: 40px;
}

/* Portfolio grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  align-items: start;
}
.card {
  display: flex;
  flex-direction: column;
}
.card figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--tinte);
}
.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--druck);
  border: 1px solid var(--druck);
  border-radius: 999px;
  padding: 1px 10px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Bilder behalten ihr eigenes Format: kein Zuschnitt, keine feste 4/5-Box.
   Neue Bilder (auch über den Editor) richten sich automatisch danach. */
.card-media {
  display: block;
  border-radius: 3px;
  overflow: hidden;
  background: var(--linie);
}
.card img,
.card-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}
.about-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
}
.ph {
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  background: linear-gradient(145deg, var(--druck-soft), var(--linie));
  position: relative;
  overflow: hidden;
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(179, 57, 43, 0.14) 0 18%, transparent 19%),
    radial-gradient(circle at 70% 60%, rgba(28, 26, 23, 0.08) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 80%, rgba(179, 57, 43, 0.10) 0 22%, transparent 23%);
}
.ph-2::after { background:
    radial-gradient(circle at 60% 30%, rgba(179, 57, 43, 0.12) 0 15%, transparent 16%),
    radial-gradient(circle at 35% 65%, rgba(28, 26, 23, 0.08) 0 20%, transparent 21%),
    radial-gradient(circle at 75% 75%, rgba(179, 57, 43, 0.10) 0 10%, transparent 11%); }
.ph-3::after { background:
    radial-gradient(circle at 40% 40%, rgba(179, 57, 43, 0.14) 0 10%, transparent 11%),
    radial-gradient(circle at 60% 55%, rgba(28, 26, 23, 0.08) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 70%, rgba(179, 57, 43, 0.10) 0 14%, transparent 15%); }
.ph-4::after { background:
    linear-gradient(30deg, transparent 40%, rgba(179, 57, 43, 0.10) 41% 45%, transparent 46%),
    linear-gradient(150deg, transparent 55%, rgba(28, 26, 23, 0.08) 56% 60%, transparent 61%); }
.ph-5::after { background:
    radial-gradient(circle at 25% 30%, rgba(28, 26, 23, 0.08) 0 16%, transparent 17%),
    radial-gradient(circle at 75% 45%, rgba(179, 57, 43, 0.12) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 80%, rgba(28, 26, 23, 0.07) 0 12%, transparent 13%); }
.ph-6::after { background:
    repeating-linear-gradient(45deg, rgba(179, 57, 43, 0.06) 0 8px, transparent 8px 16px),
    radial-gradient(circle at 50% 40%, rgba(28, 26, 23, 0.10) 0 20%, transparent 21%); }

/* About */
.about-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}
.portrait {
  aspect-ratio: 3 / 4;
  border-radius: 3px;
}
.about-text p { margin-bottom: 14px; max-width: 60ch; }
.about-text em { color: var(--grau); font-size: 0.85rem; display: block; margin-bottom: 4px; }

/* Newsletter */
.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.newsletter-form input[type="email"] {
  flex: 1 1 280px;
  padding: 12px 16px;
  border: 1px solid var(--linie);
  border-radius: 2px;
  background: var(--feld);
  font-size: 1rem;
  color: var(--tinte);
}
.newsletter-form input:focus { outline: 2px solid var(--druck); border-color: transparent; }
.form-note { font-size: 0.8rem; color: var(--grau); }

/* Kontakt */
.contact-mail {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 12px 0 6px;
}
.contact-mail a { color: var(--druck); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--linie);
  padding: 30px 5vw;
  text-align: center;
  color: var(--grau);
  font-size: 0.85rem;
  background: var(--feld);
}
.site-footer p { margin-bottom: 4px; }
.site-footer a { color: var(--grau); }

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

/* Kriecher: kleine Pixel-Schlange, kriecht ab und zu über die Seite (kriecher.js).
   Zwei Frames pro Richtung im Wechsel; 27 px Sprite × 3 = scharfe Pixel. */
.kriecher {
  position: absolute;      /* gehört zur Seite: scrollt mit, bleibt nicht am Viewport kleben */
  top: 0;
  left: 0;
  width: 54px;
  aspect-ratio: 27 / 16;
  z-index: -1;             /* hinter allen Inhalten: kriecht unter den Bildern durch */
  pointer-events: none;
  transition: opacity .9s ease;
  will-change: transform;
  transform-origin: 50% 50%;
}
.kriecher .kf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;    /* Pixelkunst bleibt scharf */
}
.kriecher .kf-2 { opacity: 0; }                /* Frames werden im Takt der Schritte in JS getauscht */

/* ---------- Teelicht-Modus ---------- */
html { transition: background-color .5s ease; }
body, .site-header, .site-footer, .section-tint, .newsletter-form input[type="email"] {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease;
}

html.kerze-an {
  --papier: #0f0d0b;
  --tinte: #f5ede1;
  --grau: #b6ab9c;
  --linie: #2a2521;
  --druck: #e6835f;
  --druck-soft: #211a16;
  --feld: #17130f;
  --kopf-bg: rgba(15, 13, 11, 0.92);
}
html.kerze-an body { background: var(--papier); }
html.kerze-an .site-header { border-bottom-color: var(--linie); }
html.kerze-an .logo-mark { background-color: #efe2cc; }
html.kerze-an .kriecher { opacity: 0; }   /* Schlangen blenden im Teelicht-Modus aus */
html.kerze-an .btn { color: #14100d; }

/* warmes Licht in der Mitte, außen dunkel auslaufend */
.kerzenschein {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
  background:
    radial-gradient(58vmax 58vmax at 50% 44%,
      rgba(255, 178, 96, 0.34) 0%,
      rgba(255, 143, 60, 0.17) 38%,
      rgba(255, 120, 40, 0) 70%),
    radial-gradient(120vmax 120vmax at 50% 50%,
      rgba(0, 0, 0, 0) 30%,
      rgba(0, 0, 0, 0.66) 100%);
}
html.kerze-an .kerzenschein { opacity: 1; }

/* Teelicht-Knopf in der Kopfzeile */
.kerze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-left: 16px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--grau);
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.kerze svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kerze .flamme { fill: transparent; }
.kerze:hover { color: var(--druck); border-color: var(--linie); }
.kerze:focus-visible { outline: 2px solid var(--druck); outline-offset: 2px; }
html.kerze-an .kerze { color: #ffc27a; border-color: transparent; }
html.kerze-an .kerze .flamme { fill: #ffc27a; }
html.kerze-an .kerze .becher { stroke: #ecdfca; }
html.kerze-an .kerze .wachs { stroke: #ecdfca; }

/* ---------- Bild-Viewer ---------- */
.grid .card img { cursor: zoom-in; }

.licht {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4vh 3vw;
  background: rgba(12, 10, 9, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.licht.offen { opacity: 1; pointer-events: auto; }
.licht-bild {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}
.licht-bild img {
  max-width: 86vw;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}
.licht-bild figcaption {
  color: #efe6da;
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
}
.licht-zu,
.licht-pfeil {
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #efe6da;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.licht-zu {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 24px;
}
.licht-pfeil { flex: 0 0 auto; width: 46px; height: 46px; font-size: 26px; }
.licht-zu:hover,
.licht-pfeil:hover { background: rgba(255, 255, 255, 0.2); }
.licht-zu:focus-visible,
.licht-pfeil:focus-visible { outline: 2px solid #efe6da; outline-offset: 2px; }

/* Responsive */
@media (max-width: 720px) {
  .hero { padding: 70px 6vw 60px; }
  .section { padding: 60px 6vw; }
  #arbeit { padding-top: 34px; }
  .about-wrap { grid-template-columns: 1fr; }
  .nav a { margin-left: 14px; font-size: 0.85rem; }
  .logo-mark { width: 106px; height: 24px; }
  .licht { padding: 3vh 2vw; gap: 6px; }
  .licht-bild img { max-width: 92vw; max-height: 70vh; }
  .licht-pfeil { width: 38px; height: 38px; font-size: 22px; }
  .kerze { width: 32px; height: 32px; margin-left: 8px; }
}