:root {
  --bg: #0b0b0b;
  --page-bg: #f5f5f5;
  --surface: rgba(24, 24, 24, 0.66);
  --surface-soft: rgba(28, 28, 28, 0.62);
  --surface-hover: rgba(44, 44, 44, 0.72);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.7);
  --accent: #dedede;
  --accent-strong: #fff;
  --accent-warm: #c4c4c4;
  --danger: #b8b8b8;
  --startscreen-bg: #111;
  --startscreen-line: #9a9a9a;
  --startscreen-fill: #f1f1f1;
  --startscreen-empty: rgba(255, 255, 255, 0);
  --header-height: 72px;
  --page-width: 1160px;
  --radius: 9px;
  --panel-radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.32, 0, 0.67, 0);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  color-scheme: dark;
  background: var(--bg);
}

html[data-theme="light"] {
  --startscreen-bg: #f5f5f5;
  --startscreen-line: #707070;
  --startscreen-fill: #000;
  --startscreen-empty: rgba(255, 255, 255, 0);
  color-scheme: light;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-active-view,
body.has-open-layer {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img,
video {
  display: block;
  max-width: 100%;
}

.view-shell {
  width: min(calc(100% - 40px), var(--page-width));
  margin-inline: auto;
}

/* Background: keep the existing full-screen video treatment. */
#video-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
  opacity: 1;
  transition: filter 280ms var(--ease), transform 360ms var(--ease), opacity 220ms ease;
  will-change: opacity, transform;
}

/* Opening animation retained from the original page. */
#startscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--startscreen-bg);
  text-align: center;
  animation: startscreen-layer 4.3s cubic-bezier(0.77, 0, 0.175, 1) both;
}

.startscreen {
  position: absolute;
  top: 30%;
  left: 50%;
  width: min(550px, 100%);
  height: 580px;
  transform: translate(-50%, -50%);
}

.startscreen-headline1 {
  height: 20px;
  margin: 270px auto;
}

.startscreen-headline2 {
  height: 50px;
  margin: -80px 0 10px;
}

.startscreen-headline1 svg path {
  fill: none;
  stroke: var(--startscreen-line);
  stroke-dasharray: 900;
  stroke-dashoffset: -650;
  stroke-width: 2;
  animation: startscreen 2.1s cubic-bezier(0.77, 0, 0.175, 1) both;
}

.startscreen-headline2 svg path {
  fill: var(--startscreen-fill);
  stroke: var(--startscreen-fill);
  stroke-dasharray: 900;
  stroke-dashoffset: -900;
  stroke-width: 2;
  animation: startscreen2 2.1s cubic-bezier(0.77, 0, 0.175, 1) 0.1s both;
}

#startscreen .title {
  animation: startscreen3 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) 1.5s both;
}

#startscreen .index {
  margin-top: 30px;
}

#startscreen .title img {
  width: 280px;
  margin-inline: auto;
}

@keyframes startscreen {
  0% {
    fill: var(--startscreen-empty);
    stroke: var(--startscreen-line);
    stroke-dashoffset: 870;
    stroke-width: 1.5;
  }
  80% {
    fill: var(--startscreen-empty);
    stroke: var(--startscreen-line);
    stroke-dashoffset: 0;
    stroke-width: 1.5;
  }
  100% {
    fill: var(--startscreen-line);
    stroke: var(--startscreen-line);
    stroke-dashoffset: 0;
    stroke-width: 0;
  }
}

@keyframes startscreen2 {
  0% {
    fill: var(--startscreen-empty);
    stroke-dashoffset: -900;
    stroke-width: 1;
  }
  80% {
    fill: var(--startscreen-empty);
    stroke-dashoffset: 0;
    stroke-width: 1;
  }
  100% {
    fill: var(--startscreen-fill);
    stroke-dashoffset: 0;
    stroke-width: 0;
  }
}

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

@keyframes startscreen-layer {
  0%, 75% { visibility: visible; opacity: 1; }
  100% { visibility: hidden; opacity: 0; }
}

/* Hero */
#header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: height 240ms var(--ease), background-color 240ms ease;
}

