@font-face {
  font-family: "Baloo 2";
  src: url("assets/fonts/Baloo2.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #F4F4F4;
  --ink: #202A2C;
  --muted: #64716E;
  --green: #174F42;
  --lime: #D7E8A1;
  --line: #D9DFDB;
  --gutter: clamp(28px, 5vw, 80px);
  --shell: 1440px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.shell { width: min(calc(100% - 2 * var(--gutter)), var(--shell)); margin-inline: auto; }
.site-header { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--green); font-weight: 750; text-decoration: none; letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: clamp(22px, 3vw, 44px); }
.main-nav a { font-size: 14px; text-decoration: none; color: var(--muted); transition: color 160ms ease; }
.main-nav a:hover { color: var(--green); }
.scene { position: relative; min-height: 100svh; }
.scene-hero { --hero-media-h: clamp(360px, calc(100svh - 330px), 700px); min-height: calc(100svh - 72px); padding-top: clamp(18px, 3vh, 34px); padding-bottom: 36px; display: flex; flex-direction: column; }
.portfolio-word { display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 0; color: var(--green); font-family: "Baloo 2", "PingFang SC", sans-serif; font-size: clamp(88px, 14.5vw, 210px); font-weight: 800; line-height: .9; letter-spacing: -.04em; white-space: nowrap; }
.letter { display: inline-block; transform: translateY(var(--rise)) rotate(var(--tilt)); transform-origin: center 65%; }
.hero-stage { position: relative; flex: 1; min-height: calc(var(--hero-media-h) + 12px); }
.hero-media { position: absolute; top: 0; left: 64%; width: min(calc(var(--hero-media-h) * .75), 38vw); transform: translateX(-50%); }
.media-frame { position: relative; width: 100%; aspect-ratio: 3 / 4; }
.hero-video, .hero-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-video { opacity: 0; }
.hero-media.has-video-frame .hero-video { opacity: 1; }
.hero-media.has-video-frame .hero-poster { opacity: 0; }
.hero-poster { opacity: 1; }
.video-controls { position: relative; display: flex; width: 100%; margin-top: 10px; align-items: center; justify-content: center; gap: 12px; }
.video-controls[hidden], .video-toggle[hidden] { display: none !important; }
.video-toggle { min-height: 44px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--green); font: inherit; font-size: 14px; cursor: pointer; }
.video-toggle:hover:not(:disabled) { border-color: var(--green); }
.video-toggle:disabled { color: var(--muted); cursor: default; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero-intro { position: absolute; z-index: 1; left: 7%; bottom: 42px; width: min(37%, 430px); }
.hero-intro h2 { margin: 0 0 10px; color: var(--green); font-size: clamp(30px, 3vw, 42px); line-height: 1.2; letter-spacing: .06em; }
.hero-intro p { margin: 0 0 6px; font-size: 17px; line-height: 1.75; }
.hero-intro .hero-detail { margin-top: 14px; color: var(--muted); font-size: 14px; }
.hero-intro .hero-direction { color: var(--green); font-size: 14px; font-weight: 650; }
.scroll-cue { align-self: center; display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; text-decoration: none; }
.cue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }

.scene-about { display: grid; grid-template-columns: 56% 38%; align-items: center; justify-content: space-between; padding-block: 64px; }
.about-art { min-width: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; }
.about-art img { display: block; width: min(100%, 720px); height: auto; max-height: 88svh; object-fit: contain; object-position: center bottom; }
.about-copy { max-width: 490px; padding: 24px 0; }
.eyebrow { margin: 0 0 18px; color: var(--green); font-size: 14px; letter-spacing: .12em; }
.about-copy h2, .experience-copy h2 { margin: 0 0 26px; color: var(--green); font-size: clamp(42px, 4.2vw, 62px); font-weight: 650; line-height: 1.22; letter-spacing: -.04em; }
.about-copy > p:not(.eyebrow), .experience-lead { margin: 0 0 18px; font-size: 17px; line-height: 1.8; }
.about-copy .about-facts { margin-top: 28px; color: var(--muted); font-size: 14px; }

.scene-experience { display: grid; grid-template-columns: 45% 51%; align-items: center; justify-content: space-between; padding-block: 64px 76px; }
.experience-copy { max-width: 560px; padding-block: 24px; }
.experience-copy { grid-column: 1; grid-row: 1; }
.experience-copy h2 { margin-bottom: 20px; }
.experience-lead { color: var(--muted); }
.experience-list { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid var(--line); }
.experience-list li { padding: 16px 0 17px; border-bottom: 1px solid var(--line); }
.experience-list h3 { margin: 0 0 6px; font-size: 18px; font-weight: 650; line-height: 1.5; }
.experience-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.contact-block { margin-top: 30px; }
.contact-block p { margin: 0 0 5px; font-size: 17px; line-height: 1.7; }
.contact-block a { color: var(--green); font-size: 15px; }
.experience-art { display: flex; justify-content: center; align-items: center; min-width: 0; align-self: stretch; }
.experience-art { grid-column: 2; grid-row: 1; }
.experience-art img { display: block; width: min(100%, 700px); height: auto; max-height: 92svh; object-fit: contain; object-position: center; }

