/* ============================================================
   Homepage art direction — one authoritative stylesheet.
   Hand-drawn paper UI + layered firework bloom.
   ============================================================ */

/* Hero */
.mascot-hero {
  position: relative;
  min-height: clamp(850px, 96vh, 980px);
  padding: 84px 0 44px;
  overflow: hidden;
  isolation: isolate;
}

.hero-paperwash {
  position: absolute;
  z-index: 0;
  inset: 72px 0 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 28% 42% at 24% 45%, rgba(200,221,191,.44), transparent 72%),
    radial-gradient(ellipse 25% 28% at 73% 22%, rgba(202,223,242,.42), transparent 76%),
    radial-gradient(ellipse 28% 30% at 78% 70%, rgba(242,205,214,.30), transparent 76%);
}

.hero-layout {
  position: relative;
  z-index: 3;
  min-height: 800px;
  display: grid;
  grid-template-columns: minmax(470px, .94fr) minmax(500px, 1.06fr);
  gap: clamp(34px, 5vw, 82px);
  align-items: center;
}

.hero-character {
  position: relative;
  min-width: 0;
  height: 790px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hero-character > img {
  width: auto;
  height: min(76vh, 750px);
  max-width: 100%;
  object-fit: contain;
  filter: saturate(1.02) drop-shadow(0 18px 22px rgba(49,92,77,.09));
  transform: translateY(8px) rotate(-1deg);
  transition: transform 700ms var(--ease);
}

.mascot-hero.is-bloomed .hero-character > img {
  transform: translateY(0) rotate(.5deg) scale(1.015);
}

.character-sticker {
  position: absolute;
  left: 8%;
  bottom: 9%;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 17px 12px 19px 11px;
  background: var(--sky);
  box-shadow: 4px 5px 0 rgba(36,53,47,.13);
  font: 700 10px/1 var(--mono);
  letter-spacing: .08em;
  transform: rotate(-5deg);
}

.hero-copy {
  position: relative;
  z-index: 5;
  max-width: 690px;
  padding: 26px 0 8px;
}

.hero-copy .micro-label {
  margin-bottom: 28px;
}

.hero-copy h1 {
  margin: 0;
  font: 500 clamp(62px, 6.1vw, 91px)/.94 var(--display);
  letter-spacing: -.025em;
}

.hero-copy h1 em {
  display: block;
  max-width: 610px;
  margin-top: 24px;
  font-size: .43em;
  line-height: 1.2;
  font-style: normal;
  letter-spacing: -.005em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 38px;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 15px 22px 14px;
  border: 2px solid var(--ink);
  border-radius: 24px 18px 26px 17px;
  background: var(--spring);
  box-shadow: 4px 5px 0 rgba(49,92,77,.13);
  font: 700 12px/1 var(--mono);
  letter-spacing: .06em;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.hero-links a + a {
  background: var(--blush);
  transform: rotate(1deg);
}

.hero-links a:hover,
.hero-links a:focus-visible {
  transform: translateY(-3px) rotate(-1.5deg);
  box-shadow: 6px 7px 0 rgba(36,53,47,.16);
}

/* Layered firework bloom */
.hero-fireworks {
  position: absolute;
  z-index: 4;
  inset: 72px 0 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-firework-canvas {
  position: absolute;
  z-index: 2;
  inset: 72px 0 0;
  width: 100%;
  height: calc(100% - 72px);
  pointer-events: none;
}

.ambient-firework-canvas {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body[data-page="home"] > main,
body[data-page="home"] > .site-footer {
  position: relative;
  z-index: 2;
}

.hero-fireworks img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: auto;
  opacity: .04;
  transform: translate(var(--from-x), var(--from-y)) scale(.18) rotate(var(--r));
  transform-origin: center;
  filter: saturate(.94);
  transition:
    transform 500ms var(--ease),
    opacity 420ms ease,
    filter 500ms ease;
  transition-delay: 0ms;
  will-change: transform, opacity;
}

.hero-fireworks img[data-layer="trail"] { opacity: .08; }
.hero-fireworks img[data-layer="burst"] { opacity: .03; }

.mascot-hero.is-ready.is-bloomed .hero-fireworks img {
  transform: translate(var(--cursor-x, 0px), var(--cursor-y, 0px)) scale(1) rotate(var(--r));
  transition-delay: var(--delay);
  filter: saturate(1.03);
}

.mascot-hero.is-bloomed .hero-fireworks img[data-layer="trail"] { opacity: .72; }
.mascot-hero.is-bloomed .hero-fireworks img[data-layer="flower"] { opacity: .88; }
.mascot-hero.is-bloomed .hero-fireworks img[data-layer="burst"] { opacity: .66; }
.mascot-hero.is-bloomed .hero-fireworks img[data-layer="spark"] { opacity: .92; }
.mascot-hero.has-pointer-motion .hero-fireworks img {
  transition-duration: 180ms, 260ms, 180ms;
  transition-delay: 0ms;
}

/* Portfolio */
.portfolio-section {
  position: relative;
  padding: 74px 0 150px;
  border-top: 0;
}

.portfolio-section .project-group:first-child { margin-top: 0; }
.project-group { margin-top: 88px; }

.group-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 4px 19px;
  border: 0;
}

.group-heading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 9px;
  opacity: .55;
  background: center / 100% 9px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 7C130 2 227 10 352 6S580 2 700 7s260 2 498-2' fill='none' stroke='%23315c4d' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.group-heading h3 {
  margin: 0;
  font: 500 clamp(56px, 6.7vw, 96px)/.92 var(--display);
  letter-spacing: -.025em;
}

.home-section-title {
  margin: 0 0 28px !important;
  color: var(--ink) !important;
  font: 500 clamp(56px, 6.7vw, 96px)/.92 var(--display) !important;
  letter-spacing: -.025em !important;
  text-transform: none !important;
}

.group-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 10px/1 var(--mono);
  letter-spacing: .1em;
}