#header > .hero-shell {
  width: min(calc(100% - 48px), 1320px);
  margin-inline: auto;
}

#header h1 {
  margin: 0;
  font-family: "Poppins", "Arial Black", system-ui, sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

#header h1 a {
  display: inline-block;
  color: #fff;
}

@font-face {
  font-family: "XIAOWEI";
  src: url("../fonts/XIAOWEI.woff2") format("woff2");
  font-display: swap;
}

#header h2 {
  max-width: 760px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-family: "XIAOWEI", "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
}

#header .hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 38px;
}

#header:not(.is-compact) .theme-toggle {
  display: none;
}

.icon-button,
.site-nav__toggle,
.dialog-close,
.modal-close,
.carousel-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.site-nav__toggle:hover,
.dialog-close:hover,
.modal-close:hover,
.carousel-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.2);
}

.icon-button:active,
.carousel-button:active {
  transform: scale(0.96);
}

.site-nav {
  margin-top: 34px;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  position: relative;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 2px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.5;
  white-space: nowrap;
  transition: color 160ms ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 200ms var(--ease);
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: #fff;
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
  width: 24px;
}

.site-nav__toggle {
  display: none;
}

#header.is-compact {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-height);
  overflow: visible;
  background: rgba(18, 18, 18, 0.64);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(24px) saturate(1.45);
}

#header.is-compact > .hero-shell {
  display: flex;
  align-items: center;
}

#header.is-compact h1 {
  margin-right: auto;
  font-size: 30px;
}

#header.is-compact h2,
#header.is-compact .hero-actions {
  display: none;
}

#header.is-compact .site-nav {
  margin: 0;
}

/* Independent content layer; the existing video remains visible. */
#viewStack {
  position: relative;
  z-index: 20;
}

#viewBackdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: var(--page-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms;
  will-change: opacity;
}

body.has-active-view #viewBackdrop {
  opacity: 1;
  visibility: visible;
}

body.is-returning-home #viewBackdrop {
  opacity: 0;
  visibility: hidden;
}

body.is-entering-view #viewBackdrop {
  opacity: 0;
  visibility: hidden;
}

.view {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 20;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
  border-top: 0;
  backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 18px, 0) scale(0.992);
  transform-origin: 50% 35%;
  transition: none;
  will-change: opacity, transform;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.view.is-active,
.view.is-transition-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
}

.view.is-active {
  pointer-events: auto;
}

.view.is-transition-visible:not(.is-active) {
  z-index: 22;
  pointer-events: none;
}

.view:focus {
  outline: 0;
}

.view > .view-shell {
  padding-top: 64px;
  padding-bottom: 64px;
}

.view > .view-shell + .view-shell {
  padding-top: 0;
}

.section-title {
  margin-bottom: 36px;
}

.section-title h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: rgba(245, 245, 245, 0.64);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-title h2::after {
  content: "";
  width: 48px;
  height: 1px;
  background: currentColor;
}

.section-title p {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.work-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.work-header .section-title {
  flex: 0 1 auto;
  margin-bottom: 0;
}

.filter-bar {
  min-width: 0;
  margin-left: auto;
}

.work-type {
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

/* About */
.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 20px;
  align-items: flex-start;
}

.about-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.about-copy h3 {
  margin: 0 0 12px;
  color: var(--accent-warm);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
}

.about-copy p {
  color: rgba(245, 245, 245, 0.82);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.32);
}

.about-copy ul {
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.about-copy li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--muted);
}

.about-copy li i {
  color: var(--accent);
  font-size: 11px;
}

.about-copy li strong {
  color: #fff;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.metric-grid > * {
  width: auto;
  padding: 0;
  margin: 0;
}

.count-box {
  min-height: 126px;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  text-align: center;
  backdrop-filter: blur(22px) saturate(1.25);
  transition: transform 220ms var(--ease), background-color 220ms ease, border-color 220ms ease;
}

.count-box:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.count-box span {
  display: block;
  color: #fff;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}

.count-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  row-gap: 4px;
}

.skills .progress {
  height: auto;
  margin-bottom: 18px;
}

