:root {
  --black: #000000;
  --cream-light: #f5f4f2;
  --cream: #eeeae7;
  --accent: #ff0000;
  --side-padding: 120px;
  --nav-height: 64px;
  
  /* Mobile variables */
  --mobile-side-padding: 20px;
  --mobile-nav-height: 56px;
  --tablet-side-padding: 40px;
  --tablet-nav-height: 60px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden; /* prevent horizontal scrollbar from any overflowing layers */
}
/* Hide scrollbars globally but keep scrolling enabled */
html,
body {
  scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none; /* WebKit */
}
body {
  margin: 0;
  font-family: "Raleway", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--black);
  background: var(--cream-light);
  /* Enable vertical scroll snapping and smooth behavior */
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

/* Terms section layout */
#terms .section-inner { 
  align-items: start; 
  justify-items: start;
  padding: 0;
  height: 100vh;
  overflow-y: auto;
  display: block;
  grid-row: 1;
}

#terms .terms-topbar { 
  position: sticky;
  top: 0;
  background: var(--cream-light);
  z-index: 10;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--side-padding);
}

#terms .terms-back { 
  display: inline-flex; 
  gap: 6px; 
  align-items: center; 
  color: var(--black); 
  text-decoration: none !important; 
  font-weight: 700; 
  font-size: 18px;
  transition: color 0.2s ease;
  border: none;
  outline: none;
}

#terms .terms-back:hover { 
  color: var(--accent); 
}

.terms-content {
  padding: 0 var(--side-padding) 40px;
  max-width: 1000px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.terms-header {
  grid-column: 1 / -1;
  margin-bottom: 20px;
}

.terms-title { 
  font-weight: 700; 
  font-size: clamp(28px, 4vw, 36px); 
  margin: 0 0 8px;
  line-height: 1.2;
}

.terms-updated { 
  font-size: 14px; 
  opacity: 0.6; 
  margin: 0;
  font-style: italic;
}

.terms-section { 
  margin: 0 0 20px;
  break-inside: avoid;
}

.terms-section:last-child {
  margin-bottom: 0;
}

.terms-section h2 { 
  font-size: clamp(18px, 2.5vw, 20px); 
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--black);
}

.terms-section p { 
  line-height: 1.5; 
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--black);
}

.terms-section p:last-child {
  margin-bottom: 0;
}

.terms-section ul { 
  margin: 0 0 12px;
  padding: 0 0 0 18px;
}

.terms-section li { 
  line-height: 1.5; 
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--black);
}

.terms-section li:last-child {
  margin-bottom: 0;
}

.terms-section a {
  color: var(--accent);
  text-decoration: none;
}

.terms-section a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--cream-light);
  transition: background-color 100ms ease, color 100ms ease,
    transform 300ms ease;
  transform: translateY(-100%); /* hidden by default */
}

/* Override background immediately for contact */
.navbar.navbar-contact {
  background: var(--accent) !important;
  transition: none !important;
}
.navbar.navbar-visible {
  transform: translateY(0); /* shown when scrolled past home */
}
.nav-inner {
  height: var(--nav-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--side-padding);
}
.brand {
  justify-self: start;
}
.cta {
  justify-self: end;
}
.brand,
.cta {
  text-decoration: none;
  color: var(--black);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.1;
  padding: 6px 0;
}
.brand {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: center;
}
.brand .brandmark svg {
  display: block;
}
.brand .brandtext {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  align-items: baseline;
}
.brand .brand-lokko {
  font-weight: 700;
}
.brand .brand-studio {
  font-weight: 400;
}
.cta {
  text-transform: lowercase;
}
.brand:hover,
.cta:hover {
  color: var(--accent);
}

/* Sections: full screen height, with an internal top spacer equal to navbar */
.viewport {
  height: calc(var(--vh, 1vh) * 100);
  width: 100%;
  display: grid;
  grid-template-rows: var(--nav-height) 1fr;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Home section gets full viewport height without navbar spacing */
.section-home {
  grid-template-rows: 1fr;
}

/* Offset content for fixed navbar */
main {
  padding-top: 0;
}

.section-inner {
  padding: 20px var(--side-padding) 60px var(--side-padding);
  display: grid;
  align-items: center;
  justify-items: start;
  grid-row: 2;
  height: 100%;
  min-height: 0; /* allow children to size without forcing overflow */
  text-align: left;
  position: relative;
  z-index: 2;
}

/* Home section inner spans full height */
.section-home .section-inner {
  grid-row: 1;
}

.section-cream {
  background: var(--cream);
}
.section-cream-light {
  background: var(--cream-light);
}
/* Make contact section fully accent */
#contact.section-cream-light {
  background: var(--accent);
}

/* Home section - Full cream light background */
.section-home {
  background: var(--cream-light);
  position: relative;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Show home section after loading */
.section-home.loaded {
  opacity: 1;
}

.home-container {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(var(--vh, 1vh) * 100);
  width: 100%;
  position: relative;
}

.home-top-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transition: opacity 1.2s ease-in-out 0.3s;
}

/* Show home content after section loads */
.section-home.loaded .home-top-content {
  opacity: 1;
}

/* Hide model-viewer loading progress bar */
model-viewer:not([loaded])::part(default-progress-mask) {
  display: none !important;
}

model-viewer:not([loaded])::part(default-progress-bar) {
  display: none !important;
}

model-viewer::part(default-progress-bar) {
  display: none !important;
}