.group-meta > span { font: inherit; }
.group-accent { width: 34px; height: 34px; object-fit: contain; transform: rotate(8deg); }

.portfolio-grid { gap: 24px; margin-top: 24px; }
.portfolio-card {
  border: 2px solid var(--ink);
  border-radius: 19px 13px 22px 14px;
  box-shadow: 6px 7px 0 rgba(49,92,77,.10);
}
.portfolio-card:nth-child(2n) { border-radius: 13px 21px 14px 20px; }
.portfolio-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 9px 10px 0 rgba(242,205,214,.82); }
.portfolio-card .card-image { border-bottom: 2px solid var(--ink); }
.portfolio-card .card-number {
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  background: var(--blush);
  box-shadow: 3px 3px 0 rgba(36,53,47,.12);
  transform: rotate(-5deg);
}
.portfolio-card:nth-child(2n) .card-number { background: var(--spring); transform: rotate(4deg); }
.tag-list span { padding: 6px 9px; border: 1.5px solid rgba(36,53,47,.48); background: rgba(202,223,242,.34); }
.tag-list span:nth-child(2n) { background: rgba(242,205,214,.38); }
.view-case {
  width: 46px;
  height: 43px;
  margin: auto 2px 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 52% 43% 55% 46%;
  background: var(--blush);
  box-shadow: 3px 4px 0 rgba(36,53,47,.14);
  transform: rotate(-4deg);
  transition: transform .25s, background .25s;
}
.portfolio-card:nth-child(2n) .view-case { background: var(--spring); transform: rotate(3deg); }
.view-case b { font: 700 22px/1 var(--display); }
.portfolio-card:hover .view-case { background: #f4c84b; transform: rotate(5deg) translate(2px,-2px); }

/* About */
body[data-lang="zh"] .main-nav a,
body[data-lang="zh"] .mobile-menu a { font-size: 12px; letter-spacing: .08em; }
body[data-lang="zh"] .micro-label,
body[data-lang="zh"] .panel-tab,
body[data-lang="zh"] .group-heading > span { font-size: 11px; }

.about-section { padding: 105px 0 112px; }
.section-header.compact { position: relative; grid-template-columns: 1fr; }
.about-section .section-header.compact h2 { max-width: 980px; }
.about-title-doodle { position: absolute; width: 92px; right: 3%; top: 2px; transform: rotate(12deg); }
.about-lead { grid-template-columns: 390px 1fr; gap: clamp(48px,8vw,110px); margin: 54px 0 80px; }
.photo-card { border: 2px solid var(--ink); border-radius: 10px 15px 8px 13px; box-shadow: 10px 12px 0 var(--spring); }
.portrait-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 63%;
  border: 1px solid var(--ink);
}
.photo-card figcaption { font-size: 21px; }
.about-intro p { margin-bottom: 22px; font-size: clamp(21px,2.15vw,30px); }
.about-intro .about-practice { max-width: 690px; color: var(--muted); font-size: clamp(17px,1.45vw,21px); }
.text-link {
  gap: 22px;
  padding: 13px 20px 12px;
  border: 2px solid var(--ink);
  border-radius: 15px 11px 16px 10px;
  background: var(--blush);
  box-shadow: 3px 4px 0 rgba(36,53,47,.12);
  font-size: 15px;
  transform: rotate(-1deg);
}