@media (min-width: 1000px) and (min-height: 700px) {
  .scene-hero { min-height: calc(100svh - 72px); }
  .scene-about, .scene-experience { min-height: 100svh; }
}

@media (max-width: 999px), (max-height: 699px) {
  .scene { min-height: auto; }
  .scene-hero { min-height: auto; }
  .hero-stage { display: flex; flex-direction: column; min-height: auto; padding-top: 16px; }
  .hero-media { position: relative; top: auto; left: auto; width: min(54vw, 520px, 100%); height: auto; margin-inline: auto; transform: none; }
  .hero-media { order: 0; }
  .hero-intro { position: static; order: 1; width: min(100%, 430px); margin-top: 28px; }
  .scene-about, .scene-experience { min-height: auto; }
}

@media (max-width: 699px) {
  :root { --gutter: 24px; }
  .site-header { height: 64px; }
  .main-nav { gap: 18px; }
  .scene-hero { padding-top: 34px; padding-bottom: 26px; }
  .portfolio-word { font-size: clamp(32px, 14.5vw, 80px); line-height: 1.2; letter-spacing: -.055em; }
  .hero-stage { display: flex; flex-direction: column; min-height: auto; padding-top: 16px; }
  .hero-media { position: relative; top: auto; left: auto; order: 0; width: min(88vw, 360px, 100%); height: auto; min-height: 0; margin-inline: auto; transform: none; }
  .hero-video, .hero-poster { inset: 0; height: 100%; }
  .hero-intro { position: static; order: 1; width: 100%; margin-top: 32px; }
  .hero-intro h2 { font-size: 32px; }
  .hero-intro p { font-size: 16px; }
  .hero-intro .hero-detail, .hero-intro .hero-direction { font-size: 14px; }
  .video-controls { position: relative; width: 100%; margin-top: 10px; flex-wrap: wrap; }
  .scroll-cue { margin-top: 32px; }
  .scene-about { display: flex; flex-direction: column; align-items: stretch; padding-block: 42px 64px; }
  .about-art { order: 0; align-self: auto; }
  .about-art img { width: min(88%, 440px); max-height: none; }
  .about-copy { order: 1; max-width: none; padding: 6px 0 0; }
  .eyebrow { margin-bottom: 12px; }
  .about-copy h2, .experience-copy h2 { font-size: clamp(32px, 8.7vw, 38px); line-height: 1.2; margin-bottom: 20px; }
  .about-copy > p:not(.eyebrow), .experience-lead { font-size: 16px; }
  .scene-experience { display: flex; flex-direction: column; align-items: stretch; padding-block: 36px 60px; }
  .experience-art { align-self: auto; margin-bottom: 22px; }
  .about-art img, .experience-art img { height: auto; max-height: none; }
  .experience-art img { width: 82%; }
  .experience-copy { max-width: none; padding: 0; }
  .experience-list { margin-top: 24px; }
  .experience-list li { padding-block: 14px; }
  .experience-list h3 { font-size: 18px; }
  .experience-meta { font-size: 14px; }
}

