/* Cheerise Topline Limited — base stylesheet */

:root {
  --ink: #16242b;
  --ink-mid: #4a5c62;
  --ink-soft: #77878c;
  --paper: #f1f2ed;
  --card: #ffffff;
  --jade: #1b6b5b;
  --jade-deep: #114438;
  --brass: #a8762f;
  --rule: rgba(22, 36, 43, 0.15);
  --rule-strong: rgba(22, 36, 43, 0.35);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --han: "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", sans-serif;

  --shell: 1180px;
  --rail: 168px;
  --gap: 48px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  font-optical-sizing: auto;
}

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

/* Firefox sizes a viewBox-only <svg> to fill its container, where Chrome falls
   back to 300x150. That difference is what made the old icons render huge in
   Firefox only. Guard against it: any inline SVG without explicit dimensions
   stays at text size. To opt out, give the SVG width and height attributes
   (as the masthead logo does) or its own sizing rule. */
svg { max-width: 100%; }
svg:not([width]):not([height]) { width: 1em; height: 1em; }

a { color: inherit; }

::selection { background: var(--brass); color: #fff; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 30;
}

.masthead .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.022em;
  text-decoration: none;
  line-height: 1.1;
}

.wordmark .logo {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.wordmark .lens { fill: var(--brass); }

.wordmark .ring {
  fill: none;
  stroke: var(--jade);
  stroke-width: 1.5;
}

.wordmark span {
  display: block;
  font-family: var(--han);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  margin-top: 3px;
}

.nav {
  display: flex;
  gap: 28px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav a:hover { border-bottom-color: var(--rule-strong); }

.nav a[aria-current="page"] {
  border-bottom-color: var(--jade);
  color: var(--jade-deep);
}

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

.hero {
  padding: 104px 0 76px;
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(2.6rem, 6.4vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 15ch;
}

.hero h1 em {
  font-style: normal;
  display: block;
}

.hero-lede {
  margin: 36px 0 0;
  max-width: 54ch;
  font-size: 1.16rem;
  color: var(--ink-mid);
}

.hero-meta {
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mid);
}

/* one orchestrated entrance, hero only */
.reveal > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.reveal > *:nth-child(1) { animation-delay: 0.05s; }
.reveal > *:nth-child(2) { animation-delay: 0.15s; }
.reveal > *:nth-child(3) { animation-delay: 0.28s; }
.reveal > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal > * { animation: none; opacity: 1; transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- railed sections ---------- */

.band {
  padding: 78px 0;
  border-bottom: 1px solid var(--rule);
}

.band:last-of-type { border-bottom: 0; }

.railed {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.rail-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  padding-top: 6px;
  color: var(--ink-mid);
  position: relative;
}

.rail-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 26px;
  height: 2px;
  background: var(--jade);
}

.prose { max-width: 66ch; }

.prose p { margin: 0 0 1.05em; }

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

h2.big {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  margin: 0 0 24px;
  max-width: 22ch;
}

/* ---------- service list ---------- */

.services { margin: 0; }

.service {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 20ch) minmax(0, 1fr);
  gap: 28px;
}

.service:first-child { border-top: 0; padding-top: 0; }

.service h3 {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.service p {
  margin: 0;
  color: var(--ink-mid);
  font-size: 1.02rem;
}

/* ---------- work index ---------- */

.index { border-top: 1px solid var(--rule); }

.index-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 0.8fr);
  gap: 24px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  align-items: baseline;
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.index-row:hover,
.index-row:focus-visible {
  background: var(--card);
  padding-left: 14px;
}

.index-row .name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.index-row .what { color: var(--ink-mid); font-size: 1rem; }

.index-row .where {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: right;
}

/* ---------- case studies ---------- */

.case {
  padding: 66px 0;
  border-bottom: 1px solid var(--rule);
}

.case:last-of-type { border-bottom: 0; }

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  margin-bottom: 8px;
}

.case h2 {
  font-family: var(--display);
  font-weight: 640;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.032em;
  line-height: 1.08;
  margin: 0;
}

.case .visit {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--jade-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--jade);
  padding-bottom: 1px;
}

.case .visit:hover { background: rgba(27, 107, 91, 0.1); }

.case-sector {
  font-family: var(--han);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--brass);
  letter-spacing: 0.14em;
  margin: 0 0 22px;
}

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 52px;
  align-items: start;
}

.case-body .prose { max-width: 62ch; }

.facts { margin: 0; font-size: 0.97rem; }

.facts dt {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-top: 16px;
}

.facts dt:first-child { margin-top: 0; }

.facts dd {
  margin: 2px 0 0;
  color: var(--ink);
}

