/* ============================================
   ICOSON 艾可森數位 — Blueprint Design System
   ============================================ */

:root {
  /* Color */
  --bg: #0A1220;
  --bg-alt: #0D1729;
  --panel: #101E33;
  --line: #1E3554;
  --line-strong: #2C4C74;
  --text: #E9EEF5;
  --text-muted: #8FA3BD;
  --text-dim: #5C7191;
  --accent: #63bec6;
  --accent-dark: #4a9aa2;
  --accent-2: #F2B84B;
  --accent-soft: rgba(99, 190, 198, 0.10);

  /* Type */
  --font-display: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --font-body: 'Noto Sans TC', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1160px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .client-carousel {
    mask-image: none;
    -webkit-mask-image: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  .client-track {
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
    gap: 16px;
    animation: none !important;
  }
  .client-track[aria-hidden="true"] { display: none; }
}

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

h1, h2, h3 { font-family: var(--font-body); font-weight: 700; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

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

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

.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

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

/* ============ Blueprint texture ============ */
.blueprint-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 85%);
  pointer-events: none;
}

.corner-marks { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.corner-marks i {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--line-strong);
  border-style: solid;
  border-width: 0;
}
.corner-marks i:nth-child(1) { top: 8px; left: -18px; border-top-width: 1px; border-left-width: 1px; }
.corner-marks i:nth-child(2) { top: 8px; right: -18px; border-top-width: 1px; border-right-width: 1px; }
.corner-marks i:nth-child(3) { bottom: 8px; left: -18px; border-bottom-width: 1px; border-left-width: 1px; }
.corner-marks i:nth-child(4) { bottom: 8px; right: -18px; border-bottom-width: 1px; border-right-width: 1px; }
.hero .corner-marks i:nth-child(1) { top: 20px; left: 4px; }
.hero .corner-marks i:nth-child(2) { top: 20px; right: 4px; }
.hero .corner-marks i:nth-child(3) { bottom: 20px; left: 4px; }
.hero .corner-marks i:nth-child(4) { bottom: 20px; right: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #071018;
}
.btn-primary:hover { background: #7dccd3; }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  line-height: 0;
}
.logo img {
  display: block;
  height: 44px;
  width: auto;
}

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--text); }
.nav-cta {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 130px 24px 100px;
  min-height: 92vh;
  display: flex;
  align-items: center;
}
.hero-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  z-index: 2;
}
.hero-title {
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 5.2vw, 4rem);
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.hero-sub {
  margin-top: 26px;
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--text-muted);
}
.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-stats {
  margin-top: 72px;
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  max-width: 640px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-plus { font-size: 1.2rem; }
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero-diagram {
  position: absolute;
  right: -4%;
  bottom: -6%;
  width: 60%;
  max-width: 640px;
  opacity: 0.9;
  z-index: 1;
  pointer-events: none;
}
.diagram-svg { width: 100%; height: auto; overflow: visible; }
.diagram-path {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-path 2.2s ease forwards 0.4s;
}
.diagram-nodes .node circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: 0;
  transform-origin: center;
  animation: node-in 0.5s ease forwards;
  animation-delay: calc(0.6s + var(--d) * 0.35s);
}
.diagram-nodes .node text {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  text-anchor: middle;
  opacity: 0;
  animation: node-in 0.5s ease forwards;
  animation-delay: calc(0.75s + var(--d) * 0.35s);
}
@keyframes draw-path { to { stroke-dashoffset: 0; } }
@keyframes node-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .diagram-path { stroke-dashoffset: 0; animation: none; }
  .diagram-nodes .node circle, .diagram-nodes .node text { opacity: 1; animation: none; }
}

/* ============ Sections ============ */
.section { position: relative; padding: 120px 24px; }
.section-alt { background: var(--bg-alt); }
.section-inner { position: relative; max-width: var(--container); margin: 0 auto; min-width: 0; padding: 12px 8px; }

.section-head { max-width: 640px; margin-bottom: 64px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.35;
}
.heading-nowrap {
  white-space: nowrap;
}
.section-desc {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============ Grid / Cards ============ */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel);
  padding: 36px 30px;
  transition: background 0.25s ease;
}
.card:hover { background: #142744; }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  border: 1px solid var(--line-strong);
  padding: 3px 9px;
  border-radius: 2px;
  margin-bottom: 20px;
}
.card-tag-foot {
  margin-top: 18px;
  margin-bottom: 0;
  color: var(--accent);
  border: none;
  padding: 0;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}
.card-tag-foot::after {
  content: " ↗";
}
.card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.card p { color: var(--text-muted); font-size: 0.92rem; }
a.card {
  display: block;
  color: inherit;
  cursor: pointer;
}
a.card:focus-visible {
  outline: none;
  background: #142744;
}

/* ============ Reasons ============ */
.reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.reason {
  background: var(--bg-alt);
  display: flex;
  gap: 22px;
  padding: 36px 34px;
}
.reason-mark {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}
.reason-body h3 { font-size: 1.1rem; margin-bottom: 10px; }
.reason-body p { color: var(--text-muted); font-size: 0.92rem; }

/* ============ Pipeline (Process) ============ */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  position: relative;
}
.pipeline::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 4%;
  right: 4%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
  z-index: 0;
}
.pipe-step { position: relative; z-index: 1; }
.pipe-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 20px;
}
.pipe-step h3 { font-size: 1rem; margin-bottom: 8px; }
.pipe-step p { color: var(--text-muted); font-size: 0.85rem; }

