/* ==========================================================================
   Urbanergy — Design system
   Tokens, type scale, primitives.

   Type scale rule: nothing that carries meaning may render below 12px.
   12px is reserved for mono uppercase labels only (they gain legibility from
   tracking and caps). Body copy starts at 17px. Prose never drops under 15px.
   ========================================================================== */

:root {
  /* colour */
  --bone: #F3F0E7;
  --bone-2: #EBE6D8;
  --paper: #FBFAF4;
  --ink: #0E1210;
  --ink-2: #171D19;
  --muted: #4F574F;
  --rule: #D2CDBF;
  --cyan: #00BFFF;
  --cyan-ink: #00626E;
  --teal: #06363B;
  --teal-2: #0A454B;
  --yellow: #F2E500;
  --yellow-2: #E4D800;

  /* layout */
  --shell: 1680px;
  --gutter: 40px;
  --header-h: 72px;

  /* type scale */
  --fs-micro: 12px;
  --fs-meta: 12.5px;
  --fs-small: 14px;
  --fs-body: 15.5px;
  --fs-lead: 17px;

  /* measure */
  --measure: 62ch;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: 'Archivo', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }

/* Chinese typesetting: CJK glyphs need looser tracking and more leading
   than the tight Latin display scale. */
html[lang='zh-Hans'] :is(h1, h2, h3, h4, blockquote, .display, .hero-promise, .value-banner, .menu-nav a) {
  letter-spacing: 0;
  font-stretch: normal;
  text-wrap: pretty;
}
html[lang='zh-Hans'] :is(h1, h2) {
  line-height: 1.14;
}
html[lang='zh-Hans'] .hero h1 {
  line-height: 1.12;
}

img { display: block; max-width: 100%; height: auto; }

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

button { font: inherit; color: inherit; }

::selection { background: var(--yellow); color: var(--ink); }

:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 3px; }

[hidden] { display: none !important; }

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.mono {
  font-family: 'Azeret Mono', 'Noto Sans SC', ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.section {
  padding: clamp(64px, 7vw, 108px) 0;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* Shared display heading: one ramp, used everywhere */
.display {
  margin: 0;
  font-size: clamp(36px, 4.4vw, 62px);
  line-height: 0.99;
  letter-spacing: -0.04em;
  font-weight: 500;
  text-wrap: balance;
}

.display em {
  font-style: normal;
  color: var(--cyan-ink);
}

.section-lede {
  margin: 18px 0 0;
  max-width: 58ch;
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: #3D453F;
}

.prose p {
  margin: 0 0 16px;
  max-width: var(--measure);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: #3D453F;
}

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

/* ==========================================================================
   Reveal / scroll animations
   ========================================================================== */

[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0ms);
}

[data-media] {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], [data-media] { opacity: 1; transform: none; clip-path: none; }
}

/* ==========================================================================
   Buttons / links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 12px 10px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.1;
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn .dot {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:hover .dot { transform: rotate(45deg); }

.btn-ink { background: var(--ink); color: var(--bone); }
.btn-ink .dot { background: var(--yellow); color: var(--ink); }
.btn-ink:hover { background: var(--teal); }

.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow .dot { background: var(--ink); color: var(--yellow); }
.btn-yellow:hover { background: var(--paper); }

.btn-outline {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.btn-outline .dot { background: var(--ink); color: var(--bone); }
.btn-outline:hover { background: var(--ink); color: var(--bone); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.text-link span { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

.text-link:hover { color: var(--cyan-ink); border-color: var(--cyan-ink); }
.text-link:hover span { transform: translateX(4px); }

/* ==========================================================================
   Section kicker
   ========================================================================== */

.sec-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: 'Azeret Mono', 'Noto Sans SC', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--cyan-ink);
  margin-bottom: 18px;
}

.sec-kicker::before {
  content: "";
  width: 26px; height: 1px; background: var(--cyan-ink);
  display: block;
  flex: none;
}

.sec-kicker--light { color: rgba(243, 240, 231, 0.66); }
.sec-kicker--light::before { background: var(--cyan); }

/* ==========================================================================
   Dot-terminated heading accent
   ========================================================================== */

.dot-end {
  display: inline-block;
  width: 0.085em;
  height: 0.085em;
  background: var(--cyan-ink);
  border-radius: 50%;
  margin-left: 0.035em;
  vertical-align: 0.02em;
}

/* ==========================================================================
   Scroll progress (mobile)
   ========================================================================== */

.progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--yellow);
  z-index: 80;
  pointer-events: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--yellow);
  color: var(--ink);
  font-family: 'Azeret Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(14, 18, 16, 0.15);
  z-index: 10000;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .site-header,
  .menu,
  .progress,
  .depth,
  .cta-mark {
    display: none !important;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
}