@media (max-width: 360px) {
  :root { --gutter: 18px; }
  .portfolio-word { font-size: 14.1vw; }
  .main-nav { gap: 13px; }
  .video-controls { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Three-scene desktop story: natural scroll drives one sticky stage. */
.story-scroll { position: relative; }
.story-stage { position: relative; }
.projects-section { padding: 100px var(--gutter) 112px; background: #E8EBE7; color: var(--ink); }
.projects-inner { width: min(100%, 1260px); margin-inline: auto; }
.projects-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 48px; }
.projects-heading .eyebrow { margin-bottom: 10px; }
.projects-heading h2 { margin: 0; color: var(--green); font-size: clamp(46px, 6vw, 76px); line-height: 1; letter-spacing: -.05em; }
.projects-heading > p { margin: 0 0 8px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.project-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); align-items: center; gap: clamp(42px, 6vw, 84px); padding-block: 48px; border-top: 1px solid #CCD4CF; }
.project-row + .project-row { margin-top: 16px; }
.project-visual { position: relative; display: flex; min-width: 0; min-height: 350px; aspect-ratio: 1.48; align-items: center; justify-content: center; overflow: hidden; color: var(--green); text-decoration: none; background: #F6F6F2; }
.project-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-visual--designflow { background: #D8E2D9; }
.project-visual--designflow img { width: 70%; height: 88%; object-fit: contain; }
.visual-caption { position: absolute; bottom: 18px; left: 20px; padding: 7px 10px; background: rgba(244,244,240,.9); color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.project-copy { max-width: 490px; }
.project-kicker { margin: 0 0 16px; color: var(--muted); font-size: 13px; letter-spacing: .09em; }
.project-copy h3 { margin: 0; color: var(--green); font-size: clamp(34px, 4vw, 50px); line-height: 1.12; letter-spacing: -.04em; }
.project-subtitle { margin: 8px 0 20px !important; color: var(--green) !important; font-size: 19px !important; font-weight: 650; }
.project-copy > p:not(.project-kicker):not(.project-subtitle):not(.project-scope) { margin: 0; font-size: 16px; line-height: 1.85; }
.project-scope { margin: 22px 0 0; color: var(--muted); font-size: 13px; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 26px; }
.project-actions a { color: var(--green); font-size: 14px; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.project-actions .project-primary { display: inline-flex; min-height: 44px; align-items: center; padding: 0 18px; border-radius: 3px; background: var(--green); color: #fff; text-decoration: none; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 22px var(--gutter); background: #E8EBE7; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--green); }

@media (min-width: 1000px) and (min-height: 700px) and (prefers-reduced-motion: no-preference) {
  body.story-enhanced .story-scroll { height: 320svh; }
  body.story-enhanced .story-stage { position: sticky; top: 0; height: 100svh; min-height: 700px; overflow: hidden; }
  body.story-enhanced .story-stage > .scene { position: absolute; inset: 0; width: min(calc(100% - 2 * var(--gutter)), var(--shell)); height: 100svh; min-height: 0; overflow: hidden; }
  body.story-enhanced .story-stage > .scene-hero { padding-bottom: 28px; }
  body.story-enhanced .story-stage > .scene-about { padding-block: 48px; }
  body.story-enhanced .story-stage > .scene-experience { padding-block: 24px; }
  body.story-enhanced .experience-copy { padding-block: 0; }
  body.story-enhanced .hero-media { transform: translate3d(calc(-50% + var(--story-shift, 0px)), 0, 0); will-change: transform, opacity; }
  body.story-enhanced .about-art,
  body.story-enhanced .experience-art { transform: translate3d(var(--story-shift, 0px), 0, 0); will-change: transform, opacity; }
  body.story-enhanced .experience-list { margin-top: 18px; }
  body.story-enhanced .experience-list li { padding-block: 10px; }
  body.story-enhanced .contact-block { margin-top: 18px; }
  body.story-enhanced .hero-intro,
  body.story-enhanced .about-copy,
  body.story-enhanced .experience-copy { will-change: opacity, transform; }
  body.story-enhanced .hero-media .media-frame,
  body.story-enhanced .about-art img,
  body.story-enhanced .experience-art img,
  body.story-enhanced .portfolio-word { will-change: transform; }
  body.story-enhanced .story-parallax-target { transform: translate3d(calc(var(--px, 0) * 8px), calc(var(--py, 0) * 5px), 0); transition: transform 220ms ease-out; }
  body.story-enhanced .portfolio-word { transform: translate3d(calc(var(--px, 0) * 4px), calc(var(--py, 0) * 3px), 0); transition: transform 220ms ease-out; }
}

@media (max-width: 999px), (max-height: 699px) {
  .projects-section { padding: 68px var(--gutter) 76px; }
  .projects-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .project-row { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-block: 30px; }
  .project-visual { min-height: 0; aspect-ratio: 1.35; }
  .project-copy { max-width: none; }
  .site-footer { padding-block: 18px; }
}
@media (max-width: 699px) {
  .projects-section { padding: 58px 20px 64px; }
  .projects-heading h2 { font-size: 48px; }
  .projects-heading > p { font-size: 15px; }
  .project-row { gap: 22px; padding-block: 25px; }
  .project-visual { aspect-ratio: 1.12; }
  .project-visual--designflow img { width: 80%; height: 90%; }
  .visual-caption { bottom: 12px; left: 12px; font-size: 9px; }
  .project-copy h3 { font-size: 34px; }
  .project-subtitle { margin-bottom: 14px !important; font-size: 17px !important; }
  .project-copy > p:not(.project-kicker):not(.project-subtitle):not(.project-scope) { font-size: 15px; }
  .project-actions { gap: 16px; }
  .site-footer { padding: 18px 20px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-scroll, .story-stage, .story-stage > .scene { position: static !important; height: auto !important; min-height: 0 !important; overflow: visible !important; opacity: 1 !important; transform: none !important; }
}