.about-board {
  position: relative;
  grid-template-columns: 1.08fr .92fr;
  gap: 36px;
  margin-top: 0;
  padding-top: 0;
  border: 0;
}
.about-panel,
.about-panel + .about-panel {
  position: relative;
  min-height: 0;
  padding: 58px 40px 42px;
  border: 2px solid var(--ink);
  border-radius: 20px 13px 18px 12px;
  box-shadow: 7px 8px 0 rgba(49,92,77,.10);
}
.journey-panel { background: var(--spring-light); }
.curiosity-panel { overflow: hidden; background: var(--sky); border-radius: 13px 21px 12px 19px !important; box-shadow: 7px 8px 0 rgba(242,205,214,.72) !important; }
.panel-tab,
.curiosity-panel .panel-tab {
  position: absolute;
  z-index: 4;
  top: -2px;
  left: 32px;
  padding: 10px 15px;
  border: 2px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 11px 8px;
  background: var(--blush);
  font: 600 10px/1 var(--mono);
  letter-spacing: .1em;
}
.curiosity-panel .panel-tab { background: var(--spring); }
.about-panel h3,
.team-title h3 { position: relative; z-index: 2; margin: 12px 0 28px; font: 500 clamp(34px,3.65vw,51px)/1.05 var(--display); }
.journey-list { position: relative; z-index: 2; }
.journey-list li { padding-block: 20px; }
.journey-list b,
body[data-lang="zh"] .journey-list b { font-size: 19px; line-height: 1.35; }
.journey-list p,
body[data-lang="zh"] .journey-list p { margin-top: 8px; font-size: 16px; line-height: 1.68; }
.thought-panel-doodle { position: absolute; z-index: 0; width: 124px; right: 6px; top: 74px; opacity: .24; transform: rotate(9deg); pointer-events: none; }
.thought-list { position: relative; z-index: 2; display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.thought-list li { padding: 19px 20px 20px; border: 2px solid var(--ink); border-radius: 12px 8px 14px 9px; background: rgba(247,244,234,.86); box-shadow: 3px 4px 0 rgba(36,53,47,.09); }
.thought-list li:nth-child(2) { background: rgba(242,205,214,.84); transform: rotate(.4deg); }
.thought-list li:nth-child(3) { background: rgba(200,221,191,.86); transform: rotate(-.4deg); }
.thought-list b { display: block; margin-bottom: 9px; color: var(--deep-green); font: 700 9px/1 var(--mono); letter-spacing: .1em; }
.thought-list p { margin: 0; font-size: 15.5px; line-height: 1.62; }

.team-section { grid-template-columns: .74fr 1.26fr; gap: 58px; margin-top: 96px; }
.team-title { position: relative; }
.team-title-doodle { position: absolute; width: 86px; left: 5px; bottom: -38px; opacity: .82; transform: rotate(-9deg); }
.trait-grid { gap: 16px; border: 0; }
.trait-grid article,
.trait-grid article:nth-child(2n) { min-height: 0; padding: 24px; border: 2px solid var(--ink); border-radius: 13px 9px 15px 10px; background: rgba(255,253,247,.72); box-shadow: 4px 5px 0 rgba(49,92,77,.08); }
.trait-grid article:nth-child(2),
.trait-grid article:nth-child(5) { background: rgba(242,205,214,.45); }
.trait-grid article:nth-child(3),
.trait-grid article:nth-child(6) { background: rgba(200,221,191,.48); }
.trait-grid article b { font-family: var(--display); font-size: 26px; font-weight: 500; }
.trait-grid p { margin-top: 14px; font-size: 14px; line-height: 1.66; }

/* Resume + contact */
.resume-callout { position: relative; overflow: visible; border: 2px solid var(--ink); border-radius: 18px 12px 20px 13px; box-shadow: 10px 11px 0 var(--ink); }
.resume-doodle { position: absolute; width: 92px; right: 178px; top: -36px; transform: rotate(18deg); }

.contact-section { position: relative; padding: 125px 0; }
.contact-top { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 56px; align-items: center; }
.contact-copy-block h2 { max-width: 900px; }
.contact-copy { max-width: 820px; }
.contact-aside { position: relative; min-height: 300px; display: grid; place-items: center; }
.contact-burst { position: absolute; width: 270px; opacity: .38; transform: rotate(7deg); }
.contact-spark { position: absolute; width: 54px; right: 18px; top: 22px; transform: rotate(14deg); }
.contact-sticker {
  position: relative;
  z-index: 2;
  width: 205px;
  min-height: 126px;
  padding: 25px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 2px solid var(--ink);
  border-radius: 19px 13px 21px 12px;
  background: var(--spring);
  box-shadow: 7px 8px 0 var(--ink);
  transform: rotate(-4deg);
  transition: transform .25s, background .25s;
}
.contact-sticker:hover,
.contact-sticker:focus-visible { background: var(--blush); transform: translateY(-4px) rotate(2deg); }
.contact-sticker small { font: 700 9px/1 var(--mono); letter-spacing: .13em; }
.contact-sticker b { align-self: flex-end; font: 500 24px/1.1 var(--display); }
.contact-list { margin-top: 48px; }

/* Responsive */
@media (max-width: 1120px) {
  .mascot-hero { min-height: 900px; }
  .hero-layout { min-height: 760px; grid-template-columns: minmax(390px,.9fr) minmax(390px,1.1fr); gap: 22px; }
  .hero-character { height: 720px; }
  .hero-character > img { height: min(70vh,670px); }
  .hero-copy h1 { font-size: clamp(58px,7vw,78px); }
  .hero-fireworks img[data-layer="burst"] { opacity: .02; }
  .team-section { grid-template-columns: 1fr; gap: 38px; }
  .team-title-doodle { left: auto; right: 4%; bottom: -20px; }
}

@media (max-width: 860px) {
  .mascot-hero { min-height: 0; padding: 92px 0 72px; overflow: hidden; }
  .hero-layout { min-height: 0; grid-template-columns: 1fr; gap: 0; }
  .hero-character { height: 640px; }
  .hero-character > img { height: 600px; max-width: 96%; }
  .hero-copy { max-width: 700px; margin-top: -8px; padding-inline: 8px; }
  .hero-copy h1 { font-size: clamp(54px,10vw,76px); }
  .hero-copy h1 em { font-size: .48em; }
  .hero-fireworks { inset: 64px 0 auto; height: 700px; }
  .hero-fireworks img { --mobile-scale: .82; }
  .hero-fireworks img[data-layer="burst"] { width: calc(var(--size) * .82); }
  .portfolio-section { padding-top: 54px; }
  .about-lead { grid-template-columns: 1fr; }
  .about-board { grid-template-columns: 1fr; gap: 18px; }
  .about-panel + .about-panel { border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); }
  .about-panel, .about-panel + .about-panel { padding: 54px 30px 34px; }
  .team-section { margin-top: 76px; }
  .resume-doodle { right: 108px; }
  .contact-top { grid-template-columns: 1fr; gap: 24px; }
  .contact-aside { min-height: 230px; }
}

