/* ByteHarbor 2026 redesign — graphite, signal green, and one moving world. */

:root {
  color-scheme: light;
  --bg: #edf1e9;
  --surface: #f5f7f2;
  --surface-strong: #ffffff;
  --ink: #0c120e;
  --muted: #536158;
  --soft: #6e7971;
  --line: rgba(12, 18, 14, 0.15);
  --line-strong: rgba(12, 18, 14, 0.34);
  --accent: #79ed69;
  --accent-hover: #93fa7f;
  --accent-ink: #071008;
  --accent-text: #176f32;
  --focus-ring: #176f32;
  --dark: #080c09;
  --dark-soft: #0d130f;
  --dark-ink: #f1f7ef;
  --dark-muted: #a8b5ac;
  --success: #2bbf62;
  --environment-bg: #c9f7bd;
  --environment-ink: #0a160d;
  --shadow: 0 28px 80px rgba(12, 18, 14, 0.1);
  --header-height: 78px;
  --gutter: clamp(20px, 4.4vw, 72px);
  --content: 1500px;
  --radius: 2px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --transition: 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b09;
  --surface: #0d120f;
  --surface-strong: #121914;
  --ink: #eef5ec;
  --muted: #a5b1a8;
  --soft: #7f8b82;
  --line: rgba(238, 245, 236, 0.14);
  --line-strong: rgba(238, 245, 236, 0.32);
  --accent: #80f06e;
  --accent-hover: #99fa87;
  --accent-ink: #061007;
  --accent-text: #80f06e;
  --focus-ring: #80f06e;
  --dark: #050806;
  --dark-soft: #0a100c;
  --dark-ink: #f2f8f0;
  --dark-muted: #a4b0a7;
  --success: #62e98b;
  --environment-bg: #102317;
  --environment-ink: #eaf8e7;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

html {
  scroll-padding-top: var(--header-height);
}

body {
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}

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

.eyebrow,
.step-count,
.pillar-index,
.process-number,
.index-number,
.footer-label,
.globe-caption {
  font-family: var(--font-mono);
}

.site-header {
  padding-inline: var(--gutter);
  border-bottom-color: rgba(255, 255, 255, 0.13);
}

.site-header.is-scrolled,
.site-header.menu-active {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.brand {
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

/* 直角、無陰影。原圖 bhb 三個字母靠右，所以用 object-position:100% 由右邊裁，
   剩低嘅方框比例 1.89:1 啱啱好包住字母、剪走左邊嘅空白。
   闊度用 calc(高 × 1.89) 明寫死，唔靠 aspect-ratio 反推 —— Safari 唔會由
   aspect-ratio 推算 fit-content 闊度，會變成用原圖 intrinsic 闊度而爆格。 */
.brand-logo {
  --mark-h: 38px;
  width: calc(var(--mark-h) * 1.89);
  height: var(--mark-h);
  flex: 0 0 auto;
  overflow: hidden;
  background: #153f46;
  border-radius: 0;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 100% 50%;
}

.brand-name {
  white-space: nowrap;
}

.desktop-nav {
  gap: clamp(22px, 2.7vw, 46px);
}

.desktop-nav a,
.text-button {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-cta {
  min-height: 40px;
  padding-inline: 16px;
  border-color: rgba(255, 255, 255, 0.35);
  font-size: 0.68rem;
  letter-spacing: 0.035em;
}

.site-header.is-scrolled .header-cta,
.site-header.menu-active .header-cta {
  border-color: var(--line-strong);
}

.mobile-menu {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 46%),
    var(--bg);
}

.mobile-menu nav a {
  font-weight: 520;
  letter-spacing: -0.045em;
}

.hero {
  position: relative;
  min-height: max(760px, 100svh);
  display: grid;
  align-content: stretch;
  overflow: hidden;
  background: #080c09;
  color: #f1f7ef;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 12, 9, 0.98) 0 42%, rgba(8, 12, 9, 0.68) 59%, transparent 82%);
  pointer-events: none;
}

.hero-grid {
  z-index: -2;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.075) 1px, transparent 1px);
  background-size: 8.333vw 100%, 100% 12.5vh;
  mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, 0.55) 54%, transparent 92%);
}

.hero-content {
  position: relative;
  z-index: 3;
  align-self: center;
  width: min(61vw, 890px);
  padding: calc(var(--header-height) + 70px) var(--gutter) 152px;
}

/* 主頁大 bhb：直角，無圓角無陰影，同 header 一樣由右邊裁。 */
.hero-mark {
  --mark-h: clamp(52px, 6.4vw, 96px);
  width: calc(var(--mark-h) * 1.89);
  height: var(--mark-h);
  margin: 0 0 26px;
  overflow: hidden;
  background: #153f46;
}

