:root {
  --bg: #ffffff;
  --text: #121619;
  --muted: #596467;
  --line: #d9e0df;
  --soft: #f6f8f7;
  --teal: #087c7a;
  --teal-dark: #075d5d;
  --amber: #d9942c;
  --shadow: 0 18px 55px rgba(9, 35, 37, 0.12);
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#top,
#work,
#services,
#contact {
  scroll-margin-top: 86px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 48px;
  align-items: center;
  min-height: 78px;
  padding: 0 clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 28px;
  font-weight: 820;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 38px;
  align-items: center;
  color: #202728;
  font-size: 16px;
  font-weight: 650;
}

.header-mail {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 680;
  box-shadow: 0 12px 28px rgba(8, 124, 122, 0.23);
}

.header-mail svg,
.email-copy svg {
  width: 22px;
  height: 22px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  gap: clamp(24px, 3vw, 64px);
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 54px clamp(20px, 6vw, 84px) 72px;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 10%;
  bottom: 42px;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  content: "";
}

.hero-copy {
  max-width: 560px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(82px, 10.5vw, 164px);
  font-weight: 850;
  line-height: 0.88;
  letter-spacing: 0;
}

.role {
  margin: 24px 0 18px;
  color: var(--teal);
  font-size: clamp(30px, 3.5vw, 48px);
  font-weight: 430;
  line-height: 1.1;
}

.hero-line {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 680;
  line-height: 1.35;
}

.hero-line::after {
  display: block;
  width: 46px;
  height: 2px;
  margin: 26px 0 22px;
  background: var(--teal);
  content: "";
}

.hero-body {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 450;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  min-width: 174px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--teal);
  font-size: 18px;
  font-weight: 720;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button svg,
.contact-mail svg {
  width: 22px;
  height: 22px;
}

.button.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 15px 34px rgba(8, 124, 122, 0.22);
}

.button.secondary {
  background: #fff;
  color: var(--text);
}

.button:hover,
.header-mail:hover,
.contact-mail:hover {
  transform: translateY(-2px);
}

.email-copy {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin-top: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #202728;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}

.hero-art {
  position: relative;
  min-height: 560px;
}

.hero-art img {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(980px, 72vw);
  max-width: none;
  transform: translate(-43%, -50%);
  filter: drop-shadow(0 34px 48px rgba(20, 35, 36, 0.08));
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #151a1d;
  transform: translateX(-50%);
}

.scroll-cue svg {
  width: 25px;
  height: 25px;
}

.work-intro {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding: 38px clamp(20px, 6vw, 84px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.work-intro > div,
.work,
.services,
.contact,
.site-footer {
  width: min(var(--max), calc(100vw - 40px));
  margin-inline: auto;
}

.work-intro h2,
.services h2,
.contact h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 820;
  line-height: 1.1;
}

.work-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.work-intro a,
.work-copy a {
  color: var(--teal);
  font-weight: 720;
}

.work {
  padding: 70px 0 88px;
}

.work-row {
  display: grid;
  grid-template-columns: 72px 92px minmax(260px, 0.7fr) minmax(360px, 1.3fr);
  gap: 30px;
  align-items: center;
  padding: 46px 0;
  border-bottom: 1px solid var(--line);
}

.work-row:first-child {
  padding-top: 0;
}

.work-index {
  color: var(--teal);
  font-size: 32px;
  font-weight: 540;
  line-height: 1;
}

.work-index::after {
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 16px;
  background: var(--teal);
  content: "";
}

.work-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
}

.work-icon svg {
  width: 34px;
  height: 34px;
}

.work-copy h3 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.18;
}

.work-copy p {
  max-width: 420px;
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.work-copy a::after,
.work-intro a::after {
  margin-left: 12px;
  content: "->";
}

.product-frame,
.flow-strip,
.launch-line {
  background: linear-gradient(180deg, #fff, var(--soft));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.product-frame {
  min-height: 250px;
  padding: 20px;
}

.browser-bar {
  display: flex;
  gap: 7px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.browser-bar span {
  width: 8px;
  height: 8px;
  border: 1px solid #9ea9aa;
  border-radius: 50%;
}

.prototype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin: 18px 0;
}

.prototype-grid div {
  min-height: 90px;
  padding: 16px;
  border: 1px solid #e6ebea;
  background: #fff;
}

.prototype-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}

.prototype-grid span,
.task-line span {
  color: var(--muted);
  font-size: 13px;
}

.task-line {
  display: grid;
  gap: 10px;
}

.task-line span {
  height: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #dfe8e7, transparent);
}

.task-line span:nth-child(1) {
  width: 86%;
}

.task-line span:nth-child(2) {
  width: 62%;
}

.task-line span:nth-child(3) {
  width: 74%;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 30px 28px;
}

.flow-strip div {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--teal);
  text-align: center;
}

