/* =========================================================
   Maren Solberg — Photography
   Design tokens
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --ink: #000000;
  --ink-soft: #5C5C5C;
  --line: #E2E2E0;
  --accent: #2B2B2B;
  --overlay: rgba(10, 10, 10, 0.94);

  --font-display: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 88px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  /* Intentionally kept light: an editorial print-like feel is the design
     choice here, not a system-preference toggle. */
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  z-index: 200;
}
.skip-link:focus {
  left: var(--gutter);
  top: 16px;
}

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

/* =========================================================
   Reveal-on-scroll (single, restrained treatment)
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  padding-top: 11.25px;
  padding-bottom: 9px;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo-image {
  height: 70px;
  width: auto;
  display: block;
}

.main-nav ul {
  display: flex;
  gap: clamp(22px, 3vw, 40px);
}

.main-nav a {
  font-size: 1.33rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 3px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.35s var(--ease);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  right: 0;
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 22px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span { top: 50%; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  max-height: 0;
  overflow: hidden;
  border-bottom: 1px solid transparent;
  transition: max-height 0.4s var(--ease), border-color 0.4s var(--ease);
}
.mobile-nav.open {
  max-height: 220px;
  border-bottom-color: var(--line);
}
.mobile-nav ul {
  padding: 8px var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mobile-nav a {
  font-size: 1.52rem;
  font-weight: 600;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  padding: clamp(48px, 9vw, 108px) var(--gutter) clamp(40px, 6vw, 72px);
  max-width: 1600px;
  margin: 0 auto;
}

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

.hero-headline {
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 8px;
}

.hero-standfirst {
  font-size: 1.37rem;
  font-weight: 500;
  line-height: 1.65;
  color: #000000;
  max-width: 42ch;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}

.hero-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.hero-meta dt {
  font-size: 0.82rem;
  color: #000000;
}

.hero-meta dd {
  margin: 0;
  font-size: 0.92rem;
  text-align: right;
}

.hero-image {
  margin: clamp(40px, 7vw, 76px) 0 0;
}

.hero-image img {
  width: 100%;
  height: clamp(320px, 62vw, 720px);
  object-fit: cover;
}

/* =========================================================
   Work / Portfolio
   ========================================================= */

.work {
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  max-width: 1600px;
  margin: 0 auto;
}

.work-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: clamp(36px, 5vw, 60px);
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.section-title {
  font-size: clamp(1.19rem, 2.1vw, 1.61rem);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.filter {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}

.filter::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transition: right 0.35s var(--ease);
}

.filter:hover {
  color: var(--ink);
}

.filter.active {
  color: var(--ink);
}
.filter.active::after {
  right: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 15vw;
  gap: clamp(14px, 1.6vw, 28px);
}

.grid-item {
  grid-column: span 2;
  grid-row: span 2;
  overflow: hidden;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.grid-item.span-wide { grid-column: span 4; }
.grid-item.span-tall { grid-row: span 3; }

.grid-item.is-hidden {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.grid-item-button {
  all: unset;
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.grid-item-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}

.grid-item-button:hover img,
.grid-item-button:focus-visible img {
  transform: scale(1.035);
}

.caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(to top, rgba(10,10,8,0.55), rgba(10,10,8,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.grid-item-button:hover .caption,
.grid-item-button:focus-visible .caption {
  opacity: 1;
  transform: translateY(0);
}

.caption-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #FAFAF8;
}

.caption-cat {
  font-size: 0.78rem;
  color: #DEDCD3;
}

/* =========================================================
   About / Contact
   ========================================================= */

.about-contact {
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  max-width: 1600px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.about-contact-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(32px, 6vw, 90px);
}

.about p {
  margin-top: 20px;
  max-width: 56ch;
  color: #000000;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.7;
}

.contact-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-list a {
  font-size: 1.3rem;
  font-weight: 700;
  font-style: normal;
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}

.contact-list a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.35s var(--ease);
}

.contact-list a:hover::after,
.contact-list a:focus-visible::after {
  right: 0;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px var(--gutter) 36px;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #000000;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.footer-logo .logo-image {
  height: 65px;
  width: auto;
  display: block;
}

/* =========================================================
   Lightbox
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 60px);
}

.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lightbox-figure img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #F1EFEA;
  font-size: 0.88rem;
}

#lightbox-title {
  font-family: var(--font-display);
  font-size: 1rem;
}

#lightbox-meta {
  color: #B9B7AE;
}

.lightbox-close {
  all: unset;
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  right: clamp(18px, 3vw, 32px);
  color: #F1EFEA;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 4px;
}
.lightbox-close:hover { color: var(--accent); }

.lightbox-nav {
  all: unset;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #F1EFEA;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 12px 18px;
}
.lightbox-nav:hover { color: var(--accent); }
.lightbox-prev { left: clamp(6px, 2vw, 20px); }
.lightbox-next { right: clamp(6px, 2vw, 20px); }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }

  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-side { padding-bottom: 0; }

  .about-contact-inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 26vw;
  }
  .grid-item { grid-column: span 2; grid-row: span 2; }
  .grid-item.span-wide { grid-column: span 4; }
  .grid-item.span-tall { grid-row: span 3; }

  .lightbox-nav { font-size: 1.9rem; padding: 10px; }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 52vw;
    gap: 12px;
  }
  .grid-item,
  .grid-item.span-wide { grid-column: span 2; grid-row: span 2; }
  .grid-item.span-tall { grid-row: span 3; }

  .caption { opacity: 1; transform: none; background: linear-gradient(to top, rgba(10,10,8,0.6), rgba(10,10,8,0)); }

  .work-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters { gap: 8px 18px; }

  /* Mobile-only type scale adjustments (H1 +30%, H2 +30%, body text -30%).
     Desktop and tablet rules above/outside this query are untouched. */
  .hero-headline { font-size: 3.38rem; }
  .section-title { font-size: 1.55rem; }
  .hero-standfirst { font-size: 0.96rem; }
  .about p { font-size: 0.91rem; }
}