/* ============ Clients ============ */
.client-carousel {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.client-track {
  display: flex;
  flex-shrink: 0;
  gap: 20px;
  padding-right: 20px;
  animation: client-scroll 28s linear infinite;
}
.client-carousel:hover .client-track {
  animation-play-state: paused;
}
.client-slide {
  margin: 0;
  flex: 0 0 auto;
  width: 240px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05080f;
  border: 1px solid var(--line);
  padding: 18px 28px;
}
.client-slide img {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}
@keyframes client-scroll {
  to { transform: translateX(-100%); }
}

/* ============ About / Title block ============ */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: start;
}
.about-head h2 { line-height: 1.3; }

.title-block {
  border: 1px solid var(--line-strong);
  background: var(--panel);
}
.tb-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line);
}
.tb-row:last-child { border-bottom: none; }
.tb-row dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(99, 190, 198, 0.04);
}
.tb-row dd {
  margin: 0;
  padding: 18px 20px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.brand-link {
  color: var(--accent);
}
.brand-link::after {
  content: " ↗";
}
.brand-link:hover { color: #7dccd3; }

/* ============ Contact ============ */
.contact-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 40px;
  align-items: start;
}
.contact-form {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 44px;
  border-radius: 4px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.req { color: var(--accent-2); }
.field input, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.form-success {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.9rem;
  background: var(--accent-soft);
}
.form-success.show { display: block; }
.form-error {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #e07a6a;
  border-radius: 3px;
  color: #e07a6a;
  font-size: 0.9rem;
  background: rgba(224, 122, 106, 0.08);
}
.form-error.show { display: block; }

.contact-window {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 36px 32px;
  border-radius: 4px;
}
.cw-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.02em;
}
.cw-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.cw-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cw-val {
  display: block;
  font-size: 1rem;
  color: var(--text);
}
a.cw-val:hover { color: var(--accent); }
.cw-val[href^="mailto"] { word-break: break-all; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 24px 32px;
  background: var(--bg-alt);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.contact-window-footer {
  max-width: var(--container);
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 28px 32px;
}
.contact-window-footer .cw-title {
  margin: 0;
  padding: 0 32px 0 0;
  border-bottom: none;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.contact-window-footer .cw-list {
  flex: 1;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px 48px;
}
.footer-brand p { margin-top: 16px; color: var(--text-muted); font-size: 0.88rem; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 14px 40px;
  align-content: start;
  justify-self: end;
}
.footer-nav a { color: var(--text-muted); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal {
  max-width: var(--container);
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .reasons { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); row-gap: 44px; }
  .pipeline::before { display: none; }
  .about-layout { grid-template-columns: 1fr; }
  .hero-diagram { width: 78%; opacity: 0.5; }
  .contact-layout { grid-template-columns: 1fr; }
  .heading-nowrap { white-space: normal; }
  .hero-title { white-space: normal; }
  .stat-label { white-space: normal; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav a { width: 100%; padding: 16px 24px; border-bottom: 1px solid var(--line); }
  .nav-cta { border: none; }
  .nav-toggle { display: flex; }

  .header-inner { padding: 14px 16px; }
  .logo img { height: 34px; }

  .hero { padding: 96px 16px 72px; min-height: auto; }
  .corner-marks i { width: 12px; height: 12px; }
  .corner-marks i:nth-child(1) { top: 4px; left: -6px; }
  .corner-marks i:nth-child(2) { top: 4px; right: -6px; }
  .corner-marks i:nth-child(3) { bottom: 4px; left: -6px; }
  .corner-marks i:nth-child(4) { bottom: 4px; right: -6px; }
  .hero .corner-marks i:nth-child(1) { top: 12px; left: 2px; }
  .hero .corner-marks i:nth-child(2) { top: 12px; right: 2px; }
  .hero .corner-marks i:nth-child(3) { bottom: 12px; left: 2px; }
  .hero .corner-marks i:nth-child(4) { bottom: 12px; right: 2px; }
  .hero-diagram { display: none; }
  .hero-title {
    white-space: normal;
    font-size: clamp(1.55rem, 7vw, 2.15rem);
  }
  .hero-sub { font-size: 0.95rem; }
  .hero-stats { gap: 24px 28px; max-width: none; }
  .stat-label { white-space: normal; }
  .heading-nowrap {
    white-space: normal;
    font-size: clamp(1.35rem, 6vw, 1.7rem);
  }
  .client-slide { width: 180px; height: 96px; padding: 12px 16px; }
  .client-slide img { max-height: 64px; }

  .section { padding: 72px 16px; }
  .section-head { max-width: none; margin-bottom: 40px; }
  .section-head h2 { font-size: clamp(1.4rem, 6.2vw, 1.8rem); }
  .grid-3 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .reason { padding: 28px 20px; }
  .card { padding: 28px 20px; }

  .tb-row {
    grid-template-columns: 1fr;
  }
  .tb-row dt {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 8px;
  }
  .tb-row dd { padding: 10px 16px 16px; }

  .footer-inner { grid-template-columns: 1fr; padding-bottom: 28px; }
  .footer-nav { justify-self: start; grid-template-columns: repeat(2, auto); }
  .footer-legal {
    flex-direction: column;
    gap: 6px;
  }
  .field-row { grid-template-columns: 1fr; }
  .contact-form { padding: 24px 18px; }
  .contact-window { padding: 24px 18px; }
  .contact-window-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 18px;
  }
  .contact-window-footer .cw-title {
    padding: 0 0 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .contact-window-footer .cw-list {
    flex-direction: column;
    gap: 18px;
    width: 100%;
  }
  .cw-val { overflow-wrap: anywhere; }
  .btn { white-space: normal; text-align: center; }
}
