/* ============================================================================
   LEUSING-THEME.CSS
   Custom Grav 2 Theme for Leusing Webdesign
   Minimalist agency & portfolio editorial design — written cleanly from scratch.
   ============================================================================
   TABLE OF CONTENTS:
   01. Design Tokens & Reset
   02. Typography & Base Elements
   03. Layout Containers & Section Variants
   04. Page Transition & Scroll Reveal Animations
   05. Header, Navigation & Mobile Overlay
   06. Hero Section & Hero Image Reveal
   07. Portfolio Grid & Project Pages
   08. Blog Listing, Categories & Single Posts
   09. Shortcodes & Editorial Components (Columns, Gallery, FAQ, CTA, Callout)
   10. Bold Bottom Project / Post Navigation (#project-nav)
   11. Footer & Circular Scroll-Progress Button (.progress-page)
   12. Lightbox Modal
   13. Responsive Breakpoints & Reduced Motion
   ============================================================================ */


/* ============================================================================
   01. DESIGN TOKENS & RESET
   ============================================================================ */

:root {
  --color-bg: #ffffff;
  --color-bg-header: rgba(255, 255, 255, 0.94);
  --color-bg-header-hero: rgba(255, 255, 255, 0.88);
  --color-bg-floating: rgba(255, 255, 255, 0.92);
  --color-surface: #f2f2f2;
  --color-surface-medium: #eeeeee;
  --color-surface-dark: #111111;
  --color-overlay-dark: rgba(0, 0, 0, 0.92);
  --color-accent: #ffe760;
  --color-badge: #ff1b0b;
  --color-ink: #000000;
  --color-ink-strong: #1a1a1a;
  --color-ink-hover: #333333;
  --color-text: #595959;
  --color-muted: #666666;
  --color-dim: #bbbbbb;
  --color-nav-dim: rgba(0, 0, 0, 0.38);
  --color-line: #cccccc;
  --color-subtle: #dddddd;
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border: rgba(0, 0, 0, 0.12);
  --color-border-medium: rgba(0, 0, 0, 0.16);
  --color-border-nav: rgba(0, 0, 0, 0.2);
  --color-border-strong: rgba(0, 0, 0, 0.25);
  --color-on-dark-text: rgba(255, 255, 255, 0.78);
  --color-on-dark-muted: #b5b5b5;
  --color-on-dark-border: rgba(255, 255, 255, 0.35);

  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: 60px;
  --max-width: 1580px;
  --narrow-width: 860px;
  --header-height: 110px;
  --radius-sm: 3px;

  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-inout: cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
  font-size: 16px;
  background-color: var(--color-bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open,
body.lightbox-open {
  overflow: hidden;
}

::selection {
  background: var(--color-surface-medium);
  color: var(--color-ink);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

figure {
  margin: 0;
}

a {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

a:hover {
  color: var(--color-ink);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 0.75rem 1.25rem;
  z-index: 9999;
  font-family: var(--font-heading);
  font-size: 0.875rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}


/* ============================================================================
   02. TYPOGRAPHY & BASE ELEMENTS
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 1rem 0;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.24;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  line-height: 1.3;
  margin-top: 2.5rem;
}

h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.4;
  margin-top: 2rem;
}

h4 {
  font-size: 1.15rem;
  line-height: 1.45;
  margin-top: 1.5rem;
}

h5 {
  font-size: 1rem;
  line-height: 1.5;
}

h6 {
  font-size: 0.875rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2:first-child,
h3:first-child,
h4:first-child {
  margin-top: 0;
}

p {
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
  line-height: 1.78;
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

p.pre,
.pre {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.65rem;
  display: block;
}

.bigger {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-ink-strong);
}

strong, b {
  font-weight: 500;
  color: var(--color-ink-strong);
}

/* Content links get a clean subtle underline for readability */
.content-section p a,
.content-section li a,
.project-fact dd a,
.post-body a {
  border-bottom: 1px solid var(--color-border-strong);
  padding-bottom: 1px;
}

.content-section p a:hover,
.content-section li a:hover,
.project-fact dd a:hover,
.post-body a:hover {
  border-bottom-color: var(--color-ink);
}

.content-section a.btn-outline,
.content-section a.btn-primary,
.content-section .portfolio-card-link,
.content-section .blog-card a {
  border-bottom: none;
  padding-bottom: 0;
}

/* Editorial heading accent dash */
.title-has-line {
  position: relative;
  margin-bottom: 1.4rem;
}

.title-has-line::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 0.68em;
  width: 24px;
  height: 1px;
  background-color: var(--color-line);
}

ul, ol {
  margin: 0 0 1.5rem 1.35rem;
  padding: 0;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
  color: var(--color-text);
}

li > ul,
li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem 1.25rem 2rem;
  border-left: 2px solid var(--color-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--color-ink-strong);
  background: var(--color-surface);
}

blockquote p {
  color: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-ink-strong);
}

pre {
  background: var(--color-surface);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  margin: 0 0 1.5rem 0;
}

pre code {
  background: transparent;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-ink);
  border-bottom: 2px solid var(--color-ink);
}

