/* ============================================================================
   STYLE MAP
   Keep this file in runtime order. The entry screen, hero water surface,
   services scroll story, and work gallery rely on later override layers.

   Safe edit zones:
   1. tokens and base page styles
   2. top/bottom navigation
   3. content sections: about, services, works, contact
   4. final correction layers at the end of the file

   Frozen visual chains:
   - entry packaging seal and calibration styles
   - hero kinetic water canvas and hero scroll progress
   - services white-stage transition
   - work gallery overlay and horizontal/detail motion
   ============================================================================ */
:root {
  --bg: #f3efe7;
  --bg-soft: #ece7de;
  --warm-paper: #f7f4ee;
  --warm-paper-deep: #eee9df;
  --warm-ink: #141414;
  --warm-muted: rgba(20, 20, 20, 0.58);
  --ink: #101114;
  --ink-soft: rgba(16, 17, 20, 0.72);
  --line: rgba(16, 17, 20, 0.1);
  --white: #f7f4ef;
  --panel-dark: #090a0d;
  --panel-dark-2: #101217;
  --panel-dark-3: #151820;
  --muted-light: rgba(238, 234, 227, 0.72);
  --muted-dark: rgba(16, 17, 20, 0.62);
  --accent-cyan: #49c4ff;
  --accent-lime: #92fa68;
  --accent-amber: #ffdf58;
  --accent-pink: #ff84c2;
  --accent-violet: #9784ff;
  --page-width: min(1440px, calc(100vw - 56px));
  --matte-border: rgba(255, 255, 255, 0.08);
  --matte-border-soft: rgba(255, 255, 255, 0.045);
  --matte-highlight: rgba(255, 255, 255, 0.05);
  --matte-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
  --grain-opacity-strong: 0.16;
  --grain-opacity-soft: 0.08;
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --site-top-safe: clamp(56px, 8svh, 84px);
  --bottom-nav-safe: clamp(104px, 14svh, 140px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--warm-paper);
}

html,
body,
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body:not(.has-entered) {
  overflow: hidden;
}

html.nav-jump-instant {
  scroll-behavior: auto !important;
}

html.snap-active {
  scroll-snap-type: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Satoshi", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: rgba(20, 24, 28, 0.88);
  background: #f8f6f2;
  overflow-x: clip;
}

.portrait-about-wrapper,
.services-section,
.service-work-transition,
.works-section,
.clients-section,
.contact-section {
  inline-size: 100%;
  min-block-size: 100svh;
}

/* Keep body black during the entry → hero transition so the cream brand
   color never flashes through between phases. Restored on has-entered. */
body.is-unfolding,
body.is-entering {
  background: #000;
}

.site-svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filters%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: var(--grain-opacity-strong);
  mix-blend-mode: soft-light;
}

body::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.008) 0px,
      rgba(255, 255, 255, 0.008) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.1;
  mix-blend-mode: overlay;
}

body:not(.has-entered) {
  overflow: hidden;
}

body.is-entry-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

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

button {
  font: inherit;
}

main > section {
  width: 100%;
  margin: 0;
  scroll-margin-top: var(--site-top-safe);
}

.top-meta-inner {
  position: relative;
}

.top-meta-inner::selection {
  background: transparent;
}

.top-meta-inner > * {
  position: relative;
  z-index: 1;
}

.accent {
  color: rgba(236, 232, 225, 0.38);
}
