:root {
  --text: #111;
  --muted: #6b6b6b;
  --accent: #e07a65;
  --border: #111;
  --field: #f8f8f8;
  --gutter: 20px;
  --gap: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
}

.site-title {
  font-size: 1.5rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.icon-link { display: inline-flex; padding: 6px; margin-right: -6px; }
.icon-link svg { width: 18px; height: 18px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px var(--gutter) 60px;
  align-items: start;
}

.bio {
  font-size: clamp(1.25rem, 2.4vw, 2.25rem);
  line-height: 1.4;
  max-width: 22em;
  margin: 0;
}

.text-link {
  display: inline-block;
  margin-top: 2.5em;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  color: var(--accent);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.featured { justify-self: center; width: min(100%, 380px); }

/* Gallery: CSS columns as a no-JS fallback; js/main.js upgrades it to a
   left-to-right masonry so the numbered order reads across rows. */
.gallery {
  padding: 0 var(--gutter) 80px;
  columns: 6;
  column-gap: var(--gap);
}

.gallery .tile {
  display: block;
  margin-bottom: var(--gap);
  break-inside: avoid;
  cursor: zoom-in;
}

.gallery.is-masonry { columns: auto; position: relative; }
.gallery.is-masonry .tile { position: absolute; margin: 0; }

.gallery img { width: 100%; background: #f4f4f4; }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 100px var(--gutter) 120px;
}

.contact h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

.form fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.form legend { padding: 0; margin-bottom: 10px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .field { margin-bottom: 20px; }
.form fieldset .field { margin-bottom: 0; }

.form label { display: block; font-size: 0.9rem; margin-bottom: 6px; }
.form label span { color: var(--muted); margin-left: 4px; }

.form input,
.form textarea {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 1rem;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 0;
}
.form textarea { min-height: 100px; resize: vertical; }
.form input:focus,
.form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.button {
  font: inherit;
  font-weight: 500;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
  padding: 16px 21px;
  cursor: pointer;
}
.button:hover { background: var(--accent); color: #fff; }
.button:disabled { opacity: 0.6; cursor: default; }
.button:disabled:hover { background: #fff; color: var(--accent); }

.form-error { color: #b3261e; margin: 0 0 16px; }

.form-thanks {
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.4;
  margin: 0;
  outline: none;
}

[hidden] { display: none !important; }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 40px var(--gutter) 16px;
  font-size: 0.85rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Lightbox */
.lightbox {
  border: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: rgba(255, 255, 255, 0.97);
}
.lightbox::backdrop { background: rgba(255, 255, 255, 0.97); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }

.lightbox img {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
  padding: 12px 16px;
  cursor: pointer;
}
.lightbox button:hover { color: var(--accent); }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 0.85rem; color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Responsive */
@media (max-width: 1200px) { .gallery { columns: 4; } }
@media (max-width: 900px)  { .gallery { columns: 3; } }

@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .site-title { font-size: 1.25rem; }
  .hero, .contact { grid-template-columns: 1fr; }
  .hero { padding-top: 20px; }
  .text-link { margin-top: 1.2em; }
  .contact { padding-top: 40px; padding-bottom: 80px; }
  .gallery { columns: 2; --gap: 4px; }
  .lightbox img { max-width: calc(100vw - 24px); max-height: calc(100vh - 120px); }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
}

@media (max-width: 420px) {
  .form .row { grid-template-columns: 1fr; }
}
