@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f6f1e9;
  --paper-deep: #ebe3d6;
  --graphite: #2b2a28;
  --heart: #b3202a;
  --gutter: clamp(16px, 5vw, 64px);
  --page: 1240px;
  --inset: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:has(#lightbox[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 400 1.125rem/1.6 "Source Sans 3", system-ui, sans-serif;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }

h2, h3 { font-family: "Newsreader", Georgia, serif; font-weight: 400; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.35rem, 2vw, 1.75rem); text-wrap: balance; }
h3 { font-size: 1.5rem; }

/* Sprachwahl sitzt nah in der Ecke, unabhaengig von der Seitenbreite */
.top { position: absolute; z-index: 2; top: 0; right: 0; padding: 0.5rem clamp(0.5rem, 1.5vw, 1.25rem) 0 0; }
.lang { display: none; position: relative; }
.js .lang { display: block; }
.lang button {
  align-items: center;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1rem;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.5rem;
  width: 100%;
}
.lang img { box-shadow: 0 0 0 1px rgb(43 42 40 / 0.25); flex: none; }
.lang-toggle::after {
  border-bottom: 1.5px solid;
  border-right: 1.5px solid;
  content: "";
  height: 0.45rem;
  margin: -0.2rem 0.15rem 0 0.15rem;
  rotate: 45deg;
  width: 0.45rem;
}
.lang-toggle[aria-expanded="true"]::after { margin-top: 0.2rem; rotate: 225deg; }
/* Oben reicht die Flagge, fuer Screenreader bleibt der Sprachname lesbar */
.top .lang-toggle span {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.lang-menu {
  background: var(--paper);
  border: 1px solid rgb(43 42 40 / 0.2);
  border-radius: 4px;
  color: var(--graphite);
  list-style: none;
  margin: 0.25rem 0 0;
  min-width: 100%;
  padding: 0.25rem;
  position: absolute;
  right: 0;
  top: 100%;
}
.lang-menu[hidden] { display: none; }
.lang-menu button { padding-right: 1rem; white-space: nowrap; }
.lang-menu button:hover { background: var(--paper-deep); }
.lang-menu button[aria-pressed="true"] { font-weight: 600; }
.tile:focus-visible { outline-offset: 8px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--heart); outline-offset: 3px; }
#lightbox button:focus-visible, .end button:focus-visible, .end a:focus-visible { outline-color: var(--paper); }

/* Die Schalen stehen immer auf gleicher Hoehe ueber dem unteren Rand; das Logo bekommt die Wandflaeche darueber.
   74vw: Unterkante der Schalen im Bild, 29.4vw: Hoehe der linken Schale vom Rand bis zum Fuss */
.hero {
  --hero-h: max(520px, min(58vw, 120svh));
  --hero-logo-top: clamp(1rem, 4vh, 3rem);
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
  background: var(--paper-deep);
}.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% calc(var(--hero-h) - 1.5rem - 74vw); }
.hero-logo { position: absolute; top: var(--hero-logo-top); left: var(--inset); margin: 0; width: clamp(130px, calc((var(--hero-h) - 29.4vw - 1.5rem - var(--hero-logo-top) - 3rem) * 1.18), min(27vw, 440px)); }

/* Unterzeile der Eroeffnung, rechts daneben die Zeichnung der kleinen Haeuser */
.intro { align-items: center; display: flex; gap: clamp(1rem, 4vw, 3rem); justify-content: space-between; padding: clamp(2.5rem, 6vw, 5rem) var(--inset) 0; }
.tagline {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.7rem, 3.3vw, 2.9rem);
  line-height: 1.1;
  margin: 0;
  max-width: none;
  text-wrap: balance;
  display: flex;
  align-items: flex-end;
  gap: 0.3em;
}
/* Zwei kleine Herzen am Draht vor der Unterzeile */
.hearts { flex: none; height: 1.9em; width: auto; }
/* Jeder Satz steht auf einer eigenen Zeile */
.tagline-text > span { display: block; }
/* Zeichnung der kleinen Haeuser mit Herz, nicht groesser als die Vorlage, sonst wird sie unscharf */
.handmade { flex: none; height: auto; width: clamp(110px, 13vw, 170px); }

.group { padding: clamp(4rem, 9vw, 8rem) var(--inset) 0; }

/* Startseite: je Technik eine Kachel, Bild und Text wechseln die Seite. Titel und Unterzeile stehen wie ein Schild unten am Bild */
.tiles { display: grid; gap: clamp(3.5rem, 8vw, 7rem); list-style: none; margin: 0; padding: 0; }
.tile { align-items: end; color: inherit; display: grid; gap: clamp(1.5rem, 4vw, 4rem); grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); text-decoration: none; }
.tiles li:nth-child(even) .tile { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.tiles li:nth-child(even) .tile img { order: 2; }
/* Die Kachelfotos haben ein gemeinsames Format, das beruhigt die Abfolge; Freisteller behalten ihres */
.tile img { aspect-ratio: 4 / 3; background: var(--paper-deep); object-fit: cover; width: 100%; }
.tile img.cutout { aspect-ratio: auto; background: none; filter: drop-shadow(0 0.4rem 0.6rem rgb(43 42 40 / 0.22)); }
.tile h3 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.02; text-wrap: balance; }
.tile p { font-family: "Newsreader", Georgia, serif; font-size: clamp(1.2rem, 1.9vw, 1.5rem); line-height: 1.3; margin: 0.6rem 0 0; max-width: 20rem; }
.tile-more { border-bottom: 1px solid rgb(43 42 40 / 0.4); display: inline-block; font-size: 1rem; margin-top: clamp(1.25rem, 2.5vw, 2rem); }
.tile:hover .tile-more { border-bottom-color: currentColor; }
.tile:hover img { opacity: 0.92; }