/* Buttons */
.btn-outline,
.btn-primary {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.75rem !important;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn-outline {
  color: var(--color-ink);
  border: 1px solid var(--color-ink) !important;
  background: transparent;
}

.btn-outline:hover {
  background: var(--color-ink);
  color: var(--color-bg);
}

.btn-primary {
  color: var(--color-bg);
  background: var(--color-ink);
  border: 1px solid var(--color-ink) !important;
}

.btn-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent) !important;
  color: var(--color-ink);
}

/* Solid black editorial button with smooth wipe hover */
.btn-dark {
  display: inline-block;
  position: relative;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 16px;
  padding: 16px 30px;
  color: var(--color-bg);
  background-color: var(--color-ink);
  border: none;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--color-ink-hover);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.22s var(--ease-out);
  z-index: 0;
}

.btn-dark span {
  position: relative;
  z-index: 1;
}

.btn-dark:hover {
  color: var(--color-bg);
}

.btn-dark:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}


/* ============================================================================
   03. LAYOUT CONTAINERS & SECTION VARIANTS
   ============================================================================ */

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

.container-narrow {
  max-width: calc(var(--narrow-width) + 4rem);
  padding-left: 2rem;
  padding-right: 2rem;
}

.container-wide {
  max-width: 1680px;
}

.container-full {
  max-width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Asymmetric Right-Half Editorial Layout (matches original /webdesign-muenster/) */
.right-half-inner {
  width: 50%;
  margin-left: 50%;
  padding-left: 1.5rem;
}

.layout-right-half .content-section {
  padding-top: 1.5rem;
  padding-bottom: 5rem;
}

.right-half-inner h2,
.right-half-inner h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 36px;
  font-weight: 600;
  color: var(--color-ink);
  margin: 4.5rem 0 1.4rem 0;
  position: relative;
}

.right-half-inner h2:first-child,
.right-half-inner h3:first-child {
  margin-top: 0;
}

.right-half-inner h3 + h3,
.right-half-inner h2 + h2 {
  margin-top: 0.35rem;
}

.right-half-inner h2::before,
.right-half-inner h3::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 18px;
  width: 25px;
  height: 1px;
  background-color: var(--color-line);
}

.right-half-inner p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 28px;
  color: var(--color-muted);
  margin: 0 0 1rem 0;
}

/* Animated underline link ([Portfolio](/){.link}) */
.content-section a.link {
  display: inline-block;
  position: relative;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-ink);
  border-bottom: none;
  padding-bottom: 3px;
  margin-top: 0.75rem;
}

.content-section a.big {
  font-size:1.25rem;
  font-weight: 600;
}

.content-section a.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-border-medium);
}

.content-section a.link::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s var(--ease-out);
}

.content-section a.link:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* Compact Topic Icon Grid ([icon-grid]) */
.icon-grid {
  display: grid;
  gap: 2.5rem 2rem;
  margin: 4rem 0 4.5rem;
}

.icon-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.icon-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.topic-icon {
  color: var(--color-ink);
  margin: 0 0 0.85rem 0;
  line-height: 1;
}

.topic-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.icon-grid-label {
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

#main {
  padding-top: var(--header-height);
  min-height: 70vh;
}

.content-section {
  padding: 8rem 0;
  position: relative;
}

.content-section + .content-section {
  padding-top: 2.5rem;
}

.section-light {
  background-color: var(--color-surface);
  padding: 5rem 0;
  margin: 2rem 0;
}

