/* ----------------------------------------------------
   KDC DESIGNS - v2 REDESIGN (SWISS BLUEPRINT & MINIMAL MOTION)
---------------------------------------------------- */

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #ffffff;
  --text-muted: #88888b;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.35);
  --accent: #f28500;                  /* Premium Hermès Orange */
  --accent-sec: #f28500;              /* Premium Hermès Orange */
  --loader-bg: #000000;
  --card-bg: rgba(255, 255, 255, 0.01);
  --panel-bg: #0a0a0a;

  --font-display: 'Outfit', sans-serif;
  --font-sub: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  scroll-behavior: smooth;
  --cursor-scale: 1;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #000000;
  --text-muted: #666666;
  --border: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(0, 0, 0, 0.35);
  --accent: #f28500;                  /* Premium Hermès Orange */
  --accent-sec: #f28500;              /* Premium Hermès Orange */
  --loader-bg: #ffffff;
  --card-bg: rgba(0, 0, 0, 0.005);
  --panel-bg: #ffffff;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-focus);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Base Typo */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

p {
  font-size: 1rem;
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4rem;
}

@media (max-width: 767px) {
  .container {
    padding: 0 2rem;
  }
}

/* ----------------------------------------------------
   SITE LOADER
---------------------------------------------------- */
.site-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--loader-bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1);
}

.site-loader.loaded {
  transform: translateY(-100%);
}

.loader-content {
  text-align: center;
  max-width: 300px;
  width: 100%;
}

.loader-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.loader-brand .accent {
  color: var(--accent);
}

.loader-bar {
  width: 100%;
  height: 2px;
  background-color: var(--border);
  position: relative;
  overflow: hidden;
}

.loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

/* ----------------------------------------------------
   CUSTOM CURSOR (VELOCITY DRIVEN)
---------------------------------------------------- */
.cursor-ring, .cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
  mix-blend-mode: difference;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent);
  transition: transform 0.1s ease-out, border-color 0.3s;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-sec);
}

@media (pointer: fine) {
  .cursor-ring, .cursor-dot {
    display: block;
  }
}

/* ----------------------------------------------------
   SITE HEADER & MINIMAL BURGER
---------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  z-index: 900;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header.shrunk {
  background-color: var(--bg);
  border-color: var(--border-focus);
}

/* Native Scroll Timeline Header Shrink */
@supports ((animation-timeline: scroll()) and (animation-range: 0px 100px)) {
  @keyframes header-bg-reveal {
    to {
      background-color: var(--bg);
      border-color: var(--border-focus);
    }
  }
  .header {
    animation: header-bg-reveal auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100px;
  }
}

.header-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 767px) {
  .header-inner {
    padding: 0 2rem;
  }
}

.logo {
  font-family: var(--font-sub);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.logo-accent {
  font-weight: 500;
  color: var(--accent);
}

.logo-sep {
  opacity: 0.3;
  margin: 0 0.2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 3rem;
}

/* Sleek Theme Switcher */
.theme-btn {
  background: none;
  border: none;
  width: 44px;
  height: 24px;
  border-radius: 50px;
  background-color: var(--border);
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
}

.theme-btn-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--text);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .theme-btn-indicator {
  transform: translateX(20px);
}

/* Minimal Burger Menu Trigger */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text);
}

.toggle-text {
  font-family: var(--font-sub);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.toggle-burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.burger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active .burger-line:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.nav-toggle.active .burger-line:nth-child(2) {
  transform: translateY(-3px) rotate(-45deg);
}

/* ----------------------------------------------------
   FULL SCREEN MENU OVERLAY
---------------------------------------------------- */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg);
  z-index: 850;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  border-bottom: 1px solid var(--border);
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-overlay-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 4rem;
}

@media (max-width: 767px) {
  .menu-overlay-inner {
    padding: 0 2rem;
  }
}

.menu-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 6rem;
}

@media (max-width: 767px) {
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.menu-sub {
  font-family: var(--font-sub);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2rem;
}

.menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-link-item {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 1.5rem;
  transition: transform 0.3s ease, color 0.3s;
}

.menu-link-item::before {
  content: attr(data-index);
  font-family: var(--font-sub);
  font-size: 1rem;
  font-weight: 400;
  color: var(--accent);
}

.menu-link-item:hover {
  transform: translateX(15px);
  color: var(--accent);
}

.menu-col-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
  padding-left: 6rem;
}

