/* ===========================================================
   Torch Creative — design tokens
   =========================================================== */
:root{
  --ink: #12121A;
  --cream: #F3EFE4;
  --dark: #0A0E18;

  --c-a: #ADA1EE;
  --c-web: #8FC6FF;
  --c-marketing: #FF9FB4;
  --c-ai: #7FE6D4;
  --c-analytics: #CBA9F5;
  --c-work: #FFB37E;
  --c-cta: #FF8266;

  --header-h: 68px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-display: "Space Grotesk", "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.16,.8,.24,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}

p{ margin: 0; }
a{ color: inherit; text-decoration: none; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
img{ max-width: 100%; }

.wrap{
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 28px;
}

.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--cream); padding: 10px 16px;
  border-radius: 0 0 8px 0; z-index: 1000; font-weight: 600;
}
.skip-link:focus{ left: 0; }

/* ===========================================================
   Section progress (segmented, fixed to the viewport bottom)
   =========================================================== */
.section-progress{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex;
  height: 34px;
  background: var(--cream);
}
.section-progress .seg{
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18,18,26,0.05);
  color: rgba(18,18,26,0.32);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-right: 1px solid rgba(18,18,26,0.06);
  margin: 0;
  padding: 0;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.section-progress .seg:last-child{ border-right: none; }
.section-progress .seg:hover{ background: rgba(18,18,26,0.1); color: var(--ink); }
.section-progress .seg.is-lit{ background: var(--seg-color); color: var(--ink); }
.section-progress .seg.is-lit:hover{ filter: brightness(0.94); }
.section-progress .seg:focus-visible{ outline: 2px solid var(--ink); outline-offset: -2px; }

/* ===========================================================
   Buttons
   =========================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  border: 1.5px solid var(--ink);
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  cursor: pointer;
}
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0); }

.btn-solid{ background: var(--ink); color: var(--cream); }
.btn-solid:hover{ background: #2a2a38; }

.btn-outline{ background: transparent; color: var(--ink); }
.btn-outline:hover{ background: rgba(18,18,26,0.08); }

.btn-lg{ padding: 13px 24px; font-size: 0.92rem; }

/* ===========================================================
   Header
   =========================================================== */
