/*
Theme Name: CRAFT Portfolio Theme
Author: Cody
Version: 1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: craft-theme
Tags: portfolio, custom-blocks, minimal, one-column, black-and-white
*/

/* ==========================================================================
   CSS RESET & BASE STYLES
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Global variables */
:root {
  /* Main gaps between columns / layout elements */
  --craft-gap-grid: 2rem;

  /* Inner gaps between stacked items inside a column or block */
  --craft-gap-inner: 2rem;

  /* Header + content offset */
  --header-height: 72px; /* tweak to your actual header height */

  /* Featured Work row heights (easy knobs to tweak) */
  --featured-work-row-height-desktop: 450px; /* change this to make thumbs taller/shorter on desktop */
  --featured-work-row-height-tablet: 260px;  /* change this for tablet */

  /* Height control (consistent look) */
  --fw-wide-aspect: 16 / 9; /* wide tiles */
  --fw-small-aspect: 1 / 1; /* small tiles */

  /* match whatever your images use today */
  --media-radius: 8px;

  /* Controls hero/container viewport height */
  --hero-min: 100vh;
}

/* General: images + videos get the same rounding */
img,
video,
iframe {
  border-radius: var(--media-radius);
}

body {
  font-family: "DM Mono", monospace;
  font-weight: 400;
  line-height: 1.6;
  color: #f4f4f7;
  background-color: #000000;
  overflow-x: hidden;
}

/* ===== Page Loader ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--loader-bg, #0e0e0f);
  display: grid;
  place-items: center;
  opacity: 1;
  transform: translateZ(0);
  transition: opacity .5s ease, visibility .5s ease;
  visibility: visible;
}
.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__inner { width: min(320px, 60vw); }

.logo-mask {
  --p: 0; /* progress 0..1 controlled via JS */
  --stroke: rgba(255,255,255,.25);
  --thickness: 2px;
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 1; /* adjust to your logo’s proportions */
}

/* Outline (silent guide so the logo is visible while filling) */
.logo-mask__outline,
.logo-mask__fill {
  position: absolute;
  inset: 0;
  -webkit-mask: var(--logo-url) no-repeat center / contain;
          mask: var(--logo-url) no-repeat center / contain;
}

/* Outline stroke look */
.logo-mask__outline {
  background: var(--stroke);
  filter: drop-shadow(0 0 .01px rgba(0,0,0,.01));
}

/* Fill that grows horizontally by clipping */
.logo-mask__fill {
  background: var(--loader-color, #fff);
  /* reveal from left to right by clipping the right side */
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0);
  transition: clip-path .25s ease;
}

/* Optional: small fade pulse while loading */
.page-loader:not(.is-done) .logo-mask__fill {
  animation: loader-breathe 1.2s ease-in-out infinite alternate;
}
@keyframes loader-breathe {
  from { filter: brightness(1); }
  to   { filter: brightness(1.15); }
}

/* replace .loader-logo with #loader-logo */
#loader-logo {
  --loader-scale: .5;
  transform: scale(var(--loader-scale));
  transform-origin: 50% 50%;
}


/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.1;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(2rem, 7.5vw, 2.4rem);
    line-height: 1.15;
  }
}

h2 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.875rem;
}

h4 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 0.75rem;
}

h5 {
  font-size: clamp(1.25rem, 2vw, 2rem);
  margin-bottom: 0.875rem;
}

h6 {
  font-size: clamp(1.125rem, 1.5vw, 1.5rem);
  margin-bottom: 0.75rem;
}

p {
  font-family: "DM Mono", monospace;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #cccccc;
}

/* ==========================================================================
   LINKS
   ========================================================================== */

a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: .5;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex-grow: 1;
  padding-top: calc(var(--header-height) + var(--header-offset-extra));
}

.craft-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (max-width: 768px) {
  .craft-container {
    padding: 0 1.25rem;
  }
}

/* Core 12-col grid used in Craft blocks */
.craft-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--craft-gap-grid);
  margin-bottom: 4rem;
}

/* Grid span helpers for .craft-grid ------------------------------------- */

/* Default: on small screens, every item is full-width */
.craft-grid > * {
  grid-column: 1 / -1;
}

/* On desktop (12-column grid), enable span helpers */
@media (min-width: 901px) {
  .craft-grid > .span-3 { grid-column: span 3; }
  .craft-grid > .span-4 { grid-column: span 4; }
  .craft-grid > .span-6 { grid-column: span 6; }
  .craft-grid > .span-8 { grid-column: span 8; }
  .craft-grid > .span-9 { grid-column: span 9; }
  .craft-grid > .span-12 { grid-column: span 12; }
}

@media (max-width: 900px) {
  .craft-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .craft-grid {
    grid-template-columns: 1fr;
  }
}

/* Simple margin helpers */
.margin-bottom-large { margin-bottom: 5rem; }
.margin-bottom-medium { margin-bottom: 4rem; }
.margin-bottom-small { margin-bottom: 2rem; }

/* ==========================================================================
   HEADER & NAV
   ========================================================================== */

.site-header {
  position: fixed;
  top: 1; /* (kept as-is) */
  left: 0;
  right: 0;
  z-index: 200; /* header/nav is above slider */
  background-color: transparent;
}

/* Header inner wrapper (put .craft-container on this in header.php) */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding-block: 0.75rem; /* vertical only */
}

