/* DDK Studios Theme Styles */
:root {
  --bg: #0A0D12;
  --glow-core: #B68B4B;
  --glow-falloff: #1A1610;
  --glow-core-shadow: rgba(182, 139, 75, 0.35);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: var(--bg);
  color: #F7F5F0;
  overflow-x: hidden;
  font-family: 'Manrope', sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.stroked-text {
  color: transparent !important;
  -webkit-text-stroke: 1.5px #F7F5F0;
  text-stroke: 1.5px #F7F5F0;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.7));
}

.slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.slide-img.active-img {
  opacity: 1;
  transform: scale(1);
  z-index: 10;
  pointer-events: auto;
}

.slide-img.leaving-img {
  opacity: 0;
  transform: scale(0.98);
  z-index: 5;
}

.title-line-inner {
  display: inline-block;
  transform: translateY(0%) rotate(0deg);
  opacity: 1;
  filter: blur(0px);
  will-change: transform, opacity, filter;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, filter 0.4s ease;
}

.title-line-inner.is-entering {
  transform: translateY(60%) rotate(1deg);
  opacity: 0;
  filter: blur(8px);
}

.title-line-inner.is-leaving {
  transform: translateY(-60%) rotate(-1deg);
  opacity: 0;
  filter: blur(6px);
  transition: transform 0.3s ease, opacity 0.25s ease, filter 0.25s ease;
}

.heading-title-item, .meta-item {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(3px);
  will-change: transform, opacity, filter;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.heading-title-item.heading-active, .meta-item.meta-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

.float-card {
  visibility: visible !important;
}

.float-frame {
  opacity: 1 !important;
  visibility: visible !important;
  display: block;
}

.step-rail-item .rail-indicator {
  width: 0px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.step-rail-item .rail-tag {
  opacity: 0;
  max-width: 0px;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-rail-item.is-active .rail-num {
  color: var(--glow-core);
  font-weight: 500;
  opacity: 1;
}

.step-rail-item.is-active .rail-indicator {
  width: 36px;
  opacity: 1;
  background-color: var(--glow-core);
}

.step-rail-item.is-active .rail-tag {
  opacity: 1;
  max-width: 170px;
  margin-left: 8px;
  color: #F7F5F0;
}

.hero-text-glow {
  text-shadow: 0 0 55px var(--glow-core);
}

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  animation: loaderFailsafe 0.01s linear 12s forwards;
}

#page-loader.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

html.no-splash #page-loader {
  display: none !important;
}

@keyframes loaderFailsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.loader-accent, .loader-panel {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.loader-accent {
  background: #B68B4B;
}

.loader-panel {
  background: #0A0D12;
  color: #F7F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader-glow {
  position: absolute;
  left: 50%;
  bottom: -35%;
  width: 120vmax;
  height: 70vmax;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(182, 139, 75, 0.20) 0%, rgba(26, 22, 16, 0.10) 45%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.loader-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  line-height: 1;
}

.loader-mask {
  display: inline-block;
  overflow: hidden;
  padding: 0.12em 0.06em 0.2em;
  margin: -0.12em -0.06em -0.2em;
}

.loader-word {
  display: inline-block;
  will-change: transform;
}

/* px, not rem: the root font-size is 14px below 768px (app.css), which would shrink this on phones. */
.loader-logo {
  display: block;
  width: clamp(320px, 33.5vw, 540px);
  max-width: 86vw;
  height: auto;
  aspect-ratio: 505.13 / 43.23;
  object-fit: contain;
  will-change: transform;
}

.loader-word-a { font-weight: 700; }
.loader-word-b {
  font-family: 'Lora', serif;
  font-weight: 400;
  font-style: italic;
  opacity: 0.9;
}

.loader-line {
  position: relative;
  width: min(260px, 56vw);
  height: 1px;
  margin-top: 2.25rem;
  background: rgba(247, 245, 240, 0.14);
  overflow: hidden;
}

.loader-line-fill {
  position: absolute;
  inset: 0;
  background: #B68B4B;
  transform-origin: left center;
  transform: scaleX(0);
}

.loader-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 1.5rem 1.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .loader-meta { padding: 0 3.5rem 2.5rem; }
}

.loader-tag {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 245, 240, 0.5);
}

.loader-count {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  color: #F7F5F0;
  font-variant-numeric: tabular-nums;
}

.works-mask {
  display: block;
  overflow: hidden;
  padding: 0.08em 0 0.16em;
  margin: -0.08em 0 -0.16em;
}

.works-line {
  display: block;
  will-change: transform;
}

.works-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(247, 245, 240, 0.22);
}

.works-marquee-item {
  font-size: clamp(2.75rem, 7.5vw, 6.5rem);
  line-height: 1;
}

.works-dot {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 9999px;
  background: #B68B4B;
  opacity: 0.85;
}