.section-dark {
  background-color: var(--color-surface-dark);
  color: var(--color-on-dark-text);
  padding: 5rem 0;
  margin: 2rem 0;
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark strong,
.section-dark a {
  color: var(--color-bg);
}

.section-dark p,
.section-dark li {
  color: var(--color-on-dark-text);
}

.section-dark .title-has-line::before {
  background-color: var(--color-on-dark-border);
}

.section-accent {
  background-color: var(--color-accent);
  color: var(--color-ink);
  padding: 5rem 0;
  margin: 2rem 0;
}

.section-accent p,
.section-accent li {
  color: var(--color-ink-strong);
}

.text-align-center {
  text-align: center;
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

.content-spacer {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  pointer-events: none;
}


/* ============================================================================
   04. PAGE TRANSITION & SCROLL REVEAL ANIMATIONS
   ============================================================================ */

/* Page entrance curtain */
.page-transition-curtain {
  position: fixed;
  inset: 0;
  background: var(--color-ink);
  z-index: 900;
  pointer-events: none;
  transform: translateY(-101%);
  transition: transform 0.38s var(--ease-inout);
}

body.is-leaving .page-transition-curtain {
  transform: translateY(0%);
}

/* Smooth page content entrance (opacity-only so position:fixed & background-attachment:fixed stay viewport-anchored) */
#page-wrapper {
  animation: pageFadeIn 0.38s var(--ease-out);
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Progressive scroll reveal — smooth 72px upward glide (visible without JS) */
.js-ready .reveal-on-scroll {
  opacity: 0;
  transform: translateY(72px);
  transition: opacity 0.95s var(--ease-out) 0.08s, transform 0.95s var(--ease-out) 0.08s;
}

.js-ready .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================================
   05. HEADER, NAVIGATION & MOBILE OVERLAY
   ============================================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 200;
  background-color: var(--color-bg-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.28s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--color-border-subtle);
}

.site-header.nav-hide {
  transform: translateY(-100%);
}

#header-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

#logo {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

#logo a {
  display: block;
}

#logo img {
  height: 52px;
  width: auto;
}

#logo img.white-logo {
  display: none;
}

/* Desktop Main Navigation */
.mainnav {
  display: block;
}

ul.nav.nav-main {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

ul.nav.nav-main > li {
  position: relative;
  margin: 0 0 0 56px;
  padding: 0;
  line-height: 1;
}

ul.nav.nav-main > li:first-child {
  margin-left: 0;
}

/* Hairline separator between top-level nav items */
ul.nav.nav-main > li::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 50%;
  width: 18px;
  height: 1px;
  background-color: var(--color-border-nav);
}

ul.nav.nav-main > li:first-child::before {
  display: none;
}

ul.nav.nav-main > li > a {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink);
  padding: 14px 0;
  white-space: nowrap;
  transition: color 0.25s ease, opacity 0.25s ease;
}

/* Hover dimming of sibling nav links */
ul.nav.nav-main:hover > li > a {
  color: var(--color-nav-dim);
}

ul.nav.nav-main > li:hover > a {
  color: var(--color-ink);
}

/* Language switcher pill emphasis */
ul.nav.nav-main > li.nav-lang > a {
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Desktop Dropdown Submenu (dark popover with top caret) */
ul.nav.nav-main li .sub-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: -14px;
  min-width: 240px;
  background: var(--color-ink);
  border-radius: var(--radius-sm);
  padding: 18px 0 12px;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  box-shadow: 0 14px 36px var(--color-border-medium);
  z-index: 220;
}

ul.nav.nav-main li .sub-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 22px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px;
  border-color: transparent transparent var(--color-ink);
}

/* Invisible hover bridge so moving mouse into dropdown stays open */
ul.nav.nav-main li .sub-menu::after {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

ul.nav.nav-main li.has-sub:hover > .sub-menu,
ul.nav.nav-main li.has-sub:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

ul.nav.nav-main li .sub-menu li {
  margin: 0;
  padding: 0;
}

ul.nav.nav-main li .sub-menu li a {
  display: block;
  padding: 8px 22px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-on-dark-muted);
  white-space: nowrap;
}

ul.nav.nav-main li .sub-menu li a:hover,
ul.nav.nav-main li .sub-menu li a.active {
  color: var(--color-bg);
}

/* Hamburger Toggle (visible below 1024px) */
.hamburger {
  display: none;
  position: relative;
  width: 26px;
  height: 20px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 310;
}

.hamburger span {
  display: block;
  position: absolute;
  right: 0;
  height: 2px;
  width: 100%;
  background: var(--color-ink);
  transition: transform 0.22s ease, opacity 0.2s ease, width 0.2s ease, top 0.22s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2),
.hamburger span:nth-child(3) { top: 8px; }
.hamburger span:nth-child(4) { top: 16px; width: 65%; }

.hamburger:hover span:nth-child(4) { width: 100%; }

.hamburger.active span:nth-child(1),
.hamburger.active span:nth-child(4) {
  top: 8px;
  width: 0;
  opacity: 0;
}

.hamburger.active span:nth-child(2) { transform: rotate(45deg); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); }