@media (max-width: 560px) {
  .mascot-hero { padding-top: 78px; padding-bottom: 62px; }
  .hero-character { height: 510px; }
  .hero-character > img { height: 480px; max-width: 100%; }
  .character-sticker { left: 2%; bottom: 6%; font-size: 8px; }
  .hero-copy { margin-top: 2px; }
  .hero-copy .micro-label { margin-bottom: 21px; font-size: 9px; }
  .hero-copy h1 { font-size: 48px; }
  .hero-copy h1 em { margin-top: 18px; font-size: 25px; line-height: 1.2; }
  .hero-links { margin-top: 28px; gap: 12px; }
  .hero-links a { padding: 14px 18px 13px; font-size: 11px; }
  .hero-fireworks { height: 560px; }
  .hero-fireworks img[data-layer="burst"] { width: calc(var(--size) * .58); }
  .hero-fireworks img[data-layer="flower"] { width: calc(var(--size) * .68); }
  .hero-fireworks img[data-layer="trail"] { width: calc(var(--size) * .66); }
  .hero-fireworks img:nth-child(5),
  .hero-fireworks img:nth-child(10) { display: none; }
  .group-heading { align-items: center; flex-direction: row; gap: 10px; }
  .group-heading h3 { font-size: clamp(42px, 12vw, 56px); }
  .home-section-title { font-size: clamp(42px, 12vw, 56px) !important; }
  .group-meta { gap: 6px; font-size: 8px; }
  .group-accent { width: 28px; height: 28px; }
  .about-section { padding-top: 82px; padding-bottom: 88px; }
  .about-title-doodle { width: 68px; right: -4px; top: 6px; }
  .about-lead { margin: 44px 0 62px; }
  .about-panel, .about-panel + .about-panel { padding: 50px 22px 28px; }
  .panel-tab, .curiosity-panel .panel-tab { left: 22px; }
  .about-panel h3, .team-title h3 { font-size: 35px; }
  .journey-list b, body[data-lang="zh"] .journey-list b { font-size: 17px; }
  .journey-list p, body[data-lang="zh"] .journey-list p { font-size: 14.5px; }
  .thought-list { gap: 17px; }
  .thought-list p { font-size: 14.5px; }
  .thought-panel-doodle { width: 92px; right: 0; opacity: .18; }
  .team-title-doodle { width: 68px; right: 0; bottom: -12px; }
  .trait-grid article b { font-size: 24px; }
  .trait-grid p { font-size: 13.5px; }
  .resume-doodle { width: 68px; right: 20px; top: -28px; }
  .contact-section { padding-block: 90px; }
  .contact-aside { min-height: 205px; }
  .contact-burst { width: 210px; }
  .contact-sticker { width: 180px; min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-hero .hero-fireworks img {
    opacity: .72;
    transform: translate(0,0) scale(1) rotate(var(--r));
    transition: none;
  }
  .mascot-hero .hero-fireworks img[data-layer="spark"] { opacity: .88; }
  .mascot-hero .hero-character > img { transform: none; transition: none; }
}

/* Portfolio category names are intentionally oversized so recruiters can scan groups instantly. */
.portfolio-section .project-group > .group-heading h3 {
  font-size: clamp(24px, 2.8vw, 42px) !important;
  line-height: 1 !important;
  letter-spacing: -.02em !important;
}
.portfolio-section .project-group > .group-heading h3 > span {
  font: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

@media (max-width: 680px) {
  .portfolio-section .project-group > .group-heading h3 {
    font-size: clamp(24px, 8vw, 36px) !important;
    line-height: 1 !important;
  }
}