.works-ghost {
  font-size: clamp(9rem, 22vw, 20rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(247, 245, 240, 0.07);
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  overflow-x: clip;
}

/* Anchor landings clear the fixed header, including cross-document /#section links. */
#hero, #about, #works, #services, #contact {
  scroll-margin-top: 5rem;
}

@supports (height: 100svh) {
  section.section-track {
    min-height: 100svh;
  }
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(247, 245, 240, 0.08);
  transition: opacity 0.4s ease;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #B68B4B !important;
  transform: scaleX(0);
  transform-origin: left center;
}

.drawer-panel {
  background: radial-gradient(120% 60% at 100% 0%, rgba(182, 139, 75, 0.16) 0%, transparent 60%), linear-gradient(165deg, #1A1A1A 0%, #111111 55%, #050505 100%);
  box-shadow: inset 1px 0 0 rgba(182, 139, 75, 0.25);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-item {
  border-bottom: 1px solid rgba(247, 245, 240, 0.09);
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#menu-drawer.opacity-100 .drawer-item {
  opacity: 1;
  transform: none;
  transition-delay: calc(140ms + var(--i) * 60ms);
}

.drawer-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  color: rgba(247, 245, 240, 0.7);
  transition: color 0.3s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-link:hover, .drawer-link.is-active {
  color: #F7F5F0;
}

.drawer-link:hover {
  transform: translateX(6px);
}

.drawer-num {
  min-width: 1.5rem;
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.875rem;
  color: rgba(247, 245, 240, 0.35);
  transition: color 0.3s;
}

.drawer-link:hover .drawer-num, .drawer-link.is-active .drawer-num {
  color: #B68B4B;
}

.drawer-label {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.drawer-toggle {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: rgba(247, 245, 240, 0.6);
  transition: color 0.3s;
}

.drawer-toggle:hover {
  color: #B68B4B;
}

.drawer-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-toggle span:last-child {
  transform: translate(-50%, -50%) rotate(90deg);
}

.drawer-toggle[aria-expanded="true"] span:last-child {
  transform: translate(-50%, -50%) rotate(0deg);
}

.drawer-sub {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0s linear 0.45s;
}

.drawer-sub.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.drawer-sub > ul {
  overflow: hidden;
  min-height: 0;
  padding-left: 2.5rem;
}

.drawer-sub li:last-child {
  padding-bottom: 0.9rem;
}

.drawer-sublink {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(247, 245, 240, 0.65);
  transition: color 0.3s;
}

.drawer-sublink::before {
  content: '';
  width: 14px;
  height: 1px;
  background: #B68B4B;
  transition: width 0.3s;
}

.drawer-sublink:hover {
  color: #B68B4B;
}

.drawer-sublink:hover::before {
  width: 26px;
}

@media (max-width: 767px) {
  .nav-cta {
    padding: 0.45rem 0.8rem;
  }
  #service-link {
    min-height: 44px;
  }
  .nav-cta span:last-child {
    display: none;
  }
  header.fixed {
    height: 4rem;
  }
  section.section-track:not(#hero):not(#services):not(#about) {
    padding-top: 6rem;
    padding-bottom: 4.5rem;
  }
  main .group\/list {
    gap: 5rem;
  }
  #contact footer {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
  }
  input, select, textarea {
    font-size: 16px !important;
  }
  #contact-form, #center-image-frame {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #contact-form {
    background: rgba(255, 255, 255, 0.05);
  }
  #menu-drawer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0, 0, 0, 0.88);
  }
  #drawer-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .heading-title-item, .meta-item, .title-line-inner.is-entering, .title-line-inner.is-leaving {
    filter: none !important;
  }
}

/* ==========================================================
MOBILE + TABLET OPTIMISATION
========================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

/* Hero -> About: remove the dead space between the two sections (phones, tablets, portrait iPad Pro) */
@media (max-width: 1023px), (max-width: 1100px) and (orientation: portrait) {
  #about.section-track {
    min-height: 0;
    padding-top: 4rem;
    padding-bottom: 5rem;
  }
}

/* Tablet: tighter section spacing */
@media (min-width: 768px) and (max-width: 1023px) {
  section.section-track:not(#hero):not(#services):not(#about) {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  main .group\/list {
    gap: 6rem;
  }
  .works-marquee {
    margin-top: 3.5rem;
    margin-bottom: 4rem;
  }
}