.hero-mark img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 100% 50%;
}

.hero-eyebrow {
  margin-bottom: 26px;
  color: var(--accent);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(3.7rem, 6.15vw, 6.9rem);
  font-weight: 520;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

.hero h1 span:last-child {
  margin-top: 0.14em;
  font-size: 0.72em;
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.hero-copy {
  width: min(570px, 100%);
  margin-top: 30px;
  color: rgba(232, 242, 232, 0.72);
  font-size: clamp(0.96rem, 1.2vw, 1.12rem);
  line-height: 1.85;
}

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

.button {
  min-height: 56px;
  padding-inline: 23px;
  border-radius: 2px;
  font-size: 0.8rem;
  letter-spacing: 0.015em;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: none;
}

.hero .button-ghost,
.final-cta .button-ghost {
  border-color: rgba(241, 247, 239, 0.32);
  color: #f1f7ef;
}

.hero .button-ghost:hover,
.final-cta .button-ghost:hover {
  border-color: rgba(241, 247, 239, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

.hero-form-link {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-top: 19px;
  color: rgba(232, 242, 232, 0.58);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.025em;
  transition: color var(--transition), gap var(--transition);
}

.hero-form-link:hover {
  gap: 18px;
  color: var(--accent);
}

/* 球體半徑 70vw，圓心喺 (120vw, -35vw)：即係右上角出面。
   弧線由畫面頂邊 x≈66vw 入，去到右邊 y≈27vw 出，只露一小段。 */
.hero-visual {
  position: absolute;
  z-index: 1;
  top: -108vw;
  left: 55vw;
  width: 140vw;
  aspect-ratio: 1;
  pointer-events: none;
}

.globe-svg {
  width: 100%;
  height: 100%;
}

.globe-face {
  fill: #0b1610;
}

.globe-grid {
  fill: none;
  stroke: rgba(180, 255, 177, 0.14);
}

.globe-land {
  fill: rgba(121, 237, 105, 0.22);
}

.globe-edge {
  fill: none;
  stroke: rgba(197, 255, 190, 0.42);
}

/* SVG 放大到 140vw，1 個 viewBox 單位≈2.7px，所以線寬要用 non-scaling-stroke
   （唔繼承，要落喺 shape 本身）先會維持 1.4px 幼線。 */
.globe-grid > *,
.globe-edge {
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.hero-foot {
  z-index: 4;
  padding-inline: var(--gutter);
  border-top-color: rgba(255, 255, 255, 0.13);
  background: rgba(8, 12, 9, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-foot[data-reveal] {
  opacity: 1;
  transform: none;
}

.hero-foot p {
  color: rgba(238, 247, 236, 0.68);
}

.status-dot {
  background: var(--accent);
  box-shadow: none;
}

[data-reveal] {
  transform: translateY(18px);
  transition-duration: 820ms;
}

.section {
  padding-block: clamp(100px, 11vw, 172px);
}

.section-intro h2,
.devices-heading h2,
.business-main h2,
.data-copy h2,
.environment-copy h2,
.pillars-heading h2,
.final-cta h2 {
  font-weight: 520;
  letter-spacing: -0.065em;
}

.eyebrow {
  color: var(--soft);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
}

.pillars-section {
  border-bottom: 1px solid var(--line);
}

.pillars-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
  gap: 7vw;
  align-items: end;
}

.pillars-heading .eyebrow {
  margin-bottom: 12px;
}

.pillars-heading h2 {
  max-width: 930px;
  margin: 0;
  font-size: clamp(2.7rem, 5.35vw, 5.8rem);
  line-height: 0.98;
}

.pillars-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(70px, 8vw, 112px);
  border-top: 1px solid var(--line-strong);
}

.pillars-list article {
  position: relative;
  min-height: 330px;
  padding: 32px clamp(24px, 3.5vw, 52px) 38px 0;
  border-right: 1px solid var(--line);
  transition: background-color var(--transition), padding var(--transition);
}

.pillars-list article:not(:first-child) {
  padding-left: clamp(24px, 3.5vw, 52px);
}

.pillars-list article:last-child {
  padding-right: 0;
  border-right: 0;
}

.pillars-list article::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pillars-list article:hover::before {
  width: 100%;
}

.pillar-index {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
}

.pillars-list h3 {
  margin: 86px 0 0;
  font-size: clamp(3rem, 5.3vw, 5.5rem);
  font-weight: 510;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.pillars-list p {
  max-width: 330px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.quote-section {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 34%, transparent), transparent 34%);
}

.quote-intro {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.55fr);
}

.quote-intro h2 {
  max-width: 860px;
}

.quote-shell {
  border-color: var(--line-strong);
  box-shadow: none;
}

.quote-progress {
  background: var(--dark);
}

.quote-progress li.is-active {
  color: var(--accent);
}

#quote-form {
  background: var(--surface-strong);
}

.choice-row {
  border-color: var(--line);
}

.choice-row:hover,
.choice-row:has(input:checked) {
  border-color: var(--accent);
}

.choice-row:has(input:checked) {
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}

.button-dark {
  background: var(--ink);
  color: var(--bg);
}

.button-dark:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--accent));
}