model-viewer::part(default-progress-mask) {
  display: none !important;
}

/* Alternative method to hide loading indicators */
model-viewer .progress-bar {
  display: none !important;
}

model-viewer .loading-bar {
  display: none !important;
}

.home-logo-brandline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-logo {
  color: var(--black);
  display: block;
}

.home-brandline {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: center;
}

.home-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Raleway", sans-serif;
  font-size: clamp(32px, 3vw, 48px);
  color: var(--black);
  text-transform: capitalize;
  letter-spacing: 0.05em;
}

.home-digital {
  font-weight: 400;
}

.home-separator {
  font-weight: 700;
}

.home-innovation {
  font-weight: 400;
}

.home-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 80px;
}

.home-text-layer {
  position: absolute;
  top: 40px;
  right: 40px;
  z-index: 10;
}

.home-text-layer {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.home-text-layer .home-identity,
.home-text-layer .home-subline {
  pointer-events: auto;
}

/* Three.js container inside home model layer */
/* Home model-viewer fills left side */
#home-model {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.home-identity {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px 0;
  justify-items: start;
  text-align: left;
  padding: 0;
}

/* Different gap for top text to LOKKO STUDIO */
.home-top-text {
  margin-bottom: 15px;
}

.home-wordmark {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: baseline;
}
.home-lokko {
  font-weight: 700;
  font-size: 80px;
  color: var(--black);
  letter-spacing: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}
.home-studio {
  font-weight: 400;
  font-size: 80px;
  color: var(--black);
  letter-spacing: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}
.home-top-text {
  font-weight: 700;
  font-size: 64px;
  color: var(--cream-light);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  font-family: "Raleway", sans-serif;
  text-align: left;
}

.home-bottom-text {
  font-weight: 700;
  font-size: 64px;
  color: var(--cream-light);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  font-family: "Raleway", sans-serif;
  text-align: left;
  display: grid;
  gap: 5px;
  width: 100%;
  position: relative;
}

.design-text {
  font-weight: 700;
  font-size: 100px;
  color: var(--cream-light);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  font-family: "Raleway", sans-serif;
  text-align: left;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s ease;
  /* Fixed positioning to prevent movement */
  position: relative;
  line-height: 1;
  height: 100px;
  display: flex;
  align-items: center;
  margin-top: 5px;
  transform-origin: left center;
  /* Initial load animation */
  animation: textEntrance 0.8s ease-out;
}

/* Handwriting font for "design" */
.design-text:not(.scrolled):not(.scrolled-twice) {
  font-family: "Shadows Into Light Two", cursive;
  font-weight: 600;
  font-size: 100px; /* Keep same size */
  line-height: 1;
  height: 100px;
}

/* Code font for "</code>" */
.design-text.scrolled:not(.scrolled-twice) {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 100px; /* Keep same size */
  line-height: 1;
  height: 100px;
}

/* Times New Roman for "publish" */
.design-text.scrolled-twice {
  font-family: "Times New Roman", serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  font-size: 100px !important; /* Keep same size */
  line-height: 1 !important;
  height: 100px !important;
  color: var(--cream-light) !important;
  text-transform: lowercase !important;
  text-align: left !important;
}

.design-text.changing {
  opacity: 0;
  transform: scale(0.9) translateY(-10px);
  filter: blur(2px);
}

/* Entrance animation for initial load */
@keyframes textEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    filter: blur(4px);
  }
  60% {
    opacity: 0.8;
    transform: scale(1.02) translateY(-2px);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Navbar color swap on home via class */
.navbar-accent {
  background: var(--cream-light);
}
.navbar-accent .brand,
.navbar-accent .cta,
.navbar-accent .center-menu .menu-item {
  color: var(--black);
}
.navbar-accent .brand:hover,
.navbar-accent .cta:hover,
.navbar-accent .center-menu .menu-item:hover {
  color: var(--accent);
}

/* Navbar text colors for contact section */
.navbar.navbar-contact .brand,
.navbar.navbar-contact .cta,
.navbar.navbar-contact .center-menu .menu-item {
  color: var(--cream-light) !important;
}
.navbar.navbar-contact .brand:hover,
.navbar.navbar-contact .cta:hover,
.navbar.navbar-contact .center-menu .menu-item:hover {
  color: var(--black) !important;
}

/* Emphasize "let's talk" button on contact navbar */
.navbar.navbar-contact .cta {
  color: var(--black) !important;
  text-decoration: underline;
  font-style: italic;
}

/* Transition navbar colors between sections */
.nav-inner .brand,
.nav-inner .cta,
.center-menu .menu-item {
  transition: color 100ms ease;
}

/* Center menu */
.center-menu {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.menu-item {
  text-decoration: none;
  color: var(--black);
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 700;
  line-height: 1.1;
  padding: 6px 0;
}
.menu-item.active {
  color: var(--accent) !important;
  text-decoration: underline !important;
  font-style: italic !important;
}
.menu-item:hover {
  color: var(--accent);
}

/* Typography */
h2 {
  margin: 0 0 12px;
  font-size: 28px;
}
p {
  margin: 0;
  max-width: 70ch;
}

/* About layout - Two layer approach */
#about .section-inner {
  position: relative; /* Create positioning context for absolute model layer */
}

.about-model-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.about-model-layer model-viewer {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background-color: transparent;
  outline: none;
}

.about-text-layer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allow clicks to pass through to model layer */
}

