:root {
  --paper: #f4f0e8;
  --paper-deep: #e9e2d4;
  --ink: #17140f;
  --ink-soft: #4a453c;
  --muted: #6a6357;
  --line: rgba(23, 20, 15, 0.16);
  --line-strong: rgba(23, 20, 15, 0.4);
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #dbe8ff;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", STSong, SimSun, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --latin: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --edge: clamp(20px, 4.6vw, 72px);
  --section-y: clamp(72px, 11vw, 160px);
  --max: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

html.is-dialog-open {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='.9'%20numOctaves='2'/%3E%3C/filter%3E%3Crect%20width='120'%20height='120'%20filter='url(%23n)'%20opacity='.05'/%3E%3C/svg%3E");
}

h1, h2, h3, p, ul, dl, dd, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 240, 232, 0.92);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand__avatar {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand__latin {
  font-family: var(--latin);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 4px 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-decoration: none;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.nav a:hover::after,
.nav a[aria-current="true"]::after {
  right: 0;
}

.nav a:hover,
.nav a[aria-current="true"] {
  color: var(--ink);
}

.masthead__meta {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 4.4vw, 56px) var(--edge) clamp(56px, 8vw, 110px);
}

.hero__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero__title {
  margin-top: clamp(48px, 9vw, 128px);
  font-family: var(--serif);
  font-size: clamp(3.2rem, 11vw, 10rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero__line {
  display: block;
}

.hero__line--2 {
  padding-left: clamp(0px, 6vw, 110px);
}

.hero__tagline {
  margin-top: clamp(18px, 2.6vw, 32px);
  padding-left: clamp(0px, 12vw, 220px);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2.8rem);
  line-height: 1.4;
  color: var(--ink);
}

.hero__tagline em {
  font-style: normal;
  color: var(--accent);
}

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-top: clamp(44px, 7vw, 100px);
}

.hero__intro {
  max-width: 30em;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.95;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link span {
  color: var(--accent-ink);
  transition: transform 0.2s ease;
}

.text-link:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.text-link:hover span {
  transform: translate(2px, 2px);
}

.hero__scroll {
  justify-self: end;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.2em;
  line-height: 2;
  color: var(--muted);
}

.hero__scroll-note {
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee span {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  margin-left: clamp(20px, 3vw, 40px);
  padding: 14px clamp(20px, 3vw, 40px) 14px 0;
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.marquee i {
  font-style: normal;
  font-size: 0.85em;
  color: var(--accent);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section-y) var(--edge);
  scroll-margin-top: 90px;
}

.section__head {
  display: grid;
  grid-template-columns: minmax(120px, 1.6fr) minmax(0, 7fr) minmax(100px, 1.4fr);
  gap: 24px;
  align-items: start;
  margin-bottom: clamp(40px, 6vw, 80px);
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.section__label {
  display: flex;
  gap: 10px;
  padding-top: 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}

.section__num {
  color: var(--accent-ink);
  font-feature-settings: "tnum";
}

.section__title {
  max-width: 16em;
  margin-top: -0.12em;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.section__en {
  justify-self: end;
  padding-top: 8px;
  font-family: var(--latin);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-align: right;
  color: var(--muted);
}

/* ---------- about ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.about__figure .media {
  aspect-ratio: 4 / 5;
}

.about__figure .media img {
  object-position: 28% center;
}

.about__figure figcaption {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--muted);
}

.about__text {
  grid-column: 3;
}

.about__lead {
  margin-bottom: 1.4em;
  font-family: var(--serif);
  font-size: clamp(1.32rem, 2.1vw, 1.8rem);
  line-height: 1.75;
  color: var(--ink);
}

.about__text > p:not(.about__lead) {
  max-width: 34em;
  margin-bottom: 1.2em;
  font-size: 1rem;
  line-height: 1.95;
  color: var(--ink-soft);
}

.about__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.about__facts div {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}

.about__facts dt {
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.about__facts dd {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(26px, 4vw, 42px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.about__stats strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--accent-ink);
}

.about__stats span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- media ---------- */

.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-deep);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.5s ease;
}

.media.is-error img {
  display: none;
}

.media__fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    repeating-linear-gradient(135deg, rgba(23, 20, 15, 0.045) 0 1px, transparent 1px 14px),
    var(--paper-deep);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.media.is-error .media__fallback {
  display: flex;
}

.media__num {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  color: var(--accent);
}

/* ---------- work ---------- */

.work .section__head {
  margin-bottom: clamp(20px, 3vw, 32px);
}

.work__note {
  max-width: 46em;
  margin-bottom: clamp(24px, 4vw, 40px);
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.filters__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.6vw, 36px);
}

.filter {
  position: relative;
  padding: 16px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.filter sup {
  margin-left: 3px;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--muted);
  vertical-align: super;
}

.filter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transition: right 0.28s ease;
}

.filter:hover,
.filter.is-active {
  color: var(--ink);
}

.filter.is-active::after {
  right: 0;
}

.filters__count {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

#work-count {
  color: var(--accent-ink);
  font-feature-settings: "tnum";
}

.work__noscript {
  margin-top: 20px;
  font-size: 13px;
  color: var(--accent-ink);
}

.projects {
  margin-top: clamp(8px, 1.5vw, 16px);
}

.project {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.6vw, 44px);
  row-gap: 28px;
  padding: clamp(36px, 6vw, 80px) 0;
  border-bottom: 1px solid var(--line);
}

