@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@200;300;400&display=swap");

:root {
  --bg: #000;
  --fg: #f2f2f2;
  --dim: #b4b4b4;
  --line: #333;
  --font: "Roboto Slab", Rockwell, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.55;
}

a { color: var(--fg); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 12px 32px; padding: 24px 32px; border-bottom: 1px solid var(--line);
}
.site-header .brand { font-size: 1.25rem; letter-spacing: .02em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-header nav a { color: var(--dim); }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--fg); }

.site-footer {
  padding: 32px; margin-top: 64px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: .9rem; text-align: center;
}

main { padding: 0 32px; max-width: 1400px; margin: 0 auto; }

h1, h2 { font-weight: 300; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 48px 0 16px; }
h2 { font-size: 1.5rem; margin: 48px 0 12px; }
.dim { color: var(--dim); }

/* ---------- front page ---------- */
.home {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; padding: 32px;
}
.home h1 { font-size: clamp(2.6rem, 9vw, 6rem); font-weight: 200; margin: 0 0 8px; }
.home .tagline { font-size: 1.25rem; color: var(--dim); margin: 0 0 56px; }
.home ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.home li a { font-size: clamp(1.6rem, 4vw, 2.2rem); border-bottom: 2px solid transparent; }
.home li a:hover { border-bottom-color: var(--fg); text-decoration: none; }

/* Front page: hazy black-and-white photo behind black text */
body[data-page="home"] { --fg: #000; --dim: #1a1a1a; background: #e6e6e6; font-weight: 400; }
.home-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #e6e6e6;
}
.home-bg::before {
  content: ""; position: absolute; inset: -20px;
  background: url("images/home-bg.jpg") center / cover no-repeat;
  filter: grayscale(1) blur(4px) contrast(.85) brightness(1.1);
}
.home-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.88) 0%, rgba(255,255,255,.7) 45%, rgba(255,255,255,.55) 100%);
}
body[data-page="home"] .home h1 { font-weight: 300; }
body[data-page="home"] .home li a:hover { border-bottom-color: #000; }

/* ---------- slideshow ---------- */
.slideshow { position: relative; margin: 32px 0 0; outline: none; }
.slide-stage {
  position: relative; height: min(72vh, 780px); display: flex;
  align-items: center; justify-content: center; touch-action: pan-y;
}
.slide-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.55); color: var(--fg); border: 1px solid var(--line);
  font: inherit; font-size: 2rem; line-height: 1; width: 52px; height: 72px; cursor: pointer;
}
.slide-btn:hover, .slide-btn:focus-visible { border-color: var(--fg); }
.slide-btn.prev { left: 0; } .slide-btn.next { right: 0; }
.caption { text-align: center; margin-top: 16px; }
.caption .t { font-size: 1.25rem; font-style: italic; }
.caption .m { color: var(--dim); font-size: 1rem; }

/* ---------- gallery ---------- */
.gallery {
  display: grid; gap: 28px; margin-top: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery figure { margin: 0; }
.gallery button {
  display: block; width: 100%; padding: 0; background: none; border: 0;
  cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden;
}
.gallery button:hover { opacity: .85; }
.gallery button:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.gallery img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery figcaption { margin-top: 10px; font-size: 1rem; }
.gallery figcaption .t { font-style: italic; }
.gallery figcaption .m { color: var(--dim); font-size: .9rem; font-style: normal; }

/* ---------- projects ---------- */
.project { padding: 40px 0; border-bottom: 1px solid var(--line); }
.project:last-child { border-bottom: 0; }
.project h2 { margin: 0 0 4px; }
.project p { max-width: 70ch; margin: 12px 0; }
.project .imgs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 20px; }
.project .imgs img { width: 100%; height: auto; display: block; border: 1px solid var(--line); }

/* ---------- cv ---------- */
/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.about-text h1 { margin-top: 48px; }
.about-text p { line-height: 1.75; max-width: 62ch; margin: 0 0 1.2em; }
.about-photo { width: 100%; height: auto; display: block; margin-top: 48px; position: sticky; top: 24px; }
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 8px; }
  .about-photo { position: static; margin-top: 16px; max-width: 480px; }
}

/* ---------- contact form ---------- */
.contact-form { max-width: 640px; margin-top: 24px; display: grid; gap: 20px; position: relative; }
.field span { display: block; color: var(--dim); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-weight: 300; color: var(--fg); background: #000;
  border: 1px solid #777; padding: 10px 12px; border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--fg); outline-offset: 2px; }
.send {
  justify-self: start; font: inherit; font-weight: 400; color: var(--fg); background: #000;
  border: 2px solid var(--fg); padding: 8px 28px; cursor: pointer;
}
.send:hover:not(:disabled) { background: var(--fg); color: #000; }
.send:disabled { opacity: .5; cursor: wait; }
.form-note { margin: 0; min-height: 1.5em; }

.cv-head { display: grid; gap: 2px; margin-bottom: 8px; }
.cv-name { font-size: 1.5rem; }
.cv-section { margin-top: 40px; }
.cv-section h2 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 6px 0; }
.cv-row .when { color: var(--dim); }
.button {
  display: inline-block; border: 2px solid var(--fg); padding: 8px 20px; margin-top: 12px;
}
.button:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

@media (max-width: 600px) {
  .site-header, main { padding-left: 16px; padding-right: 16px; }
  body { font-size: 17px; }
  .slide-btn { width: 40px; height: 56px; }
  .cv-row { grid-template-columns: 70px 1fr; }
}
