/* ============================================================
   CQWI — Beijing Woke Technology Co., Ltd.
   Aesthetic: tropical modernism × editorial retail
   Self-hosted variable fonts. No third-party requests.
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  --paper:    #faf5ed;
  --paper-2:  #f2eadd;
  --surface:  #ffffff;

  --ink:      #191e1a;
  --ink-2:    #5a625b;
  --ink-3:    #8a9089;

  --jade:     #1d4436;
  --jade-2:   #2a6650;
  --clay:     #c05a2e;
  --sun:      #dfa43f;

  --line:     #e2d8c8;
  --line-2:   #efe7da;

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  --max: 1180px;
  --gut: clamp(20px, 5vw, 56px);

  --r: 3px;
  --r-lg: 6px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #101410;
    --paper-2:  #171c18;
    --surface:  #1c221d;

    --ink:      #efebe1;
    --ink-2:    #a3aaa2;
    --ink-3:    #757c76;

    --jade:     #74c2a2;
    --jade-2:   #8fd4b8;
    --clay:     #e28a57;
    --sun:      #e8b863;

    --line:     #2a312b;
    --line-2:   #222923;
  }
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* paper grain — pure CSS, no image request */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  body::before { opacity: .05; }
}

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

a { color: inherit; }

::selection { background: var(--sun); color: #191e1a; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.06;
  margin: 0;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
}

.display {
  font-size: clamp(2.9rem, 8.2vw, 6.1rem);
  line-height: .96;
  letter-spacing: -0.035em;
  font-weight: 400;
}

.h-xl { font-size: clamp(2rem, 4.6vw, 3.3rem); }
.h-lg { font-size: clamp(1.55rem, 3vw, 2.15rem); }
.h-md { font-size: clamp(1.15rem, 1.9vw, 1.4rem); letter-spacing: -0.015em; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--clay);
  flex: none;
}

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 54ch;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 2.6em 0 .7em; }
.prose h3 { font-size: 1.06rem; font-family: var(--sans); font-weight: 700; letter-spacing: -0.005em; margin: 2em 0 .5em; }
.prose ul { padding-left: 1.15em; margin: 0 0 1.15em; }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--clay); }
.prose > p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }

.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 66px;
}

.mark {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-variation-settings: 'WONK' 1;
}

.mark span {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--clay);
  transform: translateY(-6px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
}

.site-nav a {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .005em;
  text-decoration: none;
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
  transition: color .25s var(--ease);
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .site-head .wrap { flex-direction: column; align-items: flex-start; padding-top: 14px; padding-bottom: 12px; gap: 8px; }
  .site-nav { gap: 16px; flex-wrap: wrap; }
  .site-nav a { font-size: 12.5px; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(64px, 11vw, 132px) 0 clamp(52px, 8vw, 96px);
  overflow: hidden;
}

/* soft tropical light wash */
.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -18%;
  width: 68vw;
  height: 68vw;
  max-width: 820px;
  max-height: 820px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 42% 38%,
      color-mix(in srgb, var(--sun) 34%, transparent) 0%,
      color-mix(in srgb, var(--clay) 15%, transparent) 38%,
      transparent 68%);
  filter: blur(28px);
  z-index: 0;
}

.hero > .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 6vw, 76px);
  align-items: end;
}

.hero h1 em {
  font-style: italic;
  font-variation-settings: 'WONK' 1, 'SOFT' 8;
  color: var(--jade);
}

.hero .lead { margin-top: 30px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

/* editorial metadata column */
.spec {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  min-width: 210px;
}

.spec dl { margin: 0; }

.spec div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.spec dd {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: right;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .spec { margin-top: 8px; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}

.btn-primary {
  background: var(--jade);
  color: var(--paper);
  border-color: var(--jade);
}

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #101410; }
}

.btn-primary:hover { background: var(--jade-2); border-color: var(--jade-2); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- marquee ---------- */

.marquee {
  border-block: 1px solid var(--line);
  background: var(--paper-2);
  padding: 15px 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
  animation: slide 34s linear infinite;
  will-change: transform;
}

.marquee em {
  font-family: var(--display);
  font-style: normal;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.marquee i {
  color: var(--clay);
  font-style: normal;
  font-size: 11px;
}

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- generic section ---------- */

.section { padding: clamp(60px, 9vw, 116px) 0; }
.section-tight { padding: clamp(46px, 6vw, 76px) 0; }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: clamp(34px, 5vw, 58px); }
.section-head .lead { margin-top: 18px; }

/* ---------- category cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .45s var(--ease), border-color .45s var(--ease);
}

.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--jade) 45%, var(--line)); }

/* abstract swatch — replace .card-art background with a real photo later */
.card-art {
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--jade) 0%, var(--jade-2) 55%, var(--sun) 130%);
}