/* ---------- team ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

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

.person h3 {
  font-family: var(--display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 2px;
}

.person .role {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--jade-deep);
  margin: 0 0 12px;
}

.person p { margin: 0; font-size: 0.98rem; color: var(--ink-mid); }

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

.callout {
  background: var(--ink);
  color: var(--paper);
  padding: 62px 0;
}

.callout h2 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.032em;
  line-height: 1.1;
  margin: 0 0 18px;
  max-width: 20ch;
}

.callout p {
  margin: 0 0 30px;
  max-width: 50ch;
  color: rgba(241, 242, 237, 0.78);
}

.callout .rail-title { color: rgba(241, 242, 237, 0.6); }
.callout .rail-title::after { background: var(--brass); }

.button {
  display: inline-block;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--brass);
  color: #fff;
  text-decoration: none;
  padding: 13px 26px;
  border: 0;
  cursor: pointer;
}

.button:hover { background: #8d6224; }

.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}

.button.ghost:hover { background: var(--card); }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 40px;
}

.contact-grid h3 {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.contact-grid p { margin: 0; font-size: 1.1rem; }

.contact-grid a { color: var(--jade-deep); }

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

.foot {
  border-top: 1px solid var(--rule);
  padding: 44px 0 56px;
  font-size: 0.94rem;
  color: var(--ink-mid);
}

.foot-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: 30px;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
}

.foot-nav a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot-nav a:hover { border-bottom-color: var(--rule-strong); }

.foot-fine { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- 404 ---------- */

.stub { padding: 120px 0 140px; }

.stub h1 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.032em;
  margin: 0 0 16px;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  body { font-size: 17px; }
  .shell { padding: 0 20px; }
  .railed { grid-template-columns: 1fr; gap: 26px; }
  .rail-title::after { bottom: -10px; }
  .case-body { grid-template-columns: 1fr; gap: 34px; }
  .service { grid-template-columns: 1fr; gap: 8px; }
  .index-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 4px; }
  .index-row .where { text-align: left; }
  .hero { padding: 66px 0 54px; }
  .band { padding: 56px 0; }
  .case { padding: 48px 0; }
}

@media (max-width: 620px) {
  .masthead .shell { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav { gap: 20px; flex-wrap: wrap; }
  .foot-top { flex-direction: column; }
}

/* sticky masthead clearance for in-page anchors */
.case { scroll-margin-top: 96px; }
html { scroll-behavior: smooth; }

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero-grid h1 { max-width: 13ch; }
.hero-grid .hero-lede { margin-top: 30px; }

/* width/height attributes give the intrinsic size; these make it fluid */
.hero-art svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.hero-art .ring { stroke: var(--jade); fill: none; }

.hero-art .site { fill: var(--brass); }

/* ---------- inline icons ---------- */

.ico {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  color: var(--jade);
  opacity: 0.85;
}

.service h3 { display: flex; align-items: flex-start; gap: 14px; }
.service h3 .ico { margin-top: 2px; }

.case-sector { display: flex; align-items: center; gap: 12px; }
.case-sector .ico { color: var(--brass); opacity: 1; }

/* ---------- team monograms ---------- */

.person .mono {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--jade);
  color: var(--jade-deep);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-grid h1 { max-width: 15ch; }
  .hero-art { max-width: 420px; }
}

/* ---------- case study screenshots ---------- */

.shot {
  margin: 0 0 30px;
  position: relative;
}

/* offset hairline behind the frame, like a registration mark */
.shot::before {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 10px;
  border: 1px solid var(--brass);
  opacity: 0.4;
  pointer-events: none;
}

.shot-frame {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}

.shot-bar {
  display: block;
  padding: 7px 11px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the viewport the full-length capture scrolls behind */
.shot-window {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper);
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(0);
  filter: grayscale(1) contrast(1.04);
  transition: transform var(--dur, 5s) ease-in-out, filter 0.4s ease;
}

/* --shift is set per figure: the exact distance that brings the foot of that
   capture to the bottom of the window, as a percentage of the image's own
   height. Being a percentage, it stays correct at every column width. */
.shot:hover img,
.shot:focus-within img {
  transform: translateY(var(--shift, -80%));
  filter: none;
}

/* placeholder for any case still missing a capture */
.shot.is-empty .shot-window { display: none; }

.shot.is-empty .shot-frame::after {
  content: attr(data-label);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 16px;
  text-align: center;
  font-family: var(--display);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    180deg, var(--rule) 0 1px, transparent 1px 22px);
}

@media (prefers-reduced-motion: reduce) {
  .shot img { transition: filter 0.4s ease; }
  .shot:hover img,
  .shot:focus-within img { transform: none; }
}
