/* ============================================================
   SunnyZ — sunnyz.css
   ============================================================ */

/* ── Font ── */
@font-face {
  font-family: 'TribalTwo';
  src: url('../Font/TRIBTWO.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ── */
:root {
  --bg:        #0d2412;
  --bg2:       #112b16;
  --surface:   #163020;
  --border:    rgba(140, 185, 130, 0.18);
  --green:     #7aab6a;
  --green-lt:  #a8c99c;
  --blue:      #6a9eab;
  --blue-lt:   #9cc4cc;
  --cream:     #e8e2d2;
  --cream-dim: rgba(232, 226, 210, 0.5);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Noise texture overlay (gallery pages) ── */
body.page-terrariums,
body.page-waterfeatures {
  background-size: cover;
}

body.page-terrariums {
  background-image: radial-gradient(ellipse at 60% 20%, rgba(50,120,45,0.25) 0%, transparent 60%),
                    radial-gradient(ellipse at 20% 80%, rgba(30,100,55,0.2) 0%, transparent 55%);
}

body.page-waterfeatures {
  background-color: #0c1520;
  background-image: radial-gradient(ellipse at 60% 20%, rgba(20,75,140,0.3) 0%, transparent 60%),
                    radial-gradient(ellipse at 20% 80%, rgba(15,65,120,0.25) 0%, transparent 55%);
}

body.page-terrariums::before,
body.page-waterfeatures::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ── Ambient glow circles (gallery pages) ── */
.bg-circle {
  position: fixed; border-radius: 50%;
  filter: blur(90px); pointer-events: none; z-index: 0;
}

body.page-terrariums .bg-circle-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(60,130,55,0.45), transparent 70%);
  top: -250px; right: -200px;
}
body.page-terrariums .bg-circle-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(30,100,50,0.35), transparent 70%);
  bottom: 0px; left: -150px;
}
body.page-waterfeatures .bg-circle-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(20,85,160,0.5), transparent 70%);
  top: -250px; right: -200px;
}
body.page-waterfeatures .bg-circle-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(15,70,140,0.4), transparent 70%);
  bottom: 0px; left: -150px;
}
body.page-terrariums .bg-circle-3 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(45,115,45,0.28), transparent 70%);
  top: 30%; left: 25%;
}
body.page-waterfeatures .bg-circle-3 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(18,80,150,0.35), transparent 70%);
  top: 30%; left: 25%;
}


/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: 'TribalTwo', serif;
  letter-spacing: 0.2em;
  color: var(--cream-dim);
}

body.page-home footer {
  padding: 2.5rem;
  font-size: 0.7rem;
  margin-top: 5rem;
  background: rgba(8, 16, 10, 0.5);
}

body.page-terrariums footer,
body.page-waterfeatures footer {
  padding: 2rem;
  font-size: 0.68rem;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ============================================================
   HOME PAGE
   ============================================================ */

body.page-home {
  background-image:
    linear-gradient(rgba(8, 18, 10, 0.55), rgba(8, 18, 10, 0.55)),
    url('../images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* Hero */
.hero {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 4rem 2rem 2rem;
}

.hero-eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 200; font-size: 0.7rem;
  letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--green); margin-bottom: 1.6rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.2s ease forwards;
}

.hero-title {
  font-family: 'TribalTwo', serif;
  font-size: clamp(5rem, 18vw, 12rem);
  line-height: 1; letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
  opacity: 0;
  animation: fadeUp 1s 0.4s ease forwards;
}

.hero-divider {
  width: 1px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  margin: 3rem auto;
  opacity: 0;
  animation: fadeIn 1s 0.9s ease forwards;
}

.hero-tagline {
  font-family: 'Jost', sans-serif;
  font-weight: 200; font-size: 0.8rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--cream-dim);
  opacity: 0;
  animation: fadeUp 0.9s 1s ease forwards;
}

/* Nav cards */
.nav-cards {
  display: flex; gap: 1.5rem;
  justify-content: center; flex-wrap: wrap;
  margin-top: 4rem; padding: 0 2rem;
  opacity: 0;
  animation: fadeUp 1s 1.1s ease forwards;
}

.nav-card {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 260px; height: 160px;
  border: 1px solid var(--border);
  background: rgba(12, 26, 16, 0.65);
  backdrop-filter: blur(10px);
  text-decoration: none; overflow: hidden;
  transition: border-color 0.4s, transform 0.4s, background 0.4s;
}

.nav-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(122,171,106,0.2), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}

.nav-card:hover {
  border-color: rgba(140,185,130,0.6);
  background: rgba(12, 26, 16, 0.8);
  transform: translateY(-4px);
}

.nav-card:hover::before { opacity: 1; }

.nav-card-icon {
  font-size: 2rem; margin-bottom: 0.8rem;
  transition: transform 0.4s;
}

.nav-card:hover .nav-card-icon { transform: scale(1.15); }

.nav-card-label {
  font-family: 'TribalTwo', serif;
  font-size: 1.1rem; color: var(--cream);
  letter-spacing: 0.06em;
  text-transform: none;
}



