/* ============================================================
   Robert Wicklund Photography — design system
   Palette:  #0a0a0a black / #141414 panel / #c8102e red
             #ff2d43 red-bright / #f2f0ed paper / #8a8a8a gray
             #232323 hairline
   Type:     "Cormorant Garamond" display, "Space Grotesk" UI,
             "JetBrains Mono" for EXIF-style meta captions
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Space+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --black: #0a0a0a;
  --panel: #141414;
  --panel-2: #1c1c1c;
  --line: #262222;
  --red: #c8102e;
  --red-bright: #ff2d43;
  --paper: #f2f0ed;
  --gray: #8f8a86;
  --gray-dim: #5c5754;

  --display: 'Cormorant Garamond', serif;
  --ui: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*{ box-sizing: border-box; margin: 0; padding: 0; }

html{ scroll-behavior: smooth; }

body{
  background: var(--black);
  color: var(--paper);
  font-family: var(--ui);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

/* ---------- Faint grain / vignette atmosphere ---------- */
body::before{
  content:"";
  position: fixed; inset:0;
  pointer-events:none;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.65) 100%);
}

/* ============================================================
   Landing page
   ============================================================ */

.landing{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
}

.viewfinder{
  position: relative;
  padding: clamp(48px, 8vw, 96px) clamp(32px, 10vw, 120px);
  text-align: center;
}

/* Corner brackets — the signature motif, echoing a camera's AF frame */
.viewfinder::before,
.viewfinder::after,
.viewfinder .corner-tr,
.viewfinder .corner-br{
  content:"";
  position:absolute;
  width: 28px; height: 28px;
  border: 1.5px solid var(--red);
  opacity: 0.85;
  transition: width .5s cubic-bezier(.2,.9,.2,1), height .5s cubic-bezier(.2,.9,.2,1), opacity .5s ease;
}
.viewfinder::before{ top:0; left:0; border-right:none; border-bottom:none; }
.viewfinder::after{ bottom:0; right:0; border-left:none; border-top:none; }
.viewfinder .corner-tr{ top:0; right:0; border-left:none; border-bottom:none; }
.viewfinder .corner-br{ bottom:0; left:0; border-right:none; border-top:none; }

.viewfinder:hover::before,
.viewfinder:hover::after,
.viewfinder:hover .corner-tr,
.viewfinder:hover .corner-br{
  width: 36px; height: 36px;
  opacity: 1;
}

.brand-eyebrow{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.brand-title{
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.brand-title em{
  font-style: italic;
  color: var(--red-bright);
}

.brand-sub{
  margin-top: 14px;
  font-family: var(--ui);
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gray);
}

.brand-rule{
  width: 64px;
  height: 1px;
  background: var(--red);
  margin: 34px auto;
  opacity: 0.7;
}

/* Primary CTA — the single big gallery button */
.btn-enter{
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ui);
  font-weight: 500;
  font-size: clamp(14px, 1.8vw, 16px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--red);
  padding: 20px 44px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color .35s ease, border-color .35s ease;
}

.btn-enter::before{
  content:"";
  position:absolute;
  inset: 0;
  background: var(--red);
  transform: translateX(-101%);
  transition: transform .38s cubic-bezier(.2,.9,.2,1);
  z-index: -1;
}

.btn-enter:hover,
.btn-enter:focus-visible{
  color: var(--black);
  border-color: var(--red-bright);
}
.btn-enter:hover::before,
.btn-enter:focus-visible::before{ transform: translateX(0); }

.btn-enter svg{ width: 16px; height: 16px; transition: transform .3s ease; }
.btn-enter:hover svg{ transform: translateX(4px); }

.landing-footer{
  position: fixed;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--gray-dim);
  z-index: 1;
}

/* ============================================================
   Gallery page
   ============================================================ */

