/* =========================================================
   EXPLORER. — A quiet garden photography portfolio
   Layout reference: Explorer photography template
   ========================================================= */

@font-face {
  font-family: "Abel";
  src: url("../fonts/abel.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #4a525d;
  --muted: #8f98a4;
  --nav: #7f8794;
  --blue: #5068a9;
  --blue-dark: #40578f;
  --header-bg: #f2f2f2;
  --footer-bg: #0f1115;
  --line: rgba(16, 24, 40, 0.08);
  --gap: 16px;
  --page-width: 1170px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Abel", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.menu-open,
body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

::selection {
  background: var(--blue);
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 18px;
  z-index: 999;
  padding: 12px 18px;
  background: #11141a;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 18px;
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 20;
  padding: 40px 0 20px;
  background: var(--header-bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.logo {
  display: inline-block;
  color: var(--blue);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.logo:hover,
.logo:focus-visible {
  color: var(--blue-dark);
}

.logo span {
  color: var(--blue);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.desktop-nav a {
  position: relative;
  padding: 9px 0;
  color: var(--nav);
  font-size: 14px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  background: var(--blue);
  content: "";
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.28s var(--ease);
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible,
.desktop-nav a.is-active {
  color: var(--blue);
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after,
.desktop-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- mobile drawer ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.48);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(88vw, 380px);
  height: 100%;
  padding: 28px 30px 36px;
  background: #11141a;
  color: #f5f5f2;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}

.mobile-menu.is-open .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 44px;
}

.mobile-logo {
  color: #f5f5f2;
  font-size: 19px;
}

.mobile-logo:hover,
.mobile-logo:focus-visible {
  color: #fff;
}

.mobile-logo span {
  color: #8fa2d6;
}

.menu-close {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  place-items: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.menu-close:hover,
.menu-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  padding: 15px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #f5f5f2;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0.035em;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.25s ease;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  padding-left: 7px;
  color: #a9bce9;
}

.mobile-note {
  margin: auto 0 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- intro ---------- */

.intro {
  padding-top: 66px;
  padding-bottom: 30px;
  text-align: center;
}

.intro h1 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: clamp(25px, 2.2vw, 29px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.005em;
}

.intro p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

/* ---------- gallery ---------- */

.gallery {
  padding-bottom: 86px;
  scroll-margin-top: 18px;
}

.gallery-row {
  display: grid;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.gallery-row:last-child {
  margin-bottom: 0;
}

.row-one {
  grid-template-columns: 1fr 2fr;
}

.row-two {
  grid-template-columns: 5fr 3fr 4fr;
}

.row-three {
  grid-template-columns: 2fr 1fr;
}

.tile {
  position: relative;
  display: block;
  height: 500px;
  overflow: hidden;
  background: #e7e9e3;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.9s var(--ease);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.045);
}

.tile-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(8, 10, 13, 0.72) 0%,
    rgba(8, 10, 13, 0.28) 36%,
    rgba(8, 10, 13, 0.02) 62%,
    rgba(8, 10, 13, 0) 100%
  );
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.tile:hover .tile-shade {
  opacity: 0.92;
}

.tile-caption {
  position: absolute;
  right: 22px;
  bottom: 20px;
  left: 22px;
  z-index: 2;
  display: block;
  transition: transform 0.4s var(--ease);
}

.tile:hover .tile-caption,
.tile:focus-visible .tile-caption {
  transform: translateX(7px);
}

.tile-title {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.16);
}

.tile-meta {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

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

/* Reveal (only when JavaScript is available) */
.js .tile {
  opacity: 0;
  transform: translateY(24px);
}

.js .tile.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.85s ease var(--delay, 0ms),
    transform 0.85s var(--ease) var(--delay, 0ms);
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: #8b93a0;
  padding-top: 62px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  scroll-margin-top: 24px;
}

.footer-about {
  max-width: 570px;
}

.footer-kicker {
  margin: 0 0 15px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
}

.footer-copy {
  margin: 0;
  color: #a8aeb8;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.footer-copy span {
  display: block;
}

.footer-contact {
  flex-shrink: 0;
  text-align: right;
  scroll-margin-top: 24px;
}

.footer-mail {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0ed;
  font-size: 18px;
  letter-spacing: 0.02em;
  line-height: 1.6;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.footer-mail:hover,
.footer-mail:focus-visible {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.socials {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.socials li {
  margin: 0;
  padding: 0;
}

.socials a {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: #99a1ac;
  text-decoration: none;
  place-items: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.socials a:hover,
.socials a:focus-visible {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.socials svg {
  display: block;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 0 26px;
}

.copyright {
  margin: 0;
  color: #6e7680;
  font-size: 12px;
  letter-spacing: 0.035em;
  line-height: 1.6;
}

.copyright span {
  color: #5f6771;
}

.icp {
  color: #abb2bc;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.icp:hover,
.icp:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 78px;
  background: rgba(8, 10, 13, 0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  max-width: min(1080px, 88vw);
  max-height: 88vh;
  margin: 0;
}

.lb-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 76vh;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  object-fit: contain;
}

.lb-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.lb-title {
  color: #fff;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.lb-meta {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  place-items: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lb-close:hover,
.lb-close:focus-visible,
.lb-prev:hover,
.lb-prev:focus-visible,
.lb-next:hover,
.lb-next:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lb-close:focus-visible,
.lb-prev:focus-visible,
.lb-next:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.lb-close {
  top: 24px;
  right: 28px;
}

.lb-prev {
  top: 50%;
  left: 22px;
  transform: translateY(-50%);
}

.lb-next {
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
}

.lb-count {
  position: absolute;
  bottom: 26px;
  left: 50%;
  margin: 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  letter-spacing: 0.2em;
  transform: translateX(-50%);
}

.lb-current {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- back to top ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #11141a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(9px);
  place-items: center;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--blue);
}

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  .tile {
    height: 430px;
  }
}

@media (max-width: 980px) {
  .desktop-nav {
    gap: 22px;
  }

  .tile {
    height: 390px;
  }

  .tile-title {
    font-size: 20px;
  }
}

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

  .tile {
    height: 400px;
  }

  .footer-top {
    gap: 38px;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 26px 0 20px;
  }

  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .logo {
    font-size: 19px;
  }

  .intro {
    padding-top: 54px;
    padding-bottom: 26px;
  }

  .intro h1 {
    font-size: 25px;
  }

  .intro p {
    font-size: 14px;
    line-height: 1.75;
  }

  .gallery {
    padding-bottom: 62px;
  }

  .footer-top {
    flex-direction: column;
    padding-bottom: 36px;
  }

  .footer-contact {
    text-align: left;
  }

  .socials {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 0 24px;
  }
}

@media (max-width: 600px) {
  .lightbox {
    padding: 64px 18px 76px;
  }

  .lb-figure {
    max-width: 100%;
  }

  .lb-figure img {
    max-height: 68vh;
  }

  .lb-close {
    top: 14px;
    right: 14px;
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 18px;
    width: 42px;
    height: 42px;
    transform: none;
  }

  .lb-prev {
    left: 24px;
  }

  .lb-next {
    right: 24px;
  }

  .lb-count {
    bottom: 31px;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .tile {
    height: 310px;
  }

  .tile-caption {
    right: 18px;
    bottom: 17px;
    left: 18px;
  }

  .tile-title {
    font-size: 19px;
  }

  .tile-meta {
    font-size: 9.5px;
  }

  .site-footer {
    padding-top: 48px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .tile {
    opacity: 1;
    transform: none;
  }
}