.project[hidden] {
  display: none;
}

.project.is-entering {
  animation: project-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes project-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.project__media {
  grid-column: 1 / span 7;
  grid-row: 1;
  aspect-ratio: 4 / 3;
}

.project:nth-child(even) .project__media {
  grid-column: 6 / span 7;
  aspect-ratio: 3 / 2;
}

.project:nth-child(4) .project__media {
  margin-top: clamp(0px, 2vw, 28px);
}

.project:hover .media img {
  transform: scale(1.025);
  filter: saturate(1);
}

.project__body {
  grid-column: 9 / span 4;
  grid-row: 1;
  align-self: center;
}

.project:nth-child(even) .project__body {
  grid-column: 1 / span 4;
}

.project:nth-child(3) .project__body {
  align-self: end;
  padding-bottom: 8px;
}

.project__index {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
  text-transform: uppercase;
}

.project__title {
  margin: 10px 0 14px;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
}

.project__open {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  color: inherit;
  transition: color 0.2s ease;
}

.project__open:focus-visible {
  outline: none;
}

.project__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
}

.project__open:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project:hover .project__open {
  color: var(--accent-ink);
}

.project__sub {
  max-width: 22em;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.project__meta li + li::before {
  content: "/";
  margin: 0 9px;
  color: var(--line-strong);
}

.project__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.project__hint::after {
  content: "↗";
  color: var(--accent);
  transition: transform 0.25s ease;
}

.project:hover .project__hint::after {
  transform: translate(3px, -3px);
}

.project:nth-child(3) .project__title {
  font-size: clamp(1.7rem, 3.2vw, 3rem);
}

.project:hover .app-board img {
  transform: none;
}

/* ---------- app board covers ---------- */

.app-board {
  container-type: inline-size;
  background:
    radial-gradient(80% 90% at 82% 18%, rgba(37, 99, 235, 0.22), transparent 60%),
    linear-gradient(140deg, #e3ecfc 0%, #f2f5fb 58%, #dbe7fa 100%);
}

.app-board--pickup::before {
  content: "取件";
  position: absolute;
  left: 4%;
  bottom: 2%;
  font-family: var(--serif);
  font-size: clamp(3rem, 12cqi, 8rem);
  line-height: 1;
  color: rgba(23, 20, 15, 0.055);
  pointer-events: none;
}

.app-board__kicker {
  position: absolute;
  top: clamp(14px, 4cqi, 38px);
  left: clamp(14px, 4cqi, 38px);
  z-index: 4;
  font-family: var(--latin);
  font-size: clamp(9px, 1.4cqi, 12px);
  letter-spacing: 0.16em;
  color: var(--accent-ink);
}

.app-board__badge {
  position: absolute;
  top: clamp(38px, 9cqi, 74px);
  left: clamp(14px, 4cqi, 38px);
  z-index: 4;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(9px, 1.3cqi, 11px);
  letter-spacing: 0.08em;
  line-height: 1;
}

.app-board__caption {
  position: absolute;
  left: clamp(14px, 4cqi, 38px);
  bottom: clamp(14px, 4cqi, 36px);
  z-index: 4;
  font-family: var(--latin);
  font-size: clamp(9px, 1.3cqi, 11px);
  letter-spacing: 0.12em;
  color: var(--muted);
}

.app-board__detail-mark {
  position: absolute;
  left: clamp(18px, 4.5cqi, 44px);
  bottom: 17%;
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 10cqi, 5.6rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: rgba(29, 78, 216, 0.18);
}

.app-board__phone {
  position: absolute;
  overflow: hidden;
  height: 84%;
  width: auto;
  aspect-ratio: 630 / 1450;
  border-radius: clamp(14px, 3.2cqi, 26px);
  background: #fff;
  box-shadow: 0 26px 60px rgba(23, 20, 15, 0.24);
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.app-board__phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.app-board__phone--front {
  right: 9%;
  top: 8%;
  z-index: 3;
  transform: rotate(1.6deg);
}

.app-board__phone--back {
  right: 31%;
  top: 15%;
  z-index: 2;
  height: 72%;
  transform: rotate(-5deg);
}

.app-board__phone--single {
  right: 9%;
  top: 8%;
  z-index: 3;
  aspect-ratio: 620 / 1450;
  transform: rotate(-1.5deg);
}

.project:hover .app-board__phone--front,
.project:hover .app-board__phone--single {
  transform: translateY(-6px) rotate(0.6deg);
}

.app-board--detail .app-board__phone--front {
  height: 86%;
  right: 11%;
  top: 7%;
}

.app-board--detail .app-board__phone--back {
  height: 74%;
  right: 33%;
  top: 14%;
}

.app-board--list {
  background:
    linear-gradient(rgba(23, 20, 15, 0.055) 1px, transparent 1px) 0 0 / 100% 12.5%,
    linear-gradient(90deg, rgba(23, 20, 15, 0.055) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(160deg, #eef2f1 0%, #e2eaf8 100%);
}

.app-board__side {
  position: absolute;
  left: clamp(14px, 4cqi, 38px);
  top: 30%;
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 9cqi, 5.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.app-board__side span {
  display: block;
  margin-top: clamp(8px, 2cqi, 16px);
  font-family: var(--sans);
  font-size: clamp(9px, 1.6cqi, 12px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
}

/* ---------- typographic work covers ---------- */

.work-cover {
  container-type: inline-size;
  position: relative;
  display: block;
  overflow: hidden;
  padding: clamp(16px, 4.5cqi, 40px);
}

.work-cover__meta {
  position: absolute;
  top: clamp(16px, 4.5cqi, 40px);
  left: clamp(16px, 4.5cqi, 40px);
  z-index: 3;
  font-family: var(--latin);
  font-size: clamp(9px, 1.5cqi, 12px);
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.work-cover__big {
  position: absolute;
  left: clamp(16px, 4.5cqi, 40px);
  bottom: clamp(14px, 4cqi, 36px);
  z-index: 3;
  font-family: var(--serif);
  font-size: clamp(3rem, 16cqi, 7.2rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.work-cover__big--sm {
  font-size: clamp(1.9rem, 12cqi, 4.8rem);
  line-height: 1.02;
}

.work-cover__big--light {
  color: var(--paper);
}

.work-cover__cn {
  position: absolute;
  right: clamp(16px, 4.5cqi, 40px);
  bottom: clamp(16px, 4.5cqi, 40px);
  z-index: 3;
  font-family: var(--serif);
  font-size: clamp(11px, 2.5cqi, 16px);
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.work-cover__cn--light {
  color: rgba(244, 240, 232, 0.78);
}

.work-cover--lifelist {
  background: linear-gradient(135deg, #dbe8fd 0%, #f7f3e9 68%);
}

.work-cover--lifelist .work-cover__big {
  color: var(--accent-ink);
}

.work-cover__checks {
  position: absolute;
  right: 5cqi;
  top: 20%;
  z-index: 3;
  width: 34%;
  border-top: 1px solid var(--line);
}

.work-cover__checks li {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.4cqi, 10px);
  padding: clamp(6px, 1.4cqi, 10px) 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(9px, 1.6cqi, 12px);
  line-height: 1.5;
  color: var(--ink-soft);
}

.work-cover__checks i {
  flex: 0 0 auto;
  width: clamp(9px, 1.8cqi, 13px);
  height: clamp(9px, 1.8cqi, 13px);
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.work-cover--toolbox {
  background: #14161d;
  color: var(--paper);
}

.work-cover__terminal {
  position: absolute;
  right: 5cqi;
  top: 18%;
  z-index: 3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(9px, 1.8cqi, 13px);
  line-height: 2;
  color: rgba(244, 240, 232, 0.58);
}

.work-cover__terminal p {
  margin: 0;
}

.work-cover__terminal b {
  color: var(--accent);
}

.work-cover__terminal span {
  color: #9dc0ff;
}

.work-cover__terminal .is-cursor {
  color: var(--accent);
  animation: terminal-blink 1.2s steps(1) infinite;
}

@keyframes terminal-blink {
  50% {
    opacity: 0;
  }
}

.work-cover--ohpm {
  background: linear-gradient(160deg, #f8f4eb 0%, #dce8fd 100%);
}

.work-cover__package {
  position: absolute;
  left: 5cqi;
  top: 23%;
  z-index: 3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.05rem, 5.8cqi, 2.9rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.work-cover__tabs {
  position: absolute;
  left: 5cqi;
  right: 5cqi;
  bottom: 15%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(35, 75, 140, 0.12);
}

.work-cover__tabs span {
  flex: 1 1 0;
  padding: clamp(6px, 1.1cqi, 9px) 6px;
  border-radius: 999px;
  text-align: center;
  font-size: clamp(9px, 1.7cqi, 12px);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.work-cover__tabs .is-active {
  background: var(--accent);
  color: #fff;
}

.work-cover__code {
  position: absolute;
  left: 5cqi;
  bottom: 5.5%;
  z-index: 3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(9px, 1.5cqi, 12px);
  letter-spacing: 0.01em;
  color: var(--accent-ink);
}

.work-cover--hds {
  background:
    radial-gradient(110% 100% at 82% 12%, #2f6bd8 0%, transparent 55%),
    linear-gradient(150deg, #102b57 0%, #071528 72%);
  color: var(--paper);
}

.work-cover--hds .work-cover__meta {
  color: rgba(244, 240, 232, 0.6);
}

.work-cover--hds .work-cover__big {
  font-size: clamp(5rem, 26cqi, 12rem);
  letter-spacing: -0.06em;
}

.work-cover__glass {
  position: absolute;
  right: -6%;
  bottom: -18%;
  z-index: 1;
  width: 58%;
  aspect-ratio: 1.6;
  border: 1px solid rgba(200, 222, 255, 0.5);
  border-radius: clamp(24px, 6cqi, 48px);
  background: linear-gradient(135deg, rgba(160, 196, 255, 0.38), rgba(255, 255, 255, 0.06));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transform: rotate(-14deg);
}

.work-cover__glass::before {
  content: "";
  position: absolute;
  inset: 14% 12% auto;
  height: 26%;
  border-radius: 999px;
  background: rgba(220, 235, 255, 0.28);
  filter: blur(2px);
}

.work-cover__glass::after {
  content: "";
  position: absolute;
  left: 10%;
  bottom: 12%;
  width: 32%;
  height: 22%;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.45);
  filter: blur(18px);
}

@container (max-width: 460px) {
  .work-cover__checks,
  .work-cover__terminal {
    display: none;
  }
}

/* ---------- articles ---------- */

.articles__lead {
  max-width: 42em;
  margin-bottom: clamp(28px, 4vw, 44px);
  font-size: 0.98rem;
  line-height: 1.95;
  color: var(--ink-soft);
}

.articles__list {
  border-top: 1px solid var(--ink);
}

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

.article__link {
  display: block;
  padding: clamp(22px, 3vw, 34px) 0;
  text-decoration: none;
}

.article__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.article__meta {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.article__title {
  max-width: 30em;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.article__excerpt {
  max-width: 42em;
  margin-top: 8px;
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.article__arrow {
  color: var(--accent);
  transition: transform 0.25s ease;
}

.article__link:hover .article__title {
  color: var(--accent-ink);
}

.article__link:hover .article__arrow {
  transform: translate(3px, -3px);
}

.articles__more {
  margin-top: clamp(22px, 3vw, 30px);
}

/* ---------- activity ---------- */

.activity__lead {
  max-width: 44em;
  margin-bottom: clamp(28px, 4vw, 44px);
  font-size: 0.98rem;
  line-height: 1.95;
  color: var(--ink-soft);
}

.activity__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
}

.activity__hero .media {
  aspect-ratio: 3 / 2;
}

.activity__side {
  display: grid;
  gap: clamp(16px, 2.4vw, 26px);
}

.activity__side .media {
  aspect-ratio: 4 / 3;
}

.activity figure figcaption {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.activity__card {
  padding: clamp(20px, 3vw, 30px);
  border-top: 2px solid var(--accent);
  background: var(--paper-deep);
}

.activity__card-mark {
  font-family: var(--latin);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent-ink);
}

.activity__card p {
  margin-top: 12px;
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--ink-soft);
}

.activity__card span {
  display: block;
  margin-top: 16px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.honors {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

.honors__title {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
}

.honors__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 64px);
}

.honors__list li {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.honors__list span {
  flex: 0 0 4.5em;
  padding-top: 3px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- contact ---------- */

.contact {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 170px) var(--edge) clamp(60px, 9vw, 120px);
  border-top: 1px solid var(--ink);
  scroll-margin-top: 90px;
}

.contact__mark {
  position: absolute;
  top: clamp(48px, 8vw, 100px);
  right: var(--edge);
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: 1;
  color: var(--accent);
}

.contact .section__label {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.contact__title {
  max-width: 15em;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 6.2vw, 5.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.contact__title em {
  font-style: normal;
  color: var(--accent);
  white-space: nowrap;
}

.contact__lead {
  max-width: 34em;
  margin-top: clamp(20px, 2.6vw, 32px);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink-soft);
}

.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin-top: clamp(36px, 5vw, 64px);
}

.contact__email {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.2vw, 2.8rem);
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact__email:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.copy-btn {
  padding: 11px 18px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.copy-btn.is-copied {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin-top: 26px;
}

.contact__links a {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact__links a:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.contact__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px clamp(24px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.contact__meta p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.contact__meta span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- footer ---------- */

.footer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 7fr) minmax(0, 2fr);
  gap: 20px 40px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--edge) 44px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.footer__note {
  max-width: 60em;
}

.footer__top {
  justify-self: end;
}

.footer a {
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-soft);
  text-decoration: none;
}

.footer a:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- project dialog ---------- */

.detail-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: min(880px, 90dvh);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 90px rgba(23, 20, 15, 0.32);
}

.detail-dialog::backdrop {
  background: rgba(23, 20, 15, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.detail-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-dialog__bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.detail-dialog__brand {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.detail-dialog__close {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.14em;
  transition: background 0.2s ease, color 0.2s ease;
}

.detail-dialog__close span {
  margin-left: 6px;
  color: var(--muted);
}

.detail-dialog__close:hover {
  background: var(--ink);
  color: var(--paper);
}

.detail-dialog__close:hover span {
  color: rgba(244, 240, 232, 0.6);
}

.detail-dialog__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3.4vw, 48px) clamp(18px, 3.6vw, 56px) clamp(32px, 5vw, 64px);
}

.detail__demo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
  text-transform: uppercase;
}

.detail__demo::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.detail__title {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
}

.detail__sub {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  color: var(--ink-soft);
}

.detail__media {
  margin-top: clamp(22px, 3vw, 36px);
  aspect-ratio: 2 / 1;
}

.detail__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: clamp(24px, 3.4vw, 40px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.detail__fact {
  padding: 14px 14px 16px 0;
}

.detail__fact + .detail__fact {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.detail__fact dt {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.detail__fact dd {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.detail__sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3.4vw, 40px) clamp(28px, 4.6vw, 64px);
}

.detail__section--wide {
  grid-column: 1 / -1;
}

.detail__section h3 {
  margin-bottom: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
}

.detail__section p {
  font-size: 0.96rem;
  line-height: 1.95;
  color: var(--ink-soft);
}

.detail__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail__stats strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.detail__stats span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--muted);
}

.detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin-top: 22px;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .masthead__meta {
    display: none;
  }
}

@media (max-width: 960px) {
  .about__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 4vw, 40px);
  }

  .about__figure {
    max-width: 560px;
  }

  .about__text {
    grid-column: auto;
  }
}

@media (max-width: 880px) {
  .project {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  .project__media,
  .project:nth-child(even) .project__media {
    grid-column: 1 / -1;
    grid-row: auto;
    aspect-ratio: 3 / 2;
    margin-top: 0;
  }

  .project__body,
  .project:nth-child(even) .project__body,
  .project:nth-child(3) .project__body {
    grid-column: 1 / -1;
    grid-row: auto;
    align-self: start;
    padding: 0;
  }

  .project__title {
    margin-top: 8px;
    font-size: clamp(1.9rem, 7vw, 2.6rem);
  }

  .project__meta {
    margin-top: 18px;
  }

  .project__hint {
    margin-top: 16px;
  }

  .activity__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .hero__foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 28px;
  }

  .hero__scroll {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 820px) {
  .section__head {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 20px;
  }

  .section__title {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    font-size: clamp(1.9rem, 7.4vw, 2.8rem);
  }

  .section__en {
    grid-column: 2;
    grid-row: 1;
    padding-top: 6px;
  }
}

@media (max-width: 760px) {
  .section {
    scroll-margin-top: 116px;
  }

  .masthead__inner {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 12px;
    padding-bottom: 0;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 22px;
    margin-left: 0;
    padding: 4px 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .brand__name {
    font-size: 1.2rem;
  }

  .honors__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity__side {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact {
    scroll-margin-top: 116px;
  }

  .contact__mark {
    top: auto;
    right: 20px;
    bottom: 40px;
    font-size: 4rem;
    opacity: 0.5;
  }

  .contact__meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .contact__meta p {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .contact__meta span {
    flex: 0 0 5.5em;
    margin-bottom: 0;
  }

  .footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer__top {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .detail-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
  }

  .detail-dialog__scroll {
    padding-bottom: 48px;
  }

  .detail__media {
    aspect-ratio: 3 / 2;
  }

  .detail__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail__fact:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .detail__fact:nth-child(3),
  .detail__fact:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .detail__sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail__stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .detail__stats li {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .detail__stats strong {
    font-size: 1.5rem;
  }

  .detail__stats span {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .hero__title {
    font-size: clamp(2.8rem, 12.5vw, 4.2rem);
  }

  .hero__top {
    font-size: 10px;
  }

  .about__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters {
    gap: 4px 20px;
  }

  .filters__count {
    width: 100%;
    padding-bottom: 12px;
  }

  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 40px);
    text-align: center;
  }

  .contact__email {
    font-size: clamp(1.2rem, 5.6vw, 1.6rem);
  }

  .hero__top {
    flex-direction: column;
    gap: 4px;
    line-height: 1.7;
  }

  .contact__title {
    font-size: clamp(1.9rem, 8.6vw, 2.6rem);
  }
}

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

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

  .marquee__track {
    animation: none;
  }
}