/* Mobile spacing tweak */
@media (max-width: 768px) {
  .site-header__inner {
    padding: 1rem 1.5rem;
  }
}

/* Logo area */
.site-header__logo {
  font-family: "DM Mono", monospace;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Fallback text logo */
.site-header__logo > a {
  font-family: "DM Mono", monospace;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Logo image */
.site-header__logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-header__logo .custom-logo {
  height: 28px; /* Force a visible height for SVG logo */
  width: auto;
  display: block;
}

/* Base nav container */
.site-header__nav {
  display: flex;
  align-items: center;
}

/* Menu list */
.site-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-header__menu li {
  margin: 0;
}

/* Menu links */
.site-header__menu a {
  font-family: "DM Mono" sans-serif; /* (kept as-is) */
  font-size: 1rem;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.3s ease;
}

.site-header__menu a:hover {
  opacity: 0.7;
}

/* MENU toggle (mobile) */
.site-header__toggle {
  display: none; /* hidden on desktop */
  border: none;
  background: none;
  color: #ffffff;
  cursor: pointer;
  font-family: "DM Mono", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem; /* same size as menu links */
  text-transform: uppercase;
  padding: 0;
}

/* Dark overlay behind slide-in menu */
.site-header__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 45;
}

.site-header__overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Prevent body scroll when menu open */
body.menu-open {
  overflow: hidden;
}

/* Mobile / tablet nav behaviour */
@media (max-width: 768px) {
  /* Show MENU button on mobile */
  .site-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Turn nav into off-canvas panel */
  .site-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(80vw, 320px);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(18px);
    padding: 5rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .site-header__nav.is-open {
    transform: translateX(0);
  }

  /* Stack menu items vertically inside the panel */
  .site-header__menu {
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
  }

  .site-header__menu a {
    font-size: 1rem;
  }
}

/* Desktop: keep inline nav, hide overlay */
@media (min-width: 769px) {
  .site-header__nav {
    position: static;
    height: auto;
    width: auto;
    transform: none;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .site-header__overlay {
    display: none;
  }
}

/* Perfectly center logo + MENU text on mobile */
@media (max-width: 768px) {
  .site-header__logo,
  .site-header__toggle {
    display: flex;
    align-items: center;   /* vertically center contents */
  }

  .site-header__toggle {
    line-height: 1;        /* avoid tall text box */
    padding-top: 0;
    padding-bottom: 0;
  }
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  padding: 4rem 0 2rem;
  margin-top: 8rem;
}

/* craft-container already controls width + horizontal padding */

.footer-inner {
  display: flex;
  flex-direction: column; /* stack brand, nav, contact vertically */
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Brand / tagline */
.footer-section--brand { width: 100%; }

.footer-brand {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
}

.footer-tagline {
  margin: 0;
  font-size: 0.9rem;
}

/* General section list reset */
.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nav links – horizontal row, flush with container left */
.footer-section--nav { width: 100%; }

#footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem; /* row gap, column gap */
  margin: 0;
  padding: 0;
}

#footer-menu li { margin: 0; }

.footer-section--nav a,
.footer-section--meta a {
  font-family: "DM Mono", monospace;
  font-size: 0.875rem;
  color: #cccccc;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-section--nav a:hover,
.footer-section--meta a:hover {
  color: #ffffff;
}

/* Contact/meta section */
.footer-section--meta {
  width: 100%;
  font-size: 0.875rem;
}

/* Bottom row */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  color: #666666;
}

.footer-bottom a {
  color: inherit;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* Footer responsive */
@media (max-width: 768px) {
  .site-footer {
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   CASE STUDY LISTINGS
   ========================================================================== */

.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--craft-gap-grid);
}

.case-study-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--craft-gap-inner);
}

.case-study-card__image {
  overflow: hidden;
  background-color: #111111;
}

.case-study-card__image img {
  width: 100%;
  height: auto;
  display: block;
}

.case-study-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  color: #999999;
}

.case-study-card__title {
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 500;
}

.case-study-card__tags {
  display: flex;
  gap: 0.75rem;
}

.case-study-card__tag {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .case-studies-grid {
    grid-template-columns: 1fr;
  }
}

/* Case Study Archive – 2-column 60/40 grid */
.post-type-archive-case_study .craft-grid {
  /* override the default 12-col grid for this template only */
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); /* ~60/40 */
}

/* override span helper so each article just takes one column */
.post-type-archive-case_study .craft-grid > article,
.post-type-archive-case_study .craft-grid > .span-4 {
  grid-column: auto;
}