/* ── Accent colours ── */
.accent-green { color: var(--green-lt); }
.accent-blue  { color: var(--blue-lt); }
.accent-sz    { color: var(--green); }

/* ============================================================
   GALLERY PAGES (shared)
   ============================================================ */

/* Header */
header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 2.5rem;
  background: rgba(12, 26, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.site-logo {
  font-family: 'TribalTwo', serif;
  font-size: 1.5rem; letter-spacing: 0.03em;
  color: var(--cream); text-decoration: none;
  transition: color 0.3s;
}
.site-logo:hover { color: var(--green-lt); }

nav { display: flex; gap: 2.5rem; align-items: center; }

nav a {
  font-family: 'Jost', sans-serif;
  font-weight: 300; font-size: 0.72rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cream-dim); text-decoration: none;
  transition: color 0.3s; position: relative;
}

nav a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}

nav a:hover { color: var(--cream); }
nav a:hover::after { transform: scaleX(1); }

/* Terrariums — green active accent */
body.page-terrariums nav a::after          { background: var(--green); }
body.page-terrariums nav a.active          { color: var(--green-lt); }
body.page-terrariums nav a.active::after   { transform: scaleX(1); }

/* Water Features — blue active accent */
body.page-waterfeatures nav a::after        { background: var(--blue); }
body.page-waterfeatures nav a:hover::after  { background: var(--blue); }
body.page-waterfeatures nav a.active        { color: var(--blue-lt); }
body.page-waterfeatures nav a.active::after { transform: scaleX(1); background: var(--blue-lt); }

/* Page header */
.page-header {
  position: relative; z-index: 1;
  text-align: center; padding: 5rem 2rem 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.1s ease forwards;
}

.page-header-eyebrow {
  font-size: 0.68rem; letter-spacing: 0.35em;
  text-transform: uppercase; font-weight: 200; margin-bottom: 1rem;
}

body.page-terrariums    .page-header-eyebrow { color: var(--green); }
body.page-waterfeatures .page-header-eyebrow { color: var(--blue); }

.page-header h1 {
  font-family: 'TribalTwo', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1; letter-spacing: 0.02em;
  color: var(--cream);
}

.page-header-count {
  font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cream-dim);
  margin-top: 1.2rem;
}

/* Gallery section */
.gallery-section {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 1rem 2rem 6rem;
}

.gallery-item {
  position: relative; aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-item-overlay {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.4s;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 1.2rem;
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-item-num {
  font-family: 'TribalTwo', serif;
  font-size: 1.8rem; color: var(--cream); line-height: 1;
}

.gallery-item-zoom {
  width: 36px; height: 36px;
  border: 1px solid rgba(232,226,210,0.4); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream); font-size: 1rem;
}

/* Terrariums grid — auto-fill */
body.page-terrariums .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

body.page-terrariums .gallery-item-overlay {
  background: linear-gradient(to top, rgba(8,20,10,0.7) 0%, transparent 50%);
}

body.page-terrariums .gallery-item:nth-child(1)  { animation-delay: 0.15s; }
body.page-terrariums .gallery-item:nth-child(2)  { animation-delay: 0.20s; }
body.page-terrariums .gallery-item:nth-child(3)  { animation-delay: 0.25s; }
body.page-terrariums .gallery-item:nth-child(4)  { animation-delay: 0.30s; }
body.page-terrariums .gallery-item:nth-child(5)  { animation-delay: 0.35s; }
body.page-terrariums .gallery-item:nth-child(6)  { animation-delay: 0.40s; }
body.page-terrariums .gallery-item:nth-child(7)  { animation-delay: 0.45s; }
body.page-terrariums .gallery-item:nth-child(8)  { animation-delay: 0.50s; }
body.page-terrariums .gallery-item:nth-child(9)  { animation-delay: 0.55s; }
body.page-terrariums .gallery-item:nth-child(10) { animation-delay: 0.60s; }
body.page-terrariums .gallery-item:nth-child(11) { animation-delay: 0.65s; }
body.page-terrariums .gallery-item:nth-child(12) { animation-delay: 0.70s; }

/* Water Features grid — 3-col, last 2 centred */
body.page-waterfeatures .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

body.page-waterfeatures .gallery-item-overlay {
  background: linear-gradient(to top, rgba(8,20,28,0.75) 0%, transparent 55%);
}

body.page-waterfeatures .gallery-item:nth-child(4) { grid-column: 1 / 2; margin-left: auto; }
body.page-waterfeatures .gallery-item:nth-child(5) { grid-column: 2 / 3; }

body.page-waterfeatures .gallery-item:nth-child(1) { animation-delay: 0.15s; }
body.page-waterfeatures .gallery-item:nth-child(2) { animation-delay: 0.22s; }
body.page-waterfeatures .gallery-item:nth-child(3) { animation-delay: 0.29s; }
body.page-waterfeatures .gallery-item:nth-child(4) { animation-delay: 0.36s; }
body.page-waterfeatures .gallery-item:nth-child(5) { animation-delay: 0.43s; }

/* ── Thumbnail loading spinner ── */
.thumb-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

.thumb-spinner::after {
  content: '';
  width: 28px; height: 28px;
  border: 2px solid rgba(232,226,210,0.15);
  border-top-color: var(--green-lt);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.page-waterfeatures .thumb-spinner::after {
  border-top-color: var(--blue-lt);
}

/* ── Lightbox loading spinner — fixed so parent transform can't hide it ── */
.lb-spinner {
  position: fixed;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border: 3px solid rgba(232,226,210,0.12);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  visibility: visible;   /* override inherited visibility:hidden from .lightbox */
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1002;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(8px);
}

/* Terrariums — vivid forest green */
body.page-terrariums .lightbox {
  background: rgba(15, 55, 22, 0.92);
}

/* Water Features — vivid deep blue */
body.page-waterfeatures .lightbox {
  background: rgba(10, 38, 85, 0.92);
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-inner {
  position: relative; max-width: 90vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.94) translateX(0);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.lightbox.open .lightbox-inner { transform: scale(1) translateX(0); }

.lightbox-img {
  max-width: 100%; max-height: 88vh;
  object-fit: contain; display: block;
  border: 1px solid var(--border);
}

.lightbox-close {
  position: fixed; top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--cream);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, border-color 0.3s; z-index: 1001;
}

.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--cream);
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, border-color 0.3s; z-index: 1001;
}