.card:nth-child(2) .card-art { background: linear-gradient(150deg, var(--clay) 0%, var(--sun) 78%, #f0d9a8 130%); }
.card:nth-child(3) .card-art { background: linear-gradient(150deg, #3d5a4c 0%, var(--jade-2) 48%, #a9c9ad 130%); }

.card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(58deg, rgba(255,255,255,.14) 0 1px, transparent 1px 13px);
  mix-blend-mode: overlay;
}

.card-art b {
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 2;
  font-family: var(--display);
  font-size: 46px;
  font-weight: 300;
  line-height: 1;
  color: rgba(255,255,255,.8);
  font-variant-numeric: tabular-nums;
}

.card-body { padding: 20px 22px 24px; }
.card-body h3 { font-size: 1.16rem; margin-bottom: 8px; }
.card-body p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* ---------- process / numbered steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.step {
  background: var(--paper);
  padding: 30px 26px 34px;
}

.section-alt .step { background: var(--paper-2); }

.step .num {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--clay);
  margin-bottom: 16px;
}

.step h3 { font-size: 1.06rem; margin-bottom: 9px; }
.step p { font-size: 14.5px; color: var(--ink-2); line-height: 1.62; margin: 0; }

/* ---------- markets ---------- */

/* full-bleed hairlines, gutter-respecting content */
.markets { border-top: 1px solid var(--line); }

.markets > .wrap {
  border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease);
}

.markets > .wrap:hover { background: color-mix(in srgb, var(--jade) 5%, transparent); }

.market {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 26px 0;
}

.market > * { min-width: 0; }

.market code {
  font-family: var(--mono);
  font-size: .92em;
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.market .code {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--jade);
  line-height: 1;
}

.market h3 { font-size: 1.14rem; margin-bottom: 4px; }
.market p { font-size: 14px; color: var(--ink-2); margin: 0; }

.tag {
  justify-self: end;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  white-space: nowrap;
}

.tag-live {
  color: var(--jade);
  border-color: color-mix(in srgb, var(--jade) 40%, transparent);
  background: color-mix(in srgb, var(--jade) 9%, transparent);
}

@media (max-width: 640px) {
  .market { grid-template-columns: 64px minmax(0, 1fr); row-gap: 10px; }
  .market .code { font-size: 1.6rem; }
  .tag { grid-column: 2; justify-self: start; }
}

/* ---------- storefront callout ---------- */

.storefront {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: clamp(28px, 4.4vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
}

.storefront h2 { margin-bottom: 12px; }
.storefront p { color: var(--ink-2); max-width: 50ch; margin: 0; font-size: 15px; }

@media (max-width: 760px) {
  .storefront { grid-template-columns: 1fr; }
}

/* ---------- contact / definition blocks ---------- */

.deflist { border-top: 1px solid var(--line); }

.deflist > .wrap {
  border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease);
}

.deflist > .wrap:hover { background: color-mix(in srgb, var(--jade) 5%, transparent); }

.deflist .row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px);
  padding: 24px 0;
  margin: 0;
}

.deflist dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 3px;
}

.deflist dd { margin: 0; }
.deflist dd a { color: var(--jade); text-decoration-color: color-mix(in srgb, var(--jade) 35%, transparent); text-underline-offset: 3px; }
.deflist dd a:hover { color: var(--clay); }
.deflist .note { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }

@media (max-width: 640px) {
  .deflist .row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: clamp(46px, 6vw, 72px) 0 40px;
  margin-top: auto;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 56px);
  padding-bottom: 40px;
}

.foot-grid h4 {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}

.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 9px; }

.foot-grid a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .25s var(--ease);
}

.foot-grid a:hover { color: var(--clay); }

.foot-about p { font-size: 14px; color: var(--ink-2); max-width: 40ch; line-height: 1.62; }
.foot-about .mark { margin-bottom: 14px; }

.foot-base {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}

@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
}

/* ---------- legal page header ---------- */

.page-head {
  padding: clamp(52px, 7vw, 90px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.page-head .updated {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--ink-3);
  margin-top: 18px;
}

/* ---------- entrance choreography ---------- */

/* Initial state lives in the keyframe, never as a static rule — if animation
   never runs (scraper, reduced motion, CSS partially applied) content stays
   visible. Total run stays under .8s so crawlers capture a painted page. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .5s var(--ease) both; }
  .d1 { animation-delay: .04s; }
  .d2 { animation-delay: .1s; }
  .d3 { animation-delay: .16s; }
  .d4 { animation-delay: .22s; }
  .d5 { animation-delay: .28s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- utilities ---------- */

.stack-lg > * + * { margin-top: 22px; }
.mt-lg { margin-top: clamp(34px, 5vw, 54px); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
