/* Readability for press quotes */
.quote p { margin: 0 0 1em; }
.quote p:last-of-type { margin-bottom: 0.25em; }
.quote footer { margin-top: .25em; opacity: .8; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

:root {
  --container: 1200px;
  --space: 1rem;
  --space-lg: 2rem;
  --radius: 12px;
  --muted: #666;
  --border: #e6e6e6;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --text: #111111;
  --text-inv: #ffffff;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Dark mode overrides */
.dark {
  --muted: #a9b1bd;
  --border: #2a2f36;
  --bg: #0f1216;
  --bg-alt: #12161b;
  --text: #e5e7eb;
  --text-inv: #0f1216;
  --card: #12161b;
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-lg); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(150%) blur(6px);
}
.header__inner { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--space-lg); padding: 0.75rem 0; }
.brand { grid-column: 1; }
.nav { grid-column: 2; justify-self: start; }
.theme-switch { grid-column: 3; justify-self: end; display: inline-flex; gap: 0.25rem; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.theme-btn { appearance: none; border: 0; background: transparent; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.theme-btn[aria-pressed="true"], .theme-btn.is-active { outline: 2px solid var(--border); }
.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .65rem;
  font-size: .875rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.donate-btn:hover { border-color: #bfc3cf; }
.dark .donate-btn:hover, .rainbow .donate-btn:hover { border-color: #6b6f86; }
.dark .theme-btn[aria-pressed="true"] { background: #1f2937; }
.admin-btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 32px; 
  height: 32px; 
  border: 1px solid var(--border); 
  border-radius: 6px; 
  background: var(--card); 
  color: var(--text); 
  text-decoration: none; 
  font-size: 14px; 
  transition: all 0.2s ease; 
  margin-left: 0.25rem;
}
.admin-btn:hover { 
  background: var(--accent); 
  color: white; 
  border-color: var(--accent); 
  transform: rotate(90deg);
}
.halluzinationland { 
  font-size: 0.7rem; 
  color: var(--muted); 
  letter-spacing: 0.02em; 
  text-align: center; 
  padding: 0.5rem 0; 
  opacity: 0.6;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand__logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #000; color: #fff; font-weight: 700; }
.brand__name { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.nav { display: flex; gap: 1rem; }
.nav a { color: var(--text); text-decoration: none; opacity: 0.85; }
.nav a:hover { opacity: 1; text-decoration: underline; }

/* Mobile nav toggle button (hidden on desktop) */
.nav-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  display: none;
}

/* Theme toggle */
#theme-toggle { margin-left: -0.5rem; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg-alt); }

/* Hero */
.hero { padding: calc(var(--space-lg) * 2) 0; }
.hero__grid { display: grid; gap: var(--space-lg); grid-template-columns: 1.1fr 1fr; align-items: center; }
.hero__text h1 { font-size: clamp(1.8rem, 3.2vw, 3rem); line-height: 1.15; margin-bottom: 1rem; }
.lead { color: var(--muted); font-size: 1.1rem; margin-bottom: 1rem; }
.hero__cta { display: flex; gap: 0.75rem; }
.btn { display: inline-block; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--card); text-decoration: none; }
.btn--primary { background: #111; color: #fff; border-color: #111; }
.dark .btn--primary { background: #e5e7eb; color: #111; border-color: #e5e7eb; }
.hero__media img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.credit { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }

/* Sections */
.section { padding: calc(var(--space-lg) * 2) 0; }
.section--alt { background: var(--bg-alt); }
.section__head { margin-bottom: var(--space-lg); }
.section__head h2 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.section__head p { color: var(--muted); }

/* Projects */
.grid.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-lg); }

/* No reflow enlargement */
.grid.projects .card { transition: box-shadow 200ms ease; }

/* Uniform tile sizes for works (featured and grid) */
.featured__media, .grid.projects .card__media { aspect-ratio: 4 / 3; }
.featured__media img, .grid.projects .card__media img { width: 100%; height: 100%; object-fit: cover; }
.card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); display: grid; }
.card__media { position: relative; overflow: hidden; background: #111; }
.card__media img { width: 100%; height: auto; display: block; transition: none; }
.card__media .overlay { position: absolute; inset: 0; display: grid; place-items: end start; padding: 0.75rem 1rem; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.2), rgba(0,0,0,0)); color: #fff; opacity: 0; transition: opacity 250ms ease; }
.card__media .overlay h3 { margin: 0; font-size: 1.15rem; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.card.image-only .card__body { display: none; }
/* Removed zoom transform - thumbnails are pre-zoomed during generation */
.card.image-only:hover .overlay { opacity: 1; }
.card__body { padding: 1rem; }
.card__body h3 { margin-bottom: 0.25rem; font-size: 1.15rem; }
.card__body p { color: var(--text); opacity: 0.9; margin-bottom: 0.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span { font-size: 0.85rem; padding: 0.25rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); opacity: 0.8; }

/* Featured work */
.featured { margin-bottom: calc(var(--space-lg) * 1.5); }
.featured__link { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.featured__media { position: relative; overflow: hidden; }
.featured__media img { width: 100%; height: auto; display: block; transition: transform 300ms ease; }
.featured__media .overlay { position: absolute; inset: 0; display: grid; place-items: end start; padding: 1rem 1.25rem; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.2), rgba(0,0,0,0)); color: #fff; opacity: 0; transition: opacity 250ms ease; }
.featured__media .overlay h3 { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.6rem); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.featured__media img { transform-origin: var(--zoom-origin, 50% 50%); }
.featured__link:hover .featured__media img { transform: scale(var(--zoom-scale, 1.2)); }
.featured__link:hover .featured__media .overlay { opacity: 1; }
.featured__body { padding: 1rem; }
.featured__body h3 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.featured__body p { color: var(--muted); }

/* Spotlight overlay for hovered card */
.spotlight { position: fixed; inset: 0; background: rgba(0,0,0,0); opacity: 0; display: flex; align-items: center; justify-content: center; z-index: 2000; pointer-events: none; transition: background 200ms ease, opacity 200ms ease; }
.spotlight.is-open { background: rgba(0,0,0,0.6); opacity: 1; }
.spotlight__panel { width: min(92vw, 1400px); max-height: 92vh; aspect-ratio: 4 / 3; position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.spotlight__img { width: 100%; height: 100%; object-fit: cover; transform-origin: var(--zoom-origin, 50% 50%); transform: scale(var(--zoom-scale, 1.2)); transition: transform 120ms ease-out; }
.spotlight__overlay { position: absolute; inset: 0; display: grid; place-items: end start; padding: 1rem 1.25rem; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.2), rgba(0,0,0,0)); color: #fff; }
.spotlight__overlay h3 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 2.2rem); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }

/* Uploads Embed */
.embed { margin-top: 12px; }
.embed__frame {
  width: 100%;
  height: 70vh; /* enough space for the admin UI */
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  background: #fff;
}

/* Installs */
.grid.installs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.install { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--space-lg); align-items: center; border: 1px solid var(--border); padding: var(--space-lg); border-radius: var(--radius); background: #fff; }
.install__media { overflow: hidden; border-radius: 8px; background: #111; }
.install__media img { width: 100%; height: auto; display: block; }
.install__body h3 { margin-bottom: 0.25rem; }
.install .meta { color: var(--muted); font-size: 0.95rem; }

/* About */
.about { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--space-lg); align-items: center; }
.about__text p { margin-bottom: 0.75rem; }
.about__text h2 { margin-bottom: var(--space); }
.bullets { list-style: none; display: grid; gap: 0.3rem; margin-top: 0.5rem; }
.about__portrait img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.about__cta { margin-top: 0.75rem; }

/* Contact */
.contact__box { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: var(--space-lg); }
.contact__form { display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.form__row { display: grid; gap: 0.25rem; }
input, textarea { border: 1px solid var(--border); padding: 0.6rem 0.75rem; border-radius: 8px; font: inherit; background: transparent; color: var(--text); }
input:focus, textarea:focus { outline: none; border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,0.08); }
.dark input:focus, .dark textarea:focus { border-color: #e5e7eb; box-shadow: 0 0 0 3px rgba(229,231,235,0.15); }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--bg); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1rem; }
.footer a { color: var(--text); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.legal { display: flex; gap: 1rem; align-items: center; }
.social { display: flex; gap: 0.75rem; }

/* Modal */
.modal { border: none; border-radius: 12px; padding: 0; width: min(720px, 92vw); background: var(--card); color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,0.6); }
.modal article { padding: 1rem; }
.modal header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
.modal header button { background: #111; color: #fff; border: 1px solid #111; border-radius: 999px; width: 32px; height: 32px; cursor: pointer; }
.modal .smallprint { color: var(--muted); font-size: 0.9rem; }

/* Videos */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.video__ratio { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video__ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.video h3 { margin-top: 0.5rem; }

/* Gallery (project detail) */
.gallery { display: grid; gap: 0.75rem; }
.gallery__viewer { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #000; }
.gallery__viewer img { display: block; width: 100%; height: auto; }
.gallery__controls { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.gallery__btn { pointer-events: all; appearance: none; border: none; background: rgba(0,0,0,0.45); color: #fff; width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; margin: 0 8px; }
.gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery__thumbs img { width: 96px; height: 64px; object-fit: cover; border: 2px solid transparent; border-radius: 6px; cursor: pointer; }
.gallery__thumbs img.is-active { border-color: #111; }

blockquote.quote { border-left: 3px solid var(--border); padding-left: 0.75rem; color: var(--muted); font-style: italic; }

/* Übriges (masonry-style) */
.masonry {
  column-count: 3;
  column-gap: var(--space-lg);
}
.masonry .tile {
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  display: block;
  margin: 0 0 var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.tile img { display: block; width: 100%; height: auto; }
.tile .tile__body { padding: 0.75rem 1rem; }
.tile .tile__title { font-weight: 600; margin-bottom: 0.25rem; }
.tile.size-s img { max-height: 220px; width: 100%; object-fit: cover; }
.tile.size-m img { max-height: 320px; width: 100%; object-fit: cover; }
.tile.size-l img { max-height: 480px; width: 100%; object-fit: cover; }

@media (max-width: 1024px) {
  .masonry { column-count: 2; }
}
@media (max-width: 760px) {
  .masonry { column-count: 1; }
}

/* Rainbow theme */
.rainbow {
  /* Dark-purple "1984"-style palette */
  --bg: #141225;       /* deep purple base */
  --bg-alt: #1b1833;   /* panels */
  --text: #eceaf7;     /* light text */
  --border: #3a3555;   /* lighter purple-gray for outlines */
  --card: #17142c;     /* dark card background */
}
.rainbow .brand__logo { background: linear-gradient(135deg, #ff595e, #ffca3a, #8ac926, #1982c4, #6a4c93); }
.rc { display: inline-block; }
.rc-i { display: inline; }

/* Responsive */
/* Desktop (>=761px): keep nav visible, hide toggle */
@media (min-width: 761px) {
  .nav { display: flex !important; }
  .nav-toggle { display: none !important; }
}

@media (max-width: 1024px) {
  .grid.projects { grid-template-columns: repeat(2, 1fr); }
  .install { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .featured__link { grid-template-columns: 1fr; }
  /* Always show overlay title on touch screens for discoverability */
  .card__media .overlay, .featured__media .overlay { opacity: 1; }
  .hero__grid { grid-template-columns: 1fr; }
  .grid.projects { grid-template-columns: 1fr; }
  .grid.installs { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; z-index: 1001; }
  /* Ensure header stays above content and menu overlays correctly */
  .header { position: sticky; top: 0; z-index: 1000; }
  .header__inner { position: relative; }
  /* Hide site nav by default; open as overlay panel under header */
  #site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.75rem var(--space-lg); flex-direction: column; gap: 0.75rem; z-index: 1000; }
  #site-nav.is-open { display: flex; }
  .video-grid { grid-template-columns: 1fr; }
  /* Featured image should not be too tall on mobile */
  .featured__media img { max-height: 48vh; width: 100%; object-fit: cover; }
}