/* responsive: stack on small screens */
@media (max-width: 900px) {
  .post-type-archive-case_study .craft-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Case Study: Prev / Next Navigation ---------- */

.case-study-navigation {
  border-top: 1px solid hsla(0, 0%, 100%, .12);
  padding: 32px 0;
  margin-top: 48px;
}

.case-study-navigation .nav-links {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(16px, 4vw, 64px);
}

/* Keep columns pinned to edges even if one side is missing */
.case-study-navigation .nav-previous { margin-right: auto; min-width: 0; }
.case-study-navigation .nav-next { margin-left: auto; min-width: 0; }

.case-study-navigation .nav-empty { visibility: hidden; width: 0; height: 0; }

.case-study-navigation .nav-label {
  display: block;
  font-family: var(--font-mono, 'DM Mono', ui-monospace, Menlo, monospace);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 8px;
}

.case-study-navigation .nav-title {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.2;
  margin: 0;
}

.case-study-navigation .nav-link {
  color: var(--text, #fff);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity .2s ease, border-color .2s ease;
}

.case-study-navigation .nav-link:hover {
  opacity: .8;
  border-color: hsla(0, 0%, 100%, .35);
}

/* Arrow affordances */
.case-study-navigation .nav-link--prev::before,
.case-study-navigation .nav-link--next::after {
  content: "";
  display: inline-block;
  width: .75em;
  height: .75em;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-135deg);
  margin-right: .5em;
  vertical-align: .05em;
  opacity: .8;
}

.case-study-navigation .nav-link--next::after {
  transform: rotate(45deg);
  margin-right: 0;
  margin-left: .5em;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .case-study-navigation .nav-links {
    flex-direction: column;
    gap: 24px;
  }

  .case-study-navigation .nav-previous,
  .case-study-navigation .nav-next {
    margin: 0;
  }
}

/* Optional: a stronger divider variant if desired */
.case-study-navigation.hr-strong {
  border-top: 1px solid hsla(0, 0%, 100%, .3);
}

/* ==========================================================================
   TYPOGRAPHY COMPONENTS
   ========================================================================== */

.eyebrow {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #aaaaaa;
  margin-bottom: 0.75rem;
}

.large-heading {
  font-size: clamp(2.75rem, 5vw, 4rem);
  line-height: 1.05;
}

.body-text {
  font-family: "DM Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #dddddd;
}

.body-text p + p {
  margin-top: 1rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background-color: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

/* ==========================================================================
   IMAGES
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Full-bleed utility: ignores container width and spans the viewport */
.full-bleed {
  display: block;
  width: 100vw;                          /* span full viewport width */
  max-width: 100vw;
  margin-left: calc(50% - 50vw);         /* pull out of centered container */
  margin-right: calc(50% - 50vw);
}

/* Optional: keep media crisp and rounded if you like */
.full-bleed img,
.full-bleed video {
  width: 100%;
  height: auto;
  display: block;
  /* border-radius: 8px; */              /* uncomment if you want rounding */
}

/* If your container adds side padding, you can also nuke it for full bleed sections */
.full-bleed-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

figure { margin: 0; }

figcaption {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  color: #666666;
  margin-top: 0.5rem;
  padding: 0 2rem;
}

/* ==========================================================================
   WORDPRESS ALIGNMENT CLASSES
   ========================================================================== */

.alignleft {
  float: left;
  margin-right: 2rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.alignwide {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  max-width: 100%;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.screen-reader-text:focus {
  background-color: #000;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: #fff;
  display: block;
  font-size: 0.875rem;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   GUTENBERG BLOCKS: 
   ========================================================================== */

/* Hero Block Styles */
.craft-hero-block {
  padding: 4rem 0;
  margin-bottom: 4rem;
}

.craft-hero-block h1 {
  font-size: clamp(3rem, 6vw, 6rem);
  margin-bottom: 1.5rem;
}

.craft-hero-block .subtitle {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: #999999;
}

/* Text Block Styles */
.craft-text-block {
  padding: 3rem 0;
}

.craft-text-block .craft-grid { gap: var(--craft-gap-grid); }

.craft-text-block h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 1.5rem;
}

.craft-text-block p { line-height: 1.7; }

/* Image Grid Styles */
.craft-image-grid { padding: 3rem 0; }

.craft-image-grid .craft-grid { gap: var(--craft-gap-inner); }

/* Two Column Styles */
.craft-two-column { padding: 4rem 0; }

.craft-two-column .craft-grid {
  align-items: center;
  gap: var(--craft-gap-grid);
}

.craft-two-column .column-content h3 { margin-bottom: 1rem; }
.craft-two-column .column-content p { margin-bottom: 1rem; }

@media (max-width: 768px) {
  .craft-two-column.reverse-mobile .craft-grid {
    display: flex;
    flex-direction: column-reverse;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .craft-hero-block,
  .craft-text-block,
  .craft-image-grid,
  .craft-two-column {
    padding: 2rem 0;
  }
}
.gap-lg.wp-block-columns { --wp--style--block-gap: 8rem; }


/* ==========================================================================
   FEATURED WORK – Craft-style asymmetric grid
   ========================================================================== */

.featured-work {
  padding: 6rem 0 8rem;
}

/* Header spacing */
.featured-work .featured-work__header {
  margin-bottom: 4rem;
}

/* Container for rows */
.featured-work__grid {
  display: flex;
  flex-direction: column;
  gap: var(--craft-gap-grid); /* vertical gap between rows */
}

/* Each row: 2 columns, 60/40 or 40/60 */
.featured-work__row {
  display: grid;
  gap: var(--craft-gap-grid); /* horizontal gap between the two items */
  align-items: stretch;
}

/* Row 1, 3, 5... → wide on the left (2/1) */
.featured-work__row--wide-left {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

/* Row 2, 4, 6... → wide on the right (1/2) */
.featured-work__row--wide-right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

/* Base tile – make the card fill the grid cell */
.featured-work__item {
  position: relative;
  height: 100%;
}

/* Clickable area fills the item */
.featured-work__link {
  display: block;
  position: relative;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Thumbnail frame – height controlled via aspect-ratio helpers */
.featured-work__thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  border-radius: 8px;
}

/* Image/video fill the thumb */
.featured-work__thumb img,
.featured-work__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Meta overlay bottom-left (desktop) */
.featured-work__meta {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

/* Title + services (desktop style) */
.featured-work__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 500;
}

.featured-work__services {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  color: #aaaaaa;
  margin: 0;
}

/* Gradient overlay similar to Craft */
.featured-work__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

/* Hover zoom */
.featured-work__thumb img {
  transition: transform 0.35s ease;
}

.featured-work__link:hover .featured-work__thumb img {
  transform: scale(1.03);
}

/* Mark wide vs small items via aspect-ratio on desktop */
.featured-work__row--wide-left > .featured-work__item:first-child .featured-work__thumb {
  aspect-ratio: var(--fw-wide-aspect);  /* 16 / 9 */
}
.featured-work__row--wide-left > .featured-work__item:last-child .featured-work__thumb {
  aspect-ratio: var(--fw-small-aspect); /* 1 / 1 */
}

.featured-work__row--wide-right > .featured-work__item:first-child .featured-work__thumb {
  aspect-ratio: var(--fw-small-aspect);
}
.featured-work__row--wide-right > .featured-work__item:last-child .featured-work__thumb {
  aspect-ratio: var(--fw-wide-aspect);
}

/* Fallback for old browsers without aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .featured-work__row--wide-left > .featured-work__item:first-child .featured-work__thumb,
  .featured-work__row--wide-right > .featured-work__item:last-child .featured-work__thumb {
    padding-bottom: 56.25%; /* 16:9 */
  }

  .featured-work__row--wide-left > .featured-work__item:last-child .featured-work__thumb,
  .featured-work__row--wide-right > .featured-work__item:first-child .featured-work__thumb {
    padding-bottom: 100%; /* 1:1 */
  }

  .featured-work__thumb img,
  .featured-work__thumb video {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
}

/* Tablet & down: pack rows into one 2-col grid so small items can sit inline */
@media (max-width: 1100px) {
  .featured-work__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
    gap: var(--craft-gap-grid);
  }

  .featured-work__row {
    display: contents; /* children participate in the parent grid */
  }

  /* Make wide tiles span both columns */
  .featured-work__row--wide-left > .featured-work__item:first-child,
  .featured-work__row--wide-right > .featured-work__item:last-child {
    grid-column: 1 / -1;
  }

  .featured-work__thumb {
    border-radius: 8px;
    overflow: hidden;
  }
}

/* Phone: single column below ~700px (desktop aspect-ratios still apply above 700px) */
@media (max-width: 700px) {
  .featured-work__grid {
    grid-template-columns: 1fr;
  }
}

/* HIDE meta text globally (desktop) – we re-enable on mobile below */
.featured-work .featured-work__title,
.featured-work .featured-work__services {
  display: none !important;
}

/* Also SR-only style if needed (left as-is for desktop) */
.featured-work .featured-work__title,
.featured-work .featured-work__services {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   MOBILE – Featured Work grid
   1×1 thumbs + titles BELOW thumbnail
   ========================================= */

@media (max-width: 768px) {
  /* Keep everything inside the viewport width */
  .featured-work,
  .featured-work .craft-container,
  .featured-work__grid {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  /* Turn the overall grid into a simple vertical stack */
  .featured-work__grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  /* Each "row" just becomes a vertical list of items */
  .featured-work__row,
  .featured-work__row--wide-left,
  .featured-work__row--wide-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
  }

  /* Tiles should never be wider than the screen */
  .featured-work__item {
    width: 100%;
  }

  /* Make ALL thumbs perfect 1x1 on mobile */
  .featured-work__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1 !important;
    border-radius: 8px;
    overflow: hidden;
  }

  .featured-work__thumb img,
  .featured-work__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Put meta UNDER the thumbnail instead of overlay */
  .featured-work__meta {
    position: static;
    margin-top: 0.75rem;
    display: block;
    pointer-events: auto;
  }

  /* UN-HIDE title + services on mobile (override the desktop hiding) */
  .featured-work .featured-work__title,
  .featured-work .featured-work__services {
    display: block !important;
    position: static !important;
    width: auto;
    height: auto;
    margin: 0 0 0.25rem;
    padding: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
    border: 0;
  }
}



/* =========================================
   MOBILE FIX – Featured Work grid
   Force single column and prevent overflow
   ========================================= */

@media (max-width: 768px) {
  /* Keep everything inside the viewport width */
  .featured-work,
  .featured-work .koto-container,
  .featured-work__grid {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  /* Turn the overall grid into a simple vertical stack */
  .featured-work__grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  /* Each "row" just becomes a vertical list of items */
  .featured-work__row,
  .featured-work__row--wide-left,
  .featured-work__row--wide-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
  }

  /* Tiles should never be wider than the screen */
  .featured-work__item {
    width: 100%;
  }

  /* Media fills card width and keeps a sane aspect */
  .featured-work__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
  }

  .featured-work__thumb img,
  .featured-work__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

@media (max-width: 768px) {
  /* ...existing mobile featured-work rules above... */

  /* Put meta UNDER the thumbnail instead of overlay */
  .featured-work__meta {
    position: static;
    margin-top: 0.75rem;
    display: block;
    pointer-events: auto;
  }

  /* Un-hide and render title/services as normal text */
  .featured-work .featured-work__title,
  .featured-work .featured-work__services {
    display: block !important;
    position: static !important;
    width: auto;
    height: auto;
    margin: 0 0 0.25rem;
    padding: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
    border: 0;
  }
}




/* ==========================================================================
   HOME INTRO BLOCK
   100vh hero, left-aligned text, arrow at bottom-left
   ========================================================================== */

.craft-home-intro {
  position: relative;
  height: 90vh;              /* force full browser height */
  display: flex;
  align-items: center;        /* vertically center the text */
  padding: 4rem 0;
  overflow: hidden;
  color: #ffffff;
}

.craft-home-intro__content {
  position: relative;
  z-index: 1;
  margin: 0;                  /* left-aligned within span-12 */
  text-align: left;
}

.craft-home-intro__title {
  font-size: clamp(1.5rem, 3.5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 80%;
}

.craft-home-intro__body {
  font-family: "DM Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* down arrow pinned to bottom-left of the hero */
.craft-home-intro__arrow {
  position: absolute !important;
  left: 24px !important;
  bottom: 24px !important;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transform: none !important; /* kill any old centering transforms */
}

.craft-home-intro__arrow-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.85;
  animation: craft-home-intro-arrow-bounce 1.4s infinite ease-in-out;
}

@keyframes craft-home-intro-arrow-bounce {
  0%, 20% { transform: translateY(0) rotate(-45deg); }
  50% { transform: translateY(6px) rotate(-45deg); }
  100% { transform: translateY(0) rotate(-45deg); }
}

@media (max-width: 768px) {
  .craft-home-intro { 
    padding: 3rem 0; 
  }

  .craft-home-intro__title {
    font-size: clamp(2.2rem, 5.5vw, 2.3rem);
    max-width: 100%; /* give it the full width to wrap nicely */
  }

  .craft-home-intro__arrow { 
    left: 16px !important; 
    bottom: 16px !important; 
  }
}

@media (max-width: 768px) {
  /* ...existing mobile featured-work rules above... */

  /* Put meta UNDER the thumbnail instead of overlay */
  .featured-work__meta {
    position: static;
    margin-top: 0.75rem;
    display: block;
    pointer-events: auto;
  }

  /* Un-hide and render title/services as normal text */
  .featured-work .featured-work__title,
  .featured-work .featured-work__services {
    display: block !important;
    position: static !important;
    width: auto;
    height: auto;
    margin: 0 0 0.25rem;
    padding: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
    border: 0;
  }
}


/* ==========================================================================
   WORK SLIDER BLOCK
   Full-width, fixed center slide, dimmed neighbors, sliding transform
   ========================================================================== */

.craft-work-slider {
  position: relative;
  padding: clamp(60px, 10vh, 90px) 0;

  /* 🎛 TUNING KNOBS */
  --craft-slider-gap: 60vw;            /* distance from center to side slides */
  --craft-slider-duration: 0.4s;       /* slide animation length */
  --craft-slider-ease: cubic-bezier(0.33, 1, 0.68, 1);
  --craft-slider-scale-active: 1;      /* scale of center slide */
  --craft-slider-scale-side: 0.7;      /* scale of side slides */
}

/* Don't constrain to theme container width */
.craft-work-slider .craft-container {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Make the viewport full browser width, centered on page */
.craft-work-slider__viewport {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: visible;
}

/* Track is a stacking context (not a flex row) */
.craft-work-slider__track {
  position: relative;
  width: 100%;
  height: clamp(280px, 52vw, 720px); /* approximate hero height */
}

/* Base slide */
.craft-work-slider__slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80vw, 1440px);
  max-width: 1440px;
  transform: translate(-50%, -50%) scale(var(--craft-slider-scale-side));
  transform-origin: center center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: transform var(--craft-slider-duration) var(--craft-slider-ease);
}

.craft-work-slider__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Media wrapper */
.craft-work-slider__media {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
}

.craft-work-slider__media img,
.craft-work-slider__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Caption */
.craft-work-slider__caption {
  margin-top: 14px;
  font-size: 0.9rem;
  font-family: "DM Mono", monospace;
}

/* State styles ----------------------------------------------------------- */

.craft-work-slider__slide[data-state="active"] {
  transform: translate(-50%, -50%) scale(var(--craft-slider-scale-active));
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
  filter: none;
}

.craft-work-slider__slide[data-state="prev"],
.craft-work-slider__slide[data-state="next"] {
  opacity: 0.4;
  filter: grayscale(0.4) brightness(0.75);
  z-index: 2;
  pointer-events: auto;
}

.craft-work-slider__slide[data-state="prev"] {
  transform: translate(calc(-50% - var(--craft-slider-gap)), -50%) scale(var(--craft-slider-scale-side));
}

.craft-work-slider__slide[data-state="next"] {
  transform: translate(calc(-50% + var(--craft-slider-gap)), -50%) scale(var(--craft-slider-scale-side));
}

.craft-work-slider__slide[data-state="hidden"] {
  transform: translate(-50%, -50%) scale(var(--craft-slider-scale-side));
  opacity: 0;
  filter: grayscale(0.5) brightness(0.4);
  pointer-events: none;
  z-index: 1;
}

/* Hover zones + arrows --------------------------------------------------- */

.craft-work-slider__hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 4;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.craft-work-slider__hit--left { left: 0; justify-content: flex-start; }
.craft-work-slider__hit--right { right: 0; justify-content: flex-end; }

.craft-work-slider__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0);
  opacity: 0;
  margin: 0 clamp(28px, 4vw, 52px);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.craft-work-slider__arrow::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.craft-work-slider__hit--left:hover .craft-work-slider__arrow--prev {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.craft-work-slider__hit--right:hover .craft-work-slider__arrow--next {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Responsive tweaks ------------------------------------------------------ */

@media (max-width: 900px) {
  .craft-work-slider { --craft-slider-gap: 32vw; }
}

/* =========================================
   Work Slider – mobile layout
   One centered slide, no overflow
   ========================================= */

@media (max-width: 768px) {
  /* Slightly tighter padding on mobile */
  .craft-work-slider {
    padding: 3rem 0 4rem;
  }

  /* Viewport behaves like a normal container */
  .craft-work-slider__viewport {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    transform: none !important;
    padding-inline: 0;
    overflow: hidden;
  }

  /* Track just wraps the active slide height */
  .craft-work-slider__track {
    position: relative;
    width: 100%;
    height: auto;
  }

  /* Each slide becomes a simple centered block */
  .craft-work-slider__slide {
    position: static !important;
    width: 100%;
    max-width: 520px;          /* tweak this if you want wider/narrower */
    margin: 0 auto;
    transform: none !important;
    opacity: 0;
    pointer-events: none;
    filter: none;
  }

  /* Only the active slide is visible/clickable */
  .craft-work-slider__slide[data-state="active"] {
    opacity: 1;
    pointer-events: auto;
  }

  .craft-work-slider__slide[data-state="prev"],
  .craft-work-slider__slide[data-state="next"],
  .craft-work-slider__slide[data-state="hidden"] {
    display: none !important;
  }

  /* Media box – keep it clean and responsive */
  .slider-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #111;
  }

  .slider-image .video,
  .slider-image video,
  .slider-image img,
  .slider-image .related__ph {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Hide the big hover hit zones + arrows on touch */
  .craft-work-slider__hit,
  .craft-work-slider__arrow {
    display: none !important;
  }
}

/* ==========================================================================
   HOME HERO – full-viewport, perfectly centered
   ========================================================================== */

/* Assumes a fixed header; we already have --header-height in :root */
.home-hero {
  min-height: var(--hero-min, 100vh);
  height: var(--hero-min, 100vh); /* lock it to that viewport height */
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 0;
  position: relative;
}

/* When intro is locked, no scrolling */
body.intro-locked {
  overflow: hidden;
}

/* Optionally keep the main area pinned as well */
body.intro-locked .site-main {
  height: var(--hero-min, 100vh);
  overflow: hidden;
}

.home-hero .craft-container {
  width: 100%;
  display: grid;                 /* grid lets align-content center reliably */
  align-content: center;         /* vertical center within the hero */
  justify-items: start;          /* text left-aligned like craft.studio */
  gap: 2rem;
}

/* Kill default block margins so headings/paragraphs don’t add phantom spacing */
.home-hero :where(h1,h2,h3,p) { margin-block: 0; }
.home-hero :where(p + p) { margin-top: 1rem; }

/* Optional: small breathing room on huge screens */
@media (min-width: 1100px) {
  .home-hero { padding-block: clamp(0px, 2vh, 24px); }
}

/* Compensate for WP admin bar when logged in */
@media (min-width: 783px) {
  .admin-bar .home-hero { min-height: calc(100vh - var(--header-height) - 32px); }
}

@media (max-width: 782px) {
  .admin-bar .home-hero { min-height: calc(100vh - var(--header-height) - 46px); }
}

/* ===== Hero Down Arrow (Craft-ish) ===== */

:root {
  --hero-arrow-size: 56px;                 /* circle size */
  --hero-arrow-bg: rgba(255, 255, 255, 0.06); /* idle background */
  --hero-arrow-bg-hover: rgba(255, 255, 255, 0.12);
  --hero-arrow-ring: rgba(255, 255, 255, 0.22); /* outer ring */
  --hero-arrow-color: #fff;                /* icon color (currentColor) */
  --hero-arrow-blur: 8px;                  /* subtle glassy feel */
}

/* Positioning for bottom-center pin */
.home-hero { position: relative; }

.home-hero__down {
  position: absolute;
  left: clamp(16px, 4vw, 32px);
  bottom: clamp(20px, 6vh, 56px);
  transform: translateX(-50%);
  display: inline-grid;
  place-items: center;
  width: var(--hero-arrow-size);
  height: var(--hero-arrow-size);
  color: var(--hero-arrow-color);
  text-decoration: none;
  border-radius: 999px;
  background: var(--hero-arrow-bg);
  backdrop-filter: blur(var(--hero-arrow-blur));
  -webkit-backdrop-filter: blur(var(--hero-arrow-blur));
  box-shadow:
    0 0 0 1px var(--hero-arrow-ring) inset, /* inner ring */
    0 6px 30px rgba(0, 0, 0, 0.25);         /* lift */
  transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease, opacity .25s ease;
  will-change: transform, background-color;
  isolation: isolate; /* keeps blur/rings clean */
}

/* arrow glyph sizing */
.home-hero__down-icon {
  width: 46%;
  height: 46%;
  display: block;
}

/* hover/active interaction */
.home-hero__down:hover {
  background: var(--hero-arrow-bg-hover);
  transform: translateX(-50%) translateY(2px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28) inset,
    0 10px 36px rgba(0, 0, 0, 0.32);
}

.home-hero__down:active {
  transform: translateX(-50%) translateY(3px) scale(0.99);
  background: rgba(255, 255, 255, 0.10);
}

/* keyboard focus ring (accessible) */
.home-hero__down:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.6),
    0 0 0 4px rgba(255, 255, 255, 0.85),
    0 6px 30px rgba(0, 0, 0, 0.25);
}

/* gentle pulse to hint interactivity */
@keyframes craftPulse {
  0%   { transform: translateX(-50%) translateY(0) scale(1);   opacity: .95; }
  50%  { transform: translateX(-50%) translateY(0) scale(1.04); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0) scale(1);   opacity: .95; }
}

.home-hero__down { animation: craftPulse 2.6s ease-in-out 1.2s infinite; }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .home-hero__down { animation: none; transition: none; }
}

/* If your hero is light-on-dark, keep it visible on very light backgrounds too */
.home-hero.on-light .home-hero__down {
  --hero-arrow-bg: rgba(0, 0, 0, 0.06);
  --hero-arrow-bg-hover: rgba(0, 0, 0, 0.12);
  --hero-arrow-ring: rgba(0, 0, 0, 0.18);
  --hero-arrow-color: #111;
}

/* Ensure viewport is positioned so hits overlay correctly */
.craft-work-slider__viewport { position: relative; }

/* Clickable prev/next zones (override for current slider behavior) */
.craft-work-slider__hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14%;
  z-index: 50;
  pointer-events: auto;
  cursor: pointer;
}

