:root {
  --ink: #1f2937;
  --muted: #64748b;
  --line: #dbeafe;
  --surface: #ffffff;
  --teal: #38bdf8;
  --teal-dark: #075985;
  --blue: #0ea5e9;
  --amber: #7dd3fc;
  --coral: #0284c7;
  --soft: #f5fbff;
  --content-width: 100%;
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #e0f2fe 0%, #f5fbff 42%, #ffffff 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--teal-dark);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 0.35rem;
}

nav a {
  border-radius: 6px;
  color: #334155;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
}

nav a:hover {
  background: #e0f2fe;
  color: var(--teal-dark);
}

.hero {
  align-items: center;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(125, 211, 252, 0.22), transparent 34%),
    radial-gradient(ellipse at 88% 18%, rgba(14, 165, 233, 0.1), transparent 32%),
    #ffffff;
  border-bottom: 0;
  color: var(--ink);
  display: grid;
  gap: clamp(1.5rem, 4vw, 4.5rem);
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  margin-inline: auto;
  min-height: 66vh;
  padding-inline: clamp(1.5rem, 6vw, 6rem);
  padding-block: clamp(3rem, 7vw, 5.5rem);
  position: relative;
  width: var(--content-width);
}

.hero::after {
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 22px, rgba(7, 89, 133, 0.16) 23px 24px, transparent 25px 38px);
  background-size: 360px 96px;
  bottom: -1.5rem;
  content: "";
  height: 72px;
  left: 0;
  opacity: 0.35;
  pointer-events: none;
  position: absolute;
  right: 0;
}

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

.hero p,
.section-head p,
.contact p {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.hero .intro-line {
  align-items: center;
  color: var(--teal-dark);
  display: flex;
  gap: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  font-size: 2rem;
}

.hero .intro-line::after {
  background: currentColor;
  content: "";
  display: inline-block;
  height: 2px;
  width: 72px;
}

.hero h1,
.hero h2 {
  font-size: clamp(2rem, 4.8vw, 4.1rem);
  line-height: 1.1;
  margin: 0;
  max-width: 940px;
}

.hero span {
  color: var(--muted);
  display: block;
  font-size: 1.08rem;
  line-height: 1.8;
  margin-top: 1.2rem;
  max-width: 720px;
}

.hero .intro-en {
  color: #273241;
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.75;
  max-width: 820px;
}

.hero .intro-zh {
  color: var(--teal-dark);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  font-weight: 800;
  line-height: 1.85;
  margin-top: 1.7rem;
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.hero-actions a,
.project a {
  border-radius: 6px;
  font-weight: 800;
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
}

.secondary {
  border: 1px solid #7dd3fc;
  color: var(--teal-dark);
}

.profile-panel,
.project-panel,
.focus-panel {
  align-self: stretch;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(224, 242, 254, 0.9));
  border: 1px solid #bae6fd;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(14, 165, 233, 0.13);
  color: var(--ink);
  justify-self: start;
  max-width: none;
  padding: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
}

.profile-panel > span {
  color: var(--teal);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-panel h1,
.profile-panel h2,
.project-panel h1,
.focus-panel h2 {
  font-size: clamp(0.95rem, 2.8vw, 1.65rem);
  line-height: 1.15;
  margin: 0.7rem 0 1rem;
}

.project-panel h1,
.focus-panel h2 {
  color: var(--teal-dark);
  letter-spacing: 0.08em;
}

.project-mini-list,
.profile-list {
  display: grid;
  gap: 1rem;
}

.project-mini-list {
  gap: 1.15rem;
}

.project-mini-card {
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.project-mini-card img {
  display: block;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  width: 100%;
}

.project-mini-card span,
.project-mini-card strong,
.project-mini-card small {
  display: block;
}

.project-mini-card span {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-mini-card strong {
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.25;
  margin-top: 0.25rem;
}

.project-mini-card small,
.project-mini-card p {
  color: var(--muted);
  line-height: 1.45;
}

.project-mini-card small {
  margin: 0.35rem 0 0;
}

.project-mini-card p {
  font-size: 0.95rem;
  margin: 0.55rem 0 0;
}

.project-mini-card > div {
  align-self: center;
  padding: 1rem 1rem 1rem 0;
}

.project-mini-card:hover {
  border-color: #7dd3fc;
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.project-mini-card:hover strong {
  color: var(--teal-dark);
}

.project-panel .experience-head {
  margin-bottom: 1.4rem;
  text-align: left;
}

.project-panel .experience-head h2 {
  font-size: clamp(0.95rem, 3.8vw, 1.95rem);
}

.project-panel .experience-head h2::after {
  margin-left: 0;
  margin-right: 0;
}

.hero-project-list {
  gap: clamp(1.4rem, 3vw, 2.4rem);
}

.hero-project-list .experience-item,
.hero-project-list .experience-item.reverse {
  align-items: center;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr);
}

.hero-project-list .project-visual {
  height: clamp(140px, 13vw, 190px);
}

.hero-project-list .experience-copy {
  text-align: left;
}

.hero-project-list .experience-copy p {
  font-size: 0.98rem;
}

.hero-project-list .experience-copy span {
  font-size: 0.82rem;
}

.hero-project-list .experience-copy h3 {
  font-size: clamp(1.18rem, 1.9vw, 1.55rem);
}

.hero-project-list .experience-copy strong {
  font-size: 0.94rem;
}

.hero-project-list .project-links {
  justify-content: flex-start;
}

.project-quick-card {
  border-top: 1px solid var(--line);
  color: inherit;
  display: block;
  padding-top: 0.9rem;
  text-decoration: none;
}

.project-quick-card strong,
.project-quick-card span {
  display: block;
}

.project-quick-card strong {
  color: var(--teal-dark);
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
  margin-bottom: 0.25rem;
}

.project-quick-card span {
  color: var(--muted);
  line-height: 1.55;
}

.project-quick-card:hover strong {
  color: var(--blue);
}

.profile-list div {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.profile-list strong,
.profile-list small {
  display: block;
}

.profile-list strong {
  color: var(--teal-dark);
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
  margin-bottom: 0.25rem;
}

.profile-list small {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.6;
}

.focus-panel {
  align-self: center;
  justify-self: start;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  max-width: min(100%, 620px);
  width: fit-content;
}

.focus-panel .profile-list {
  width: fit-content;
  max-width: 100%;
}

.focus-panel .profile-list div {
  max-width: 560px;
}

.section {
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 6vw, 6rem);
  padding-block: clamp(2.5rem, 6vw, 5rem);
  width: var(--content-width);
}

.section-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.section .skills-head h2 {
  color: #1f2937;
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0;
  position: relative;
}

.section .skills-head h2::after {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral));
  border-radius: 999px;
  content: "";
  display: block;
  height: 5px;
  margin-top: 0.8rem;
  width: 58px;
}

.experience-head {
  margin-bottom: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.experience-head h2 {
  color: #1f2937;
  font-size: clamp(3.2rem, 8vw, 6rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0;
  position: relative;
}

.experience-head h2::after {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral));
  border-radius: 999px;
  content: "";
  display: block;
  height: 5px;
  margin: 0.8rem auto 0;
  width: 58px;
}

.section h2,
.contact h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.2;
  margin: 0;
}

.experience-list {
  display: grid;
  gap: clamp(2.2rem, 6vw, 5rem);
}

.experience-item {
  align-items: center;
  display: grid;
  gap: clamp(1.4rem, 4vw, 3rem);
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
}

.experience-item.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
}

