/* Rafal Rogowski — minimal artist website */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --placeholder: #efefef;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --fg: #f2f2f2;
    --muted: #7d7d7d;
    --line: #242424;
    --placeholder: #1a1a1a;
  }
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.55; }
img { max-width: 100%; display: block; }

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

header {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 36px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.site-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

nav a {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

nav a:hover { opacity: 1; color: var(--fg); }
nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }

/* ---------- Layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--gutter) 80px;
}

h1 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

p + p { margin-top: 1.2em; }

/* ---------- Placeholders (swap for real images) ---------- */

.ph {
  background: var(--placeholder);
  width: 100%;
  aspect-ratio: 4 / 5;
}
.ph.wide { aspect-ratio: 16 / 9; }
.ph.square { aspect-ratio: 1 / 1; }

/* ---------- Home ---------- */

.hero { max-width: 900px; margin: 0 auto; }
.hero figure { margin-bottom: 20px; }
.hero img { width: 100%; height: auto; }

figcaption, .caption {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.5;
}
figcaption em, .caption em { font-style: italic; }

.intro {
  max-width: 900px;
  margin: 56px auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Work grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
}

.grid figure a { display: block; }
.grid figcaption { margin-top: 12px; }

.series-title {
  margin: 72px 0 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.series-title:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.about .text { max-width: 560px; }
.about img { width: 100%; height: auto; }

/* ---------- Exhibitions / CV ---------- */

.cv { max-width: 760px; }
.cv section { margin-bottom: 56px; }

.cv ul { list-style: none; }
.cv li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cv li:last-child { border-bottom: 1px solid var(--line); }
.cv .year { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(32px, 6vw, 96px);
}

.contact dl dt {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 24px;
}
.contact dl dt:first-child { margin-top: 0; }
.contact dl dd a { border-bottom: 1px solid var(--line); }

form { display: grid; gap: 20px; }

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input, textarea {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  border-radius: 0;
  outline: none;
}
input:focus, textarea:focus { border-bottom-color: var(--fg); }
textarea { resize: vertical; min-height: 140px; }

button {
  justify-self: start;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  padding: 12px 28px;
  cursor: pointer;
}
button:hover { background: transparent; color: var(--fg); }

.hidden { display: none; }

/* ---------- Gallery images + lightbox ---------- */

.grid { align-items: start; }
.grid figure img { width: 100%; height: auto; background: var(--placeholder); }
.grid figure a { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
}
.lightbox[hidden] { display: none; }

@media (prefers-color-scheme: dark) {
  .lightbox { background: rgba(10, 10, 10, 0.97); }
}

.lightbox figure {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox figcaption { text-align: center; }

.lightbox button {
  position: absolute;
  background: transparent;
  color: var(--fg);
  border: 0;
  padding: 12px 16px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  text-transform: none;
}
.lightbox button:hover { opacity: 0.5; background: transparent; color: var(--fg); }
.lb-close { top: 12px; right: 16px; font-size: 36px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

body.lb-open { overflow: hidden; }

@media (max-width: 560px) {
  .lightbox { padding: 56px 12px 40px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
}

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

footer {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

footer ul { list-style: none; display: flex; gap: 20px; }

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

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about, .contact { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  header { padding-top: 24px; }
  .grid { grid-template-columns: 1fr; gap: 40px; }
  .cv li { grid-template-columns: 56px 1fr; }
  nav ul { gap: 20px; }
}