@media (max-width: 767px) {
  .menu-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 120px;
    padding-bottom: 4rem;
  }
  .menu-link-item {
    font-size: 2.25rem;
  }
  .menu-col-right {
    display: none;
  }
}

.menu-email {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.menu-location {
  color: var(--text-muted);
  margin-bottom: 4rem;
}

.menu-partners-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   HERO SECTION (SPLIT SCREEN LAYOUT)
---------------------------------------------------- */
.hero {
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-canvas-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.hero-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @keyframes hero-scale-down {
    to {
      transform: scale(1.0);
    }
  }

  .hero-canvas {
    animation: hero-scale-down auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100vh;
  }
}

.hero-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--bg) 0%, rgba(0, 0, 0, 0.3) 100%);
}

@media (max-width: 991px) {
  .hero-canvas-wrapper {
    width: 100%;
    opacity: 0.25;
  }
  .hero-canvas-overlay {
    background: radial-gradient(circle, transparent 20%, var(--bg) 80%);
  }
}

.hero-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  position: relative;
  z-index: 10;
  padding-top: 100px;
}

@media (max-width: 767px) {
  .hero-container {
    padding-top: 130px;
  }
}

.hero-metareveal {
  margin-bottom: 2rem;
  overflow: hidden;
}

.hero-meta-badge {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-sec);
  display: inline-block;
  transform: translateY(100%);
  animation: reveal-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.2s;
}

.hero-title {
  font-size: 6.5rem;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 4rem;
  max-width: 900px;
}

.text-outline {
  -webkit-text-stroke: 1px var(--text);
  color: transparent;
}

.word-wrapper {
  display: block;
  overflow: hidden;
}

.word {
  display: block;
  transform: translateY(100%);
  animation: reveal-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .word-wrapper:nth-child(1) .word { animation-delay: 1.3s; }
.hero-title .word-wrapper:nth-child(2) .word { animation-delay: 1.4s; }
.hero-title .word-wrapper:nth-child(3) .word { animation-delay: 1.5s; }
.hero-title .word-wrapper:nth-child(4) .word { animation-delay: 1.6s; }

@keyframes reveal-up {
  to { transform: translateY(0); }
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 4.5rem;
  }
}
@media (max-width: 576px) {
  .hero-title {
    font-size: 3.25rem;
  }
}

.hero-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 800px;
  transform: translateY(30px);
  opacity: 0;
  animation: fade-in-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.8s;
}

@keyframes fade-in-up {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .hero-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.hero-desc p {
  font-size: 1.15rem;
  line-height: 1.6;
}

.cta-link {
  font-family: var(--font-sub);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--text);
  padding-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.cta-link .arrow {
  transition: transform 0.3s ease;
}

.cta-link:hover .arrow {
  transform: translateY(4px);
}

/* ----------------------------------------------------
   SWISS BLUEPRINT SECTIONS
---------------------------------------------------- */
.section-title-wrap {
  position: relative;
  padding-top: 3rem;
  margin-bottom: 9rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.section-title-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border-focus);
  transform-origin: left;
  transform: scaleX(0);
}

@media (max-width: 767px) {
  .section-title-wrap {
    gap: 1rem;
  }
}