.experience-item.reverse .project-visual {
  grid-column: 2;
  grid-row: 1;
}

.experience-item.reverse .experience-copy {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

.project-visual {
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.18);
  display: block;
  height: clamp(150px, 16vw, 210px);
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.experience-copy span {
  color: var(--teal-dark);
  display: block;
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.experience-copy h3 {
  color: #1f2937;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.1;
  margin: 0.15rem 0 0.25rem;
}

.experience-copy strong,
.experience-copy small {
  display: block;
  line-height: 1.35;
}

.experience-copy strong {
  color: #3f3f46;
  font-size: 1rem;
}

.experience-copy small {
  color: #7c7c80;
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.experience-copy p,
.skill-list span,
.contact span {
  color: var(--muted);
  line-height: 1.7;
}

.experience-copy p {
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  margin: 0;
  max-width: 820px;
}

.experience-item.reverse .experience-copy p {
  margin-left: auto;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.experience-item.reverse .project-links {
  justify-content: flex-end;
}

.project-links a {
  border: 1px solid #bae6fd;
  border-radius: 6px;
  color: var(--teal-dark);
  font-weight: 800;
  padding: 0.68rem 0.9rem;
  text-decoration: none;
}

.project-links a:first-child {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
}

.split {
  background: rgba(248, 252, 255, 0.92);
  border-block: 1px solid var(--line);
  padding-inline: clamp(1rem, 5vw, 5rem);
  width: 100%;
}

.split > * {
  margin-inline: auto;
  max-width: none;
}

.skill-list {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-list div {
  border-left: 3px solid var(--coral);
  padding: 0.4rem 1rem;
}

.skill-list strong,
.skill-list span {
  display: block;
}

.skill-list strong {
  margin-bottom: 0.35rem;
}

.contact {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff 55%, #ffffff);
  color: var(--ink);
  padding-inline: clamp(1rem, 5vw, 5rem);
  width: 100%;
}

.contact > * {
  margin-inline: auto;
  max-width: none;
}

.contact p {
  color: var(--teal-dark);
}

.contact span {
  color: var(--muted);
}

.mail-button {
  align-items: center;
  background: transparent;
  border-radius: 0;
  color: var(--teal-dark);
  gap: 0.55rem;
  display: inline-flex;
  font-weight: 900;
  margin-top: 1.4rem;
  padding: 0;
  text-decoration: none;
}

.mail-button span {
  font-size: 1.05rem;
  line-height: 1;
}

.mail-button strong {
  font-size: 1rem;
}

@media (max-width: 760px) {
  :root {
    --content-width: 100%;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .experience-item,
  .experience-item.reverse,
  .skill-list {
    grid-template-columns: 1fr;
  }

  .experience-item.reverse .project-visual,
  .experience-item.reverse .experience-copy {
    grid-column: auto;
    grid-row: auto;
  }

  .experience-item.reverse .experience-copy {
    text-align: left;
  }

  .experience-item.reverse .experience-copy p {
    margin-left: 0;
  }

  .experience-item.reverse .project-links {
    justify-content: flex-start;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 0.65rem;
  }

  nav {
    flex-wrap: wrap;
  }

  .project-mini-card {
    grid-template-columns: 1fr;
  }

  .project-mini-card img {
    height: 160px;
  }

  .project-mini-card > div {
    padding: 0 1rem 1rem;
  }
}