/* Mobile Full-Screen Overlay Menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: var(--color-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-overlay-inner {
  padding: calc(var(--header-height) + 2rem) 2rem 4rem;
  max-width: 560px;
  margin: 0 auto;
}

.mobile-nav-list,
.mobile-sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list > li {
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.mobile-nav-list > li > a,
.mobile-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.mobile-sub-toggle::after {
  content: "+";
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

.mobile-has-sub.is-open > .mobile-sub-toggle::after {
  content: "−";
  color: var(--color-ink);
}

.mobile-sub-menu {
  display: none;
  padding: 0 0 1rem 1rem;
}

.mobile-has-sub.is-open > .mobile-sub-menu {
  display: block;
}

.mobile-sub-menu li {
  margin: 0;
}

.mobile-sub-menu li a {
  display: block;
  padding: 0.45rem 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
}

.mobile-sub-menu li a:hover {
  color: var(--color-ink);
}

.mobile-lang > a {
  color: var(--color-muted);
}


/* ============================================================================
   06. HERO SECTION & HERO IMAGE REVEAL
   ============================================================================ */

.hero {
  padding: 8rem 0 8rem;
  position: relative;
}

.hero-caption {
  max-width: 1040px;
}

.hero-scroll-fade .hero-caption {
  will-change: opacity;
}

.hero-scroll-fade .hero-subtitle {
  animation: heroFadeIn 0.65s var(--ease-out) 0.1s both;
}

.hero-scroll-fade .hero-title {
  animation: heroFadeIn 0.7s var(--ease-out) 0.18s both;
}

.hero-scroll-fade .hero-lead {
  animation: heroFadeIn 0.75s var(--ease-out) 0.28s both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
  animation: heroSlideUp 0.65s var(--ease-out) 0.1s both;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  max-width: 700px;
  font-weight: 600;
  line-height: 1.22;
  color: var(--color-ink);
  margin-bottom: 1.25rem;
  animation: heroSlideUp 0.7s var(--ease-out) 0.18s both;
}

.hero-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 1040px;
  animation: heroSlideUp 0.75s var(--ease-out) 0.28s both;
}

.hero-meta {
  margin-bottom: 1.25rem;
  animation: heroSlideUp 0.6s var(--ease-out) 0.05s both;
}

@keyframes heroSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Framed Hero Image Reveal */
.hero-media-frame {
  position: relative;
  margin-top: 3.5rem;
  overflow: hidden;
  width: 100%;
  max-height: 78vh;
  background: var(--color-surface);
}

.hero-media-img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.1s var(--ease-out);
}

.hero-media-frame.is-revealed .hero-media-img,
body:not(.js-ready) .hero-media-img {
  transform: scale(1);
}

/* Side white framing borders that gracefully retract on reveal */
.hero-media-curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--gutter);
  background: var(--color-bg);
  z-index: 2;
  pointer-events: none;
  transition: transform 0.9s var(--ease-inout);
}

.hero-curtain-left {
  left: 0;
  transform: translateX(0);
}

.hero-curtain-right {
  right: 0;
  transform: translateX(0);
}

.hero-media-frame.is-revealed .hero-curtain-left {
  transform: translateX(-65%);
}

.hero-media-frame.is-revealed .hero-curtain-right {
  transform: translateX(65%);
}

/* ============================================================================
   06b. PORTFOLIO PROJECT & BLOG POST SCROLL-REVEAL HERO
   ============================================================================ */

body.template-project #main,
body.template-post #main {
  padding-top: 0;
}

body.template-project #site-header,
body.template-post #site-header {
  background-color: var(--color-bg-header-hero);
}

#hero.hero-project-reveal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

#hero.hero-project-reveal #hero-styles {
  position: relative;
  width: 100%;
  height: 100%;
}

#hero.hero-project-reveal #hero-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: calc(var(--header-height) * 0.65) var(--gutter) 0;
  box-sizing: border-box;
  will-change: transform, opacity;
}

#hero.hero-project-reveal .hero-caption-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

#hero.hero-project-reveal .hero-subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 30px;
  font-weight: 400;
  color: var(--color-muted);
  margin: 0 0 2rem 0;
  animation: none;
}

#hero.hero-project-reveal .hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.25;
  font-weight: 600;
  color: var(--color-ink);
  max-width: 720px;
  margin: 0 auto;
  animation: none;
}

/* Word-by-word hero entrance reveal */
#hero.hero-project-reveal .hero-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin: 0 0.14em;
}

#hero.hero-project-reveal .hero-word-inner {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.6s var(--ease-out);
}

#hero.hero-project-reveal.is-animated .hero-subtitle .hero-word-inner {
  transform: translateY(0);
  transition-delay: 0.12s;
}

#hero.hero-project-reveal.is-animated .hero-title .hero-word-inner {
  transform: translateY(0);
  transition-delay: 0.24s;
}

#hero-height {
  position: relative;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Compact scroll-reveal hero when a post/project has no featured image */