/* Hero image cards */
@media (max-width: 767px) {
  #hero-floaters {
    opacity: 0.92;
  }
  #hero-floaters > .float-card {
    display: block !important;
    min-width: 0 !important;
    max-width: none !important;
    width: 30vw !important;
    width: min(30vw, 15svh) !important;
  }
  /* top, row 1 */
  #hero-floaters > .float-card:nth-child(11) { left: 2vw !important; top: 10% !important; }
  #hero-floaters > .float-card:nth-child(1)  { left: 35vw !important; top: 8.5% !important; }
  #hero-floaters > .float-card:nth-child(5)  { left: 68vw !important; top: 11% !important; }
  /* top, row 2 */
  #hero-floaters > .float-card:nth-child(2)  { left: -15vw !important; top: 25% !important; }
  #hero-floaters > .float-card:nth-child(10) { left: 18vw !important; top: 23.5% !important; }
  #hero-floaters > .float-card:nth-child(6)  { left: 51vw !important; top: 25.5% !important; }
  #hero-floaters > .float-card:nth-child(7)  { left: 84vw !important; top: 24% !important; }
  /* bottom, row 3 */
  #hero-floaters > .float-card:nth-child(3)  { left: 2vw !important; top: 64% !important; }
  #hero-floaters > .float-card:nth-child(13) { left: 35vw !important; top: 62.5% !important; }
  #hero-floaters > .float-card:nth-child(8)  { left: 68vw !important; top: 64.5% !important; }
  /* bottom, row 4 */
  #hero-floaters > .float-card:nth-child(4)  { left: -15vw !important; top: 80% !important; }
  #hero-floaters > .float-card:nth-child(12) { left: 18vw !important; top: 78.5% !important; }
  #hero-floaters > .float-card:nth-child(14) { left: 51vw !important; top: 80.5% !important; }
  #hero-floaters > .float-card:nth-child(9)  { left: 84vw !important; top: 79% !important; }

  /* About stats: stack cleanly */
  .about-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 2rem;
  }
  .about-stats > span:nth-child(even) {
    display: none;
  }
  .works-marquee {
    margin-top: 2.5rem;
    margin-bottom: 3rem;
  }
}

/* Portrait tablets (and portrait iPad Pro) */
@media (min-width: 768px) and (max-width: 1100px) and (orientation: portrait) {
  #hero-floaters > .float-card {
    display: block !important;
    min-width: 0 !important;
    max-width: none !important;
    width: 18vw !important;
    width: min(18vw, 13.5svh) !important;
  }
  /* top, row 1 */
  #hero-floaters > .float-card:nth-child(11) { left: 5.6vw !important; top: 9.5% !important; }
  #hero-floaters > .float-card:nth-child(1)  { left: 29.2vw !important; top: 8.5% !important; }
  #hero-floaters > .float-card:nth-child(5)  { left: 52.8vw !important; top: 10% !important; }
  #hero-floaters > .float-card:nth-child(6)  { left: 76.4vw !important; top: 9% !important; }
  /* top, row 2 */
  #hero-floaters > .float-card:nth-child(2)  { left: 17.4vw !important; top: 24% !important; }
  #hero-floaters > .float-card:nth-child(10) { left: 41vw !important; top: 23% !important; }
  #hero-floaters > .float-card:nth-child(7)  { left: 64.6vw !important; top: 24.5% !important; }
  /* bottom, row 3 */
  #hero-floaters > .float-card:nth-child(3)  { left: 17.4vw !important; top: 63% !important; }
  #hero-floaters > .float-card:nth-child(13) { left: 41vw !important; top: 62% !important; }
  #hero-floaters > .float-card:nth-child(8)  { left: 64.6vw !important; top: 63.5% !important; }
  /* bottom, row 4 */
  #hero-floaters > .float-card:nth-child(4)  { left: 5.6vw !important; top: 78.5% !important; }
  #hero-floaters > .float-card:nth-child(12) { left: 29.2vw !important; top: 77.5% !important; }
  #hero-floaters > .float-card:nth-child(14) { left: 52.8vw !important; top: 79% !important; }
  #hero-floaters > .float-card:nth-child(9)  { left: 76.4vw !important; top: 78% !important; }
}

/* Very narrow phones: stop header items from colliding */
@media (max-width: 380px) {
  .site-header { padding-left: 1rem; padding-right: 1rem; }
  .nav-cta { padding: 0.4rem 0.6rem; font-size: 10px; letter-spacing: 0.04em; }
  #menu-trigger .font-serif { font-size: 14px; }
}

/* Touch-friendly form + tap targets */
@media (max-width: 1023px) {
  #contact-form input, #contact-form select { min-height: 48px; }
  #contact-form textarea { min-height: 120px; }
  #contact-form button[type="submit"] { min-height: 52px; }
  #contact footer a { display: inline-block; padding: 0.5rem 0; }
  #contact footer #back-to-top { padding: 0.5rem 0; }
  .protected-contact { display: inline-block; padding: 0.5rem 0; }
  .drawer-sublink { min-height: 44px; }
}

@media (max-width: 639px) {
  .form-actions { justify-content: stretch; }
  .form-actions button { width: 100%; }
}

/* Touch devices: a tap must not leave other rows faded */
@media (hover: none) {
  main .works-row {
    opacity: 1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}