.about-left {
  justify-self: start;
  text-align: left;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: auto; /* Re-enable pointer events for text */
}

.about-middle-empty {
  /* Empty middle column for spacing */
  min-height: 0;
}

.about-right {
  justify-self: end;
  text-align: left;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: auto; /* Re-enable pointer events for text */
}

.about-line {
  white-space: nowrap;
}
.about-light {
  font-weight: 300;
  font-size: clamp(24px, 4vw, 48px);
}
.about-medium {
  font-weight: 500;
  font-size: clamp(24px, 4vw, 48px);
}
.about-semibold {
  font-weight: 600;
  font-size: clamp(24px, 4vw, 48px);
}

/* Scramble text effect */
.scramble {
  display: inline-block;
  letter-spacing: 0.02em;
  position: relative;
}
.scramble .char {
  display: inline-block;
  transform: translateZ(0);
  will-change: contents, transform, opacity;
}
.scramble .char.hyphen {
  color: var(--cream-light);
}
@media (prefers-reduced-motion: reduce) {
  .scramble .char {
    transition: none !important;
  }
}

/* Ensure content touches edges minus 20px */
main,
header,
section {
  width: 100%;
}

/* Small screen tweaks */
@media (max-width: 480px) {
  :root {
    --nav-height: 56px;
  }
}

/* About page (second) */
.about2-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
  width: 100%;
  height: 100%;
}
.about2-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 100%;
}
.about2-bottom-left {
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 0px;
}

.about2-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about2-bottom-right {
  display: flex;
  align-items: flex-end;
}
.about2-bottom-right p {
  margin: 0;
  font-weight: 300;
  font-size: clamp(20px, 3.2vw, 36px);
  line-height: 1.25;
}

/* Work layout - EXACTLY like highlights2-grid */
.work-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.work-left {
  justify-self: start;
  align-self: start;
}
.work-right {
  justify-self: stretch;
}

/* Ensure work section clips overflow content */
#work .section-inner {
  overflow: hidden;
}

/* Work right side scrollable list - EXACTLY like highlights2-right */
.work-right {
  min-height: 0;
  overflow: hidden;
  display: flex;
}

/* Work vertical list - EXACTLY like highlights2-list */
.work-list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-auto-rows: auto;
  gap: 0px;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  scrollbar-width: none;
  align-content: start;
}
.work-list::-webkit-scrollbar {
  display: none;
}

/* Work items - EXACTLY like highlights2-item */
.work-item {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  align-content: center;
  cursor: pointer;
  border-bottom: 1px solid var(--black);
  padding: 10px 10px;
  position: relative;
  transition: height 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  height: 15vh;
  overflow: hidden;
}

/* Background image overlay - only visible on hover */
.work-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  animation: backgroundMoveTop60 20s ease-in-out infinite, backgroundScale 20s ease-in-out infinite;
}

@keyframes backgroundMove {
  0% {
    background-position: center 5%;
  }
  50% {
    background-position: center 95%;
  }
  100% {
    background-position: center 5%;
  }
}

/* Work items: restrict vertical pan to top 60% only */
@keyframes backgroundMoveTop60 {
  0% {
    background-position: center 5%;
  }
  50% {
    background-position: center 60%;
  }
  100% {
    background-position: center 5%;
  }
}

/* Brands: restrict vertical pan to top 80% */
@keyframes backgroundMoveTop80 {
  0% {
    background-position: center 5%;
  }
  50% {
    background-position: center 80%;
  }
  100% {
    background-position: center 5%;
  }
}

@keyframes backgroundScale {
  0% {
    transform: scale(1.5);
  }
  50% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.5);
  }
}

/* Match work-section style hover: slow pan + scale loop */
@keyframes workImagePanScale {
  0% {
    transform: scale(1.15) translateY(-5%);
  }
  50% {
    transform: scale(1) translateY(5%);
  }
  100% {
    transform: scale(1.15) translateY(-5%);
  }
}

@keyframes brandBackgroundScale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* Accent color overlay - only visible on hover */
.work-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.work-item:hover::before {
  opacity: 0.7;
}

.work-item:hover {
  height: 25vh !important;
}

.work-item:hover h2.work-item-title,
.work-item:hover h4.work-item-detail {
  color: white;
}

/* Mobile work-item height */
@media (max-width: 768px) {
  .work-item {
    height: 8vh;
  }
  
  .brands-item {
    height: 8vh;
  }
}

h2.work-item-title {
  font-weight: 600;
  position: relative;
  z-index: 2;
  color: var(--black);
  transition: color 250ms ease;
}

h4.work-item-detail {
  position: relative;
  z-index: 2;
  color: var(--black);
  transition: color 250ms ease;
}

.work-title-text {
  /* Font styles inherited from h2 */
  font-family: "Raleway", sans-serif;
  margin: 0 0 8px 0;
}

.work-detail-text {
  /* Font styles inherited from h3 */
  font-family: "Raleway", sans-serif;
  margin: 0;
}

/* Work second section */
.work2-grid, .brands-gird {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
  width: 100%;
  height: 100%;
}
h1 {
  font-weight: 700;
  font-size: 50px;
  line-height: 0.9;
  text-transform: lowercase;
  margin: 0;
}

h2 {
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  margin: 0;
  font-family: "Raleway", sans-serif;
}

h3 {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  margin: 0;
  font-family: "Raleway", sans-serif;
}