#hero.hero-project-reveal.no-hero-image,
#hero-height.no-hero-image {
  height: clamp(400px, 64vh, 580px);
}

#hero-image.hero-reveal-image {
  position: relative;
  width: 100%;
  height: 100vh;
  z-index: 2;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  overflow: hidden;
  background-color: var(--color-surface);
  will-change: opacity;
}

.js-ready #hero-image.hero-reveal-image {
  opacity: 0;
}

#hero-image.hero-reveal-image.bgrelative {
  background-attachment: scroll;
}

#image-border-left,
#image-border-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(180px, 22vw, 380px);
  background: var(--color-bg);
  z-index: 3;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

#image-border-left {
  left: 0;
}

#image-border-right {
  right: 0;
}

.hero-image-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Solid white main-content layer gliding cleanly over fixed hero */
.project-detail-content,
.post-detail-content {
  position: relative;
  z-index: 3;
  background: var(--color-bg);
}

.post-detail-content.no-hero-image .post-body {
  padding-top: 1rem;
}


/* ============================================================================
   07. PORTFOLIO GRID & PROJECT PAGES
   ============================================================================ */

.portfolio-section {
  padding: 1rem 0 6rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  list-style: none;
  margin: 0 0 3rem 0;
  padding: 0;
}

.category-pills li {
  margin: 0;
}

.category-pills a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.category-pills a:hover,
.category-pills a.active {
  color: var(--color-ink);
  border-bottom-color: var(--color-ink);
}

/* Pure CSS Grid 3-Column Masonry Portfolio Layout */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(270px, 24vw, 370px);
  grid-auto-flow: dense;
  gap: 3.25rem 2.75rem;
  align-items: stretch;
}

.portfolio-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.portfolio-item.item-normal {
  grid-column: span 1;
  grid-row: span 1;
}

.portfolio-item.item-tall {
  grid-column: span 1;
  grid-row: span 2;
}

.portfolio-item.item-wide {
  grid-column: span 2;
  grid-row: span 2;
}

.portfolio-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.portfolio-card-media {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface);
  width: 100%;
}

.portfolio-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.55s var(--ease-out);
}

.portfolio-card-link:hover .portfolio-card-media img {
  transform: scale(1.035);
}

.portfolio-card-caption {
  flex: 0 0 auto;
  padding-top: 1.05rem;
  text-align: center;
}

.item-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.35vw, 1.32rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-ink);
  margin: 0 0 0.3rem 0;
}

.item-badge {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-badge);
  vertical-align: super;
  margin-left: 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-cat {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-muted);
}

/* ============================================================================
   07b. PORTFOLIO DETAIL TYPOGRAPHY, PROJECT-INFO & SHOWCASE (Original leusing.de)
   ============================================================================ */

.project-detail-content .container,
.project-detail-content > .gallery-grid,
.project-detail-content > .grid-columns {
  padding-left: 200px;
  padding-right: 200px;
}

.project-detail-content .container-narrow {
  max-width: calc(var(--narrow-width) + 400px);
  padding-left: 200px;
  padding-right: 200px;
}

.project-detail-content .content-section {
  padding: 5.5rem 0 4.5rem;
}

.project-detail-content .content-section.section-narrow {
  padding: 6.5rem 0 5rem;
}

/* Plain-Markdown portfolio flow: centered prose column, 100%-wide images, 2-col [project-meta] split */
.project-body > .container > h2,
.project-body > .container > h3,
.project-body > .container > h4,
.project-body > .container > p,
.project-body > .container > ul,
.project-body > .container > ol,
.project-body > .container > blockquote {
  max-width: var(--narrow-width);
  margin-left: auto;
  margin-right: auto;
}

.project-body > .container > figure.project-showcase {
  margin: 4rem auto;
}

.project-body > .container > figure.project-showcase + figure.project-showcase {
  margin-top: 2.5rem;
}

.project-body > .container > figure.project-showcase + h2,
.project-body > .container > figure.project-showcase + p,
.project-body > .container > .gallery-grid + h2,
.project-body > .container > .gallery-grid + p {
  margin-top: 5rem;
}

.project-body > .container > .project-showcase-linked {
  cursor: pointer;
}

.project-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 4.5rem;
  align-items: start;
  margin: 5.5rem 0;
}

.project-split:first-child {
  margin-top: 0;
}

.project-info-solo {
  max-width: var(--narrow-width);
  margin: 4rem auto;
}

/* Match leusing.de original project typography: 24px/36px Poppins 600 + left dash */
.project-detail-content h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 36px;
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 22px 0;
  position: relative;
}

.project-detail-content h2::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 18px;
  width: 25px;
  height: 1px;
  background-color: var(--color-line);
}

