:root {
  --paper: oklch(15.2% 0.0082 285.52);
  --bg: var(--paper);
  --surface: oklch(18.6% 0.0082 285.52);
  --ink: oklch(96.4% 0.0035 106.45);
  --fg: var(--ink);
  --ink-60: oklch(74% 0.0095 285.94);
  --muted: var(--ink-60);
  --line: oklch(96.4% 0.0035 106.45 / 0.09);
  --border: var(--line);
  --line-strong: oklch(96.4% 0.0035 106.45 / 0.17);
  --line-mid: oklch(96.4% 0.0035 106.45 / 0.30);
  --accent: oklch(67.5% 0.209 36.85);
  --on-accent: oklch(15.2% 0.0082 285.52);
  --on-dark: oklch(96.4% 0.0035 106.45);
  --in-on-dark: oklch(15.2% 0.0082 285.52);
  --dark: oklch(10.5% 0.007 285.52);
  --paper-60: oklch(98.45% 0.0026 106.45 / 0.62);
  --line-inv: oklch(98.45% 0.0026 106.45 / 0.1);
  --pencil: oklch(72% 0.095 245);
  --radius: 1px;
  --font-display: "Space Grotesk", "Noto Sans TC", sans-serif;
  --font-body: "Noto Sans TC", "Space Grotesk", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 64px;
  --wrap: min(1180px, calc(100% - 48px));
  --grid-size: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* 不用 CSS smooth:與 ScrollTrigger 相衝(GSAP 官方建議移除),
     平滑錨點改由 site.js 以 scrollIntoView 驅動 */
  scroll-behavior: auto;
  background: var(--paper);
}

html.reduce-motion {
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

h1, h2, h3, p {
  text-wrap: pretty;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
  min-width: 0;
}

html[lang="en"] .display,
html[lang="en"] .hero-title,
html[lang="en"] .sec-heading,
html[lang="en"] .cta-title,
html[lang="en"] .case-title,
html[lang="en"] .why-copy {
  font-family: var(--font-display);
}

html[lang="zh-TW"] .display,
html[lang="zh-TW"] .hero-title,
html[lang="zh-TW"] .sec-heading,
html[lang="zh-TW"] .cta-title,
html[lang="zh-TW"] .case-title,
html[lang="zh-TW"] .why-copy {
  font-family: var(--font-body);
}

.accent {
  color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* Section stamp */
.sec-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--ink-60);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sec-dim {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent);
  flex: 0 0 auto;
}

.sec-heading {
  margin: 0 0 var(--grid-size);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* Ticks */
.ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: center;
}

.ticks-tr,
.ticks-bl {
  transform-origin: center;
}

.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
}

.ticks::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.ticks::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.ticks-tr {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  pointer-events: none;
}

.ticks-bl {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  pointer-events: none;
}

/* Buttons */
.btn-solid,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-outline:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--on-dark);
  border: 1px solid oklch(98.45% 0.0026 106.45 / 0.35);
}

.btn-ghost:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.link-arrow:hover {
  border-bottom-color: var(--accent);
}

.link-arrow.on-dark {
  color: var(--on-dark);
  border-bottom-color: var(--on-dark);
}

.link-arrow.on-dark:hover {
  border-bottom-color: var(--accent);
  color: var(--on-dark);
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line-mid);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  width: var(--wrap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
  min-height: 44px;
}

.brand img {
  width: 32px;
  height: 32px;
  aspect-ratio: 1;
  object-fit: contain;
}

.brand-lockup {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.lang-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.lang-switch button:hover:not([aria-pressed="true"]) {
  background: var(--line);
}

.lang-switch button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  position: relative;
  margin-left: auto;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 1px;
  background: var(--ink);
}

.nav-toggle span {
  top: 50%;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-cta {
  font-size: 13px;
}

/* Footer */
.site-footer {
  background: var(--dark);
  color: var(--on-dark);
  padding: 48px 0 32px;
  border-top: 1px solid oklch(98.45% 0.0026 106.45 / 0.12);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  aspect-ratio: 1;
  object-fit: contain;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  width: fit-content;
}

.footer-links a:hover {
  box-shadow: inset 0 -1px 0 var(--accent);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--paper-60);
  line-height: 1.8;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-inv);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--paper-60);
}

