/* =========================================================
   心映好事 SINGINGS HOUSE — style.css
   ========================================================= */

:root {
  --paper: #EFEEE9;
  --paper-2: #E7E5DE;
  --ink: #333333;
  --ink-soft: #6E6B64;
  --ink-faint: #A9A69D;
  --line: #D2CFC6;
  --accent: #E986A2;        /* 裝飾用（網格、標籤） */
  --accent-ink: #C4677F;    /* 文字用（深一階，確保可讀性） */

  --max: 1320px;
  --gutter: 40px;

  /* 中文：Noto Sans TC ／ 英文：Archivo（中文字自動 fallback 回黑體） */
  --f-display: "Noto Sans TC", -apple-system, "Helvetica Neue", sans-serif;
  --f-latin: "Archivo", "Noto Sans TC", sans-serif;
  --f-body: "Noto Sans TC", -apple-system, "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 背景互動網格：固定於視窗，位於內容之下 */
#kgrid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--kg-start, 0px), #000 var(--kg-end, 0px));
          mask-image: linear-gradient(to bottom, transparent var(--kg-start, 0px), #000 var(--kg-end, 0px));
}
body > *:not(#kgrid):not(.nav) { position: relative; z-index: 1; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.label {
  font-family: var(--f-latin);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}

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

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(239, 238, 233, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav-logo { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: 12px; }
.nav-logo img { width: auto; height: 30px; }
.nav-links { grid-column: 3; justify-self: end; display: flex; gap: 34px; }
.nav-links a {
  font-family: var(--f-latin);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .25s;
}
.nav-links a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  padding: 40px 0 120px;
  position: relative;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 54px);
  line-height: 1.6;
  letter-spacing: 0.02em;
  max-width: 19em;
  margin: 28px 0 34px;
}
.hero p {
  max-width: 40em;
  color: var(--ink-soft);
  font-size: 16px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 46px;
}
.hero-meta span {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 18px;
}

/* 主標重點標示：粉色螢光筆效果，載入時由左往右刷過 */
.hero h1 .hl {
  position: relative;
  font-style: normal;
  display: inline-block;
}
.hero h1 .hl i {
  position: relative;
  z-index: 1;
  font-style: normal;
}
.hero h1 .hl::before {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  bottom: 0.06em;
  height: 0.42em;
  background: var(--accent);
  opacity: 0.42;
  transform: scaleX(0);
  transform-origin: left center;
  animation: hl-sweep 1s cubic-bezier(.2,.7,.2,1) .55s forwards;
}
@keyframes hl-sweep { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero h1 .hl::before { animation: none; transform: scaleX(1); }
}

/* ---------- section frame ---------- */
.section { padding: 100px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.06em;
}

/* ---------- work grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 54px 34px;
}
.card { display: block; }
.card-img {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 3;
}
.card-img img {
  height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.card:hover .card-img img { transform: scale(1.035); }
.card-body { padding-top: 18px; }
.card-body h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  transition: color .25s;
}
.card:hover .card-body h3 { color: var(--accent-ink); }
.card-tags {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.card.is-own .card-img::after {
  content: "自有品牌";
  position: absolute;
  top: 14px; left: 14px;
  background: var(--accent-ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 5px 12px;
}

/* ---------- other works ---------- */
.otherworks {
  margin-top: 74px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
}
.otherworks p { color: var(--ink-soft); max-width: 52em; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 80px;
}
/* 主理人 */
.profile {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-bottom: 26px;
  margin-bottom: 4px;
}
.profile img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--paper-2);
}
.profile-meta strong {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.profile-meta strong span {
  font-family: var(--f-latin);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.profile-meta p { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.cv-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: border-color .3s;
}
.cv-link:hover { border-color: var(--accent-ink); }

.about-text p { margin-bottom: 26px; max-width: 34em; }
.about-text p:first-child { color: var(--ink); }
.about-text p:not(:last-child) { margin-bottom: 26px; }
.about-text p:not(:first-child) { color: var(--ink-soft); }

.orbit { position: relative; }
/* 數據列 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 46px;
  border-top: 1px solid var(--line);
}
.stat { padding: 22px 0 4px; }
.stat strong {
  display: block;
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.stat span { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.06em; }

/* 時間軸 */
.orbit-list { display: grid; gap: 2px; }
.orbit-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: default;
  transition: border-color .3s;
}
.orbit-item:hover, .orbit-item:focus-visible { border-color: var(--accent); outline: none; }
.orbit-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 18px;
  align-items: baseline;
}
.orbit-note {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 136px;
  transition: max-height .45s ease, opacity .35s ease, margin .45s ease;
}
.orbit-item:hover .orbit-note,
.orbit-item:focus-visible .orbit-note { max-height: 90px; opacity: 1; margin-top: 8px; }
.orbit-item strong {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.orbit-item em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.orbit-item.is-now strong { color: var(--accent-ink); }

/* ---------- clients ---------- */
.clients {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  align-items: center;
}
.clients span {
  font-family: var(--f-latin);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
/* 品牌跑馬燈 */
.clients-marquee { display: grid; gap: 10px; }
.mq-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.mq-track {
  display: flex;
  width: max-content;
  gap: 46px;
  animation: mq 64s linear infinite;
}
.mq-track.rev { animation-duration: 78s; animation-direction: reverse; }
.mq-track span {
  font-family: var(--f-latin);
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 6px 0;
}
.clients-marquee:hover .mq-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .mq-track { animation-duration: 140s; }
}

.attribution {
  margin-top: 34px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-faint);
  max-width: 46em;
}