.skills .skill {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
}

.skills .val {
  color: var(--muted);
  font-style: normal;
}

.progress-bar-wrap {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-strong);
  transition: width 800ms var(--ease);
}

/* Native scroll-snap carousel */
.testimonials-slider {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 calc((100% - 28px) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

.testimonial-item {
  min-height: 330px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: transform 220ms var(--ease), border-color 220ms ease, background-color 220ms ease;
}

.testimonial-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.testimonial-item p {
  min-height: 170px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  font-style: normal;
  line-height: 1.8;
}

.testimonial-item .quote-icon-left {
  margin-right: 8px;
  color: var(--accent-warm);
}

.testimonial-img {
  width: 64px;
  height: 64px;
  margin-top: 22px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-item h3 {
  margin: -58px 0 1px 80px;
  font-size: 17px;
}

.testimonial-item h4 {
  margin: 0 0 0 80px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.carousel-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  backdrop-filter: blur(16px);
}

.carousel-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.carousel-pagination {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 70px;
  justify-content: center;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.carousel-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #f5f5f5;
}

/* Photography */
#videoRow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

#videoRow.single-video {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.video-item {
  min-width: 0;
  display: flex;
}

.video-container {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: border-color 220ms ease, background-color 220ms ease, transform 220ms var(--ease), box-shadow 220ms ease;
}

.video-container:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: var(--surface-hover);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.11);
  transform: translateY(-4px);
}

.video-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020202;
}

.video-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 245, 245, 0.86);
  color: #1d1d1d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
}

.video-copy {
  display: block;
  min-height: 82px;
  padding: 17px 18px;
}

.video-copy h3 {
  margin: 0;
  font-size: 18px;
}

.video-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Portfolio */
#portfolio-flters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#portfolio-flters button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(28, 28, 28, 0.44);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(16px);
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

#portfolio-flters button:hover,
#portfolio-flters button.filter-active {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(245, 245, 245, 0.92);
  color: #1d1d1d;
}

#portfolio-flters button:active {
  transform: scale(0.97);
}

#portfolioContainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.portfolio-item {
  width: auto;
  min-width: 0;
  padding: 0;
  animation: item-in 260ms var(--ease) both;
}

.portfolio-item[hidden] {
  display: none;
}

.portfolio-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #080808;
  color: #fff;
  cursor: zoom-in;
  font: inherit;
  text-align: left;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.09);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms var(--ease);
}

.portfolio-wrap > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms var(--ease);
}

.portfolio-info {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(18px) saturate(1.35);
  transform: translateY(100%);
  transition: transform 220ms var(--ease);
}