.line-label {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.section-display {
  font-size: 3.5rem;
  font-weight: 300;
  max-width: 700px;
}

@media (max-width: 767px) {
  .section-display {
    font-size: 2.5rem;
  }
}

/* Capabilities/Disciplines */
.disciplines-grid {
  display: flex;
  flex-direction: column;
}

.discipline-row {
  display: grid;
  grid-template-columns: 80px 1.5fr 1fr;
  gap: 4rem;
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

@media (max-width: 767px) {
  .discipline-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 3rem 0;
  }
}

.discipline-meta {
  font-family: var(--font-sub);
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.4;
}

.discipline-name {
  font-size: 2.25rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.discipline-text {
  font-size: 1.05rem;
  line-height: 1.6;
}

.discipline-tag {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-sec);
  border: 1px solid var(--border-focus);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  justify-self: end;
}

@media (max-width: 767px) {
  .discipline-tag {
    justify-self: start;
    margin-top: 1rem;
  }
  /* re-order items on mobile */
  .discipline-row:nth-child(2) .discipline-meta {
    order: -1;
  }
}

/* ----------------------------------------------------
   TEAM SECTION (FLOATING REVEALS)
---------------------------------------------------- */
.team-list {
  display: flex;
  flex-direction: column;
}

.team-row {
  display: grid;
  grid-template-columns: 1.25fr 1.5fr;
  gap: 4rem;
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
  position: relative;
  transition: border-color 0.3s;
}

.team-row:hover {
  border-color: var(--border-focus);
}

.team-row-left {
  display: flex;
  align-items: baseline;
  gap: 3rem;
}

.team-index {
  font-family: var(--font-sub);
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.4;
}

.team-partner-name {
  font-size: 3rem;
  font-weight: 400;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.team-row:hover .team-partner-name {
  transform: translateX(10px);
  color: var(--accent);
}

.team-row-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.team-partner-role {
  font-family: var(--font-sub);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-sec);
}

.team-partner-desc {
  max-width: 450px;
}

.team-partner-link {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border-focus);
  align-self: start;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.team-partner-link:hover {
  color: var(--accent);
}

@media (max-width: 767px) {
  .team-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 3rem 0;
  }
  .team-partner-name {
    font-size: 2.25rem;
  }
}

/* Floating Thumbnail reveal elements */
.floating-img-wrap {
  position: fixed;
  width: 280px;
  height: 380px;
  pointer-events: none;
  z-index: 100;
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.6) translate(-50%, -50%);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.floating-img-wrap.active {
  opacity: 1;
  transform: scale(1) translate(-50%, -50%);
}

.floating-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ----------------------------------------------------
   WORK LIST (EDITORIAL ROW LIST)
---------------------------------------------------- */
.work-list {
  display: flex;
  flex-direction: column;
}