.project-detail-content p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 28px;
  font-weight: 400;
  color: var(--color-muted);
  margin: 0 0 14px 0;
}

.project-detail-content p:last-child {
  margin-bottom: 0;
}

.project-detail-content strong,
.project-detail-content b {
  font-weight: 500;
  color: var(--color-ink);
}

/* Left-column Markdown project metadata block ([col class="project-info"]) */
.project-info p {
  margin: 0 0 1.35rem 0;
  line-height: 26px;
}

.project-info p strong {
  display: inline-block;
  color: var(--color-ink);
  font-weight: 500;
  margin-bottom: 2px;
}

.project-info a {
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-border-strong);
}

.project-info a:hover {
  border-bottom-color: var(--color-ink);
}

/* Standalone & nested [showcase] frames */
.showcase-wrap {
  padding: 1.5rem 0;
}

.container .showcase-wrap {
  padding: 1.5rem 0;
}

.container .showcase-wrap > .container {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}

.project-showcase {
  margin: 0 auto;
  text-align: center;
  cursor: zoom-in;
}

.project-showcase img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: var(--color-surface);
}

.project-showcase figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}

/* Standalone gallery directly inside project-detail-content gets container framing */
.project-detail-content > .gallery-grid,
.project-detail-content > .grid-columns {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}


/* ============================================================================
   08. BLOG LISTING, CATEGORIES & SINGLE POSTS
   ============================================================================ */

.taxonomy-description {
  padding: 0 0 8rem;
}

.taxonomy-description .container > * {
  max-width: var(--narrow-width);
}

/* Centered Blog & Category Intro Hero */
.hero-blog-intro {
  padding: 7rem 0 6.5rem;
  text-align: center;
}

.hero-blog-intro .hero-caption {
  max-width: 780px;
  margin: 0 auto;
}

.hero-blog-intro .hero-title {
  max-width: 740px;
  margin-left: auto;
  margin-right: auto;
}

.hero-blog-intro .blog-intro-description,
.hero-blog-intro .hero-lead {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-muted);
}

.hero-blog-intro .blog-intro-description p:last-child {
  margin-bottom: 0;
}

.blog-listing-section {
  padding: 1rem 0 4rem;
}

.blog-entry {
  margin-bottom: 10rem;
}

.blog-entry:last-child {
  margin-bottom: 3rem;
}

.blog-entry .post-image {
  max-width: 1120px;
  overflow: hidden;
  background: var(--color-surface);
  margin: 0 auto 2.5rem;
}

.blog-entry .post-image img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  transition: transform 0.55s var(--ease-out);
}

.blog-entry .post-image a:hover img {
  transform: scale(1.025);
}

.article-meta-bar {
  max-width: 1120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 auto 2rem;
}

/* Entry Meta with animated bottom underline */
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-meta li {
  margin: 0;
  position: relative;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-muted);
}

.entry-meta li a {
  display: inline-block;
  position: relative;
  color: var(--color-ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--color-border-nav);
}

.entry-meta li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--color-ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s var(--ease-out);
}

.entry-meta li a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.article-summary {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
}

.post-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 1.25rem 0;
}

.post-title a:hover {
  opacity: 0.65;
}

.post-excerpt {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 2rem;
}

.read-more-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--color-ink);
}

.read-more-link:hover {
  opacity: 0.6;
}

/* Single Post Bottom Meta */
.article-meta-data {
  padding: 2.5rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.article-meta-data .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Blog Pagination (#blog-navigation) */
#blog-navigation {
  margin: 8rem auto;
  text-align: center;
}

.blog-numbers,
.big-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 2.25rem;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.blog-page-num {
  color: var(--color-muted);
  transition: color 0.2s ease;
}

a.blog-page-num:hover {
  color: var(--color-ink);
}

.blog-page-num.blog-active {
  color: var(--color-ink);
}


/* ============================================================================
   09. SHORTCODES & EDITORIAL COMPONENTS
   ============================================================================ */

/* Responsive Multi-Column Shortcode [columns cols="2|3|4"] */
.grid-columns {
  display: grid;
  gap: 2.5rem 3.5rem;
  margin: 2rem 0;
}

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-ratio-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid-ratio-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.grid-col > *:first-child { margin-top: 0; }
.grid-col > *:last-child { margin-bottom: 0; }

/* Gallery Grid Shortcode [gallery cols="2|3|4"] */
.gallery-grid {
  display: grid;
  gap: 1.75rem;
  margin: 2.5rem 0;
}

.gallery-cols-1 { grid-template-columns: 1fr; }
.gallery-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gallery-grid figure {
  overflow: hidden;
  background: transparent;
}

.gallery-grid.gallery-lightbox figure {
  cursor: zoom-in;
}

.gallery-grid figure img {
  width: 100%;
  height: auto;
  background: var(--color-surface);
  transition: transform 0.45s var(--ease-out);
}

.gallery-grid.gallery-lightbox figure:hover img {
  transform: scale(1.025);
}

.gallery-grid figcaption {
  padding: 0.7rem 0.25rem 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--color-muted);
  text-align: center;
}