.craft-work-slider__hit--left { left: 0; }
.craft-work-slider__hit--right { right: 0; }

/* Optional visible arrows while testing */
.craft-work-slider__arrow {
  position: absolute;
  left: clamp(16px, 4vw, 32px);
  transform: translateX(-50%);
  display: inline-grid;
  place-items: center;
  width: var(--hero-arrow-size);
  height: var(--hero-arrow-size);
  color: var(--hero-arrow-color);
  text-decoration: none;
  border-radius: 999px;
  background: var(--hero-arrow-bg);
  backdrop-filter: blur(var(--hero-arrow-blur));
  -webkit-backdrop-filter: blur(var(--hero-arrow-blur));
  box-shadow:
    0 0 0 1px var(--hero-arrow-ring) inset,
    0 6px 30px rgba(0, 0, 0, 0.25);
  transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease, opacity .25s ease;
  will-change: transform, background-color;
  isolation: isolate; /* keeps blur/rings clean */
  rotate: 45deg;
}

.craft-work-slider__arrow--prev { left: 16px; rotate: 225deg; }
.craft-work-slider__arrow--next { right: 16px; rotate: 45deg; }

/* ==========================================================================
   HR / DIVIDERS
   ========================================================================== */

/* normalize any theme HR styles */
hr { border: 0; }

