/* Nadja Kugler — Graphic Design */

:root {
  --text: #222222;
  --heading: #111111;
  --muted: #a9a9a9;
  --placeholder: rgba(0, 0, 0, 0.03);
  --bg: #ffffff;
  --gutter: 20px;
  --font: "Work Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 24px;
  line-height: 32px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 32px var(--gutter);
  min-height: 144px;
}

.site-nav { display: flex; gap: 16px; font-size: 24px; line-height: 24px; }
.site-nav a { color: var(--muted); transition: color .2s; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

.logo { font-size: 24px; line-height: 32px; color: #282828; white-space: nowrap; }

/* ---------- Main ---------- */

main { padding: 0 var(--gutter); }

/* Project grid (home) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-cover { position: relative; display: block; overflow: hidden; }

.project-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--placeholder);
  transition: transform .6s ease, opacity .3s;
}

.project-cover .cover-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--heading);
  opacity: 0;
  transition: opacity .3s;
}

.project-cover:hover .cover-title,
.project-cover:focus-visible .cover-title { opacity: 1; }
.project-cover:hover img { transform: scale(1.02); }

/* Project page */
.page-header { max-width: 720px; padding-bottom: 32px; }
.page-header h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 400; color: var(--heading); }
.page-header .subtitle { margin: 0; }
.page-header .description { margin: 32px 0 0; }

.project-modules { padding-top: 32px; }
.project-image { margin: 0 0 20px; cursor: zoom-in; }
.project-image img { width: 100%; background: var(--placeholder); }

/* Other projects */
.other-projects { padding: 40px 0; }
.other-projects h2 {
  margin: 0 0 30px;
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
  color: var(--heading);
}
.other-projects .project-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.other-projects .cover-title { font-size: 18px; line-height: 24px; }

/* About */
.about {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.about-text { flex: 3; max-width: 720px; padding-bottom: 40px; }
.about-text h2 { margin: 0; font-size: inherit; font-weight: 400; }
.about-text p { margin: 0 0 32px; }
.about-text a { text-decoration: underline; text-underline-offset: 3px; }
.about-image { flex: 2; }
.about-image img { width: 100%; background: var(--placeholder); }

/* Imprint / text pages */
.text-page { max-width: 80%; }
.text-page h2 { margin: 0; font-size: inherit; font-weight: 400; color: #1c1c1c; }
.text-page p { margin: 0 0 32px; }

/* ---------- Footer ---------- */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, background .2s;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: rgba(0, 0, 0, 0.2); }
.back-to-top svg { width: 20px; height: 20px; fill: currentColor; }

.site-footer { padding: 50px var(--gutter) 100px; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.94);
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 32px;
  color: var(--text);
  cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  body { font-size: 18px; line-height: 26px; }
  .site-header { flex-direction: column-reverse; min-height: 0; padding-bottom: 40px; gap: 12px; }
  .site-nav, .logo { font-size: 20px; line-height: 26px; }
  .logo { white-space: normal; }
  .project-grid { grid-template-columns: 1fr; }
  .other-projects .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about { flex-direction: column; }
  .text-page { max-width: none; }
  .lightbox { padding: 16px; }
}

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