.portfolio-title {
  display: block;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.portfolio-open {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.portfolio-wrap:hover > img,
.portfolio-wrap:focus-within > img {
  transform: scale(1.035);
}

.portfolio-wrap:hover,
.portfolio-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.portfolio-wrap:hover .portfolio-info,
.portfolio-wrap:focus-within .portfolio-info {
  transform: translateY(0);
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.contact-card {
  position: relative;
  width: 100%;
  min-height: 118px;
  padding: 22px 20px 20px 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: border-color 220ms ease, background-color 220ms ease, transform 220ms var(--ease);
}

.contact-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.contact-view .info-icon {
  position: absolute;
  top: 23px;
  left: 20px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.contact-card h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 17px;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.contact-socials {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.contact-socials a,
.contact-socials button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.contact-socials a:hover,
.contact-socials button:hover {
  color: var(--accent);
}

.contact-form {
  margin-top: 26px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(1.25);
}

.field-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
}

.field {
  display: block;
}

.field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  margin-top: 14px;
}

.form-submit {
  display: block;
  margin-inline: auto;
}

.form-control {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: border-color 160ms ease, background-color 160ms ease;
}

textarea.form-control {
  height: 148px;
  min-height: 136px;
  resize: vertical;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-control:focus {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  outline: 0;
}

.contact-form button[type="submit"],
#submitPasswordBtn {
  min-width: 104px;
  min-height: 42px;
  padding: 9px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f5f5f5 !important;
  color: #1d1d1d !important;
  cursor: pointer;
  font-weight: 600;
  transition: transform 180ms var(--ease), background-color 180ms ease, box-shadow 180ms ease;
}

.contact-form button[type="submit"]:hover,
#submitPasswordBtn:hover {
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.contact-form button:disabled,
#submitPasswordBtn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.loading,
.error-message,
.sent-message {
  display: none;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 4px;
  font-size: 14px;
}

.loading { color: var(--muted); background: var(--surface-soft); }
.error-message { color: #fff; background: rgba(255, 255, 255, 0.12); }
.sent-message { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* Overlays and dialogs */
.layer-backdrop,
.layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: blur(24px) saturate(0.8) brightness(0.7);
}

.layer-backdrop.is-open,
.layer.is-open {
  display: flex;
  animation: layer-in 260ms var(--ease) both;
}

.layer-backdrop {
  align-items: center;
  justify-content: center;
}

.dialog-card {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 110;
  width: min(calc(100% - 32px), 380px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: var(--panel-radius);
  background: rgba(245, 245, 245, 0.9);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(30px) saturate(1.4);
  color-scheme: light;
  animation: dialog-card-in 340ms var(--ease) both;
}

.dialog-card__content {
  color: #1d1d1d;
  text-align: center;
}

.dialog-card__content h3,
.dialog-card__content h4 {
  margin: 0 0 16px !important;
  color: #1d1d1d;
  font-size: 20px;
  font-weight: 600;
}

.dialog-card__content p {
  margin: 6px 0;
  color: rgba(29, 29, 29, 0.68);
}

#passwordDialog .form-control {
  margin-bottom: 10px;
  border-color: rgba(29, 29, 29, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: #1d1d1d;
  text-align: left;
}

#passwordDialog .form-control::placeholder {
  color: rgba(29, 29, 29, 0.42);
}

#passwordDialog .form-control:focus {
  border-color: rgba(29, 29, 29, 0.4);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 29, 29, 0.08);
}

#password-error {
  display: none;
  margin: 8px 0 0 !important;
  color: var(--danger);
  font-size: 14px;
}

#submitPasswordBtn {
  margin-top: 18px;
}

.dialog-close,
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
}

.dialog-card .dialog-close,
.layer-card .dialog-close {
  border-color: rgba(29, 29, 29, 0.08);
  background: rgba(29, 29, 29, 0.07);
  color: #1d1d1d;
}

.dialog-card .dialog-close:hover,
.layer-card .dialog-close:hover {
  border-color: rgba(29, 29, 29, 0.14);
  background: rgba(29, 29, 29, 0.12);
}

.layer {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.layer-card {
  position: relative;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  background: rgba(245, 245, 245, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(30px) saturate(1.4);
  animation: dialog-in 340ms var(--ease) both;
}

@keyframes layer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-card-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.layer-card__image {
  width: 100%;
  height: auto;
}

.share-view {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 140;
  display: block;
  width: min(838px, 100vw);
  max-height: 100dvh;
  aspect-ratio: 838 / 680;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.share-view__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top right;
}

.share-view.is-open .share-view__image {
  animation: share-image-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes share-image-in {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.share-view:focus {
  outline: 0;
}

.modal-content {
  width: min(1000px, 92vw);
  max-height: 82vh;
  background: transparent;
  object-fit: contain;
}

.image-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(1100px, 92vw);
  margin: 0;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.image-modal-content figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

#imageModalCounter {
  color: rgba(255, 255, 255, 0.52);
  font-variant-numeric: tabular-nums;
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.54);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.image-modal-nav:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(44, 44, 44, 0.78);
  transform: translateY(-50%) scale(1.04);
}

.image-modal-prev {
  left: 24px;
}

.image-modal-next {
  right: 24px;
}

#wechat-overlay {
  position: fixed;
  left: 50%;
  bottom: 58px;
  z-index: 12;
  display: none;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.54);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  transition: opacity 240ms ease;
}

#wechat-overlay.is-hiding {
  opacity: 0;
  pointer-events: none;
}

footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  padding: 12px 20px;
  color: rgba(230, 230, 230, 0.62);
  font-size: 12px;
  text-align: center;
  transition: opacity 180ms ease;
}

footer p {
  margin: 0;
}

footer a:hover {
  color: #fff;
}

body.has-active-view footer,
body.has-active-view #wechat-overlay {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 991px) {
  :root { --header-height: 60px; }

  #header h1 { font-size: 42px; }

  #header > .hero-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #header h2 {
    max-width: 720px;
    font-size: 18px;
    text-align: center;
  }

  #header .hero-actions {
    justify-content: center;
    margin-top: 22px;
  }

  .site-nav {
    margin-top: 0;
  }

  .site-nav__list {
    display: none;
  }

  .site-nav__toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 82;
    display: inline-grid;
    pointer-events: auto;
  }

  .site-nav__toggle i {
    pointer-events: none;
  }

  .site-nav.is-menu-open .site-nav__list {
    position: fixed;
    top: 64px;
    right: 14px;
    z-index: 81;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(280px, calc(100vw - 28px));
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--panel-radius);
    background: rgba(12, 12, 12, 0.97);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
  }

  .site-nav.is-menu-open .site-nav__link {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 5px;
  }

  .site-nav.is-menu-open .site-nav__link::after {
    display: none;
  }

  .site-nav.is-menu-open .site-nav__link.is-active {
    background: rgba(255, 255, 255, 0.1);
  }

  #header.is-compact > .hero-shell {
    flex-direction: row;
    align-items: center;
  }

  #header.is-compact h1 {
    font-size: 25px;
  }

  #header.is-compact .site-nav {
    margin: 0;
  }

  #header.is-compact .site-nav__toggle {
    top: 10px;
    right: 10px;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .carousel-item {
    flex-basis: calc((100% - 14px) / 2);
  }

  #videoRow,
  #portfolioContainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .view-shell,
  #header > .hero-shell {
    width: min(calc(100% - 28px), var(--page-width));
  }

  #header h1 {
    font-size: 36px;
    text-align: center;
  }

  #header h2 {
    font-size: 18px;
    line-height: 1.65;
  }

  #header .hero-actions {
    gap: 12px;
  }

  #header .hero-actions .icon-button {
    width: 42px;
    height: 42px;
  }

  #wechat-overlay {
    display: block;
  }

  .view > .view-shell {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .section-title {
    margin-bottom: 22px;
  }

  .section-title p {
    font-size: 26px;
  }

  .work-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }

  .filter-bar {
    width: 100%;
    margin-left: 0;
  }

  .work-type {
    align-self: flex-start;
  }

  .about-copy {
    padding-top: 22px;
  }

  .about-copy h3 {
    font-size: 22px;
  }

  .about-facts,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .count-box {
    min-height: 108px;
    padding: 20px 12px;
  }

  .count-box span {
    font-size: 28px;
  }

  .carousel-item {
    flex-basis: 86%;
  }

  .testimonial-item {
    min-height: 310px;
  }

  #videoRow,
  #portfolioContainer {
    grid-template-columns: 1fr;
  }

  .contact-grid,
  .field-stack {
    grid-template-columns: 1fr;
  }

  .portfolio-info {
    transform: translateY(0);
  }

  .image-modal-content img {
    max-height: 68vh;
  }

  .image-modal-nav {
    top: auto;
    bottom: 20px;
    width: 44px;
    height: 44px;
    transform: none;
  }

  .image-modal-nav:hover {
    transform: scale(1.04);
  }

  .image-modal-prev {
    left: calc(50% - 54px);
  }

  .image-modal-next {
    right: calc(50% - 54px);
  }

  #portfolio-flters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  #portfolio-flters::-webkit-scrollbar {
    display: none;
  }

  #portfolio-flters li,
  #portfolio-flters button {
    flex: 0 0 auto;
  }

  #portfolio-flters button {
    padding-inline: 12px;
  }

  .contact-card {
    min-height: 106px;
  }

  .contact-form {
    padding: 20px;
  }

  .count-box,
  .testimonial-item,
  .video-container,
  .contact-card,
  .contact-form {
    background: rgba(24, 24, 24, 0.82);
    backdrop-filter: none;
  }

  footer {
    padding: 8px 14px;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .startscreen {
    top: 27%;
  }

  .startscreen-headline1 {
    margin-top: 250px;
  }

  #header h2 {
    font-size: 16px;
  }

  .metric-grid {
    gap: 8px;
  }
}