/* ---------- contact ---------- */
.contact { padding: 110px 0 120px; border-top: 1px solid var(--line); }
.contact h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.6;
  letter-spacing: 0.02em;
  margin: 22px 0 34px;
}
.mail {
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: clamp(19px, 2.6vw, 32px);
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition: border-color .3s;
}
.mail:hover { border-color: var(--accent-ink); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}
.footer-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer img { width: 150px; opacity: .75; }
.footer small { font-family: var(--f-latin); font-size: 11px; letter-spacing: .12em; color: var(--ink-faint); }

/* =========================================================
   brand detail page
   ========================================================= */
.b-hero {
  margin-top: 74px;
  aspect-ratio: 21 / 9;
  background: var(--paper-2);
  overflow: hidden;
}
.b-hero img { height: 100%; object-fit: cover; }

.b-head { padding: 66px 0 76px; text-align: center; }
.b-head h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: 0.05em;
  margin: 16px 0 10px;
}
.b-head .en {
  font-family: var(--f-latin);
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}
.b-intro {
  max-width: 40em;
  margin: 34px auto 0;
  color: var(--ink-soft);
}
.b-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 32px;
}
.b-tags span {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 6px 15px;
  border-radius: 100px;
}

.proj { padding-bottom: 96px; }
.proj-head {
  max-width: 40em;
  margin: 0 auto 44px;
  text-align: center;
}
.proj-head h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: .05em;
  margin: 14px 0 12px;
}
.proj-head p { color: var(--ink-soft); }
.proj-flow { display: grid; gap: 26px; }
.proj-flow figure { background: var(--paper-2); aspect-ratio: 4 / 3; overflow: hidden; }
.proj-flow img { height: 100%; object-fit: cover; }

.b-also {
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}

.b-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 44px 0 96px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.b-nav a { font-size: 13px; letter-spacing: .08em; color: var(--ink-soft); transition: color .25s; }
.b-nav a:hover { color: var(--accent-ink); }

/* ---------- pressure headline ---------- */
.pressure-band {
  padding: 140px 0 0;
}
#pressure {
  position: relative;
  width: 100%;
  overflow: visible;
  user-select: none;
}
.pressure-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
  transform-origin: center top;
  font-family: var(--f-body);
  font-weight: 100;
  color: var(--ink);
  text-transform: uppercase;
  font-variation-settings: "wght" 300, "wdth" 100, "slnt" 0;
}
.pressure-title span {
  display: inline-block;
  font-variation-settings: "wght" 200, "wdth" 70;
  will-change: font-variation-settings;
}

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .card-img img { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 54px; }
}
@media (max-width: 680px) {
  :root { --gutter: 22px; }
  .nav-in { grid-template-columns: 1fr; justify-items: center; height: auto; padding: 16px var(--gutter); gap: 10px; }
  .nav-logo { grid-column: 1; }
  .nav-links { grid-column: 1; justify-self: center; gap: 20px; }
  .pressure-band { padding-top: 104px; }
  .nav-links a { font-size: 11px; letter-spacing: .12em; }
  .hero { padding: 26px 0 80px; }
  .section { padding: 70px 0; }
  .grid { grid-template-columns: 1fr; gap: 42px; }
  .otherworks { grid-template-columns: 1fr; gap: 12px; }
  .orbit-row { grid-template-columns: 1fr auto; }
  .orbit-note { padding-left: 0; max-height: 90px; opacity: 1; margin-top: 8px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .profile { gap: 16px; }
  .profile img { width: 72px; height: 72px; }
  .stat strong { font-size: 22px; }
  .orbit-row .label { grid-column: 1 / -1; }
  .b-hero { aspect-ratio: 3 / 2; }
}