/* Content Figure Shortcode [figure] */
.content-figure {
  margin: 2.5rem 0;
}

.content-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* Checkmark List [checkmark] */
ul.checkmark {
  list-style: none;
  margin-left: 0;
}

ul.checkmark li {
  position: relative;
  padding-left: 1.75rem;
}

ul.checkmark li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-ink);
  font-weight: 700;
}

/* Callout Box [callout side="left|right"] */
.calloutbox-left,
.calloutbox-right {
  display: block;
  width: 38%;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  background: var(--color-surface);
  border-left: 3px solid var(--color-ink);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-ink-strong);
}

.calloutbox-left { float: left; margin-right: 2rem; }
.calloutbox-right { float: right; margin-left: 2rem; }

/* CTA Section & Phone [cta] / [cta-phone] */
.section-cta {
  background: var(--color-surface);
  padding: 4rem 0;
  margin: 3rem 0;
}

.cta-phone {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-ink);
}

.cta-phone svg {
  flex-shrink: 0;
}

.cta-tel a {
  border-bottom: none;
}

/* FAQ Accordion [faq] / [faq-item] */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: 0;
  padding: 1.35rem 0;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
}

.faq-icon {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--color-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--color-ink);
}

.faq-answer {
  display: none;
  padding-bottom: 1.5rem;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Blog Shortcode Grid [blog-posts] */
.blog-shortcode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin: 2.5rem 0;
}

.blog-card a {
  display: block;
}

.blog-card-img {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-surface);
  margin-bottom: 1rem;
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease-out);
}

.blog-card a:hover .blog-card-img img {
  transform: scale(1.04);
}

.blog-card-body h3 {
  font-size: 1.15rem;
  margin: 0.25rem 0 0.5rem;
}

.blog-card-body p {
  font-size: 0.92rem;
}


/* ============================================================================
   10. BOLD BOTTOM PROJECT / POST NAVIGATION (#project-nav)
   ============================================================================ */

#project-nav {
  max-width: 920px;
  margin: 5rem auto 2rem;
  padding: 2rem 2rem 4rem;
  text-align: center;
}

.project-nav-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-ink);
}

.project-nav-link .nav-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-ink);
  transition: opacity 0.25s ease;
}

.project-nav-link .nav-next-post-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-muted);
  transition: color 0.25s ease;
}

.project-nav-link:hover .nav-title {
  opacity: 0.65;
}

.project-nav-link:hover .nav-next-post-title {
  color: var(--color-ink);
}


/* ============================================================================
   11. FOOTER & CIRCULAR SCROLL-PROGRESS BUTTON (.progress-page)
   ============================================================================ */

.site-footer {
  position: relative;
  z-index: 3;
  background: var(--color-bg);
  padding: 4.5rem 0 70px;
  border-top: 0 solid var(--color-border);
  text-align: center;
}

.footer-nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0 auto 8rem;
  padding: 0;
}

.footer-nav li {
  position: relative;
  margin: 0 30px;
  line-height: 1.6;
}

.footer-nav li::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--color-border-nav);
}

.footer-nav li:first-child::before {
  display: none;
}

.footer-nav li a {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-ink);
}

.footer-nav:hover li a {
  color: var(--color-dim);
}

.footer-nav li a:hover {
  color: var(--color-ink);
}

/* Footer Bottom Nav Line: copyright + legal links in one row, aligned under left edge of logo */
.footer-bottom-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1.75rem;
  padding-top: 1.5rem;
  border-top: 0 solid var(--color-border-subtle);
  text-align: left;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal-links li {
  margin: 0;
  line-height: 1.5;
}

.footer-legal-links a {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--color-muted);
}

.footer-legal-links a:hover {
  color: var(--color-ink);
}

.footer-copyright {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--color-muted);
  margin: 0;
}