.site-header{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  background: rgba(10,10,10,0.86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-logo{
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.site-logo span{ color: var(--red); }

.site-nav{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-nav a{ color: var(--gray); transition: color .25s ease; }
.site-nav a:hover{ color: var(--red-bright); }

.gallery-hero{
  padding: clamp(40px, 8vw, 88px) clamp(20px, 5vw, 56px) clamp(24px, 4vw, 40px);
  max-width: 900px;
}

.gallery-hero .brand-eyebrow{ margin-bottom: 14px; }

.gallery-hero h1{
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 12px;
}

.gallery-hero p{
  color: var(--gray);
  font-size: 14px;
  line-height: 1.7;
  max-width: 56ch;
}

.grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
  padding: 0 clamp(20px, 5vw, 56px) clamp(60px, 8vw, 100px);
}

.thumb{
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid transparent;
}

.thumb img{
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.02);
  transition: transform .6s cubic-bezier(.2,.9,.2,1), filter .5s ease;
}

.thumb:hover img{
  transform: scale(1.045);
  filter: grayscale(0) contrast(1.05);
}

.thumb::before,
.thumb::after{
  content:"";
  position:absolute;
  width: 18px; height: 18px;
  border: 1.5px solid var(--red-bright);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 2;
}
.thumb::before{ top: 10px; left: 10px; border-right:none; border-bottom:none; }
.thumb::after{ bottom: 10px; right: 10px; border-left:none; border-top:none; }
.thumb:hover::before, .thumb:hover::after{ opacity: 1; }

.thumb-meta{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--paper);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 2;
}
.thumb:hover .thumb-meta{ opacity: 1; transform: translateY(0); }
.thumb-meta .price{ color: var(--red-bright); }

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

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6,5,5,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.lightbox.is-open{ display: flex; }

.lightbox-inner{
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 0;
  width: min(1100px, 100%);
  max-height: 92vh;
  background: var(--panel);
  border: 1px solid var(--line);
}

.lightbox-image{
  position: relative;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 260px;
}
.lightbox-image img{
  width: 100%; height: 100%;
  object-fit: contain;
  max-height: 92vh;
}

.lightbox-panel{
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.lightbox-panel .brand-eyebrow{ font-size: 10px; margin-bottom: 10px; }

.lightbox-title{
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-bottom: 6px;
}

.lightbox-id{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 22px;
}

.exif-list{
  list-style: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--gray);
  display: grid;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.exif-list li{ display:flex; justify-content: space-between; }
.exif-list span:last-child{ color: var(--paper); }

.price-row{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.price-label{
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
}
.price-value{
  font-family: var(--display);
  font-size: 2rem;
  color: var(--red-bright);
}

.btn-buy{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: var(--red);
  color: var(--black);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background .25s ease, transform .15s ease;
}
.btn-buy:hover{ background: var(--red-bright); }
.btn-buy:active{ transform: scale(0.99); }

.buy-note{
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray-dim);
}

.lightbox-close{
  position: absolute;
  top: 18px; right: 18px;
  z-index: 5;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  cursor: pointer;
  font-size: 18px;
  transition: border-color .25s ease, color .25s ease;
}
.lightbox-close:hover{ border-color: var(--red-bright); color: var(--red-bright); }

.lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items:center; justify-content:center;
  background: rgba(10,10,10,0.6);
  border: 1px solid var(--line);
  color: var(--paper);
  cursor: pointer;
  z-index: 5;
  transition: border-color .25s ease, color .25s ease;
}
.lightbox-nav:hover{ border-color: var(--red-bright); color: var(--red-bright); }
.lightbox-nav.prev{ left: 16px; }
.lightbox-nav.next{ right: 16px; }

/* Toast for the payment placeholder */
.toast{
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--panel-2);
  border: 1px solid var(--red);
  color: var(--paper);
  padding: 14px 22px;
  font-family: var(--ui);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  max-width: min(420px, 86vw);
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.is-visible{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px){
  .lightbox-inner{
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .lightbox-image{ max-height: 46vh; }
  .lightbox-panel{ border-left: none; border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}
