/* Fonts are loaded with <link> tags in each page's <head> — loading them here
   with @import would block the page from rendering until they arrive. */

:root {
  --bg: #f3f1ec;
  --ink: #1c1a17;
  --muted: #6e675c;
  --line: #d4cfc5;
  --paper: #faf9f6;
  --max: 1180px;
  --nav-h: 4.25rem;
  --serif: "Newsreader", "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}

/* ——— Nav ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.05rem;
  padding-bottom: 0.95rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.35rem;
  font-size: 0.92rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ——— Page ——— */

main {
  padding: 2.25rem 0 5rem;
}

.page-intro {
  max-width: 38rem;
  margin-bottom: 2.75rem;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.page-intro h1,
.about-lead {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 3.15rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 1.25rem;
}

.prose p {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ——— Year filter ——— */

.year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0 0 2rem;
  font-size: 0.88rem;
}

.year-filter button {
  color: var(--muted);
}

.year-filter button:hover,
.year-filter button[aria-pressed="true"] {
  color: var(--ink);
}

.year-filter button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

/* ——— Works grid ——— */

.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.4rem 2.25rem;
  align-items: start;
}

.work {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.work:hover {
  text-decoration: none;
}

.work-image {
  background: var(--paper);
  cursor: zoom-in;
}

.work-image img {
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.work-meta {
  padding-top: 0.7rem;
}

.work-title {
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.work:hover .work-title,
.work:focus-visible .work-title {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.work-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ——— Selected works ——— */

.selected {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.selected-head h2 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}

.works-btn {
  display: inline-block;
  margin-top: 1.75rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.85rem 1.45rem;
  white-space: nowrap;
}

.works-btn:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.selected-head .works-btn {
  margin-top: 0;
}

.selected-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem 1.5rem;
}

.selected-grid .work {
  margin-bottom: 0;
}

/* ——— Contact ——— */

.contact-layout {
  display: grid;
  gap: 3rem;
}

.contact-layout .page-intro {
  margin-bottom: 0;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem 0.55rem 0.65rem;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1;
  background: transparent;
}

.social-btn:hover {
  text-decoration: none;
  border-color: var(--ink);
  background: var(--paper);
}

.social-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.social-btn-icon {
  padding: 0.45rem;
}

.social-btn-icon span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.contact-form {
  display: grid;
  gap: 1.1rem;
  position: relative;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 0.95rem;
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
  min-height: 10rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.contact-form button[type="submit"] {
  justify-self: start;
  background: var(--ink);
  color: var(--bg);
  padding: 0.95rem 1.4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.contact-form button[type="submit"]:hover {
  background: #2c2823;
}

.contact-form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

.form-status {
  margin: 0;
  font-size: 0.92rem;
  min-height: 1.3em;
}

.form-status.is-success {
  color: #2f5d34;
}

.form-status.is-error {
  color: #8a2d2d;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ——— Footer ——— */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ——— Lightbox ——— */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(18, 16, 14, 0.94);
  color: #f4f1ea;
  overflow: auto;
  cursor: zoom-out;
}

.lightbox.is-open {
  display: block;
}

.lightbox-bar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  z-index: 2;
}

.lightbox-count {
  font-size: 0.82rem;
  color: #b7b1a6;
}

.lightbox-close {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.7rem;
  line-height: 1;
  color: #f4f1ea;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
  min-height: calc(100vh - 12rem);
  padding: 0 0.4rem 1rem;
}

.lightbox-nav {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.8rem;
  line-height: 1;
  color: #cfc8bb;
}

.lightbox-nav:hover {
  color: #fff;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  justify-content: center;
}

.lightbox-figure img {
  max-height: min(78vh, 900px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  cursor: default;
}

.lightbox-info,
.lightbox-nav,
.lightbox-close,
.lightbox-details,
.lightbox-count {
  cursor: default;
}

.lightbox-info {
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto 2.5rem;
}

.lightbox-info h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.lightbox-year {
  color: #cfc8bb;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.lightbox-facts {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.lightbox-facts div span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a59e92;
  margin-bottom: 0.2rem;
}

.lightbox-facts p {
  margin: 0;
  color: #ece7dc;
  font-size: 0.95rem;
}

.lightbox-details {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.lightbox-details button {
  width: 4.5rem;
  border: 1px solid transparent;
}

.lightbox-details button[aria-pressed="true"] {
  border-color: #f4f1ea;
}

.lightbox-details img {
  width: 100%;
  height: 4.5rem;
  object-fit: cover;
}

body.lightbox-open {
  overflow: hidden;
}

/* ——— Responsive ——— */

@media (min-width: 860px) {
  .contact-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 4.5rem;
    align-items: start;
  }

  .contact-layout .page-intro {
    max-width: none;
  }
}

@media (min-width: 760px) {
  .works {
    grid-template-columns: 1fr 1fr;
  }

  .selected-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lightbox-info {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem 2.5rem;
    align-items: start;
    width: min(900px, calc(100% - 4rem));
  }

  .lightbox-info h2 {
    grid-column: 1;
  }

  .lightbox-year {
    grid-column: 1;
  }

  .lightbox-facts {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .lightbox-details {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(var(--max), calc(100% - 1.5rem));
  }

  .site-header-inner {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  /* Keep the arrows on phones — swipe works too, but they're the only visible
     hint that there's more than one work. */
  .lightbox-stage {
    gap: 0.1rem;
    padding: 0 0.25rem 1rem;
  }

  .lightbox-nav {
    width: 2.5rem;
    height: 3.5rem;
    font-size: 1.6rem;
  }
}

/* ——— Landing ——— */

body.landing {
  overflow: hidden;
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #161412;
  background-image: linear-gradient(rgba(18, 16, 14, 0.35), rgba(18, 16, 14, 0.58)), url("../img/bug-trap-love-2024.webp");
  background-size: cover;
  background-position: center;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #f3f1ec;
  padding: 2rem 1.5rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0 0 0.85rem;
}

.hero-role {
  margin: 0 0 2.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: #f3f1ec;
}

.enter-btn {
  display: inline-block;
  border: 1px solid #f3f1ec;
  color: #f3f1ec;
  text-decoration: none;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 1.05rem 3.4rem;
}

.enter-btn:hover {
  background: #f3f1ec;
  color: #161412;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