h4 {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
  font-family: "Raleway", sans-serif;
}

h5 {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.1;
  margin: 0;
  font-family: "Raleway", sans-serif;
}

.work2-bottom {
  display: grid;
  grid-template-rows: 1fr 2fr; /* stats 1fr, logos 2fr */
  gap: 10%;
  min-height: 0;
}

.brands-bottom {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: 0;
}

.brands-items-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  grid-auto-rows: 1fr;
}

/* Preview box at top of brands section */
.brands-preview {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
  border-bottom: none;
}
.brands-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
  animation: backgroundMoveTop80 20s ease-in-out infinite, brandBackgroundScale 20s ease-in-out infinite;
  transform: scale(1);
}
.brands-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cream-light);
  opacity: 0.95;
  z-index: 1;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.brands-preview.active::before {
  opacity: 0;
}

/* When there is an active brand, split the grid equally */
.brands-bottom.has-active {
  grid-template-rows: 1fr 1fr;
}

/* Add padding so left-aligned large text has breathing room */
.brands-bottom > div {
  flex: 1 1 0;
  border-bottom: none;
  color: var(--black);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-transform: none;
  text-align: left;
  line-height: 0.9;
  
  background-color: var(--cream-light);
}

.brands-item {
  flex: 1 1 0;
  position: relative;
  overflow: hidden;
  transition: none !important;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--black);
  transition: border-bottom-width 200ms ease, border-color 200ms ease;
  min-width: 0; /* allow inner text to wrap instead of overflowing */
}

/* Remove all image/overlay pseudo-elements from brand items */
.brands-item::after,
.brands-item::before,
.brands-item:first-child::after,
.brands-item:first-child::before {
  content: none !important;
}

/* Background image overlay for brands - visible by default */
.brands-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: none;
  animation: none;
  transform: none;
}

/* Accent color overlay for brands - visible by default */
.brands-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream-light);
  opacity: 0.95;
  z-index: 1;
  pointer-events: none;
  transition: opacity 250ms ease;
}

/* On hover: remove accent overlay and start zoom animation */
/* No overlay changes on hover */
.brands-item:hover::before {}

/* Active state mirrors hover behavior */
.brands-item.is-active::before {}

/* First brands-item starts in hover state */
.brands-item:hover {
  height: 100% !important;
  flex: 1 1 0 !important;
  border-bottom: 20px solid var(--accent);
}

/* Keep thick accent stroke for active/keyboard-focused states as well */
.brands-item.is-active,
.brands-item:focus-within {
  border-bottom: 20px solid var(--accent);
}

/* Active state sizing mirrors hover */
.brands-item.is-active {
  height: 100% !important;
  flex: 1 1 0 !important;
}

.brands-item:hover::after {}

.brands-item.is-active::after {}

.brands-item a {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
  padding: 10px;
}

