:root {
  --ink: #16130f;
  --paper: #fffaf0;
  --paper-2: #fff1d6;
  --red: #ff4b2b;
  --yellow: #ffd23f;
  --blue: #3a6bff;
  --green: #1fb67a;
  --pink: #ff7eb6;
  --muted: #6b6257;
  --radius: 22px;
  --shadow: 6px 6px 0 var(--ink);
  --wrap: 1200px;
  --font: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", sans-serif;
  --display: "Space Grotesk", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 900; letter-spacing: -0.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.m-only { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 14px 26px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 700;
  border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-small { padding: 8px 18px; font-size: 15px; }
.btn-big { font-size: clamp(18px, 3vw, 28px); padding: 18px 34px; background: var(--yellow); color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2.5px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: var(--red); color: #fff; font-family: var(--display); font-weight: 700;
  border: 2.5px solid var(--ink); border-radius: 12px; transform: rotate(-6deg);
  box-shadow: 3px 3px 0 var(--ink);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--display); letter-spacing: .04em; }
.brand-text small { font-size: 12px; color: var(--muted); letter-spacing: .2em; }
.nav-links { display: flex; align-items: center; gap: 28px; font-weight: 700; }
.nav-links a:not(.btn) { position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 3px;
  background: var(--red); transition: right .2s;
}
.nav-links a:not(.btn):hover::after { right: 0; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .2s; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(60px, 10vw, 120px) 0 80px; overflow: hidden; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 16px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; margin: 0 0 28px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }
.hero h1 { font-size: clamp(42px, 8vw, 104px); }
.wow {
  display: inline-block; font-family: var(--display); color: var(--red);
  background: var(--yellow); padding: 0 .18em; border-radius: .15em;
  transform: rotate(-3deg); border: .04em solid var(--ink); box-shadow: .06em .06em 0 var(--ink);
  margin: .06em .05em;
}
.lede { max-width: 620px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); margin: 28px 0 36px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.stats { list-style: none; padding: 0; margin: 64px 0 0; display: flex; gap: clamp(24px, 6vw, 72px); flex-wrap: wrap; }
.stats b { font-family: var(--display); font-size: clamp(40px, 5vw, 60px); line-height: 1; }
.stats span { display: block; font-weight: 700; color: var(--muted); font-size: 14px; margin-top: 6px; }

.hero-stickers { position: absolute; inset: 0; pointer-events: none; }
.sticker {
  position: absolute; font-family: var(--display); font-weight: 700;
  padding: 10px 20px; border: 2.5px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink); animation: float 6s ease-in-out infinite;
}
.s1 { top: 16%; right: 8%; background: var(--green); color: #fff; transform: rotate(8deg); }
.s2 { top: 34%; right: 22%; background: var(--pink); animation-delay: -1s; transform: rotate(-6deg); }
.s3 { top: 52%; right: 6%; background: var(--blue); color: #fff; animation-delay: -2s; transform: rotate(4deg); }
.s4 { top: 70%; right: 26%; background: var(--yellow); animation-delay: -3s; transform: rotate(-10deg); }
.s5 { top: 82%; right: 10%; background: #fff; animation-delay: -4s; transform: rotate(6deg); }
@keyframes float { 50% { translate: 0 -14px; } }

/* ---------- Marquee ---------- */
.marquee { background: var(--ink); color: var(--paper); border-block: 2.5px solid var(--ink); overflow: hidden; padding: 18px 0; transform: rotate(-1.2deg); margin: 0 -10px; }
.marquee-track { display: flex; gap: 28px; width: max-content; animation: scroll 40s linear infinite; font-weight: 900; font-size: clamp(18px, 2.4vw, 28px); white-space: nowrap; }
.marquee i { color: var(--yellow); font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section-alt { background: var(--paper-2); border-block: 2.5px solid var(--ink); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-head { margin-bottom: 48px; }
.kicker { font-family: var(--display); font-weight: 700; color: var(--red); letter-spacing: .1em; margin: 0 0 12px; }
.section h2 { font-size: clamp(34px, 5.4vw, 64px); }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
  position: relative; padding: 32px 28px; border: 2.5px solid var(--ink); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); transition: transform .2s;
}
.service:hover { transform: translate(-3px, -3px) rotate(-.6deg); }
.service-num {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px;
  font-family: var(--display); font-size: 24px; font-weight: 700;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--accent); color: var(--on-accent, var(--ink));
}
.service h3 { font-size: 24px; margin-bottom: 10px; }
.service p { margin: 0 0 18px; color: var(--muted); }
.service ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.service li { font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--ink); }
.c-red { --accent: var(--red); --on-accent: #fff; }
.c-yellow { --accent: var(--yellow); }
.c-blue { --accent: var(--blue); --on-accent: #fff; }
.c-green { --accent: var(--green); --on-accent: #fff; }
.c-pink { --accent: var(--pink); }
.c-ink { --accent: var(--ink); --on-accent: var(--yellow); }

/* Works */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter {
  font: inherit; font-weight: 700; cursor: pointer; padding: 8px 20px; border-radius: 999px;
  border: 2.5px solid var(--ink); background: #fff; color: var(--ink); transition: background .15s;
}
.filter:hover { background: var(--yellow); }
.filter[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.work {
  display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; padding: 0; cursor: pointer;
  background: #fff; border: 2.5px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  animation: pop .35s both;
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.work:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.work.featured { grid-column: span 2; }
.work-cover {
  position: relative; aspect-ratio: 16 / 9; border-bottom: 2.5px solid var(--ink);
  background: var(--accent); color: var(--on-accent, var(--ink)); overflow: hidden;
  display: flex; align-items: flex-end; padding: 20px 22px;
}
.work-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-cover .mono {
  position: absolute; right: -0.06em; top: -0.18em; font-family: var(--display); font-weight: 700;
  font-size: clamp(90px, 12vw, 160px); line-height: 1; opacity: .22; letter-spacing: -.04em;
}
.work-cover .client { position: relative; font-weight: 900; font-size: 15px; background: var(--paper); color: var(--ink); padding: 2px 12px; border-radius: 999px; border: 2px solid var(--ink); }
.work-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.work-meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); }
.work h3 { font-size: 21px; }
.work p { margin: 0; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tags span { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 6px; background: var(--paper-2); border: 1.5px solid var(--ink); }

/* Modal */
.modal { width: min(720px, calc(100% - 32px)); max-height: 88vh; padding: 0; border: 2.5px solid var(--ink); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--ink); background: var(--paper); color: var(--ink); }
.modal::backdrop { background: rgba(22, 19, 15, .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .25s both; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; font-size: 26px; line-height: 1; cursor: pointer; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--yellow); }
.modal .work-cover { aspect-ratio: 21 / 9; }
.modal-body .inner { padding: 28px 32px 36px; }
.modal-body h3 { font-size: 30px; margin: 6px 0 14px; }
.modal-body ul { padding-left: 1.2em; margin: 16px 0; }
.modal-body li { margin: 4px 0; }
.modal-body .link { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--red); border-bottom: 2px solid; }

/* Process */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: s; }
.process li { position: relative; padding: 26px 22px; border: 2.5px solid var(--ink); border-radius: var(--radius); background: #fff; }
.process li:nth-child(odd) { transform: rotate(-1.2deg); }
.process li:nth-child(even) { transform: rotate(1.2deg); background: var(--yellow); }
.process b { font-family: var(--display); font-size: 40px; color: var(--red); line-height: 1; }
.process h3 { font-size: 20px; margin: 12px 0 8px; }
.process p { margin: 0; font-size: 15px; color: var(--muted); }
.process li:nth-child(even) p { color: var(--ink); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
.about .kicker { color: var(--yellow); }
.about-body p { font-size: 17px; margin: 0 0 18px; color: #d8cfc2; }
.about-body b { color: var(--yellow); }
.tech { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tech span { padding: 6px 14px; border: 2px solid var(--paper); border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 14px; }
.tech span:nth-child(3n+1) { background: var(--red); border-color: var(--red); }

/* Contact */
.contact { text-align: center; background: radial-gradient(circle at 50% 120%, var(--yellow) 0, transparent 55%); }
.contact .lede { margin-inline: auto; }

/* Footer */
.footer { border-top: 2.5px solid var(--ink); padding: 26px 0; font-size: 14px; font-weight: 500; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services, .works-grid { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process li:last-child { grid-column: span 2; }
  .hero-stickers { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .m-only { display: inline; }
  .nav { padding: 12px 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 18px;
    padding: 24px 16px 28px; background: var(--paper); border-bottom: 2.5px solid var(--ink);
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav.open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .services, .works-grid, .process { grid-template-columns: 1fr; }
  .work.featured, .process li:last-child { grid-column: auto; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .modal-body .inner { padding: 22px 20px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