.site-footer .lang-switch {
  border-color: oklch(98.45% 0.0026 106.45 / 0.4);
}

.site-footer .lang-switch button {
  color: var(--on-dark);
}

.site-footer .lang-switch button[aria-pressed="true"] {
  background: var(--on-dark);
  color: var(--in-on-dark);
}

.site-footer .lang-switch button:hover:not([aria-pressed="true"]) {
  background: oklch(98.45% 0.0026 106.45 / 0.1);
}

/* Form */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid oklch(98.45% 0.0026 106.45 / 0.28);
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-dark);
  caret-color: var(--accent);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: oklch(98.45% 0.0026 106.45 / 0.55);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-success {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  color: var(--on-dark);
  font-size: 14px;
}

.btn-label {
  display: inline-flex;
  align-items: center;
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex-shrink: 0;
  animation: btn-spin 0.7s linear infinite;
}

.contact-form.is-sending .btn-spinner {
  display: inline-block;
}

.contact-form.is-sending {
  pointer-events: none;
}

.contact-form.is-sending .field input,
.contact-form.is-sending .field textarea {
  opacity: 0.55;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.reduce-motion .btn-spinner,
html.reduce-motion .btn-spinner {
  animation: btn-pulse 1.1s ease-in-out infinite;
  border-right-color: currentColor;
  opacity: 0.55;
}

@keyframes btn-pulse {
  50% { opacity: 1; }
}

.contact-form.is-sent .form-success {
  display: block;
}

.contact-form.is-sent .form-grid,
.contact-form.is-sent .btn-solid {
  display: none;
}

/* Ops mock */
.ops-mock {
  display: grid;
  grid-template-columns: 148px 1fr;
  min-height: 420px;
  background: var(--surface);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.ops-side {
  border-right: 1px solid var(--ink);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 16px 16px;
}

.ops-side-mark {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-bottom: 16px;
}

.ops-side-item {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid transparent;
}

.ops-side-item.is-active {
  border-color: var(--ink);
  background: var(--paper);
}

.ops-main {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ops-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--line-mid);
  padding-bottom: 10px;
}

.ops-head-title {
  font-weight: 700;
  font-size: 15px;
}

.ops-live {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.ops-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ops-stat {
  border: 1px solid var(--ink);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ops-stat-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-60);
}

.ops-stat-v {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
}

.ops-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  min-height: 0;
  flex: 1;
}

.ops-tasks,
.ops-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ops-task,
.ops-panel {
  border: 1px solid var(--ink);
  padding: 10px 12px;
  background: var(--paper);
}

.ops-task header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 2px 6px;
}

.tag-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.bar {
  height: 6px;
  background: var(--line-strong);
  position: relative;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--ink);
}

.bar.is-accent > span {
  background: var(--accent);
}

.ops-panel h4 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--ink-60);
}

.tl-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.tl-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  margin-top: 4px;
  background: var(--paper);
}

.tl-item.is-now .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.approve-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.crumb {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.crumb:hover {
  border-bottom-color: var(--accent);
}

@media (max-width: 1024px) {
  :root { --wrap: min(1180px, calc(100% - 40px)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  :root {
    --wrap: min(1180px, calc(100% - 32px));
    --grid-size: 28px;
    --nav-h: 56px;
  }

  /* 直向格線對齊 .wrap 左緣(16px);橫向格線從文件頂對齊,nav 剛好兩格 */
  body {
    background-position: 16px 0;
  }

  .brand-lockup {
    letter-spacing: 0.08em;
    font-size: 11px;
  }

  .nav-toggle { display: block; }

  .nav-panel {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    padding: 8px 16px 20px;
    margin: 0;
  }

  body.nav-open .nav-panel { display: flex; }
  body.nav-open { overflow: hidden; }

  .nav-links {
    flex-direction: column;
  }

  .nav-tools {
    justify-content: space-between;
    padding: 8px 0 0;
  }

  .footer-grid,
  .ops-mock,
  .ops-split {
    grid-template-columns: 1fr;
  }

  .ops-side,
  .ops-rail {
    display: none;
  }

  .ops-mock { min-height: 0; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .brand-lockup { max-width: 11.5em; white-space: normal; line-height: 1.2; }
}