.flow-strip div:not(:last-child)::after {
  position: absolute;
  top: 19px;
  right: -18px;
  width: 36px;
  height: 1px;
  background: var(--line);
  content: "";
}

.flow-strip svg {
  width: 42px;
  height: 42px;
}

.flow-strip span {
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
}

.launch-line {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: center;
  padding: 46px 30px;
}

.launch-line span {
  position: relative;
  color: #1c2325;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.launch-line span:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -12px;
  width: 18px;
  height: 1px;
  background: var(--line);
  content: "";
}

.services {
  padding: 78px 0 92px;
  border-top: 1px solid var(--line);
}

.service-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-rail article {
  min-height: 210px;
  padding: 34px 34px 38px;
  border-right: 1px solid var(--line);
}

.service-rail article:last-child {
  border-right: 0;
}

.service-rail span {
  color: var(--teal);
  font-size: clamp(58px, 7vw, 88px);
  font-weight: 360;
  line-height: 1;
}

.service-rail h3 {
  margin: 20px 0 10px;
  font-size: 26px;
  line-height: 1.2;
}

.service-rail p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.contact {
  display: grid;
  grid-template-columns: minmax(610px, 0.95fr) minmax(460px, 0.85fr);
  gap: 48px;
  align-items: center;
  padding: 86px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-copy p {
  max-width: 540px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.85;
}

.contact h2 {
  font-size: clamp(34px, 3vw, 40px);
}

.contact-mail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  min-height: 132px;
  border: 2px solid var(--teal);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.contact-mail span {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 22px 20px;
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 830;
  line-height: 1;
  white-space: nowrap;
}

.contact-mail svg {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  padding: 31px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 40px;
  align-items: center;
  padding: 42px 0 56px;
}

.site-footer div {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site-footer strong {
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}

.site-footer span,
.site-footer a {
  color: var(--muted);
  font-size: 15px;
}

.site-footer nav {
  display: flex;
  gap: 32px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 12px 18px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 54px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-art {
    min-height: 420px;
  }

  .hero-art img {
    width: min(880px, 118vw);
    transform: translate(-47%, -50%);
  }

  .work-row {
    grid-template-columns: 64px 1fr;
  }

  .work-icon {
    display: none;
  }

  .work-copy,
  .product-frame,
  .flow-strip,
  .launch-line {
    grid-column: 2;
  }

  .flow-strip,
  .launch-line {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .flow-strip div:not(:last-child)::after,
  .launch-line span:not(:last-child)::after {
    display: none;
  }

  .service-rail,
  .contact,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .service-rail article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-rail article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 68px;
    padding-inline: 18px;
  }

  .brand {
    font-size: 23px;
  }

  .header-mail {
    min-height: 40px;
    padding-inline: 12px;
  }

  .header-mail span {
    display: none;
  }

  .hero {
    padding: 34px 20px 46px;
  }

  .hero h1 {
    font-size: clamp(64px, 20vw, 84px);
  }

  .role {
    margin: 16px 0 12px;
    font-size: 29px;
  }

  .hero-line {
    font-size: 23px;
  }

  .hero-line::after {
    margin: 20px 0 18px;
  }

  .hero-body {
    font-size: 16px;
    line-height: 1.75;
  }

  .hero-actions {
    gap: 14px;
    margin-top: 24px;
  }

  .email-copy {
    margin-top: 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero-art {
    min-height: 132px;
    overflow: hidden;
  }

  .hero-art img {
    width: min(420px, 86vw);
  }

  .work-intro {
    display: block;
    padding-inline: 20px;
  }

  .work-intro a {
    display: inline-block;
    margin-top: 18px;
  }

  .work {
    padding-top: 48px;
  }

  .work-row {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 38px 0;
  }

  .work-index,
  .work-copy,
  .product-frame,
  .flow-strip,
  .launch-line {
    grid-column: 1;
  }

  .prototype-grid {
    grid-template-columns: 1fr;
  }

  .contact-mail {
    grid-template-columns: 1fr 70px;
    min-height: 96px;
  }

  .contact-mail span {
    font-size: 24px;
    white-space: normal;
  }

  .contact-mail svg {
    padding: 22px;
  }

  .site-footer div {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-footer nav {
    flex-wrap: wrap;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