/* Theme tokens for secondary views. */
body.has-active-view {
  --page-bg: #f5f5f5;
  --surface: #fff;
  --surface-soft: #f1f1f1;
  --surface-hover: #f7f7f7;
  --border: rgba(28, 28, 28, 0.12);
  --text: #1c1c1c;
  --muted: #707070;
  --accent: #1c1c1c;
  --accent-strong: #111;
  --accent-warm: #666;
  --accent-contrast: #fff;
  --danger: #555;
  --view-strong: #111;
  --view-copy: #444;
  --view-secondary: #666;
  --view-faint: #777;
  --view-card: #fff;
  --view-card-hover: #fff;
  --view-control: #fff;
  --view-input: #f2f2f2;
  --view-status: #e8e8e8;
  --view-dialog: rgba(245, 245, 245, 0.96);
  --view-header: rgba(250, 250, 250, 0.84);
  --view-header-border: rgba(28, 28, 28, 0.1);
  --view-header-link: rgba(0, 0, 0, 0.58);
  --view-menu: rgba(255, 255, 255, 0.98);
  --view-progress: #ddd;
  --view-scrollbar: #bbb;
  --view-overlay: rgba(255, 255, 255, 0.96);
  --view-shadow: 0 8px 24px rgba(28, 28, 28, 0.06);
  --view-hover-shadow: 0 16px 38px rgba(28, 28, 28, 0.1);
  --view-preview-shadow: 0 12px 30px rgba(28, 28, 28, 0.05);
  --view-preview-hover-shadow: 0 16px 36px rgba(28, 28, 28, 0.05);
  color-scheme: light;
  background: var(--bg);
}

html[data-theme="dark"] body.has-active-view {
  --page-bg: #111;
  --surface: #1c1c1c;
  --surface-soft: #181818;
  --surface-hover: #262626;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f4f4f4;
  --muted: #aaa;
  --accent: #e0e0e0;
  --accent-strong: #fff;
  --accent-warm: #bcbcbc;
  --accent-contrast: #111;
  --danger: #c4c4c4;
  --view-strong: #f5f5f5;
  --view-copy: #c9c9c9;
  --view-secondary: #aaa;
  --view-faint: #888;
  --view-card: #191919;
  --view-card-hover: #202020;
  --view-control: #1c1c1c;
  --view-input: #151515;
  --view-status: #242424;
  --view-dialog: rgba(26, 26, 26, 0.96);
  --view-header: rgba(18, 18, 18, 0.88);
  --view-header-border: rgba(255, 255, 255, 0.1);
  --view-header-link: rgba(255, 255, 255, 0.66);
  --view-menu: rgba(22, 22, 22, 0.98);
  --view-progress: #383838;
  --view-scrollbar: #5b5b5b;
  --view-overlay: rgba(20, 20, 20, 0.96);
  --view-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --view-hover-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  --view-preview-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --view-preview-hover-shadow: 0 16px 36px rgba(0, 0, 0, 0.11);
  color-scheme: dark;
}

body.has-active-view #video-background {
  opacity: 0;
  pointer-events: none;
  filter: none;
  transform: scale(1.025);
}

body.is-returning-home #video-background {
  opacity: 1;
  transform: scale(1);
}

body.is-entering-view #video-background {
  opacity: 1;
  transform: scale(1);
}

body.has-active-view .view {
  background: var(--page-bg);
  scrollbar-color: var(--view-scrollbar) transparent;
}

#header.is-compact {
  border-bottom-color: var(--view-header-border);
  background: var(--view-header);
  box-shadow: 0 1px 18px rgba(28, 28, 28, 0.06);
}

#header.is-compact h1 a,
#header.is-compact .site-nav__link {
  color: var(--text);
}