/* your thin line */
.craft-hr {
  border: 0; /* kill theme defaults */
  border-bottom: 1px solid hsla(0, 0%, 100%, .3);
  height: 0;
}

/* ==========================================================================
   RELATED PROJECTS – 16x9 thumbs + titles
   ========================================================================== */

.related {
  margin-top: 64px;
}

/* Section heading */
.related__title-heading,
.related__title { /* support old + new class names */
  font-size: clamp(24px, 2.8vw, 36px);
  margin-bottom: 20px;
}

/* Grid of related cards */
.related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related__item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 16x9 media frame */
.related__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;   /* ⬅️ CHANGED from 1 / 1 */
  border-radius: 14px;
  overflow: hidden;
  background: #111;
}

/* Make video/image/placeholder fill the frame */
.related__thumb .related__video,
.related__thumb img,
.related__thumb .related__ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder styling */
.related__ph {
  background: rgba(255, 255, 255, .08);
  border: 1px dashed rgba(255, 255, 255, .25);
  border-radius: 14px;
}

/* Title under thumb */
.related__title {
  display: block;
  margin-top: 0.55rem;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  color: #cccccc;
}

/* Responsive columns */
@media (max-width: 900px) {
  .related__list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .related__list {
    grid-template-columns: 1fr;
  }
}