.work-row {
  display: grid;
  grid-template-columns: 240px 1fr 80px;
  gap: 4rem;
  padding: 6.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.work-row:hover {
  border-color: var(--border-focus);
}

.work-meta {
  font-family: var(--font-sub);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.work-row-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.work-title {
  font-size: 3.5rem;
  font-weight: 300;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.work-row:hover .work-title {
  transform: translateX(15px);
  color: var(--accent);
}

.work-summary {
  font-size: 1.05rem;
  max-width: 500px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-row:hover .work-summary {
  transform: translateX(15px);
}

.work-arrow {
  font-size: 2.5rem;
  font-weight: 300;
  justify-self: end;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.work-row:hover .work-arrow {
  transform: scale(1.1) rotate(45deg);
  color: var(--accent);
}

@media (max-width: 767px) {
  .work-row {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 0;
  }
  .work-meta {
    display: none;
  }
  .work-title {
    font-size: 2.25rem;
  }
  .work-arrow {
    display: none;
  }
}

/* ----------------------------------------------------
   CONTACT SECTION & MINIMAL FORM
---------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 6rem;
}

@media (max-width: 991px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

.contact-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 4rem;
  max-width: 500px;
}

.contact-methods {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.contact-label {
  font-family: var(--font-sub);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
}

.hover-underline {
  position: relative;
  display: inline-block;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.hover-underline:hover::after {
  width: 100%;
}

/* Minimal Underlined Inputs */
.minimal-form {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 576px) {
  .input-row {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.input-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  border: none;
  border-bottom: 1.5px solid var(--border);
  background-color: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.75rem 0;
  width: 100%;
  outline: none;
  transition: border-color 0.3s;
}

.input-wrap textarea {
  resize: none;
}

.input-wrap label {
  position: absolute;
  top: 0.75rem;
  left: 0;
  font-family: var(--font-sub);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
  transform-origin: left top;
}

/* Float Up Labels */
.input-wrap input:focus ~ label,
.input-wrap input:not(:placeholder-shown) ~ label,
.input-wrap textarea:focus ~ label,
.input-wrap textarea:not(:placeholder-shown) ~ label,
.input-wrap select:focus ~ label,
.input-wrap select:valid ~ label {
  transform: translateY(-20px) scale(0.8);
  color: var(--accent);
}

.input-wrap input:focus,
.input-wrap textarea:focus,
.input-wrap select:focus {
  border-color: var(--accent);
}

/* Error/Validation styling using `:user-invalid` */
.input-wrap input:user-invalid,
.input-wrap select:user-invalid,
.input-wrap textarea:user-invalid {
  border-color: oklch(0.6 0.2 25);
}

.input-wrap input:user-invalid ~ label,
.input-wrap select:user-invalid ~ label,
.input-wrap textarea:user-invalid ~ label {
  color: oklch(0.6 0.2 25);
}

.input-wrap input:user-invalid ~ .error-msg,
.input-wrap select:user-invalid ~ .error-msg,
.input-wrap textarea:user-invalid ~ .error-msg {
  display: block;
}

.input-wrap select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2388888b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 1.25rem;
  padding-right: 2rem;
}

.select-label {
  /* Ensure select label is floated up when item is selected */
  pointer-events: none;
}

.error-msg {
  display: none;
  font-size: 0.8rem;
  color: oklch(0.6 0.2 25);
  margin-top: 0.25rem;
}

/* Minimal submit button */
.submit-btn {
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sub);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  align-self: start;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}

.submit-btn:hover {
  color: var(--bg);
  border-color: var(--accent);
}

.submit-btn:hover::before {
  transform: translateY(0);
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text {
  visibility: hidden;
  opacity: 0;
}

.submit-btn.loading .btn-spinner {
  display: block;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Form success & form hidden visibility overrides */
.minimal-form[hidden],
.success-screen[hidden] {
  display: none !important;
}

.success-screen {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-indicator {
  width: 50px;
  height: 50px;
  border: 1.5px solid var(--accent-sec);
  color: var(--accent-sec);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.success-title {
  font-size: 1.75rem;
}

/* ----------------------------------------------------
   SLIDE-OUT PROJECT DIALOG MODAL
---------------------------------------------------- */
.slide-modal {
  border: none;
  background-color: var(--panel-bg);
  color: var(--text);
  height: 100vh;
  width: 100%;
  max-width: 680px;
  margin: 0 0 0 auto; /* Align to the right side */
  outline: none;
  box-shadow: var(--shadow-lg);
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.85, 0, 0.15, 1);
  display: none;
}

.slide-modal[open] {
  display: block;
  transform: translateX(0);
}

.slide-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-inner {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: border-color 0.3s;
}

.modal-close:hover {
  border-color: var(--accent);
}

.close-icon {
  position: relative;
  width: 14px;
  height: 14px;
}

.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--text);
}

.close-icon::before { transform: rotate(45deg); }
.close-icon::after { transform: rotate(-45deg); }

.modal-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8rem 4rem 4rem;
}

@media (max-width: 767px) {
  .modal-content {
    padding: 6rem 2rem 2rem;
  }
}

/* Modal layout elements */
.modal-header-img {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 1px solid var(--border);
}

.modal-hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 3rem;
  display: block;
}

.modal-meta {
  font-family: var(--font-sub);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.modal-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.modal-tag {
  font-family: var(--font-sub);
  font-size: 0.8rem;
  background-color: var(--border);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}

.modal-desc h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.modal-desc p {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.modal-stats {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-bottom: 4rem;
}

.modal-stats h4 {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.modal-stats-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  list-style: none;
}

.modal-stat-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.modal-stat-label {
  color: var(--text-muted);
}

.modal-stat-value {
  font-family: var(--font-sub);
  font-weight: 500;
}

/* ----------------------------------------------------
   FOOTER
---------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

@media (max-width: 767px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

.credentials {
  font-family: var(--font-sub);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* ----------------------------------------------------
   PERFORMANCE & SCROLL ENTRANCE EFFECTS
---------------------------------------------------- */
.disciplines, .team, .work, .contact {
  content-visibility: auto;
  contain-intrinsic-block-size: auto 600px;
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes line-reveal {
      to { transform: scaleX(1); }
    }

    @keyframes row-reveal {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .section-title-wrap::before {
      animation: line-reveal auto linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }

    .discipline-row, .team-row, .work-row, .contact-grid {
      animation: row-reveal auto linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }
  }

  /* Fallback animations styling for older browsers toggled by JS IntersectionObserver */
  .reveal-js {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal-js::before {
    transform: scaleX(0);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .reveal-js.is-visible::before {
    transform: scaleX(1);
  }
}
