/*
Theme Name: OakDepth
Theme URI: https://example.com/oakdepth
Author: Brent Ferraro + OpenAI
Description: A work-first WordPress block theme with lush green styling and true Z-axis scroll depth.
Version: 1.1
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: oakdepth
*/

:root {
  --oak-ink: #07150d;
  --oak-deep: #0b2414;
  --oak-moss: #163b20;
  --oak-leaf: #2f6b36;
  --oak-lime: #9bcf66;
  --oak-cream: #ecf3df;
  --oak-fog: rgba(236,243,223,.72);
}

html { scroll-behavior:smooth; background:var(--oak-ink); }
body { margin:0; overflow-x:hidden; background:var(--oak-ink); color:var(--oak-cream); }

.oakdepth-site {
  min-height:100vh;
  background:
    radial-gradient(circle at 75% 14%, rgba(114,168,80,.18), transparent 28rem),
    radial-gradient(circle at 12% 50%, rgba(60,110,62,.20), transparent 34rem),
    linear-gradient(180deg, #07150d 0%, #0b2414 45%, #07150d 100%);
}

.oakdepth-header {
  position:fixed;
  inset:0 0 auto 0;
  z-index:1000;
  padding:22px clamp(20px,4vw,70px);
  pointer-events:none;
}
.oakdepth-header .wp-block-site-title { margin:0; }
.oakdepth-header a { color:var(--oak-cream); text-decoration:none; font-size:clamp(14px,1vw,17px); letter-spacing:.08em; text-transform:uppercase; }

.oakdepth-hero {
  min-height:100svh;
  display:flex;
  align-items:flex-end;
  position:relative;
  overflow:hidden;
  padding:clamp(80px,9vw,150px) clamp(20px,5vw,80px) clamp(50px,7vw,100px);
  box-sizing:border-box;
  perspective:1200px;
}
.oakdepth-hero::before,
.oakdepth-hero::after {
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}
.oakdepth-hero::before { width:56vw; height:56vw; right:-12vw; top:-12vw; background:radial-gradient(circle, rgba(155,207,102,.17), rgba(47,107,54,.04) 48%, transparent 70%); }
.oakdepth-hero::after { width:30vw; height:30vw; left:8vw; top:18vh; border:1px solid rgba(236,243,223,.13); box-shadow:0 0 0 7vw rgba(236,243,223,.018),0 0 0 14vw rgba(236,243,223,.012); }
.oakdepth-hero-copy { position:relative; z-index:4; max-width:1200px; transform:translateZ(80px); }
.oakdepth-kicker { margin:0 0 18px; color:var(--oak-lime); text-transform:uppercase; letter-spacing:.16em; font-size:12px; }
.oakdepth-display { margin:0; font-size:clamp(70px,14vw,220px); line-height:.72; letter-spacing:-.075em; font-weight:700; max-width:8ch; }
.oakdepth-display em { display:block; color:transparent; -webkit-text-stroke:1px rgba(236,243,223,.5); font-style:normal; transform:translateX(.16em); }
.oakdepth-scroll-note { position:absolute; right:clamp(20px,5vw,80px); bottom:clamp(50px,7vw,100px); writing-mode:vertical-rl; font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:rgba(236,243,223,.55); z-index:4; }

/* The page scrolls through this tall wrapper while the stage remains fixed in the viewport. */
.oakdepth-work {
  position:relative;
  height:900vh;
  margin:0 !important;
  padding:0 !important;
  background:
    radial-gradient(circle at 18% 28%, rgba(62,112,61,.20), transparent 32vw),
    radial-gradient(circle at 82% 70%, rgba(103,145,69,.12), transparent 30vw),
    #07150d;
}

.oakdepth-stage {
  position:sticky;
  top:0;
  height:100svh;
  width:100%;
  margin:0 !important;
  overflow:hidden;
  perspective:1400px;
  perspective-origin:50% 50%;
  transform-style:preserve-3d;
  isolation:isolate;
}

.oakdepth-stage::before {
  content:"";
  position:absolute;
  inset:-20%;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(ellipse at 15% 30%, rgba(155,207,102,.08), transparent 23%),
    radial-gradient(ellipse at 84% 72%, rgba(47,107,54,.12), transparent 25%);
  filter:blur(28px);
}

.oakdepth-work-intro {
  position:absolute;
  z-index:50;
  top:8vh;
  left:50%;
  width:min(72vw,1100px);
  transform:translateX(-50%);
  margin:0;
  color:var(--oak-fog);
  font-size:clamp(17px,2vw,28px);
  transition:opacity .25s linear, transform .25s linear;
  pointer-events:none;
}

.oakdepth-depth-meter {
  position:absolute;
  z-index:60;
  right:clamp(18px,4vw,64px);
  bottom:clamp(18px,4vw,48px);
  margin:0;
  font-size:10px;
  letter-spacing:.18em;
  color:rgba(236,243,223,.42);
  pointer-events:none;
}
.oakdepth-depth-meter span { color:var(--oak-lime); }
.oakdepth-depth-meter b { font-weight:400; }


/* Work Grid plugin becomes the 3D scene. The plugin owns the content and lightbox;
   OakDepth owns only the spatial choreography. */
.oakdepth-feed,
.oakdepth-feed > .wp-block-shortcode,
.oakdepth-feed .bdg-grid {
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  display:block !important;
  transform-style:preserve-3d;
  pointer-events:none;
}

.oakdepth-feed .bdg-grid > .bdg-item {
  --oak-x:0px;
  --oak-y:0px;
  position:absolute !important;
  top:50% !important;
  left:50% !important;
  width:min(86vw,1320px) !important;
  height:min(82svh,900px) !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible;
  border-radius:0;
  background:transparent;
  transform-style:preserve-3d;
  transform-origin:center center;
  will-change:transform,opacity;
  backface-visibility:hidden;
  pointer-events:auto;
  box-shadow:none;
}

.oakdepth-feed .bdg-link {
  position:absolute;
  inset:0;
  display:block;
  overflow:visible;
  color:white;
  text-decoration:none;
}

.oakdepth-feed .bdg-image-wrap {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  aspect-ratio:auto;
  overflow:visible;
  border-radius:0;
  background:transparent;
}

.oakdepth-feed .bdg-image-wrap::after {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
}

.oakdepth-feed .bdg-image {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  transition:transform .7s cubic-bezier(.2,.7,.2,1), filter .45s ease;
}
.oakdepth-feed .bdg-link:hover .bdg-image,
.oakdepth-feed .bdg-link:focus-visible .bdg-image { filter:saturate(1.06); opacity:1; }

.oakdepth-feed .bdg-title {
  position:absolute;
  z-index:5;
  left:clamp(20px,3vw,46px);
  right:clamp(20px,3vw,46px);
  bottom:clamp(20px,3vw,42px);
  margin:0;
  color:#fff;
  font-size:clamp(30px,4.6vw,76px);
  font-weight:650;
  line-height:.9;
  letter-spacing:-.05em;
  text-shadow:0 2px 30px rgba(0,0,0,.24);
}

.oakdepth-feed .bdg-type {
  z-index:6;
  left:clamp(20px,3vw,46px);
  top:clamp(20px,3vw,38px);
  bottom:auto;
  border-radius:999px;
  padding:7px 9px;
  background:rgba(7,21,13,.68);
  backdrop-filter:blur(8px);
  color:rgba(255,255,255,.9);
}

.oakdepth-feed .bdg-play { z-index:6; }
.oakdepth-feed .bdg-link:focus-visible { outline:2px solid var(--oak-lime); outline-offset:-6px; }

.oakdepth-end { min-height:65vh; display:grid; place-items:center; padding:10vh 20px; text-align:center; color:rgba(236,243,223,.42); font-size:11px; letter-spacing:.18em; text-transform:uppercase; background:#07150d; }

@media (max-width:800px) {
  .oakdepth-display { font-size:clamp(62px,20vw,130px); }
  .oakdepth-scroll-note { display:none; }
  .oakdepth-work-intro { left:22px; transform:none; width:calc(100% - 44px); }
  .oakdepth-feed .bdg-grid > .bdg-item,
  .oakdepth-feed .bdg-grid > .bdg-item:nth-child(n) {
    --oak-x:0px;
    --oak-y:4vh;
    width:92vw !important;
    height:78svh !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .oakdepth-work { height:auto !important; padding:8vh 16px 12vh !important; }
  .oakdepth-stage { position:relative; height:auto; overflow:visible; perspective:none; }
  .oakdepth-work-intro { position:relative; top:auto; left:auto; width:auto; transform:none !important; margin:0 auto 8vh; }
  .oakdepth-depth-meter { display:none; }
  .oakdepth-feed, .oakdepth-feed > .wp-block-shortcode, .oakdepth-feed .bdg-grid { position:relative !important; inset:auto !important; height:auto !important; }
  .oakdepth-feed .bdg-grid > .bdg-item,
  .oakdepth-feed .bdg-grid > .bdg-item:nth-child(n) { position:relative !important; top:auto !important; left:auto !important; width:100% !important; height:min(75vh,720px) !important; transform:none !important; opacity:1 !important; visibility:visible !important; margin:0 0 24px !important; }
}


/* v0.6: the work itself is the interface. */
.oakdepth-feed .bdg-title,
.oakdepth-feed .bdg-type { display:none !important; }
.oakdepth-feed .bdg-link--static { position:absolute; inset:0; display:block; }
.oakdepth-feed .bdg-inline-video-trigger.is-playing .bdg-image-wrap { overflow:hidden; background:#000; }
.oakdepth-feed .bdg-inline-video-trigger .bdg-image-wrap iframe { position:absolute; inset:0; width:100%!important; height:100%!important; border:0; }
.oakdepth-feed .bdg-inline-video-trigger.is-playing .bdg-play { display:none; }


/* OakDepth v0.7 closing statement */
.oakdepth-closing-description {
    max-width: 38rem;
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    line-height: 1.45;
    opacity: 0.78;
}


/* OakDepth v1.0 — photographic forest background */
body {
    background-color: #06170f;
    background-image:
        linear-gradient(rgba(4, 20, 13, 0.56), rgba(4, 20, 13, 0.68)),
        url("assets/images/oakdepth-background.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Keep theme sections transparent so the forest remains visible through the experience. */
.wp-site-blocks,
main,
.oakdepth-stage,
.oakdepth-work-stage,
.oakdepth-closing {
    background-color: transparent;
}

@media (max-width: 782px) {
    body {
        /* Fixed backgrounds are unreliable/expensive on many mobile browsers. */
        background-attachment: scroll;
        background-position: center top;
    }
}

@media (prefers-reduced-motion: reduce) {
    body {
        background-attachment: scroll;
    }
}


/* OakDepth v1.0.1 — let the forest image become the actual visual background */
.oakdepth-site,
.oakdepth-work,
.oakdepth-stage,
.oakdepth-end,
.wp-site-blocks,
main {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Remove the original abstract circle / glow artwork. */
.oakdepth-hero::before,
.oakdepth-hero::after,
.oakdepth-stage::before {
    content: none !important;
    display: none !important;
}

/* Keep a restrained dark veil for legibility without hiding the photograph. */
.oakdepth-site {
    position: relative;
}

.oakdepth-site::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(3, 15, 9, 0.24) 0%,
            rgba(3, 15, 9, 0.38) 48%,
            rgba(3, 15, 9, 0.50) 100%
        );
}

.oakdepth-site > * {
    position: relative;
    z-index: 1;
}


/* OakDepth v1.1 — native WordPress portfolio/gallery zone */
.oakdepth-native-gallery {
    width: min(92vw, 1500px);
    margin: clamp(1.5rem, 4vw, 4rem) auto clamp(3rem, 7vw, 7rem);
    padding: 0;
    position: relative;
    z-index: 2;
}

.oakdepth-native-gallery .wp-block-post-content:empty {
    margin: 0;
    padding: 0;
    min-height: 0;
}

.oakdepth-native-gallery .wp-block-gallery {
    gap: clamp(0.5rem, 1.2vw, 1rem);
    margin: 0;
}

.oakdepth-native-gallery .wp-block-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.oakdepth-native-gallery .wp-block-image,
.oakdepth-native-gallery figure {
    margin: 0;
}

.oakdepth-native-gallery figcaption {
    font-size: 0.8rem;
    line-height: 1.35;
    opacity: 0.68;
    margin-top: 0.4rem;
}

.oakdepth-native-gallery a {
    color: inherit;
}

@media (max-width: 782px) {
    .oakdepth-native-gallery {
        width: min(94vw, 1500px);
        margin-top: 1rem;
        margin-bottom: 3rem;
    }
}