.button-whatsapp {
  background: #1eaa59;
}

.button-whatsapp:hover {
  background: #178e4a;
}

.process-list article {
  transition: padding var(--transition), border-color var(--transition), background-color var(--transition);
}

.process-list article:hover {
  padding-inline: 18px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

.process-copy h3 {
  font-weight: 530;
}

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

.device-index article:first-child h3 {
  color: color-mix(in srgb, var(--accent) 68%, var(--ink));
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
}

.environment-section {
  position: relative;
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(50px, 10vw, 160px);
  padding: clamp(90px, 10vw, 154px) var(--gutter);
  overflow: hidden;
  background: var(--environment-bg);
  color: var(--environment-ink);
}

.environment-section::after {
  content: "";
  position: absolute;
  right: -10vw;
  bottom: -22vw;
  width: 48vw;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--environment-ink) 15%, transparent);
  border-radius: 50%;
}

.environment-mark {
  display: grid;
  place-items: center;
  border-right: 1px solid color-mix(in srgb, var(--environment-ink) 18%, transparent);
}

.environment-mark svg {
  width: min(300px, 72%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.environment-copy {
  position: relative;
  z-index: 1;
  max-width: 970px;
}

.environment-copy .eyebrow {
  color: color-mix(in srgb, var(--environment-ink) 68%, transparent);
}

.environment-copy h2 {
  margin: 0;
  font-size: clamp(3rem, 6.4vw, 7rem);
  line-height: 0.94;
}

.environment-copy > p:last-child {
  max-width: 640px;
  margin: 34px 0 0;
  color: color-mix(in srgb, var(--environment-ink) 72%, transparent);
  line-height: 1.9;
}

.data-section {
  min-height: 760px;
  background: var(--dark);
}

.data-pattern {
  opacity: 0.55;
  background:
    linear-gradient(115deg, transparent 0 55%, rgba(255, 255, 255, 0.025) 55% 56%, transparent 56%),
    repeating-linear-gradient(90deg, transparent 0 8.333vw, rgba(255, 255, 255, 0.04) 8.333vw calc(8.333vw + 1px));
}

.data-copy h2 {
  max-width: 850px;
}

.business-section {
  border-bottom: 1px solid var(--line);
}

.business-main .button-dark {
  background: var(--accent);
  color: var(--accent-ink);
}

.business-main .button-dark:hover {
  background: var(--accent-hover);
}

.faq-list details[open] {
  border-bottom-color: var(--accent);
}

.final-cta {
  min-height: 720px;
  background: var(--dark-soft);
}

.final-cta .eyebrow {
  color: var(--accent);
}

.final-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 12px;
  margin-top: 42px;
}

.final-actions .button {
  margin-top: 0;
}

.final-orbit,
.final-orbit::before,
.final-orbit::after {
  border-color: rgba(121, 237, 105, 0.14);
}

.final-orbit::after {
  border-color: rgba(121, 237, 105, 0.28);
}

.site-footer {
  background: var(--dark);
}

/* WhatsApp 官方綠 + 實心字符，唔要描邊線稿同光暈。 */
.floating-whatsapp {
  right: clamp(16px, 2vw, 30px);
  bottom: clamp(16px, 2vw, 30px);
  width: 58px;
  height: 58px;
  background: #25d366;
  color: #fff;
  border: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.floating-whatsapp:hover {
  background: #1fbb59;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.floating-whatsapp svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  stroke: none;
}

@media (max-width: 1180px) {
  .hero-content {
    width: min(70vw, 800px);
  }
}

@media (max-width: 1080px) {
  .quote-intro {
    grid-template-columns: 1fr;
  }

  .quote-intro > p:last-child {
    margin-top: 24px;
  }

  .hero::before {
    z-index: 2;
    background: linear-gradient(90deg, rgba(8, 12, 9, 0.98) 0 51%, rgba(8, 12, 9, 0.7) 71%, transparent 100%);
  }

  .pillars-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .environment-section {
    grid-template-columns: minmax(190px, 0.4fr) minmax(0, 1fr);
    gap: 7vw;
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  .hero {
    min-height: 760px;
  }

  .hero-content {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 126px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 5.7vw, 5.8rem);
  }

  .hero-mark {
    --mark-h: clamp(46px, 4.6vw, 66px);
    margin-bottom: 20px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 68px;
  }

  .site-header {
    padding-inline: 18px;
  }

  .floating-whatsapp {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .site-header .brand-name {
    display: block;
    font-size: 0.7rem;
  }

  .brand-logo {
    --mark-h: 30px;
  }

  .header-actions {
    gap: 2px;
  }

  .text-button {
    min-width: 36px;
    padding-inline: 4px;
  }

  .hero {
    min-height: max(820px, 100svh);
  }

  .hero::before {
    z-index: 1;
    background:
      linear-gradient(0deg, rgba(8, 12, 9, 0.99) 0 48%, rgba(8, 12, 9, 0.76) 72%, rgba(8, 12, 9, 0.34) 100%),
      linear-gradient(90deg, rgba(8, 12, 9, 0.75), transparent);
  }

  .hero-grid {
    z-index: 0;
    background-size: 25vw 100%, 100% 12.5vh;
    mask-image: linear-gradient(#000, rgba(0, 0, 0, 0.5) 65%, transparent);
  }

  /* 手機：球體再推出去啲，只喺右上角留一小條弧。 */
  .hero-visual {
    z-index: 0;
    top: -150vw;
    left: 60vw;
    width: 200vw;
  }

  .hero-content {
    z-index: 3;
    align-self: end;
    width: 100%;
    padding: calc(var(--header-height) + 150px) var(--gutter) 170px;
  }

  .hero-mark {
    --mark-h: 58px;
    margin-bottom: 20px;
  }

  .hero-eyebrow {
    margin-bottom: 18px;
  }

  .hero h1 {
    max-width: 360px;
    font-size: clamp(2.72rem, 12.3vw, 3.35rem);
    line-height: 0.99;
  }

  .hero-copy {
    width: 100%;
    margin-top: 22px;
    font-size: 0.88rem;
    line-height: 1.72;
  }

  .hero-actions {
    gap: 9px;
    margin-top: 24px;
  }

  .hero-actions .button {
    min-height: 52px;
  }

  .hero-form-link {
    margin-top: 15px;
  }

  .hero-foot {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 15px 20px 17px;
    font-size: 0.52rem;
    letter-spacing: 0.025em;
  }

  .hero-foot p,
  .hero-foot p:last-child {
    grid-column: auto;
    justify-self: start;
    text-align: left;
    line-height: 1.45;
  }

  .pillars-heading h2 {
    font-size: clamp(2.55rem, 11vw, 4rem);
  }

  .pillars-list {
    grid-template-columns: 1fr;
    margin-top: 58px;
  }

  .pillars-list article,
  .pillars-list article:not(:first-child),
  .pillars-list article:last-child {
    min-height: 250px;
    padding: 25px 0 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pillars-list h3 {
    margin-top: 48px;
    font-size: 4.4rem;
  }

  .pillars-list p {
    margin-top: 20px;
  }

  .quote-section {
    background: none;
  }

  .environment-section {
    min-height: 700px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 45px;
    padding-block: 90px;
  }

  .environment-mark {
    justify-content: start;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--environment-ink) 18%, transparent);
  }

  .environment-mark svg {
    width: 155px;
    margin-bottom: 35px;
  }

  .environment-copy h2 {
    font-size: clamp(2.85rem, 12.5vw, 4.5rem);
  }

  .environment-copy > p:last-child {
    margin-top: 25px;
    font-size: 0.88rem;
  }

  .final-actions {
    width: min(100%, 360px);
    flex-direction: column;
  }

  .final-actions .button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .site-header .brand {
    gap: 8px;
  }

  .site-header .brand-name {
    display: none;
  }

  .hero {
    min-height: 850px;
  }

  .hero-content {
    padding-top: calc(var(--header-height) + 138px);
    padding-bottom: 172px;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero-copy {
    font-size: 0.84rem;
  }

  .hero-foot {
    padding-inline: 16px;
    font-size: 0.49rem;
  }

  .hero-mark {
    --mark-h: 52px;
  }
}

@media (forced-colors: active) {
  .site-header,
  .mobile-menu,
  .quote-progress,
  .data-section,
  .final-cta,
  .site-footer {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
  }

  .footer-brand > p,
  .footer-label,
  .footer-bottom,
  .footer-contact a,
  .footer-links a,
  .step-count {
    color: CanvasText;
  }

  .button,
  .floating-whatsapp {
    border: 1px solid ButtonText;
    color: ButtonText;
    background: ButtonFace;
  }
}
