:root {
  --paper: #f8f4ec;
  --paper-strong: #fffdf8;
  --ink: #242120;
  --muted: #726b66;
  --red: #c72932;
  --red-dark: #8f1720;
  --coral: #ee6650;
  --orange: #f3a33b;
  --sun: #ffd264;
  --teal: #1e6570;
  --line: rgba(36, 33, 32, 0.16);
  --shadow: 0 24px 70px rgba(74, 34, 24, 0.13);
  --serif: "Noto Sans TC", sans-serif;
  --sans: "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link {
  position: fixed;
  z-index: 999;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 0.85rem clamp(1.15rem, 4vw, 4.5rem);
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 8px 28px rgba(45, 28, 22, 0.06); }
.brand { display: flex; gap: 0.7rem; align-items: center; text-decoration: none; line-height: 1.1; }
.brand > span:last-child { display: grid; gap: 0.25rem; }
.brand strong { font-size: 0.95rem; letter-spacing: 0.08em; }
.brand small { color: var(--red); font-size: 0.58rem; letter-spacing: 0.16em; }
.brand-mark { width: 34px; height: 34px; display: grid; align-content: center; gap: 3px; padding: 5px; border-radius: 50%; background: var(--red); overflow: hidden; }
.brand-mark i { width: 130%; height: 3px; margin-left: -15%; border-radius: 99px; background: white; transform: rotate(10deg); }
.site-header nav { display: flex; justify-content: center; gap: clamp(1.2rem, 3vw, 3rem); }
.site-header nav a { position: relative; font-size: 0.88rem; text-decoration: none; }
.site-header nav a::after { content: ""; position: absolute; left: 0; bottom: -0.4rem; width: 100%; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform 220ms ease; }
.site-header nav a:hover::after, .site-header nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.header-tools { display: flex; gap: 0.5rem; }
.header-tools a { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(199,41,50,0.45); border-radius: 50%; color: var(--red); background: white; font-size: 0.63rem; font-weight: 800; text-decoration: none; transition: color 180ms ease, background 180ms ease, transform 180ms ease; }
.header-tools a:hover { color: white; background: var(--red); transform: translateY(-2px); }
.install-button { padding: 0.65rem 1rem; border: 1px solid var(--red); border-radius: 999px; color: var(--red); background: transparent; font: 600 0.8rem var(--sans); cursor: pointer; }
.menu-button { display: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--red); place-content: center; gap: 5px; }
.menu-button span { width: 18px; height: 2px; background: white; }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 7rem);
  padding: clamp(8rem, 13vh, 10rem) clamp(1.2rem, 6vw, 7.5rem) 5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 9% 18%, rgba(255,255,255,.28) 0 7px, transparent 8px),
    radial-gradient(circle at 94% 72%, rgba(143,23,32,.13) 0 46px, transparent 47px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 2px, transparent 2px 92px),
    linear-gradient(135deg, #f8b846 0%, #ef8a32 52%, #e96a43 100%);
}
.hero::before { content: ""; position: absolute; z-index: 0; inset: clamp(6rem, 10vh, 8rem) clamp(1rem, 5vw, 5.5rem) 3.5rem; border-radius: clamp(24px, 4vw, 52px); background: rgba(255,253,248,.96); box-shadow: 0 28px 80px rgba(126,56,20,.2); }
.hero::after { content: ""; position: absolute; right: -15vw; bottom: -42vw; width: 70vw; height: 70vw; border: 1px solid rgba(255,255,255,0.26); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow { margin: 0 0 1.15rem; color: var(--red); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.75rem; font-family: var(--serif); font-size: clamp(2.9rem, 5.6vw, 6rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.04em; }
h1 span { display: block; }
h1 span:last-child { color: var(--red); }
.hero-lead { max-width: 660px; color: #514a46; font-size: clamp(1rem, 1.25vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero-contact { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.35rem; }
.hero-contact a { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-decoration-color: rgba(199,41,50,0.35); text-underline-offset: 0.28rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.75rem 1.35rem; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.9rem; transition: transform 180ms ease, box-shadow 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--red); color: white; box-shadow: 0 12px 28px rgba(199,41,50,0.24); }
.button-quiet { border: 1px solid var(--line); background: rgba(255,255,255,0.65); }
.hero-stage { position: relative; z-index: 1; min-height: 590px; }
.sun-disc { position: absolute; top: 6%; right: -2%; width: min(34vw, 440px); aspect-ratio: 1; border-radius: 50%; background: linear-gradient(145deg, var(--sun), var(--orange)); box-shadow: 0 35px 100px rgba(243,163,59,0.3); }
.portrait-frame { position: absolute; z-index: 1; top: 7%; right: 4%; width: min(28vw, 355px); aspect-ratio: 0.78; margin: 0; border: 10px solid var(--paper-strong); border-radius: 48% 48% 10px 10px; overflow: hidden; box-shadow: var(--shadow); transform: rotate(2deg); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 26%; filter: saturate(0.92) contrast(1.02); }
.stage-card { position: absolute; padding: 1.4rem; border-radius: 6px; box-shadow: var(--shadow); }
.stage-card span, .stage-card p { font-size: 0.72rem; letter-spacing: 0.12em; }
.stage-card strong { display: block; margin: 1rem 0 0.3rem; font-family: var(--serif); font-size: clamp(2rem, 4vw, 4rem); }
.stage-card p { margin: 0; }
.stage-card-main { z-index: 2; top: 30%; left: -2%; width: min(72%, 360px); min-height: 230px; color: white; background: var(--red); transform: rotate(-3deg); }
.stage-card-main::before { content: ""; position: absolute; right: 1.4rem; bottom: 1.4rem; width: 88px; height: 88px; border: 1px solid rgba(255,255,255,0.6); border-radius: 50%; }
.stage-card-code { z-index: 3; right: 0; bottom: 5%; width: min(62%, 300px); min-height: 190px; background: white; transform: rotate(4deg); }
.stage-card-code strong { color: var(--teal); font-size: clamp(1.8rem, 3vw, 3rem); }
.stage-tag { position: absolute; right: -2rem; top: 46%; color: var(--red-dark); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.22em; writing-mode: vertical-rl; }
.hero-dots { position: absolute; z-index: 3; left: 50%; bottom: 4.65rem; display: flex; gap: 0.45rem; transform: translateX(-50%); }
.hero-dots i { width: 42px; height: 4px; border-radius: 99px; background: rgba(199,41,50,.22); }
.hero-dots i:first-child { background: var(--red); }
.hero-orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(199,41,50,0.14); }
.orbit-one { width: 40vw; height: 40vw; left: -26vw; top: 16%; }
.orbit-two { width: 18vw; height: 18vw; right: 38%; bottom: -12vw; }

.ticker { overflow: hidden; background: var(--red); color: white; border-block: 1px solid var(--red-dark); }
.ticker-track { width: max-content; display: flex; align-items: center; gap: 2.6rem; padding: 0.85rem 0; animation: marquee 28s linear infinite; }
.ticker span { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; }
.ticker i { color: var(--sun); font-size: 0.55rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

.section { padding: clamp(5.5rem, 10vw, 9rem) clamp(1.2rem, 7vw, 9rem); }
.section-heading { display: grid; grid-template-columns: 0.38fr 1fr; gap: 2rem; align-items: start; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section-heading h2 { margin: 0; max-width: 960px; font-family: var(--serif); font-size: clamp(2.2rem, 4.6vw, 5rem); line-height: 1.25; letter-spacing: -0.04em; }
.profile { background: var(--paper-strong); }
.profile-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 7vw, 8rem); }
.profile-story { max-width: 760px; font-size: clamp(1rem, 1.25vw, 1.18rem); }
.profile-story p + p { margin-top: 1.8rem; }
.profile-numbers { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-numbers article { display: flex; min-height: 180px; flex-direction: column; justify-content: space-between; padding: 1rem; border-left: 1px solid var(--line); }
.profile-numbers strong { color: var(--red); font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 4.4rem); line-height: 1; }
.profile-numbers span { color: var(--muted); font-size: 0.78rem; }

.experience { background: #efe7da; }
.timeline { position: relative; max-width: 1180px; margin-left: auto; }
.timeline-line { position: absolute; left: 190px; top: 0; bottom: 0; width: 2px; background: rgba(36,33,32,0.12); }
.timeline-line span { display: block; width: 100%; height: 0; background: var(--red); }
.timeline-item { position: relative; display: grid; grid-template-columns: 190px 1fr; min-height: 260px; padding-bottom: 4rem; }
.timeline-item::before { content: ""; position: absolute; left: 183px; top: 0.45rem; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #efe7da; background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.timeline-date { padding-right: 2rem; color: var(--red); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; }
.timeline-item > div:last-child { padding-left: clamp(2rem, 5vw, 5rem); }
.timeline-kicker { margin-bottom: 0.25rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; }
.timeline h3 { margin-bottom: 1rem; font-family: var(--serif); font-size: clamp(1.55rem, 2.8vw, 2.75rem); }
.timeline-item > div:last-child > p { max-width: 780px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 0.35rem 0.7rem; border: 1px solid rgba(36,33,32,0.19); border-radius: 999px; color: #574f49; font-size: 0.68rem; }

.projects { background: var(--paper-strong); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project-card { position: relative; min-height: 390px; padding: clamp(1.5rem, 3vw, 3rem); background: var(--paper-strong); overflow: hidden; }
.project-card h3 { margin: 0.8rem 0 1rem; font-family: var(--serif); font-size: clamp(1.6rem, 2.7vw, 2.7rem); }
.project-card > p:last-child { max-width: 620px; color: #5c5550; }
.project-no { position: absolute; top: 1.5rem; right: 1.5rem; color: var(--red); font: 800 0.74rem var(--sans); }
.project-type { color: var(--red); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.project-featured { grid-column: 1 / -1; min-height: 520px; display: grid; grid-template-columns: 0.9fr 1fr; align-items: center; background: #f8ddac; }
.project-featured > div:nth-child(2) { max-width: 650px; }
.project-visual { display: grid; place-items: center; min-height: 360px; }
.phone { position: relative; width: 210px; height: 390px; padding: 40px 18px 18px; border: 9px solid var(--ink); border-radius: 38px; background: var(--paper-strong); transform: rotate(7deg); box-shadow: 25px 35px 0 var(--red); }
.phone::before { content: ""; position: absolute; top: 14px; left: 50%; width: 58px; height: 7px; border-radius: 99px; background: var(--ink); transform: translateX(-50%); }
.phone span { display: block; height: 88px; margin-bottom: 12px; border-radius: 12px; background: linear-gradient(145deg, var(--red), var(--coral)); }
.phone i { display: block; height: 52px; margin-top: 10px; border-radius: 10px; background: #e9e0d2; }
.project-dark { color: white; background: var(--teal); }
.project-dark .project-type, .project-dark .project-no { color: #ffdca1; }
.project-dark > p:last-child { color: rgba(255,255,255,0.78); }

.next-step { background: var(--paper); }
.next-step-box { position: relative; padding: clamp(2.2rem, 6vw, 6rem); color: white; background: var(--ink); overflow: hidden; }
.next-step-box::after { content: ""; position: absolute; right: -12%; bottom: -70%; width: 55%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,0.18); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,0.03), 0 0 0 120px rgba(255,255,255,0.025); }
.next-step-box .eyebrow { color: var(--sun); }
.next-step-box h2 { max-width: 1050px; margin-bottom: 1.6rem; font-family: var(--serif); font-size: clamp(2.2rem, 4.8vw, 5rem); line-height: 1.28; }
.next-step-box p { max-width: 760px; color: rgba(255,255,255,0.72); }
.button-light { position: relative; z-index: 2; margin-top: 1rem; color: var(--ink); background: white; }

.service-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-strong); }
.service-links a { min-height: 128px; display: flex; align-items: center; justify-content: center; gap: 0.9rem; padding: 1.25rem; border-right: 1px solid var(--line); text-decoration: none; transition: color 180ms ease, background 180ms ease; }
.service-links a:last-child { border-right: 0; }
.service-links a:hover { color: white; background: var(--red); }
.service-links b { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 0.66rem; }
.service-links span { display: grid; font-size: 0.88rem; font-weight: 700; }
.service-links small { color: var(--muted); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.08em; }
.service-links a:hover small { color: rgba(255,255,255,.72); }

footer { display: grid; grid-template-columns: 1fr 1fr auto; gap: 2rem; align-items: end; padding: 3rem clamp(1.2rem, 7vw, 9rem); border-top: 1px solid var(--line); background: var(--paper-strong); }
footer div { display: grid; gap: 0.2rem; }
footer strong { font-family: var(--serif); font-size: 1.3rem; }
footer span, footer p, footer small { margin: 0; color: var(--muted); font-size: 0.72rem; }
footer a { text-underline-offset: 0.22rem; }
.offline-toast { position: fixed; z-index: 150; left: 50%; bottom: 1.2rem; padding: 0.7rem 1rem; border-radius: 999px; color: white; background: var(--ink); font-size: 0.75rem; transform: translate(-50%, 150%); transition: transform 260ms ease; }
.offline-toast.is-visible { transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { position: fixed; inset: 76px 0 auto; display: none; padding: 1.5rem; background: var(--paper-strong); border-bottom: 1px solid var(--line); flex-direction: column; }
  .site-header.is-menu-open nav { display: flex; }
  .install-button { display: none !important; }
  .header-tools { display: none; }
  .menu-button { display: grid; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 9rem; }
  .hero::before { inset: 6.2rem 1rem 3rem; }
  .hero-stage { min-height: 530px; max-width: 650px; width: 100%; margin: 0 auto; }
  .sun-disc { width: min(75vw, 420px); }
  .portrait-frame { width: min(56vw, 345px); right: 7%; }
  .section-heading { grid-template-columns: 1fr; gap: 0.5rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .project-featured { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; }
  .service-links { grid-template-columns: repeat(2, 1fr); }
  .service-links a { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .site-header { min-height: 68px; padding-inline: 1rem; }
  .site-header nav { inset-block-start: 68px; }
  .brand small { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .hero { padding: 7.5rem 1.2rem 3rem; }
  .hero::before { inset: 5.5rem .6rem 2.3rem; border-radius: 26px; }
  h1 { font-size: clamp(2.85rem, 14vw, 4.5rem); }
  .hero-stage { min-height: 440px; }
  .stage-card-main { top: 17%; width: 84%; min-height: 210px; }
  .portrait-frame { top: 2%; right: 2%; width: min(64vw, 280px); }
  .stage-card-main { top: 35%; width: 78%; }
  .stage-card-code { bottom: 6%; width: 72%; min-height: 170px; }
  .stage-tag { right: -0.4rem; }
  .hero-dots { bottom: 3.1rem; }
  .hero-dots i { width: 24px; }
  .section { padding-inline: 1.2rem; }
  .profile-numbers { grid-template-columns: 1fr; }
  .profile-numbers article { min-height: 120px; border-left: 0; border-top: 1px solid var(--line); }
  .profile-numbers article:first-child { border-top: 0; }
  .timeline-line { left: 7px; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 2rem; }
  .timeline-item::before { left: 0; }
  .timeline-date { margin-bottom: 0.65rem; padding-right: 0; }
  .timeline-item > div:last-child { padding-left: 0; }
  .project-grid { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; min-height: 680px; }
  .project-card { min-height: 340px; }
  .phone { width: 170px; height: 315px; box-shadow: 18px 24px 0 var(--red); }
  .next-step { padding-inline: 1rem; }
  footer { padding-inline: 1.2rem; }
  .service-links { grid-template-columns: 1fr; }
  .service-links a { min-height: 92px; justify-content: flex-start; padding-inline: 1.5rem; border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