.brands-item .brand-detail {
  display: none;
  color: var(--cream-light)!important;
  line-height: inherit;
  margin-top: 0;
  position: relative;
  z-index: 2;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.brands-item .brand-name {
  display: inline-block;
  color: var(--black) !important;
  position: relative;
  z-index: 2;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/*.brands-item:hover {
  border-bottom: 2px solid var(--accent);
}*/

.brands-item:hover .brand-name { color: var(--accent)!important; }

.brands-item.is-active .brand-name { color: var(--accent)!important; }

.brands-item:hover .brand-detail {
  /* display: inline-block; */
}

.work2-stats {
  display: flex; /* re-show stats */
  gap: 60px;
  align-items: flex-end; /* content align to bottom */
  justify-content: start;
  text-align: center;
  /* Fill assigned grid track height */
  align-self: stretch; /* stretch to full 1fr row */
  height: 100%;
  /* Prevent width changes from clamp() font sizes */
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
}

.work2-stat {
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.work2-stat-number {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6.5vw, 64px);
  line-height: 1;
  will-change: auto;
}

.work2-stat-label {
  font-weight: 400;
  font-size: clamp(28px, 5.5vw, 56px);
  line-height: 1.1;
  
  will-change: auto;
}

/* Responsive work2-stats for larger screens */
@media (min-width: 1801px) {
  .work2-stats {
    gap: 80px;
  }
  
  .work2-stat-number {
    font-size: clamp(40px, 7.5vw, 80px);
  }
  
  .work2-stat-label {
    font-size: clamp(32px, 6.5vw, 72px);
  }
}

/* Responsive work2-stats for medium-large screens */
@media (min-width: 1601px) and (max-width: 1800px) {
  .work2-stats {
    gap: 70px;
  }
  
  .work2-stat-number {
    font-size: clamp(36px, 7vw, 72px);
  }
  
  .work2-stat-label {
    font-size: clamp(30px, 6vw, 64px);
  }
}

/* Responsive work2-stats for smaller screens */
@media (max-width: 1600px) {
  .work2-stats {
    gap: 50px;
  }
  
  .work2-stat-number {
    font-size: clamp(28px, 5.5vw, 56px);
  }
  
  .work2-stat-label {
    font-size: clamp(24px, 4.5vw, 48px);
  }
}

@media (max-width: 1300px) {
  .work2-stats {
    gap: 40px;
  }
  
  .work2-stat-number {
    font-size: clamp(24px, 5vw, 48px);
  }
  
  .work2-stat-label {
    font-size: clamp(20px, 4vw, 40px);
  }
}

@media (max-width: 900px) {
  .work2-stats {
    gap: 30px;
  }
  
  .work2-stat-number {
    font-size: clamp(20px, 4vw, 36px);
  }
  
  .work2-stat-label {
    font-size: clamp(16px, 3vw, 28px);
  }
}

.work2-image-wrap {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  min-height: 0;
  align-self: start; /* place at top of its grid row */
  height: 100%; /* fill available height */
  flex: 1 1 auto; /* allow growth in flex/grid contexts */
  display: flex;
  align-items: flex-start; /* content align to top */
  padding: 0;
}

.work2-logos {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: 10px;
  height: 260px; /* fixed height */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
}

.work2-logo {
  position: relative;
  background: var(--cream-light);
  border-radius: 4px;
  overflow: hidden;
}

.work2-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
  display: block;
  transition: opacity 250ms ease;
}

.work2-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Highlights layout */
.highlights-grid {
  display: grid;
  grid-template-rows: minmax(0, auto) 1fr;
  gap: 20px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.highlights-top {
  padding-bottom: 8px;
}
.highlights-bottom {
  background: var(--cream-light);
  /* Ensure it strictly fills remaining space and clips overflow */
  min-height: 0;
  overflow: auto; /* allow vertical scrolling when used as scroller */
  display: flex;
  flex-direction: column; /* stack children vertically so content height can grow */
  height: 100%;
  max-height: 100%;
}

.highlights-list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 0 40px;
  padding-right: 6px; /* breathing room for hidden scrollbar */
  -webkit-overflow-scrolling: touch;
  /* Allow it to shrink grow within the clipped container */
  flex: 1 1 auto;
  /* Hide scrollbars cross-browser */
  scrollbar-width: none; /* Firefox */
  align-content: start;
  align-items: start;
}
.highlights-list::-webkit-scrollbar {
  display: none; /* WebKit */
}
.highlights-item {
  display: grid;
  grid-template-rows: auto auto;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
  /* Make each grid cell a square */
  aspect-ratio: 1 / 1;
  align-self: stretch;
  justify-self: stretch;
  padding: 10px;
  overflow: hidden;
  align-content: end;
  align-items: end;
  border-bottom: 1px solid var(--black);
}

.highlights-item:hover {
  background-color: var(--accent);
}

/* Requested typography: titles 24pt semibold, details 24pt very light */
h5.highlights-title {
  font-weight: 600; /* semibold */
  line-height: 1;
}

h5.highlights-detail {
  font-weight: 200; /* very light */
  line-height: 1;
}

/* Highlights second section */
.highlights2-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.highlights2-left {
  justify-self: start;
  align-self: start;
}
.highlights2-right {
  justify-self: stretch;
}

/* Highlights2 right side scrollable list */
.highlights2-right {
  min-height: 0;
  overflow: hidden;
  display: flex;
}
.highlights2-list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-auto-rows: auto;
  gap: 10px;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  scrollbar-width: none;
  align-content: start;
}
.highlights2-list::-webkit-scrollbar {
  display: none;
}
.highlights2-item {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  align-content: start;
}

h1.highlights2-item-title {
  font-weight: 600;
}

/* Academy layout */
.academy-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  width: 100%;
  height: 100%;
  align-items: stretch;
}
.academy-left {
  justify-self: start;
  align-self: start;
}
.academy-right {
  justify-self: stretch;
  min-height: 0;
  display: flex;
}
.academy-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  height: 100%;
  flex: 1 1 auto;
}
.academy-box {
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--black);
  transition: border-bottom-width 200ms ease, border-color 200ms ease;
}

/* Academy images fill like work cards */
.academy-box {
  position: relative;
  overflow: hidden;
}
.academy-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform 250ms ease;
  will-change: transform;
  animation: workImagePanScale 20s ease-in-out infinite;
}
.academy-box:hover .academy-image { animation: workImagePanScale 20s ease-in-out infinite; }

/* Academy overlay and text (mirrors work cards) */
.academy-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream-light);
  opacity: 0.95;
  transition: opacity 250ms ease;
  z-index: 1;
  border-radius: 0;
}
.academy-box:hover::before {
  background: var(--accent);
  opacity: 0.7;
}

.academy-box:hover {
  border-bottom: 1px solid var(--accent);
}
.academy-box:hover .academy-text {
  color: var(--cream-light);
}
.academy-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  color: var(--black);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.academy-title-text {
  /* Font styles inherited from h2 */
  font-family: "Raleway", sans-serif;
  margin: 0 0 6px 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.academy-detail-text {
  /* Font styles inherited from h3 */
  font-family: "Raleway", sans-serif;
  margin: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Contact layout */
.contact-grid {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 20px;
  width: 100%;
  height: 100%;
  align-content: center;
  justify-items: center;
  position: relative;
  z-index: 2;
}
.contact-title {
  /* Font styles inherited from h1 */
  text-align: center;
  color: white;
}
.contact-subtitle {
  text-align: center;
  color: white;
}
.contact-accent {
  background: transparent;
  width: 100%;
  border-radius: 0;
  display: flex;
  gap: 10px;
  padding: 10px;
}
.contact-accent-left {
  flex: 2 1 0%;
  min-height: 280px;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  display: flex;
}
.contact-model-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 1;
  pointer-events: none;
}
.contact-model-layer model-viewer {
  width: 50%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background-color: transparent;
  outline: none;
}
.contact-accent-left model-viewer {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background-color: transparent;
  outline: none;
}
.contact-accent-right {
  flex: 3 1 0%;
  background: transparent;
  border-radius: 0;
  padding: 20px;
  display: flex;
  align-items: center;
}
.contact-links {
  display: grid;
  grid-auto-rows: auto;
  gap: 20px;
  color: white;
}
.contact-block-title {
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1.1;
  margin-bottom: 6px;
}
.contact-link {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 32px);
}
.contact-link:hover {
  color: var(--black);
}
.contact-socials {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 16px;
}
.contact-footer {
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1.1;
  text-align: center;
  color: white;
}
.contact-terms {
  text-decoration: underline;
  color: white;
}