#header.is-compact .site-nav__link {
  color: var(--view-header-link);
}

#header.is-compact .site-nav__link:hover,
#header.is-compact .site-nav__link.is-active {
  color: var(--accent-strong);
}

#header.is-compact .site-nav__link::after {
  background: var(--accent);
}

#header.is-compact .site-nav__toggle {
  border-color: var(--border);
  background: var(--view-control);
  color: var(--text);
}

#header.is-compact .site-nav__toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

#header.is-compact .hero-actions {
  display: flex;
  margin: 0 0 0 12px;
}

#header.is-compact .hero-actions > :not(.theme-toggle) {
  display: none;
}

#header.is-compact .theme-toggle {
  display: inline-grid;
  border-color: var(--border);
  background: var(--view-control);
  color: var(--text);
}

#header.is-compact .theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .section-title h2,
body.has-active-view .skills .val {
  color: var(--view-faint);
}

body.has-active-view .section-title p,
body.has-active-view .about-copy h3,
body.has-active-view .about-copy li strong {
  color: var(--view-strong);
  text-shadow: none;
}

body.has-active-view .about-copy p {
  color: var(--view-copy);
  text-shadow: none;
}

body.has-active-view .about-copy li,
body.has-active-view .skills .skill {
  color: var(--view-copy);
}

body.has-active-view .about-copy li i {
  color: var(--view-faint);
}

body.has-active-view .testimonial-item .quote-icon-left {
  color: var(--accent);
}

body.has-active-view .progress-bar-wrap {
  background: var(--view-progress);
}

body.has-active-view .progress-bar {
  background: var(--accent);
}

body.has-active-view .about-portrait {
  border-color: var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

body.has-active-view .count-box,
body.has-active-view .testimonial-item,
body.has-active-view .video-container,
body.has-active-view .contact-card,
body.has-active-view .contact-form {
  border-color: var(--border);
  background: var(--view-card);
  color: var(--view-strong);
  box-shadow: var(--view-shadow);
}

body.has-active-view .count-box span,
body.has-active-view .testimonial-item h3,
body.has-active-view .video-copy h3,
body.has-active-view .contact-card h3 {
  color: var(--view-strong);
}

body.has-active-view .count-box p,
body.has-active-view .testimonial-item p,
body.has-active-view .testimonial-item h4,
body.has-active-view .video-copy p,
body.has-active-view .contact-card p {
  color: var(--view-secondary);
}

body.has-active-view .count-box:hover,
body.has-active-view .testimonial-item:hover,
body.has-active-view .video-container:hover,
body.has-active-view .contact-card:hover {
  border-color: var(--accent);
  background: var(--view-card-hover);
  color: var(--text);
  box-shadow: var(--view-hover-shadow);
}

body.has-active-view .count-box:hover span,
body.has-active-view .testimonial-item:hover h3,
body.has-active-view .video-container:hover h3,
body.has-active-view .contact-card:hover h3 {
  color: var(--text);
}

body.has-active-view .count-box:hover p,
body.has-active-view .testimonial-item:hover p,
body.has-active-view .testimonial-item:hover h4,
body.has-active-view .video-container:hover p,
body.has-active-view .contact-card:hover p {
  color: var(--muted);
}

body.has-active-view .testimonial-item:hover .quote-icon-left {
  color: var(--accent);
}

body.has-active-view .testimonial-img {
  border-color: var(--border);
}

body.has-active-view .carousel-button {
  border-color: var(--border);
  background: var(--view-control);
  color: var(--text);
}

body.has-active-view .carousel-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .carousel-dot {
  background: var(--view-faint);
}

body.has-active-view .carousel-dot.active {
  background: var(--accent);
}

body.has-active-view .video-play {
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .video-media {
  background: #000;
}

body.has-active-view .work-type {
  border-color: var(--border);
  background: var(--view-control);
  color: var(--muted);
}

body.has-active-view #portfolio-flters button {
  border-color: var(--border);
  background: var(--view-control);
  color: var(--text);
}

body.has-active-view #portfolio-flters button:hover,
body.has-active-view #portfolio-flters button.filter-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .portfolio-wrap {
  border-color: var(--border);
  background: var(--view-card);
}