.site-header{
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(243,239,228,0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(18,18,26,0.1);
}

.header-inner{
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand{ display: inline-flex; align-items: center; }
.brand-word{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.site-footer .brand-word{ color: var(--cream); }

.header-right{
  display: flex;
  align-items: center;
  gap: 40px;
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.main-nav a{ position: relative; transition: opacity .2s; }
.main-nav a:hover{ opacity: 0.6; }

.header-cta{ display: flex; align-items: center; gap: 10px; }

.lang-toggle{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-right: 4px;
  background: transparent;
  border: 1.5px solid rgba(18,18,26,0.25);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(18,18,26,0.5);
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.lang-toggle:hover{ border-color: var(--ink); }
.lang-toggle .lang-div{ opacity: 0.4; }
.lang-toggle .lang-opt.is-active{ color: var(--ink); }
.lang-toggle-mobile{ align-self: flex-start; margin: 14px 4px 4px; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: 1.5px solid rgba(18,18,26,0.25);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span{
  width: 18px; height: 1.5px; margin-inline: auto;
  background: var(--ink);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav{
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px 28px 22px;
  border-top: 1px solid rgba(18,18,26,0.1);
  background: rgba(243,239,228,0.98);
}
.mobile-nav a:not(.btn){
  padding: 14px 4px;
  border-bottom: 1px solid rgba(18,18,26,0.1);
  color: var(--ink);
  font-weight: 600;
}
.mobile-nav a.btn{ margin-top: 10px; }
.mobile-nav.is-open{ display: flex; }

/* ===========================================================
   Portfolio overlay
   =========================================================== */
.portfolio-overlay{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.portfolio-overlay.is-open{ display: flex; }
.portfolio-overlay-backdrop{
  position: absolute; inset: 0;
  background: rgba(18,18,26,0.55);
  backdrop-filter: blur(3px);
}
.portfolio-panel{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.5);
  animation: portfolio-in .3s var(--ease);
}
@keyframes portfolio-in{
  from{ opacity: 0; transform: translateY(12px) scale(0.98); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
.portfolio-close{
  position: absolute;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(18,18,26,0.18);
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}
.portfolio-close:hover{ background: rgba(18,18,26,0.08); }
.portfolio-panel h2{ font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 6px 0 26px; }
.eyebrow-mark{
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
}

.portfolio-list{ display: flex; flex-direction: column; }
.portfolio-list li{ border-top: 1.5px dashed rgba(18,18,26,0.18); }
.portfolio-list li:last-child{ border-bottom: 1.5px dashed rgba(18,18,26,0.18); }
.portfolio-list a{
  display: block;
  padding: 20px 4px;
  transition: opacity .2s;
}
.portfolio-list a:hover{ opacity: 0.65; }
.portfolio-item-tag{
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 6px;
}
.portfolio-list h3{ font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.portfolio-list p{ font-size: 0.88rem; opacity: 0.7; line-height: 1.5; margin-bottom: 8px; }
.portfolio-item-link{ font-size: 0.8rem; font-weight: 700; }

/* ===========================================================
   Color blocks (shared)
   =========================================================== */
.block{
  position: relative;
  background: var(--block-bg, var(--cream));
  color: var(--ink);
  overflow: hidden;
}

.block-inner{
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 56px;
  min-height: clamp(560px, 84vh, 800px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.block-num{
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 18px;
}

.side-rail{
  position: absolute;
  top: calc(var(--header-h) + 40px);
  bottom: 40px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 2;
  pointer-events: none;
}
.side-rail-index{
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.4;
  margin-bottom: 8px;
}
.side-rail-label{
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.55;
}
.side-rail-label::after{ content: " \\"; }
.side-rail-line{
  flex: 1;
  width: 1px;
  margin-top: 14px;
  background: currentColor;
  opacity: 0.22;
}

/* ===========================================================
   01 — split hero
   =========================================================== */
.block-content--split{
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  gap: 56px;
  align-items: start;
}
.giant-headline{
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  max-width: 13ch;
}

#top .block-inner{
  min-height: 100svh;
  justify-content: center;
}
#top .giant-headline{
  font-size: clamp(3rem, 7.4vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.split-meta{ padding-top: 10px; max-width: 44ch; }
.meta-body{ font-size: 1rem; line-height: 1.6; margin-bottom: 26px; }
.hero-ctas{ display: flex; flex-wrap: wrap; gap: 12px; }
.meta-audience{ margin-top: 16px; font-size: 0.8rem; font-weight: 600; opacity: 0.6; max-width: 34ch; }

.scroll-link{
  display: inline-flex;
  margin-top: 40px;
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.75;
  transition: opacity .2s;
}
.scroll-link:hover{ opacity: 1; }

/* ===========================================================
   Interlude photo
   =========================================================== */
.block--visual{ background: var(--dark); min-height: 62vh; }
.visual-photo{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9);
}
.block--visual::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,24,0.15), rgba(10,14,24,0.55));
}
.visual-caption{
  position: absolute;
  left: 28px; bottom: 26px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.85;
}

/* ===========================================================
   02–05 — service blocks
   =========================================================== */
.block-content--stack{ max-width: 820px; }
.stack-top{ display: flex; align-items: center; }
.stack-sub{ font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; opacity: 0.7; }
.giant-word{ font-size: clamp(3rem, 8vw, 6.2rem); line-height: 0.95; margin-bottom: 22px; }
.stack-package{ font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.stack-body{ font-size: 0.98rem; line-height: 1.6; max-width: 56ch; opacity: 0.85; }

/* ===========================================================
   05 — Contact
   =========================================================== */
.block--cta .giant-headline{ max-width: 14ch; margin-bottom: 22px; }
.cta-desc{ margin-bottom: 40px; }
.cta-actions{ display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.cta-top-link{ margin-top: 0; }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer{
  background: var(--dark);
  color: var(--cream);
  padding: 56px 0 40px;
}
.footer-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.footer-tag{ color: rgba(243,239,228,0.7); font-size: 0.94rem; }
.footer-copy{ color: rgba(243,239,228,0.45); font-size: 0.82rem; margin-top: 18px; }

/* ===========================================================
   Chinese-locale type adjustments
   =========================================================== */
body.lang-zh .giant-headline,
body.lang-zh .giant-word,
body.lang-zh .brand-word{ letter-spacing: 0; }
body.lang-zh .meta-body,
body.lang-zh .stack-body{ line-height: 1.85; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 980px){
  .header-right{ display: none; }
  .nav-toggle{ display: flex; }
  .side-rail{ display: none; }
  .block-content--split{ grid-template-columns: 1fr; gap: 40px; }
  .split-meta{ max-width: 60ch; }
}

@media (max-width: 640px){
  .block-inner{ padding-top: calc(var(--header-h) + 40px); padding-bottom: 56px; }
  .cta-actions{ flex-direction: column; align-items: stretch; }
  .cta-actions .btn{ width: 100%; }
  .visual-caption{ left: 20px; bottom: 20px; font-size: 0.68rem; }
  .section-progress .seg{ font-size: 0.56rem; letter-spacing: 0.01em; padding-inline: 2px; }
}