/* ===============================================
   MOBILE RESPONSIVE DESIGN
   =============================================== */

/* Large screens - start reducing padding */
/* Mobile-first approach: gradual progression with 1920px = 80px as anchor */
/* Using fixed px values to ensure consistent progression */

/* Small mobile base: already defined in base h1 rule */

/* Merged H1, H2, H3 & H4 Responsive System */

/* Mobile */
@media (min-width: 480px) {
  h1 {
    font-size: 58px;
  }
  h2 {
    font-size: 28px;
  }
  h3 {
    font-size: 22px;
  }
  h4 {
    font-size: 18px;
  }
  h5 {
    font-size: 16px;
  }
}

/* Tablet */
@media (min-width: 768px) {
  h1 {
    font-size: 66px;
  }
  h2 {
    font-size: 32px;
  }
  h3 {
    font-size: 26px;
  }
  h4 {
    font-size: 20px;
  }
  h5 {
    font-size: 18px;
  }
}

/* Small tablet */
@media (min-width: 900px) {
  h1 {
    font-size: 74px;
  }
  h2 {
    font-size: 36px;
  }
  h3 {
    font-size: 30px;
  }
  h4 {
    font-size: 22px;
  }
  h5 {
    font-size: 20px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  h1 {
    font-size: 82px;
  }
  h2 {
    font-size: 40px;
  }
  h3 {
    font-size: 32px;
  }
  h4 {
    font-size: 24px;
  }
  h5 {
    font-size: 22px;
  }
}

/* Large desktop */
@media (min-width: 1250px) {
  h1 {
    font-size: 90px;
  }
  h2 {
    font-size: 44px;
  }
  h3 {
    font-size: 36px;
  }
  h4 {
    font-size: 26px;
  }
  h5 {
    font-size: 24px;
  }
}

/* H2, H3 & H4 Anchor points - H2: 1500px = 64px, H3: 1500px = 48px, H4: 1500px = 36px */
@media (min-width: 1500px) {
  h2 {
    font-size: 48px;
  }
  h3 {
    font-size: 40px;
  }
  h4 {
    font-size: 28px;
  }
  h5 {
    font-size: 26px;
  }
}

/* Extra large desktop */
@media (min-width: 1600px) {
  h1 {
    font-size: 98px;
  }
  h2 {
    font-size: 52px;
  }
  h3 {
    font-size: 44px;
  }
  h4 {
    font-size: 31px;
  }
  h5 {
    font-size: 28px;
  }
}

/* Ultra large desktop */
@media (min-width: 1920px) {
  h1 {
    font-size: 106px;
  }
  h2 {
    font-size: 56px;
  }
  h3 {
    font-size: 48px;
  }
  h4 {
    font-size: 34px;
  }
  h5 {
    font-size: 30px;
  }
}

/* 2K screens */
@media (min-width: 2560px) {
  h1 {
    font-size: 114px;
  }
  h2 {
    font-size: 60px;
  }
  h3 {
    font-size: 52px;
  }
  h4 {
    font-size: 36px;
  }
  h5 {
    font-size: 32px;
  }
}

/* 4K screens */
@media (min-width: 3840px) {
  h1 {
    font-size: 122px;
  }
  h2 {
    font-size: 64px;
  }
  h3 {
    font-size: 56px;
  }
  h4 {
    font-size: 38px;
  }
  h5 {
    font-size: 34px;
  }
}

/* 8K screens */
@media (min-width: 7680px) {
  h1 {
    font-size: 130px;
  }
  h2 {
    font-size: 68px;
  }
  h3 {
    font-size: 60px;
  }
  h4 {
    font-size: 40px;
  }
  h5 {
    font-size: 36px;
  }
}

@media (max-width: 1400px) {
  :root {
    --side-padding: 100px;
  }
}

/* Medium-large screens */
@media (max-width: 1200px) {
  :root {
    --side-padding: 80px;
  }
}

/* Tablet Breakpoint (768px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --side-padding: var(--tablet-side-padding);
    --nav-height: var(--tablet-nav-height);
  }
  
  /* Reduce font sizes for tablet */
  .home-lokko, .home-studio {
    font-size: clamp(60px, 12vw, 70px);
  }
  
  .design-text {
    font-size: clamp(70px, 14vw, 80px);
  }
  
  
}

/* Small tablet */
@media (max-width: 900px) {
  :root {
    --side-padding: 30px;
  }
  
}