body.has-active-view .video-container,
body.has-active-view .portfolio-wrap {
  border-radius: var(--panel-radius);
  box-shadow: var(--view-preview-shadow);
}

body.has-active-view .video-container:hover,
body.has-active-view .portfolio-wrap:hover,
body.has-active-view .portfolio-wrap:focus-within {
  box-shadow: var(--view-preview-hover-shadow);
}

body.has-active-view .portfolio-wrap:hover,
body.has-active-view .portfolio-wrap:focus-within {
  border-color: var(--accent);
}

body.has-active-view .portfolio-info {
  background: var(--view-overlay);
  color: var(--view-strong);
}

body.has-active-view .portfolio-open {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .contact-view .info-icon {
  background: var(--accent);
  color: var(--accent-contrast);
}

body.has-active-view .contact-card:hover .info-icon {
  background: var(--surface-hover);
  color: var(--accent-strong);
}

body.has-active-view .contact-socials a,
body.has-active-view .contact-socials button {
  color: var(--view-secondary);
}

body.has-active-view .contact-card:hover .contact-socials a,
body.has-active-view .contact-card:hover .contact-socials button {
  color: var(--accent-strong);
}

body.has-active-view .form-control {
  border-color: var(--border);
  background: var(--view-input);
  color: var(--text);
}

body.has-active-view .form-control::placeholder {
  color: var(--view-faint);
}

body.has-active-view .form-control:focus {
  border-color: var(--accent);
  background: var(--view-control);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

body.has-active-view .contact-form button[type="submit"] {
  background: var(--accent) !important;
  color: var(--accent-contrast) !important;
}

body.has-active-view .contact-form button[type="submit"]:hover {
  background: var(--accent-strong) !important;
}

body.has-active-view .loading,
body.has-active-view .error-message,
body.has-active-view .sent-message {
  background: var(--view-status);
  color: var(--text);
}

body.has-active-view .layer-card,
body.has-active-view .dialog-card {
  border-color: var(--border);
  background: var(--view-dialog);
  color: var(--text);
}

html[data-theme="dark"] .dialog-card,
html[data-theme="dark"] .layer-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(26, 26, 26, 0.96);
  color-scheme: dark;
}

html[data-theme="dark"] .dialog-card__content,
html[data-theme="dark"] .dialog-card__content h3,
html[data-theme="dark"] .dialog-card__content h4 {
  color: #f4f4f4;
}

html[data-theme="dark"] .dialog-card__content p {
  color: rgba(244, 244, 244, 0.68);
}

html[data-theme="dark"] #passwordDialog .form-control {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
}

html[data-theme="dark"] #passwordDialog .form-control::placeholder {
  color: rgba(244, 244, 244, 0.42);
}

html[data-theme="dark"] .dialog-card .dialog-close,
html[data-theme="dark"] .layer-card .dialog-close {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
}

body.has-active-view .image-modal-nav {
  background: rgba(17, 17, 17, 0.64);
  color: #fff;
}

body.has-active-view .image-modal-content figcaption,
body.has-active-view #imageModalCounter {
  color: #ccc;
}

body.has-active-view button:focus-visible,
body.has-active-view a:focus-visible,
body.has-active-view input:focus-visible,
body.has-active-view textarea:focus-visible {
  outline-color: var(--accent);
}

@media (max-width: 991px) {
  #header.is-compact .site-nav.is-menu-open .site-nav__list {
    border-color: var(--border);
    background: var(--view-menu);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  }

  #header.is-compact .site-nav.is-menu-open .site-nav__link {
    color: var(--text);
  }

  #header.is-compact .site-nav.is-menu-open .site-nav__link:hover,
  #header.is-compact .site-nav.is-menu-open .site-nav__link.is-active {
    background: var(--accent);
    color: var(--accent-contrast);
  }

  #header.is-compact .hero-actions {
    position: fixed;
    top: 10px;
    right: 60px;
    left: auto;
    margin: 0;
  }

}

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

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