:root {
  --bg: #080a0f;
  --bg-soft: #0d1017;
  --panel: #11151d;
  --panel-light: #151a24;
  --text: #f4f6f8;
  --muted: #9ca4b2;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --red: #f04444;
  --blue: #397cf6;
  --max-width: 1240px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 8%, rgba(57, 124, 246, 0.08), transparent 28rem),
    radial-gradient(circle at 13% 30%, rgba(240, 68, 68, 0.055), transparent 24rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

body.modal-open {
  overflow: hidden;
}

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

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

button {
  color: inherit;
  font: inherit;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 4px solid var(--red);
  border-right-color: var(--blue);
  transform: rotate(45deg);
}

.desktop-nav {
  display: flex;
  gap: 34px;
}

.desktop-nav a {
  color: var(--muted);
  font-size: 13px;
  transition: color 180ms ease;
}

.desktop-nav a:hover {
  color: var(--text);
}

.site-header > .button {
  justify-self: end;
}

.section {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 112px 0;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-height) + 90px);
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(820px, 82%);
}

.eyebrow {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow span {
  color: var(--red);
}

.hero h1 {
  max-width: 850px;
  margin-bottom: 16px;
  font-size: clamp(48px, 7.2vw, 102px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-en {
  margin-bottom: 30px;
  color: #c7ccd5;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 1.5vw, 20px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-description {
  max-width: 760px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 16px;
}

.hero-art {
  position: absolute;
  top: 50%;
  right: -3%;
  width: min(44vw, 560px);
  aspect-ratio: 1;
  transform: translateY(-48%);
}

.hero-art::before,
.hero-art::after {
  position: absolute;
  content: "";
}

.hero-art::before {
  inset: 16%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(32deg);
}

.hero-art::after {
  top: 9%;
  right: 12%;
  width: 34%;
  height: 58%;
  background: linear-gradient(145deg, rgba(57, 124, 246, 0.32), rgba(57, 124, 246, 0));
  clip-path: polygon(0 0, 100% 18%, 62% 100%);
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
}

.hero-orbit-one {
  inset: 4%;
}

.hero-orbit-two {
  inset: 29%;
  border-color: rgba(240, 68, 68, 0.35);
}

.hero-block {
  position: absolute;
  right: 3%;
  bottom: 13%;
  width: 34%;
  height: 21%;
  background: linear-gradient(120deg, rgba(240, 68, 68, 0.2), transparent);
  transform: skew(-18deg);
}

.hero-index {
  position: absolute;
  right: 0;
  bottom: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.hero-index span:first-child {
  color: var(--text);
  font-size: 24px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c2c8d2;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  line-height: 1;
}

.hero-tags {
  margin-bottom: 34px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: white;
  background: var(--red);
}

.button-primary:hover {
  background: #ff5151;
}

.button-primary-blue {
  background: var(--blue);
}

.button-primary-blue:hover {
  background: #4d8bff;
}

.button-secondary,
.button-outline {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.button-secondary:hover,
.button-outline:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.button-text {
  padding-right: 8px;
  padding-left: 8px;
  background: transparent;
}

.button-text span,
.text-button span {
  margin-left: 8px;
  color: var(--red);
}

.button-small {
  min-height: 36px;
  padding: 0 15px;
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-note,
.section-description {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 56%) minmax(0, 44%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.project-card-primary {
  border-top: 2px solid var(--red);
}

.project-card-secondary {
  border-top: 2px solid var(--blue);
}

.project-media {
  position: relative;
  width: 100%;
  align-self: center;
  overflow: hidden;
  background: #11151d;
}

.media-trigger {
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.media-trigger img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.media-trigger::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 2px solid transparent;
  pointer-events: none;
  content: "";
  transition: border-color 180ms ease, background 180ms ease;
}

.media-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  background: rgba(4, 6, 10, 0.46);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.media-play-overlay .play-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(8, 10, 15, 0.58);
  font-size: 16px;
  line-height: 1;
  text-indent: 2px;
  backdrop-filter: blur(8px);
}

.media-play-overlay strong {
  font-size: 12px;
  letter-spacing: 0.12em;
}

.media-trigger:hover .media-play-overlay,
.media-trigger:focus-visible .media-play-overlay {
  opacity: 1;
}

.media-trigger:hover::after,
.media-trigger:focus-visible::after {
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.035);
}

.project-card-secondary .media-trigger:hover::after,
.project-card-secondary .media-trigger:focus-visible::after {
  border-color: var(--blue);
}

.media-trigger:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
}

.media-landscape {
  aspect-ratio: 16 / 9;
}

.project-card > .media-landscape {
  aspect-ratio: 16 / 9;
}

.project-media img,
.detail-image img,
.small-media > img,
.phone-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.06) 48% 48.4%, transparent 48.4%),
    radial-gradient(circle at 28% 34%, rgba(240, 68, 68, 0.3), transparent 32%),
    linear-gradient(135deg, #17100f, #10141e 60%, #090b10);
}

.media-placeholder-blue {
  background:
    linear-gradient(38deg, transparent 0 47%, rgba(255, 255, 255, 0.06) 47% 47.4%, transparent 47.4%),
    radial-gradient(circle at 70% 28%, rgba(57, 124, 246, 0.34), transparent 34%),
    linear-gradient(135deg, #0d1422, #13131b 60%, #090b10);
}

.media-placeholder span {
  color: rgba(255, 255, 255, 0.13);
  font-size: clamp(64px, 11vw, 160px);
  font-weight: 800;
  line-height: 0.8;
}

.media-placeholder strong {
  font-size: clamp(18px, 2.5vw, 34px);
  letter-spacing: 0.05em;
}

.media-placeholder small {
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.media-shade {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.media-label,
.media-type {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 20px;
  padding: 6px 9px;
  color: white;
  background: rgba(7, 9, 13, 0.72);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
  backdrop-filter: blur(8px);
}

.project-content {
  align-self: center;
  padding: clamp(26px, 2.6vw, 40px);
}

.project-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.project-title-row h3 {
  margin-bottom: 16px;
  font-size: clamp(25px, 2.2vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.project-title-row h3 span {
  color: #b7bdc8;
  font-size: 0.58em;
  font-weight: 500;
  letter-spacing: 0;
}

.project-number {
  color: rgba(255, 255, 255, 0.14);
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.project-summary {
  max-width: 930px;
  color: #c7ccd5;
  font-size: 14px;
}

.project-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 20px 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-details h4 {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0.15em;
}

.project-card-secondary .project-details h4 {
  color: #6a9cff;
}

.project-details p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.backup-text-link {
  margin-top: 18px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  font-size: 11px;
}

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

.detail-gallery {
  margin-top: 56px;
}

.subsection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}

.subsection-heading h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.subsection-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-card {
  display: grid;
  grid-template-columns: 44% 1fr;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.detail-image {
  position: relative;
  width: 100%;
  min-height: 190px;
  overflow: hidden;
}

.detail-image .media-placeholder strong {
  padding: 0 20px;
  font-size: 16px;
  text-align: center;
}

.detail-copy {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-self: center;
  padding: 26px;
}

.detail-copy h4 {
  margin-bottom: 10px;
  font-size: 16px;
}

.detail-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.section-heading-compact {
  align-items: end;
}

.section-description {
  max-width: 510px;
}

.other-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.small-project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(17, 21, 29, 0.68);
  transition: transform 180ms ease, border-color 180ms ease;
}

.small-project-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.small-media {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  height: 190px;
  overflow: hidden;
  background: #0b0e14;
}

.image-preview-trigger {
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  cursor: zoom-in;
  text-align: inherit;
}

.image-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(4, 6, 10, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, background 180ms ease;
}

.image-preview-overlay strong {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(8, 10, 15, 0.55);
  font-size: 10px;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.image-preview-trigger:hover .image-preview-overlay,
.image-preview-trigger:focus-visible .image-preview-overlay {
  opacity: 1;
}

.image-preview-trigger:hover img {
  filter: brightness(1.1);
}

.image-preview-trigger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

.small-media .media-placeholder span {
  font-size: 58px;
}

.small-media .media-placeholder strong {
  font-size: 20px;
}

.small-media .media-type {
  top: 12px;
  left: 12px;
}

.small-media .media-play-overlay .play-icon,
.detail-image .media-play-overlay .play-icon {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.portrait-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(57, 124, 246, 0.26), transparent 45%),
    linear-gradient(120deg, #0e1420, #080b11);
}

.portrait-backdrop-red {
  background:
    radial-gradient(circle at 50% 40%, rgba(240, 68, 68, 0.2), transparent 46%),
    linear-gradient(120deg, #18100f, #080b11);
}

.phone-frame,
.vertical-video-frame {
  position: relative;
  z-index: 1;
  height: 164px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 3px solid #252b36;
  border-radius: 12px;
  background: #0b0d12;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.phone-frame::before {
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 3;
  width: 28%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
  content: "";
  transform: translateX(-50%);
}

.phone-frame img {
  object-fit: contain;
}

.vertical-video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vertical-video-frame .media-placeholder strong {
  font-size: 13px;
}

.vertical-video-frame .media-placeholder small {
  padding: 0 8px;
  font-size: 6px;
  text-align: center;
}

.small-project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 20px;
}

.small-project-content h3 {
  margin-bottom: 9px;
  font-size: 17px;
  line-height: 1.4;
}

.compact-tags {
  margin-bottom: 14px;
  color: #7ea5ed !important;
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.small-project-content > p,
.small-project-content details p {
  color: var(--muted);
  font-size: 12px;
}

.small-project-content .small-responsibility {
  margin: 5px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.65;
}

.small-responsibility strong {
  display: block;
  margin-bottom: 5px;
  color: #cfd4dc;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.small-project-content details {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.small-project-content summary {
  width: max-content;
  cursor: pointer;
  color: #c9ced6;
}

.small-project-content details p {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.text-button {
  width: max-content;
  margin-top: auto;
  padding: 20px 0 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  border-color: var(--text);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.skill-group {
  grid-column: span 2;
  min-height: 210px;
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.skill-index {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.skill-group h3 {
  margin: 14px 0 24px;
  font-size: 21px;
}

.skill-group .tag-list li {
  background: var(--panel);
}

.about {
  border-top: 1px solid var(--line);
}

.about-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(50px, 9vw, 130px);
  align-items: end;
}

.about-layout h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.about-layout > div > p:first-child {
  color: #b7bec9;
  font-size: 15px;
}

.about-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.about-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ed58a;
  box-shadow: 0 0 14px rgba(94, 213, 138, 0.75);
}

.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(50px, 9vw, 130px);
  border-top: 1px solid var(--line);
}

.contact-copy h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 4.5vw, 62px);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.contact-panel dl {
  margin: 0;
}

.contact-panel dl > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.contact-panel dt {
  color: var(--muted);
  font-size: 12px;
}

.contact-panel dd {
  margin: 0;
  font-size: 14px;
}

.contact-panel dd a:hover {
  color: #7ea5ed;
}

.contact-actions {
  display: flex;
  margin-top: 28px;
}

.contact-actions .button {
  min-width: 128px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100svh - 48px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #0d1016;
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 15px;
}

.modal-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  min-height: 240px;
}

.modal-media {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  background: #05070a;
}

.modal-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.modal-media video {
  display: block;
  width: 100%;
  max-height: calc(100svh - 150px);
  background: #05070a;
  object-fit: contain;
}

.modal-image-preview {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #05070a;
}

.modal-image-preview > img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100svh - 150px);
  object-fit: contain;
}

.modal-message {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.modal-message-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--red);
  font-size: 20px;
}

.modal-message h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.modal-message p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.qr-preview {
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 40px;
  align-items: center;
  padding: 46px;
}

.qr-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #11151d;
}

.qr-image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: white;
  object-fit: contain;
}

.qr-image-wrap .media-placeholder strong {
  font-size: 18px;
}

.qr-copy h3 {
  margin-bottom: 12px;
  font-size: 27px;
}

.qr-copy p {
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  padding: 12px 17px;
  border: 1px solid var(--line-strong);
  color: white;
  background: rgba(17, 21, 29, 0.96);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1050px) {
  .project-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .project-card > .project-media.media-landscape {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .project-content {
    padding: clamp(26px, 4vw, 42px);
  }
}

@media (max-width: 1000px) {
  .other-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .small-media {
    height: 240px;
  }

  .phone-frame,
  .vertical-video-frame {
    height: 210px;
  }

  .detail-card {
    grid-template-columns: 40% 1fr;
  }

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

  .skill-group,
  .skill-group:nth-child(4),
  .skill-group:nth-child(5),
  .skill-group:nth-child(6) {
    grid-column: auto;
  }

  .about-layout,
  .contact {
    grid-template-columns: 1fr 1fr;
    gap: 50px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 62px;
  }

  body {
    line-height: 1.65;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
  }

  .desktop-nav {
    display: none;
  }

  .brand {
    font-size: 9px;
  }

  .brand-mark {
    width: 14px;
    height: 14px;
    border-width: 3px;
  }

  .section {
    width: min(calc(100% - 32px), var(--max-width));
    padding: 56px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 122px;
    padding-bottom: 36px;
  }

  .featured-work {
    padding-top: 48px;
  }

  .hero-content {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(42px, 11vw, 48px);
    line-height: 1.06;
  }

  .hero-en {
    max-width: 320px;
    margin-bottom: 22px;
    font-size: 12px;
  }

  .hero-description {
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.65;
  }

  .hero-art {
    top: 45%;
    right: -48%;
    width: 110vw;
    opacity: 0.58;
  }

  .hero-index {
    display: none;
  }

  .button-row {
    gap: 9px;
    margin-top: 24px;
  }

  .hero .button-row .button {
    flex: 1 1 auto;
  }

  .section-heading,
  .section-heading-compact {
    display: block;
    margin-bottom: 24px;
    padding-bottom: 13px;
  }

  .section-heading h2 {
    font-size: clamp(30px, 8vw, 34px);
  }

  .section-note,
  .section-description {
    margin-top: 16px;
  }

  .project-content {
    padding: 15px;
  }

  .project-title-row h3 {
    margin-bottom: 10px;
    font-size: clamp(23px, 6.3vw, 26px);
    line-height: 1.25;
  }

  .project-title-row h3 span {
    display: block;
    margin-top: 3px;
    font-size: clamp(15px, 4vw, 16px);
    line-height: 1.4;
  }

  .project-number {
    display: none;
  }

  .project-summary {
    margin-bottom: 9px;
    font-size: 14px;
    line-height: 1.6;
  }

  .project-details {
    grid-template-columns: 1fr;
    gap: 7px;
    margin: 9px 0;
    padding: 9px 0;
  }

  .project-details h4 {
    margin-bottom: 3px;
    font-size: 13px;
  }

  .project-details p {
    font-size: 14px;
    line-height: 1.6;
  }

  .project-media.media-landscape {
    height: auto;
    min-height: 0;
    max-height: 190px;
  }

  .project-content .button {
    flex: 1;
    min-height: 44px;
    padding: 0 15px;
    font-size: 14px;
  }

  .tag-list {
    gap: 6px;
  }

  .tag-list li {
    padding: 5px 9px;
    font-size: 12px;
  }

  .detail-grid,
  .other-grid,
  .skills-grid,
  .about-layout,
  .contact {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .other-grid {
    gap: 14px;
  }

  .detail-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-image {
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 190px;
  }

  .detail-copy {
    padding: 15px;
  }

  .detail-copy h4 {
    margin-bottom: 6px;
    font-size: 20px;
  }

  .detail-copy p {
    font-size: 14px;
    line-height: 1.6;
  }

  .subsection-heading {
    display: block;
  }

  .subsection-heading p {
    margin-top: 5px;
  }

  .small-media {
    height: 180px;
  }

  .phone-frame,
  .vertical-video-frame {
    height: 160px;
  }

  .small-project-content {
    padding: 15px;
  }

  .small-project-content h3 {
    margin-bottom: 7px;
    font-size: 20px;
  }

  .small-project-content > p {
    font-size: 14px;
    line-height: 1.6;
  }

  .small-project-content .small-responsibility {
    margin-top: 3px;
    padding-top: 9px;
    font-size: 14px;
    line-height: 1.6;
  }

  .compact-tags {
    margin-bottom: 10px;
  }

  .skills-grid {
    gap: 12px;
  }

  .skill-group,
  .skill-group:last-child {
    grid-column: auto;
    min-height: auto;
    padding: 15px;
  }

  .skill-index {
    display: block;
    height: 0;
    overflow: hidden;
    opacity: 0;
  }

  .skill-group h3 {
    margin: 0 0 11px;
    font-size: 20px;
    line-height: 1.25;
  }

  .skill-group .tag-list {
    gap: 6px;
  }

  .skill-group .tag-list li {
    padding: 5px 9px;
  }

  .about-layout,
  .contact {
    gap: 30px;
  }

  .about-layout h2,
  .contact-copy h2 {
    font-size: 34px;
  }

  .about-layout > div > p:first-child {
    font-size: 15px;
    line-height: 1.7;
  }

  .contact-panel dl > div {
    grid-template-columns: 76px 1fr;
  }

  .contact-actions {
    margin-top: 22px;
  }

  .contact-actions .button {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }

  .site-footer {
    width: calc(100% - 32px);
  }

  .modal {
    padding: 12px;
  }

  .modal-dialog {
    max-height: calc(100svh - 24px);
  }

  .modal-header {
    height: 56px;
  }

  .qr-preview {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }

  .qr-image-wrap {
    width: min(70vw, 280px);
    margin: 0 auto;
  }

  .qr-copy {
    text-align: center;
  }

  .qr-copy .button {
    width: 100%;
    min-height: 48px;
    font-size: 14px;
  }

  .qr-copy h3 {
    margin-bottom: 8px;
    font-size: 22px;
  }

  .qr-copy p {
    margin-bottom: 18px;
  }

  .modal-image-preview {
    padding: 12px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    text-align: center;
  }
}

@media (hover: none) {
  .media-play-overlay {
    justify-content: center;
    padding: 0;
    background: rgba(4, 6, 10, 0.34);
    opacity: 1;
  }

  .media-play-overlay .play-icon {
    width: 40px;
    height: 40px;
    font-size: 12px;
  }

  .media-play-overlay strong {
    font-size: 10px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  /* Mobile compact overrides */
  body {
    line-height: 1.6;
  }

  .section {
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .hero.section {
    min-height: 0;
    padding-top: 70px;
    padding-bottom: 36px;
  }

  .featured-work.section {
    padding-top: 12px;
  }

  .hero h1 {
    margin-bottom: 12px;
    font-size: clamp(34px, 9.5vw, 40px);
    line-height: 0.98;
  }

  .hero-en {
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
  }

  .hero-description {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.65;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .hero-tags {
    margin-bottom: 14px;
  }

  .hero .button-row {
    gap: 7px;
    margin-top: 12px;
  }

  .hero .button-row .button {
    min-height: 43px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 13px;
  }

  .section-heading,
  .section-heading-compact {
    margin-bottom: 21px;
    padding-bottom: 10px;
  }

  .section-heading h2 {
    font-size: clamp(24px, 7vw, 28px);
    line-height: 1.05;
  }

  .section-heading .eyebrow {
    margin-bottom: 7px;
  }

  .section-note,
  .section-description {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.55;
  }

  .project-content {
    padding: 13px;
  }

  .project-title-row h3 {
    margin-bottom: 7px;
    font-size: clamp(20px, 5.8vw, 22px);
    line-height: 1.15;
  }

  .project-title-row h3 span {
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.4;
  }

  .project-summary {
    display: -webkit-box;
    margin-bottom: 7px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .project-details {
    gap: 5px;
    margin: 7px 0;
    padding: 7px 0;
  }

  .project-details h4 {
    margin-bottom: 2px;
    font-size: 12px;
  }

  .project-details p {
    font-size: 14px;
    line-height: 1.55;
  }

  .project-media.media-landscape {
    max-height: 175px;
  }

  .project-content > .tag-list {
    gap: 5px;
  }

  .tag-list li {
    padding: 4px 8px;
    font-size: 11px;
  }

  .backup-text-link {
    margin-top: 10px;
  }

  .detail-gallery {
    margin-top: 30px;
  }

  .subsection-heading {
    margin-bottom: 14px;
  }

  .subsection-heading h3 {
    font-size: 19px;
  }

  .detail-grid,
  .other-grid {
    gap: 18px;
  }

  .detail-image {
    max-height: 165px;
  }

  .detail-copy {
    padding: 13px;
  }

  .detail-copy h4 {
    margin-bottom: 5px;
    font-size: 19px;
    line-height: 1.2;
  }

  .detail-copy p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .small-media {
    height: 155px;
  }

  .small-media.portrait-media {
    height: 180px;
  }

  .phone-frame,
  .vertical-video-frame {
    height: 164px;
  }

  .small-project-content {
    padding: 13px;
  }

  .small-project-content h3 {
    margin-bottom: 5px;
    font-size: 19px;
    line-height: 1.2;
  }

  .compact-tags {
    margin-bottom: 7px;
    font-size: 9px !important;
    line-height: 1.4;
  }

  .small-project-content > p:not(.compact-tags) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .small-project-content .small-responsibility {
    margin-top: 2px;
    padding-top: 7px;
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
  }

  .small-responsibility strong {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .skills-grid {
    display: block;
  }

  .skill-group,
  .skill-group:last-child {
    min-height: 0;
    margin-bottom: 9px;
    padding: 11px;
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.012);
  }

  .skill-group:last-child {
    margin-bottom: 0;
  }

  .skill-index {
    display: none;
  }

  .skill-group h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.2;
  }

  .skill-group .tag-list {
    gap: 5px;
  }

  .skill-group .tag-list li {
    padding: 4px 8px;
    font-size: 11px;
  }

  .about-layout,
  .contact {
    gap: 22px;
  }

  .about-layout h2,
  .contact-copy h2 {
    font-size: 28px;
    line-height: 1.12;
  }

  .about-layout > div > p:first-child {
    font-size: 14px;
    line-height: 1.6;
  }

  .about-status {
    margin-top: 18px;
  }

  .contact-panel dl > div {
    grid-template-columns: 66px 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .contact-panel dt,
  .contact-panel dd {
    font-size: 14px;
  }

  .contact-actions {
    margin-top: 16px;
  }

  .contact-actions .button {
    min-height: 43px;
    font-size: 13px;
  }

  .site-footer {
    padding-top: 22px;
    padding-bottom: 28px;
  }
}