/* Mobile Breakpoint (320px - 768px) */
@media (max-width: 768px) {
  /* Hide navbar completely on mobile */
  .navbar {
    display: none !important;
  }
  
  /* Remove navbar spacer since navbar is hidden */
  .viewport {
    grid-template-rows: 1fr;
  }
  .section-inner {
    grid-row: 1;
    padding: 5px var(--mobile-side-padding);
    max-height: 100%;
    overflow: hidden;
  }
  :root {
    --side-padding: var(--mobile-side-padding);
    --nav-height: var(--mobile-nav-height);
  }
  
  /* Use dynamic viewport units to account for browser UI toolbars on mobile */
  .viewport {
    height: 100vh;   /* fallback */
    height: 100svh;  /* small viewport unit */
    height: 100dvh;  /* dynamic viewport */
  }
  .home-container {
    height: 100vh;   /* fallback */
    height: 100svh;  /* small viewport unit */
    height: 100dvh;  /* dynamic viewport */
  }
  
  /* Hide scrollbars on mobile */
  html, body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Override: remove duplicate padding since we set it above */
  
  /* Navigation improvements */
  .nav-inner {
    padding: 0 var(--mobile-side-padding);
    grid-template-columns: 1fr auto;
    gap: 20px;
  }
  
  .center-menu {
    display: none; /* Hide menu on mobile, keep brand and CTA */
  }
  
  .brand, .cta {
    font-size: clamp(14px, 4vw, 18px);
  }
  
  .brand .brandmark svg {
    width: 20px;
    height: 20px;
  }
  
  /* Home section mobile */
  .home-container {
    padding: 20px 0;
  }
  
  .home-top-content {
    gap: 15px;
    padding: 0 10px;
  }
  
  /* Ensure logo and wordmark align and can wrap nicely on small widths */
  .home-logo-brandline {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap; /* keep logo and text side-by-side */
    gap: 8px;
    width: 100%;
  }
  .home-logo {
    display: flex;
    align-items: center;
  }
  .home-logo svg {
    display: block;
    vertical-align: middle;
  }
  .home-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap; /* prevent line break between LOKKO and STUDIO */
  }
  
  .home-lokko, .home-studio {
    font-size: clamp(32px, 12vw, 48px);
    line-height: 0.9;
  }
  
  .home-logo svg {
    width: clamp(32px, 12vw, 48px);
    height: clamp(32px, 12vw, 48px);
  }
  
  .home-tagline {
    font-size: clamp(16px, 5vw, 24px);
    gap: 4px;
    text-align: center;
  }
  
  .design-text {
    font-size: clamp(40px, 15vw, 60px);
    height: auto;
    line-height: 1.1;
  }
  
  /* About section mobile */
  .about-text-layer {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 10px 0;
    height: 100%;
    max-height: 100%;
  }
  
  .about-left, .about-right {
    text-align: left;
    justify-content: flex-start;
  }

  /* Make about-right full width and align content to bottom on mobile */
  .about-right {
    justify-content: flex-end;
    justify-self: stretch;
    width: 100%;
  }
  
  .about-middle-empty {
    display: none;
  }
  
  
  .about-light, .about-medium, .about-semibold {
    font-size: clamp(16px, 4vw, 24px);
  }
  
  /* About2 section mobile */
  .about2-grid {
    grid-template-rows: auto 1fr;
    gap: 15px;
    align-items: start;
  }
  
  
  .about2-bottom {
    grid-template-columns: 1fr;
    gap: 15px;
    height: 100%;
    max-height: 100%;
  }
  
  .about2-bottom-right {
    display: flex;
    align-items: flex-start;
  }
  
  .about2-bottom-right p {
    font-size: clamp(16px, 4vw, 24px);
    text-align: left;
  }
  
  /* Work section mobile */
  .work-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 15px;
    align-items: start;
  }
  
  
  /* Work list mobile behavior - EXACTLY like highlights2-list mobile */
  .work-list {
    height: 100%;
    max-height: 100%;
    padding: 10px;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto !important;
  }
  
  .work-card {
    flex: none;
    width: 100%;
    display: block;
    height: auto;
    min-height: 150px; /* match academy cards height */
    max-height: 200px; /* prevent exceeding screen */
    width: 100%;
    scroll-snap-align: none;
  }

  /* Center overlay texts vertically and horizontally inside cards on mobile */
  .work-text,
  .academy-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 20px;
  }
  
  
  
  /* Work2 section mobile - logo grid */
  .work2-logos {
    display: none; /* hide references logos on mobile */
  }

  /* Work2 stats: stack vertically on mobile with larger type */
  .work2-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .work2-stat {
    align-items: baseline;
  }
  .work2-stat-number {
    font-size: clamp(48px, 14vw, 96px);
    line-height: 1;
  }
  .work2-stat-label {
    font-size: clamp(28px, 8vw, 64px);
    line-height: 1.1;
  }
  
  .work2-logo img {
    padding: 6px;
  }
  
  /* Highlights sections mobile */
  .highlights-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 15px;
    align-items: start;
  }
  /* Use block layout for container to avoid any flex shrink/overlap */
  #highlights .highlights-bottom {
    display: block;
    height: 100%;
    max-height: 100%;
    overflow-y: auto !important;
  }
  /* Ensure list flows normally with auto-height rows and wraps text safely */
  #highlights .highlights-list {
    display: grid;
    grid-auto-rows: auto;
    gap: 10px;
    height: auto;
    max-height: none;
    overflow: visible !important;
    position: relative;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  #highlights .highlights-item { align-content: start; }
  /* Ensure inner lists can scroll independently on mobile */
  .highlights-list,
  .highlights2-list,
  .work-list,
  #work .work-detail-panel .work-detail-content,
  #academy .academy-detail-panel .academy-detail-content {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  /* Make image rows accept horizontal pans */
  #work .work-detail-panel .work-detail-image .work-carousel,
  #academy .academy-detail-panel .academy-detail-image .work-carousel {
    touch-action: pan-x;
  }
  
  .highlights2-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 15px;
    align-items: start;
  }
  
  
  
  
  .highlights-list, .highlights2-list, .work-list {
    height: 100%;
    max-height: 100%;
    padding: 10px;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto !important;
  }
  /* Make the entire container the scroller on mobile to avoid nested scroll conflicts */
  #highlights .highlights-bottom,
  #highlights-2 .highlights2-right,
  #work .work-right {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    min-height: 0;
  }
  /* Disable inner list overflow so container scrolls */
  #highlights .highlights-list,
  #highlights-2 .highlights2-list,
  #work .work-list {
    overflow: visible !important;
  }
  
  /* Academy section mobile */
  .academy-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 15px;
    align-items: start;
  }
  
  
  .academy-boxes {
    grid-template-columns: repeat(2, 1fr); /* 2x3 grid on mobile */
    grid-template-rows: repeat(3, minmax(120px, 150px)); /* constrain row height */
    gap: 8px;
    height: 100%;
    max-height: 100%;
  }
  
  
  
  /* Contact section mobile */
  .contact-grid {
    grid-template-rows: auto auto 1fr auto;
    gap: 10px;
    padding: 10px 0;
    align-items: start;
  }
  
  
  
  .contact-accent {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .contact-accent-left, .contact-accent-right {
    flex: none;
    min-height: 200px;
  }
  
  .contact-accent-right {
    padding: 15px;
  }
  
  .contact-block-title, .contact-link {
    font-size: clamp(16px, 4vw, 24px);
  }
  
  .contact-footer {
    font-size: clamp(14px, 3.5vw, 20px);
  }
  
  .contact-model-layer model-viewer {
    width: 80%;
  }
  
  /* Terms section mobile */
  #terms .terms-topbar {
    padding: 0 var(--mobile-side-padding);
    height: 50px;
  }
  
  #terms .terms-back {
    font-size: 16px;
  }
  
  .terms-content {
    padding: 15px var(--mobile-side-padding) 40px;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  
  .terms-title {
    font-size: clamp(24px, 6vw, 32px);
  }
  
  .terms-section h2 {
    font-size: clamp(16px, 4vw, 20px);
  }
  
  .terms-section p, .terms-section li {
    font-size: 14px;
    line-height: 1.6;
  }
  
  /* Touch-friendly improvements */
  .work-card, .academy-box, .highlights-item {
    min-height: 44px; /* Minimum touch target */
  }
  
  .cta, .brand, .menu-item, .terms-back {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Model viewer mobile optimizations */
  model-viewer {
    --progress-bar-height: 2px;
  }
  
  /* Improve tap targets */
  a, button, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Reduce motion for mobile users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    .work2-logo img {
      transition: none;
    }
    
    .design-text {
      animation: none;
    }
    
    .highlights-item {
      transition: none;
    }
  }
}