/* Unterseiten: Logo fuehrt zurueck, darunter Titel und Erklaerung der Technik */
.page-head { padding: clamp(0.75rem, 2vw, 1.5rem) var(--inset) 0; }
.home { display: inline-block; }
.home img { width: clamp(110px, 13vw, 170px); }
h1 { font-family: "Newsreader", Georgia, serif; font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 400; line-height: 1.05; margin: clamp(1.5rem, 4vw, 3rem) 0 0; text-wrap: balance; }
.page-head p { font-family: "Newsreader", Georgia, serif; font-size: clamp(1.15rem, 1.5vw, 1.3rem); line-height: 1.5; margin: 1rem 0 0; max-width: 38rem; }

/* Galerie in Spalten, jedes Foto behaelt sein Format */
.gallery { column-gap: clamp(1rem, 2.5vw, 2rem); columns: 3 14rem; margin-top: clamp(2rem, 5vw, 4rem); padding: 0 var(--inset); }
.gallery .work { break-inside: avoid; margin-bottom: clamp(1rem, 2.5vw, 2rem); }
/* Wenige Bilder bekommen zwei breite Spalten statt einer leeren dritten */
.gallery:not(:has(.work:nth-child(4))) { columns: 2 18rem; }

.work { background: var(--paper-deep); cursor: zoom-in; display: block; }
.work img { width: 100%; }
/* Freigestellt: kein Rechteck dahinter, ein leichter Schatten haelt das Stueck auf der Seite */
.work.cutout { background: none; }
.work.cutout img { filter: drop-shadow(0 0.4rem 0.6rem rgb(43 42 40 / 0.22)); }
/* Das lange Brett steht ausserhalb der Galerie und laeuft als Teiler von Fensterrand zu Fensterrand */
.work.divider { margin-top: clamp(1.5rem, 4vw, 3rem); }

.more { padding: clamp(4rem, 9vw, 7rem) var(--inset) 0; }
/* Leiste zum Weiterklicken: Startseite und alle Techniken, die aktuelle ist dunkel hervorgehoben */
.more ul { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.more a, .more [aria-current] {
  align-items: center;
  border: 1px solid rgb(43 42 40 / 0.3);
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 1.1rem;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.more a:hover { background: var(--paper-deep); border-color: currentColor; }
.more [aria-current] { background: var(--graphite); border-color: var(--graphite); color: var(--paper); }
.more-home::before { content: "←"; }
/* Die Scheibe steht rechts neben der Leiste; beim Drehen laufen Rillen und Muster der Vase um */
.more-row { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; margin-top: 1.25rem; }
.more-row ul { flex: 1 1 20rem; margin: 0; }
.wheel { flex: none; }
.wheel svg { display: block; height: auto; width: clamp(110px, 12vw, 140px); }
.wheel .turns { transition: stroke-dashoffset 0.7s cubic-bezier(0.2, 0.7, 0.3, 1); }

.end {
  background: var(--graphite);
  color: var(--paper);
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: 3rem var(--inset);
}
.end .lang-menu { bottom: 100%; margin: 0 0 0.25rem; right: auto; left: 50%; top: auto; translate: -50%; }
.end .lang-menu button:focus-visible { outline-color: var(--heart); }
.end p { margin: 0; font-size: 1rem; text-align: center; }
.end a { color: inherit; }

#lightbox {
  background: var(--graphite);
  border: 0;
  color: var(--paper);
  height: 100dvh;
  max-height: none;
  max-width: none;
  padding: 0;
  width: 100vw;
}
#lightbox[open] { display: grid; gap: 0.5rem; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; padding: 1rem 0; }
#lightbox img { align-self: center; max-height: 100%; max-width: 88vw; min-height: 0; object-fit: contain; }
.lb-caption { font-size: 1rem; margin: 0; max-width: 40rem; padding: 0 3.5rem; text-align: center; }
#lightbox button {
  background: rgb(43 42 40 / 0.72);
  border: 0;
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  font-size: 2.5rem;
  line-height: 1;
  min-height: 48px;
  min-width: 48px;
  position: absolute;
}
.lb-close { right: 0.5rem; top: 0.5rem; }
.lb-prev { left: 0.5rem; top: calc(50% - 24px); }
.lb-next { right: 0.5rem; top: calc(50% - 24px); }

@media (max-aspect-ratio: 1/1) {
  .hero { aspect-ratio: 2755 / 3000; height: auto; min-height: 0; }
  .hero-photo { object-position: 50% 50%; }
  .hero-logo { top: 0.75rem; width: min(46vw, 320px); }
}

/* Breit: Titel links, Erklaerung rechts daneben; der Abschluss folgt dem Seitenraster statt mittig zu stehen */
@media (min-width: 900px) {
  .page-head { column-gap: clamp(2rem, 5vw, 5rem); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .home { grid-column: 1 / -1; justify-self: start; }
  .page-head p { margin-top: calc(clamp(1.5rem, 4vw, 3rem) + 0.75rem); }
  .end { align-items: center; grid-template-columns: auto 1fr; justify-items: end; }
  .end > img { grid-row: 1 / 5; justify-self: start; }
  .end .lang-menu { left: auto; right: 0; translate: none; }
  .end p { text-align: right; }
}

@media (max-width: 700px) {
  .tile, .tiles li:nth-child(even) .tile { gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
  .tiles li:nth-child(even) .tile img { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .more a, .wheel .turns { transition: none; }
}