body.page-terrariums .lightbox-close:hover,
body.page-terrariums .lightbox-nav:hover {
  background: rgba(122,171,106,0.2); border-color: var(--green);
}

body.page-waterfeatures .lightbox-close:hover,
body.page-waterfeatures .lightbox-nav:hover {
  background: rgba(106,158,171,0.2); border-color: var(--blue);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-counter {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--cream-dim); z-index: 1001;
}

/* ══════════════════════════════════════════
   MOBILE — prevent any horizontal overflow
   ══════════════════════════════════════════ */
html, body { max-width: 100%; overflow-x: hidden; }

/* ══════════════════════════════════════════
   TABLET / LARGE PHONE  ≤ 768px
   ══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Gallery section padding */
  .gallery-section { padding: 0.8rem 0.8rem 4rem; }

  /* Force 2-col on both gallery pages */
  body.page-terrariums .gallery-grid,
  body.page-waterfeatures .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  /* Remove water features nth-child centering on mobile */
  body.page-waterfeatures .gallery-item:nth-child(4),
  body.page-waterfeatures .gallery-item:nth-child(5) {
    grid-column: auto;
    margin-left: 0;
  }

  /* Lightbox nav arrows hidden on touch */
  .lightbox-nav { display: none; }
}

/* ══════════════════════════════════════════
   PHONE  ≤ 500px
   ══════════════════════════════════════════ */
@media (max-width: 500px) {

  /* ── Header: logo centered, nav links spread edge to edge ── */
  header {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
  }

  .site-logo { font-size: 1rem; letter-spacing: 0.02em; text-align: center; }

  nav { gap: 0; width: 100%; justify-content: space-between; }

  nav a {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  /* ── Gallery page header ── */
  .page-header { padding: 2rem 1rem 1.2rem; }

  .page-header-eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
  }

  /* Terrariums heading — shorter word, can be a little bigger */
  body.page-terrariums .page-header h1 {
    font-size: clamp(1.6rem, 8vw, 3.5rem);
  }

  /* Water Features heading — longer, needs to be smaller */
  body.page-waterfeatures .page-header h1 {
    font-size: clamp(1.1rem, 5.5vw, 2.5rem);
  }

  .page-header-count { font-size: 0.55rem; letter-spacing: 0.12em; }

  /* ── Gallery grid ── */
  .gallery-section { padding: 0.5rem 0.5rem 3rem; }

  body.page-terrariums .gallery-grid,
  body.page-waterfeatures .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  /* Thumbnails — square, fill column */
  .gallery-item { aspect-ratio: 1 / 1; }

  /* Overlay number a little smaller */
  .gallery-item-num { font-size: 1.3rem; }
  .gallery-item-zoom { width: 28px; height: 28px; font-size: 0.8rem; }

  /* ── Lightbox ── */
  .lightbox-close {
    top: 0.6rem; right: 0.6rem;
    width: 34px; height: 34px;
    font-size: 0.85rem;
  }

  .lightbox-counter { bottom: 0.8rem; font-size: 0.55rem; }

  /* ── Landing page ── */
  .hero { padding: 2.5rem 1rem 1.5rem; }

  .hero-eyebrow { font-size: 0.55rem; letter-spacing: 0.2em; margin-bottom: 1rem; }

  /* Scale title so -SunnyZ- fits on one line */
  .hero-title { font-size: clamp(2.2rem, 11vw, 6rem); }

  .hero-divider { height: 40px; margin: 1.5rem auto; }

  .hero-tagline { font-size: 0.58rem; letter-spacing: 0.12em; }

  .nav-cards {
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
    gap: 0.8rem;
    padding: 0 1rem;
  }

  .nav-card { width: 100%; max-width: 280px; height: 110px; }

  .nav-card-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }

  .nav-card-label { font-size: 0.95rem; }

  /* ── Footer ── */
  footer {
    margin-top: 2rem;
    padding: 1.2rem 1rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }
}