/* Small mobile (320px - 480px) */
/* Small mobile */
@media (max-width: 480px) {
  
  .home-lokko, .home-studio {
    font-size: clamp(28px, 10vw, 36px);
  }
  
  .work-carousel {
    grid-auto-columns: 240px;
  }
  
  .work2-logos {
    grid-auto-columns: 200px;
  }
  
  .academy-boxes {
    grid-template-columns: 1fr; /* Single column on very small screens */
    grid-template-rows: repeat(6, 1fr);
  }
  
  .contact-accent-left {
    min-height: 150px;
  }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .home-container {
    padding: 10px 0;
  }
  
  .home-top-content {
    gap: 10px;
  }
  
  .contact-grid {
    grid-template-rows: auto auto auto auto;
    gap: 10px;
  }
  
  .section-inner {
    padding: 10px var(--side-padding);
  }
}

/* Detail panels typography overrides (ensure correct sizes on desktop) */
.work-detail-panel .work-detail-back .work-detail-back-arrow { line-height: 1; }
/* Remove explicit font sizes to let semantic h2/h3/h4/p styles apply */

.academy-detail-panel .academy-detail-back .academy-detail-back-arrow { line-height: 1; }

/* Ensure detail image rows fill available space */
.work-detail-panel .work-detail-image-container { height: 100%; min-height: 0; max-height: none; }
.work-detail-panel .work-detail-image { height: 100%; }
.work-detail-panel .work-detail-image .work-carousel { height: 100%; }

/* Prevent inner scrollbars on detail content; fit within panel height */
.work-detail-panel .work-detail-content { overflow: hidden; }

.academy-detail-panel .academy-detail-image-container { height: 100%; min-height: 0; max-height: none; }
.academy-detail-panel .academy-detail-image { height: 100%; }
.academy-detail-panel .academy-detail-image .work-carousel { height: 100%; }

.academy-detail-panel .academy-detail-content { overflow: hidden; }

@media (max-width: 768px) {
  .work-detail-panel .work-detail-back .work-detail-back-arrow { font-size: clamp(32px, 8vw, 48px); }
  /* Removed explicit font-size overrides for work detail texts to respect h2/h3/h4/p */

  .academy-detail-panel .academy-detail-back .academy-detail-back-arrow { font-size: clamp(32px, 8vw, 48px); }

}