/* Circular Scroll-Progress & Back-to-Top Button (.progress-page) */
.progress-page {
  position: fixed;
  right: 60px;
  bottom: 56px;
  height: 48px;
  width: 48px;
  border-radius: 50%;
  background: var(--color-bg-floating);
  box-shadow: inset 0 0 0 1px var(--color-border-medium);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  z-index: 150;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.progress-page.is-active.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.progress-page svg.progress-circle {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.progress-page svg.progress-circle path {
  fill: none;
  stroke: var(--color-ink);
  stroke-width: 3;
  transition: stroke-dashoffset 0.06s linear;
}

.scrolltotop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

.arrow-top {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-top: 2px solid var(--color-ink);
  border-left: 2px solid var(--color-ink);
  transform: rotate(45deg);
  transition: top 0.2s ease;
}

.arrow-top-line {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background-color: var(--color-ink);
  transition: height 0.2s ease, top 0.2s ease;
}

.scrolltotop:hover .arrow-top {
  top: 14px;
}

.scrolltotop:hover .arrow-top-line {
  top: 15px;
  height: 17px;
}


/* ============================================================================
   12. LIGHTBOX MODAL
   ============================================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--color-overlay-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 2rem;
}

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

.lightbox-stage {
  max-width: min(92vw, 1300px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  color: var(--color-on-dark-text);
  font-size: 0.9rem;
  margin-top: 0.85rem;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: transparent;
  border: 0;
  color: var(--color-bg);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.75rem;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close { top: 1.25rem; right: 1.5rem; font-size: 2.5rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }


/* ============================================================================
   13. RESPONSIVE BREAKPOINTS & REDUCED MOTION
   ============================================================================ */

@media only screen and (max-width: 1466px) {
  :root {
    --gutter: 100px;
  }

  ul.nav.nav-main > li {
    margin-left: 34px;
  }

  ul.nav.nav-main > li::before {
    left: -23px;
    width: 12px;
  }

  .site-footer {
    padding-bottom: 50px;
  }

  .progress-page {
    right: 28px;
    bottom: 36px;
  }
}

@media only screen and (max-width: 1024px) {
  :root {
    --gutter: 48px;
    --header-height: 88px;
  }

  /* Explicitly beat base ul.nav specificity on tablet/mobile */
  ul.nav.nav-top,
  .mainnav,
  ul.nav.nav-main {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }

  .hero-media-curtain {
    display: none;
  }

  .title-has-line::before,
  .project-detail-content h2::before,
  .right-half-inner h2::before,
  .right-half-inner h3::before {
    display: none;
  }

  .right-half-inner {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }

  #hero.hero-project-reveal,
  #hero.hero-project-reveal.no-hero-image {
    position: relative;
    height: auto;
    padding: calc(var(--header-height) + 3.5rem) 0 3rem;
    pointer-events: auto;
  }

  #hero.hero-project-reveal #hero-caption {
    padding: 0 var(--gutter);
  }

  #hero-height,
  #hero-height.no-hero-image {
    display: none;
  }

  #hero-image.hero-reveal-image,
  .js-ready #hero-image.hero-reveal-image {
    height: 60vh;
    background-attachment: scroll;
    opacity: 1;
  }

  #image-border-left,
  #image-border-right {
    display: none;
  }

  .project-detail-content .container,
  .project-detail-content .container-narrow,
  .project-detail-content > .gallery-grid,
  .project-detail-content > .grid-columns {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .project-detail-content .content-section,
  .project-detail-content .content-section.section-narrow {
    padding: 3.5rem 0 2.5rem;
  }

  .grid-cols-3,
  .grid-cols-4,
  .gallery-cols-4,
  .blog-shortcode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-ratio-1-2,
  .grid-ratio-2-1 {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(250px, 34vw, 320px);
    gap: 2.75rem 2rem;
  }
}

@media only screen and (max-width: 767px) {
  :root {
    --gutter: 24px;
    --header-height: 78px;
  }

  #logo img {
    height: 48px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 2.75rem;
  }

  .portfolio-item.item-normal,
  .portfolio-item.item-tall,
  .portfolio-item.item-wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .portfolio-card-media {
    aspect-ratio: 4 / 3;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .project-split,
  .gallery-cols-2,
  .gallery-cols-3,
  .gallery-cols-4,
  .blog-shortcode-grid {
    grid-template-columns: 1fr;
  }

  .icon-grid-cols-3,
  .icon-grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-entry {
    margin-bottom: 6rem;
  }

  #blog-navigation {
    margin: 5rem auto;
  }

  .calloutbox-left,
  .calloutbox-right {
    float: none;
    width: 100%;
    margin: 1.25rem 0;
  }

  .footer-nav li {
    margin: 0 18px;
  }

  .footer-nav li::before {
    display: none;
  }

  .site-footer {
    padding-bottom: 34px;
  }

  .progress-page {
    right: 18px;
    bottom: 22px;
    width: 44px;
    height: 44px;
  }
}

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

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

  .js-ready .reveal-on-scroll,
  .js-ready #hero-image.hero-reveal-image {
    opacity: 1;
    transform: none;
  }
}