/* Hide visible captions/titles for project tiles/slides (SR-only behavior) */
.slider-caption,
.craft-work-slider__caption,
.featured-work__item .title,
.related__item .title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* Fully hide Featured Work meta if you don’t need SR text there
   (do NOT hide Work Slider captions here) */
.featured-work .featured-work__item-title,
.featured-work .featured-work__title,
.featured-work .featured-work__services {
  display: none !important;
}

/* Visually hide but keep accessible for Featured Work (if re-enabled later) */
.featured-work .featured-work__title,
.featured-work .featured-work__services {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Custom cursor tooltip ===== */

.craft-cursor {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%); /* center on pointer */
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity .18s ease;
  will-change: transform, opacity;
}

.craft-cursor__bubble {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono, "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  transform: translate3d(0, 0, 0);
}

.craft-cursor[data-pos="show"] { opacity: 1; }

.is-light-bg .craft-cursor__bubble {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Cursor tooltip */
.craft-cursor-tip {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition: opacity .18s ease;
  z-index: 99999;

  /* look & feel */
  font-family: var(--font-mono, "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .02em;
  color: #111;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  will-change: transform, opacity;
}

.craft-cursor-tip.is-visible { opacity: 1; }
.craft-cursor-tip.is-press { transform: scale(.98); }

/* Visually hide but keep for screen readers */
.u-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* Full-viewport vertical (and horizontal) centering */
.center-vert {
  min-height: 100vh;       /* fill the screen */
  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center (optional) */
}

/* Home hero uses a variable for min-height (refined) */
.home-hero {
  min-height: calc(var(--hero-min, 100dvh) - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 0;
}

@media (min-width: 783px) {
  .admin-bar .home-hero {
    min-height: calc(var(--hero-min, 100dvh) - var(--header-height) - 32px);
  }
}

@media (max-width: 782px) {
  .admin-bar .home-hero {
    min-height: calc(var(--hero-min, 100dvh) - var(--header-height) - 46px);
  }
}

/* Make .slider-image a proper media frame */
.slider-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Ensure <img> and <video> cover the frame */
.slider-image img,
.slider-image .video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* match image cover behavior */
}

/* Optional: if your track relies on fixed slide heights */
.craft-work-slider__slide {
  /* keep your existing dimensions; example: */
  /* min-height: 420px; */
}

/* If your previous CSS expected .video-with-fallback, it remains */
.slider-image.video-with-fallback { /* keep any old rules here */ }

/* Media box gets an aspect-ratio so it has height even without media */
.slider-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;/* <-- sets height */
  border-radius: 8px;
  overflow: hidden;
  background: #111;/* safety bg */
}

/* Make video/img/placeholder fill the frame */
.slider-image .video,
.slider-image img,
.slider-image .related__ph{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Nice-looking placeholder (when no img/video) */
.slider-image .related__ph{
  background:
    linear-gradient(180deg, #1b1b1b, #121212);
  /* Optional checker */
  /* background-image: repeating-linear-gradient(45deg,#1a1a1a 0 10px,#141414 10px 20px); */
}

/* Caption base */
.slider-caption{
  margin-top:12px;
  font-weight:600;
  line-height:1.2;
}

.featured-work__media {
  position:relative;
  aspect-ratio: 16 / 9;   /* adjust to your look */
  overflow:hidden;
}

.featured-work__media .fw-image,
.featured-work__media .fw-video {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.featured-work__caption { margin-top:.6rem; }

/* Stop global link hover from fading slides */
.craft-work-slider .slide-wrap:hover { opacity: 1 !important; }

/* Offset for the hero down-arrow jump */
#work-slider {
  /* This value controls how far from the top the slider sits after the jump */
  scroll-margin-top: calc(var(--header-height) + 80px);
}


.craft-work-slider__slide:hover .slider-caption,
.craft-work-slider__slide:focus-within .slider-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Featured Work: tile defines aspect-ratio, media fills it */
.featured-work__thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Apply to both video + image inside Featured Work tiles */
.featured-work__thumb .fw-video,
.featured-work__thumb .fw-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill the block, no letterboxing */
  object-position: center;    /* keep subject centered */
}

#footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
}

@media (max-width: 768px) {
  #footer-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* MOBILE FIX – force Featured Work titles visible under thumbs */
@media (max-width: 768px) {
  /* Make meta behave like a normal block under the thumbnail */
  .featured-work__meta {
    position: static !important;
    margin-top: 0.75rem;
    display: block !important;
    pointer-events: auto;
  }

  /* Un-hide title + services on mobile */
  .featured-work__title,
  .featured-work__services {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 0.25rem 0;
    padding: 0;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    border: 0 !important;
  }
}

/* =========================================
   MOBILE – Featured Work: 1x1 tiles + titles
   ========================================= */
@media (max-width: 768px) {
  /* Force the grid into a simple vertical stack */
  .featured-work,
  .featured-work .craft-container,
  .featured-work__grid {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  .featured-work__grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  .featured-work__row,
  .featured-work__row--wide-left,
  .featured-work__row--wide-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
  }

  .featured-work__item {
    width: 100%;
  }

  /* 🔲 Make every thumb a perfect 1x1 square */
  .featured-work__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1 !important;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
  }

  .featured-work__thumb img,
  .featured-work__thumb .fw-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* 📛 Put meta under the thumbnail */
  .featured-work__meta {
    position: static !important;
    margin-top: 0.75rem;
    display: block !important;
    pointer-events: auto;
  }

  /* 🧼 Undo the earlier "hide everything" + SR-only styles */
  .featured-work .featured-work__item-title,
  .featured-work .featured-work__title,
  .featured-work .featured-work__services {
    display: block !important;
  }

  .featured-work .featured-work__title,
  .featured-work .featured-work__services {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 0.25rem 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 0 !important;
  }

  .featured-work__title {
    font-size: 1rem;
    font-weight: 500;
  }

  .featured-work__services {
    font-size: 0.75rem;
    color: #aaaaaa;
  }
}

/* Desktop / tablet: all Featured Work tiles same height */
.featured-work__thumb {
  position: relative;
  width: 100%;
  height: var(--featured-work-row-height-desktop); /* one fixed height */
  overflow: hidden;
  background: #111;
  border-radius: 8px;
}

/* Tablet down: slightly shorter but still equal */
@media (max-width: 900px) {
  .featured-work__thumb {
    height: var(--featured-work-row-height-tablet);
  }
}

/* Media fills the box on desktop/tablet */
.featured-work__thumb .fw-video,
.featured-work__thumb .fw-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;     /* crops 1x1 or 16x9 to fit the tile */
  object-position: center;
  display: block;
}

/* Mobile: all cards become 1x1 */
@media (max-width: 768px) {
  .featured-work__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
  }

  .featured-work__thumb .fw-video,
  .featured-work__thumb .fw-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

