/* Triza AI — charcoal + champagne gold, sharp-corner system (brand card v2.4) */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/fonts/CabinetGrotesk-Variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --bg: #17171B;
  --bg-raise: #1D1D23;
  --text: #EDEAE3;
  --text-dim: #ABA79E;
  --gold: #D2AB67;
  --gold-dim: #A9884F;
  --line: rgba(237, 234, 227, 0.14);
  --display: "Cabinet Grotesk", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --body: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 20;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

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

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--pad);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(23, 23, 27, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.logo, .foot-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.logo-ai { color: var(--gold); font-weight: 800; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 2rem);
}
.site-nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--text); }

.lang-toggle {
  border: 1px solid var(--line);
  padding: 0.25rem 0.7rem;
  color: var(--text) !important;
  font-family: var(--display);
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lang-toggle:hover { border-color: var(--gold); color: var(--gold) !important; }

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

.hero {
  min-height: calc(100dvh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(3rem, 8vh, 5.5rem) var(--pad) 0;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hero-inner { max-width: 46rem; }

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-dim);
  max-width: 34em;
}

.hero .btn { margin-top: 2.2rem; }

/* signal polyline (brand mark, from card v2.4) */
.signal {
  width: 100%;
  height: clamp(90px, 16vh, 180px);
  display: block;
  margin-top: 2rem;
}
.signal-path {
  stroke: var(--gold);
  stroke-width: 1.5;
  opacity: 0.85;
}
.signal-node { fill: var(--text-dim); }
.signal-core { fill: var(--gold); }

@media (prefers-reduced-motion: no-preference) {
  .signal-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: draw 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
  }
  .signal-node {
    opacity: 0;
    animation: node-in 0.5s ease 1.2s forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes node-in { to { opacity: 1; } }
}

/* ---------- shared section ---------- */

.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 8rem) var(--pad);
}

.section h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* ---------- services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.service {
  padding: 2.2rem 2.2rem 2.6rem 0;
  border-bottom: 1px solid var(--line);
}
.service:nth-child(odd) { padding-right: 3rem; }
.service:nth-child(even) {
  border-left: 1px solid var(--line);
  padding-left: 3rem;
}
.service h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.service p { color: var(--text-dim); max-width: 30em; }

/* ---------- cases ---------- */

.cases-note {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: -1.5rem 0 2.5rem;
}

.case {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
}

.case-metric {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--gold);
}
.case-metric-label {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: 0;
  font-family: var(--body);
  font-weight: 400;
  color: var(--text-dim);
}

.case h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.3rem;
}

.case dl { display: grid; gap: 1.1rem; }
.case dt {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}
.case dd { color: var(--text-dim); max-width: 58em; }

/* ---------- about ---------- */

.about { text-align: center; }
.about h2 { margin-bottom: 1.5rem; }
.about-body {
  max-width: 38em;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}

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

.contact {
  border-top: 1px solid var(--line);
}
.contact h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.contact-body { color: var(--text-dim); max-width: 36em; }
.contact-actions {
  margin-top: 2.2rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.contact-email {
  font-family: var(--display);
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-email:hover { color: var(--gold); border-color: var(--gold); }

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

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85rem 2rem;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-solid {
  background: var(--gold);
  color: var(--bg);
}
.btn-solid:hover { background: #E0BC7C; }

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

.site-foot {
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.foot-tagline {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--gold-dim);
}
.foot-copy { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
  .site-head { padding: 0.9rem 1rem; }
  .logo { font-size: 1.05rem; }
  .site-nav { gap: 0.7rem; }
  .site-nav a { font-size: 0.8rem; }
  .lang-toggle { padding: 0.2rem 0.5rem; }

  .services-grid { grid-template-columns: 1fr; }
  .service:nth-child(even) { border-left: none; padding-left: 0; }
  .service:nth-child(odd) { padding-right: 0; }

  .case { grid-template-columns: 1fr; gap: 1.5rem; }

  .contact-actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 374px) {
  .site-nav { gap: 0.45rem; }
  .site-nav a { font-size: 0.72rem; }
  .logo { font-size: 0.95rem; }
}
