/* ==========================================================
   oh.tyn — styles
   ========================================================== */
@font-face {
  font-family: 'Tetsubin Gothic';
  src: url('assets/fonts/Tetsubin Gothic.otf') format('opentype');
  font-display: swap;
}

:root {
  /* color */
  --bg: #f4f4f3;
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #3c3c3c;
  --mute: #9a9a9a;
  --line: #d6d6d6;
  --line-soft: #e3e3e3;
  --sat-stroke: #888884;

  /* type */
  --f-sans: 'Noto Sans KR', 'Noto Sans JP', system-ui, sans-serif;
  --f-jp: 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  --f-serif: 'Noto Serif JP', 'Noto Sans JP', serif;
  --f-label: 'Tetsubin Gothic', 'Noto Sans JP', sans-serif;

  /* layout — 가이드선 영역 */
  --content: 700px;
  --narrow: 560px;
  --gutter: 20px;
  --bar-h: 56px;

  --radius: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

body.is-dark {
  --bg: #111113;
  --paper: #19191c;
  --ink: #f0f0ee;
  --ink-2: #c2c2be;
  --mute: #7c7c78;
  --line: #2d2d32;
  --line-soft: #232327;
  --sat-stroke: #9e9e98;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container.narrow {
  max-width: calc(var(--narrow) + var(--gutter) * 2);
}

/* ---------- 상단 바 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--bar-h);
  background: rgba(244, 244, 243, .82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), background-color .4s var(--ease), border-color .4s var(--ease);
}

body.is-dark .topbar {
  background: rgba(17, 17, 19, .82);
}

.topbar.is-scrolled {
  box-shadow: 0 6px 24px -18px rgba(0, 0, 0, .35);
}

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__logo img {
  height: 22px;
  width: auto;
  mix-blend-mode: multiply;
  transition: opacity .2s;
}

.topbar__logo:hover img {
  opacity: .6;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 4vw, 40px);
}

.nav-link {
  position: relative;
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .01em;
  color: var(--mute);
  transition: color .2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}

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

.nav-link:hover::after,
.nav-link[aria-expanded="true"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- 필름 그레인 (sonohoka 다크모드 시 짙어짐) ---------- */
.film-grain {
  position: fixed;
  inset: -20%;
  width: 140%;
  height: 140%;
  z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: .024;
  mix-blend-mode: multiply;
  transition: opacity .5s var(--ease);
}

body.is-dark .film-grain {
  opacity: .11;
  mix-blend-mode: overlay;
  animation: grainShift .6s steps(2) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.5%); }
  50% { transform: translate(1.5%, -2%); }
  75% { transform: translate(-1%, -1.5%); }
  100% { transform: translate(0, 0); }
}

/* ---------- 상단 바 데모 오디오 루프 버튼 (sonohoka 전용 + 볼륨) ---------- */
.nav-audio-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  animation: audioPop .32s var(--ease) both;
}

.nav-audio-wrap[hidden] {
  display: none;
}

.nav-audio-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 160px;
  height: 14px;
}

@keyframes audioPop {
  from {
    opacity: 0;
    transform: scale(.78) translateY(-2px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.nav-audio {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 600 13px/1 var(--f-serif);
  transition: border-color .25s, background .25s, color .25s, transform .25s var(--ease), box-shadow .25s;
}

.nav-audio:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.nav-audio__bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.nav-audio__bars i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  animation: eqBar .75s ease-in-out infinite alternate;
}

.nav-audio__bars i:nth-child(2) {
  animation-delay: .18s;
}

.nav-audio__bars i:nth-child(3) {
  animation-delay: .34s;
}

.nav-audio.is-playing {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35);
}

.nav-audio.is-playing .nav-audio__note {
  display: none;
}

.nav-audio.is-playing .nav-audio__bars {
  display: inline-flex;
}

.nav-audio.is-scrubbing .nav-audio__bars i {
  animation-duration: .22s;
}

@keyframes eqBar {
  0% { height: 3px; }
  100% { height: 10px; }
}

.nav-audio__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 11px;
  background: rgba(25, 25, 28, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(.97);
  transform-origin: top right;
  transition: opacity .22s var(--ease), transform .25s var(--ease);
}

.nav-audio-wrap:hover .nav-audio__panel,
.nav-audio-wrap:focus-within .nav-audio__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-audio__tip {
  font: 400 10px/1.2 var(--f-label);
  letter-spacing: .04em;
  color: var(--ink);
  white-space: nowrap;
}

.nav-audio__vol-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-audio__vol-icon {
  font: 400 8.5px/1 var(--f-label);
  letter-spacing: .08em;
  color: var(--mute);
}

.nav-audio__vol {
  -webkit-appearance: none;
  appearance: none;
  width: 78px;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}

.nav-audio__vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
  transition: transform .15s var(--ease);
}

.nav-audio__vol::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.nav-audio__vol::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
}

/* ---------- Sites 팝업 ---------- */
.sites {
  position: relative;
}

.sites::after {
  /* 버튼↔팝업 사이 호버가 끊기지 않게 */
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 220px;
  height: 22px;
  transform: translateX(-50%);
  display: none;
}

.sites:has(.is-open)::after {
  display: block;
}

.sites__popup {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.96);
  transform-origin: top center;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}

body.is-dark .sites__popup {
  background: rgba(25, 25, 28, .86);
}

.sites__popup::before {
  /* 꼬리 */
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: inherit;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.sites__popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.sites__item {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  transition: background .25s, color .25s, transform .3s var(--ease);
  opacity: 0;
  transform: translateY(-4px);
}

.sites__popup.is-open .sites__item {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--d, 0) * 40ms);
}

.sites__item:nth-child(2) {
  --d: 1;
}

.sites__item:nth-child(3) {
  --d: 2;
}

.sites__item:nth-child(4) {
  --d: 3;
}

.sites__item svg {
  width: 20px;
  height: 20px;
}

.sites__item:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
}

.sites__tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  font: 500 11px/1 var(--f-label);
  white-space: nowrap;
  color: var(--ink-2);
  transform: translate(-50%, -3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.sites__item:hover .sites__tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 히어로 / 지구본 ---------- */
.hero {
  position: relative;
  margin-top: var(--bar-h);
  height: clamp(220px, 21vw, 400px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}

.hero.is-dragging {
  cursor: grabbing;
}

.globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.globe__line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  transition: stroke .4s var(--ease);
}

.globe__sat {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.hero__title {
  position: relative;
  z-index: 1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: rise 1.1s var(--ease) both .15s;
}

.hero__title:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 8px;
  border-radius: 6px;
}

.hero__title img {
  width: clamp(140px, 12.5vw, 240px);
  height: auto;
  mix-blend-mode: multiply;
  transition: transform .18s var(--ease), opacity .2s var(--ease), filter .4s var(--ease);
}

.hero__title:active img {
  transform: scale(.96);
}

.hero__title img.is-switching,
.about__name img.is-switching {
  animation: logoSwitch .32s var(--ease) both;
}

.hero__title img.is-tremor {
  animation: logoTremor .58s cubic-bezier(.36, .07, .19, .97) both;
}

body.is-dark .topbar__logo img,
body.is-dark .hero__title img,
body.is-dark .about__name img,
body.is-dark .footer img {
  filter: invert(1);
  mix-blend-mode: screen;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
}

@keyframes logoSwitch {
  0% {
    opacity: .25;
    transform: scale(.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoTremor {
  0% {
    opacity: .35;
    transform: translate(0, 0) scale(.96);
  }
  16% {
    opacity: .85;
    transform: translate(-5px, 1.5px) skewX(-4deg) scale(1.02);
  }
  32% {
    transform: translate(4.5px, -1.5px) skewX(3.5deg) scale(1.01);
  }
  48% {
    transform: translate(-3px, 1px) skewX(-2deg);
  }
  66% {
    transform: translate(2px, -.5px) skewX(1.2deg);
  }
  82% {
    transform: translate(-1px, .5px) skewX(-.5deg);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) skewX(0) scale(1);
  }
}

/* ---------- 섹션 공통 ---------- */
.section {
  padding-block: 64px;
}

.section+.section>.container {
  position: relative;
}

.section+.section>.container::before {
  /* 섹션 구분선 */
  content: '';
  position: absolute;
  top: -64px;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}

.section__label {
  font-family: var(--f-label);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--mute);
  text-align: center;
  margin-bottom: 26px;
}

.section__label--left {
  text-align: left;
  margin: 0;
  font-size: 22px;
}

/* ---------- News ---------- */
.news {
  display: grid;
  gap: 10px;
}

.news__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s, transform .35s var(--ease), box-shadow .35s var(--ease);
}

.news__item time {
  font: 700 11px/1 var(--f-sans);
  letter-spacing: .02em;
  flex: none;
}

.news__title {
  font: 600 15px/1.4 var(--f-serif);
  flex: 1;
  min-width: 0;
}

.news__arrow {
  color: var(--mute);
  opacity: 0;
  transform: translateX(-6px);
  transition: .3s var(--ease);
}

.news__item:hover {
  border-color: #bdbdbd;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .4);
}

.news__item:hover .news__arrow {
  opacity: 1;
  transform: none;
  color: var(--ink);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 20px;
  align-items: start;
}

.about__photo {
  margin-top: 44px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.about__name {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 6px 0 14px;
}

.about__name img {
  height: 44px;
  width: auto;
  mix-blend-mode: multiply;
}

.about__name span {
  font: 700 13px/1 var(--f-label);
  color: var(--mute);
  padding-bottom: 6px;
  letter-spacing: .04em;
}

.about__text {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 300;
  transition: opacity .18s, transform .18s;
}

.about__text[data-lang="jp"] {
  font-family: var(--f-jp);
}

.about__text p+p {
  margin-top: 1.1em;
}

.about__text.is-fading {
  opacity: 0;
  transform: translateY(3px);
}

.more {
  display: inline-flex;
  gap: 6px;
  float: right;
  margin-top: 20px;
  font: 700 12px/1 var(--f-label);
  letter-spacing: .04em;
}

.more span {
  transition: transform .3s var(--ease);
}

.more:hover span {
  transform: translateX(4px);
}

/* 언어 토글 */
.lang {
  --i: 0;
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 34px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.lang button {
  position: relative;
  z-index: 1;
  height: 22px;
  font: 500 10.5px/22px var(--f-label);
  letter-spacing: .06em;
  color: var(--mute);
  transition: color .25s;
}

.lang button[aria-selected="true"] {
  color: var(--paper);
}

.lang button:not([aria-selected="true"]):hover {
  color: var(--ink);
}

.lang__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(calc(var(--i) * 34px));
  transition: transform .4s var(--ease);
}

/* ---------- 플레이스홀더 (사진 들어오기 전) ---------- */
.placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(0, 0, 0, .035) 9px 10px),
    linear-gradient(160deg, #eceeed, #dfe3e1);
  display: grid;
  place-items: center;
}

body.is-dark .placeholder {
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(255, 255, 255, .03) 9px 10px),
    linear-gradient(160deg, #222326, #1a1b1e);
}

.placeholder::after {
  content: attr(data-label);
  font: 400 11px/1 var(--f-label);
  color: #a7aaa8;
  letter-spacing: .08em;
}

/* ---------- Works 그리드 (비율이 다른 카드, 메이슨리) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 12px;
  grid-auto-rows: 2px;
  /* 행 높이는 JS가 span으로 계산 */
  align-items: start;
}

.card {
  position: relative;
  z-index: 1;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1);
  transform-style: preserve-3d;
  transition: transform .22s var(--ease), z-index 0s .35s;
}

.card:hover,
.card:focus-within {
  z-index: 10;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.045);
  transition: transform .14s ease-out, z-index 0s;
}

.card__inner {
  display: block;
  position: relative;
  aspect-ratio: var(--ratio);
}

.card__face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 22px -14px rgba(0, 0, 0, .22);
  transition: box-shadow .35s var(--ease), border-color .35s var(--ease);
}

.card:hover .card__face {
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .34);
}

.card__front {
  background: var(--paper);
}

.card__front > img,
.card__front > .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s var(--ease), filter .35s var(--ease);
}

.card:hover .card__front > img {
  transform: scale(1.03);
}

.card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background: linear-gradient(180deg, rgba(10, 10, 12, .38) 0%, rgba(10, 10, 12, .22) 45%, rgba(10, 10, 12, .72) 100%);
  color: #fff;
  opacity: 0;
  transition: opacity .28s var(--ease);
  pointer-events: none;
}

.card:hover .card__overlay,
.card__inner:focus-visible .card__overlay {
  opacity: 1;
}

.card__overlay-no {
  font: 400 10.5px/1 var(--f-label);
  color: rgba(255, 255, 255, .82);
  letter-spacing: .08em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.card__open {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 7px 16px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #111;
  border: 1px solid rgba(0, 0, 0, .12);
  font: 400 11.5px/1 var(--f-label);
  letter-spacing: .14em;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45);
  transform: translate(-50%, calc(-50% + 6px)) scale(.96);
  transition: transform .32s var(--ease);
}

.card:hover .card__open,
.card__inner:focus-visible .card__open {
  transform: translate(-50%, -50%) scale(1);
}

.card__overlay-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
  transform: translateY(4px);
  transition: transform .32s var(--ease);
}

.card:hover .card__overlay-info,
.card__inner:focus-visible .card__overlay-info {
  transform: translateY(0);
}

.card__overlay-title {
  font: 600 13.5px/1.3 var(--f-serif);
  color: #fff;
}

.card__overlay-desc {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .86);
  font-weight: 300;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card[style*="3/2"] .card__overlay,
.card[style*="16/9"] .card__overlay {
  padding: 11px 12px;
}

.card[style*="3/2"] .card__overlay-title,
.card[style*="16/9"] .card__overlay-title {
  font-size: 12px;
  line-height: 1.25;
}

.card[style*="3/2"] .card__overlay-desc,
.card[style*="16/9"] .card__overlay-desc {
  font-size: 10.5px;
  -webkit-line-clamp: 1;
}

.card__back {
  display: none;
}

.card__no {
  margin-bottom: auto;
  font: 400 10px/1 var(--f-label);
  color: var(--mute);
  letter-spacing: .08em;
}

.card__title {
  font: 600 14px/1.35 var(--f-serif);
}

.card__desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
  font-weight: 300;
}

.card__tag {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  font: 400 10px/1.4 var(--f-label);
  letter-spacing: .05em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

/* 가로형 카드(16/9, 3/2)는 뒷면 여백과 글자 크기를 다듬어 넘치지 않게 */
.card[style*="3/2"] .card__back,
.card[style*="16/9"] .card__back {
  padding: 11px 12px;
  gap: 3px;
}

.card[style*="3/2"] .card__title,
.card[style*="16/9"] .card__title {
  font-size: 12.5px;
  line-height: 1.28;
}

.card[style*="3/2"] .card__desc,
.card[style*="16/9"] .card__desc {
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* waveroad 모드: 음악/릴리즈(Release) 작업이 은은하게 먼저 돋보이도록 */
body.is-waveroad .card:not([data-tag="Release"]):not(:hover) {
  opacity: .56;
  filter: saturate(.78);
  transition: opacity .4s var(--ease), filter .4s var(--ease), transform .22s var(--ease);
}

body.is-waveroad .card[data-tag="Release"] .card__face {
  border-color: var(--ink-2);
  box-shadow:
    0 0 0 1px rgba(17, 17, 17, .14),
    0 16px 34px -14px rgba(0, 0, 0, .28);
}

body.is-waveroad .card[data-tag="Release"] .card__front::after {
  content: '♪ RELEASE';
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #111;
  border: 1px solid rgba(0, 0, 0, .12);
  font: 400 9px/1 var(--f-label);
  letter-spacing: .1em;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .25);
  pointer-events: none;
  animation: audioPop .35s var(--ease) both;
}

/* ---------- 카드 클릭 → 트레이 ---------- */
.card__inner {
  cursor: pointer;
  outline: none;
}

.card.is-lifted {
  visibility: hidden;
}

/* ---------- 작품 트레이 (화이트 / 페이퍼 톤) ---------- */
.tray {
  --tray: #fafaf9;
  --tray-deep: #ecece9;
  --slip: #f0f0ee;
  --side: 54px;
  --gap: 22px;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.tray[hidden] {
  display: none;
}

.tray__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 16, .48);
  backdrop-filter: blur(12px) saturate(.9);
  -webkit-backdrop-filter: blur(12px) saturate(.9);
}

.tray__panel {
  --r: .75;
  /* 사진 높이: 화면 높이 / 가로 폭 중 더 빡빡한 쪽에 맞춤 (--r = 가로/세로, JS가 지정) */
  --h: min(60vh, calc((min(92vw, 1000px) - var(--side) * 2 - var(--gap) * 2 - 48px) / var(--r)));
  position: relative;
  transform-origin: 0 0;
  border-radius: 22px;
  background: var(--tray);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow:
    0 42px 84px -32px rgba(0, 0, 0, .38),
    0 14px 32px -18px rgba(0, 0, 0, .2);
  will-change: transform;
}

@supports (height: 1svh) {
  .tray__panel {
    --h: min(60svh, calc((min(92vw, 1000px) - var(--side) * 2 - var(--gap) * 2 - 48px) / var(--r)));
  }
}

.tray__content {
  position: relative;
  display: grid;
  grid-template-columns: var(--side) auto var(--side);
  grid-template-areas:
    'head head head'
    'prev stage next'
    'desc desc desc';
  align-items: center;
  justify-items: center;
  column-gap: var(--gap);
  row-gap: 24px;
  padding: 32px 24px 26px;
}

/* 좌상단 번호 / 태그 */
.tray__meta {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font: 400 10.5px/1 var(--f-label);
  letter-spacing: .08em;
  color: var(--mute);
}

.tray__meta b {
  font-weight: 400;
  color: var(--ink-2);
}

.tray__meta span::before {
  content: '— ';
}

.tray__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--mute);
  transition: background .2s, color .2s, transform .3s var(--ease);
}

.tray__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tray__close:hover {
  background: var(--line-soft);
  color: var(--ink);
  transform: rotate(90deg);
}

/* 제목 · 설명 (상자 없이 깔끔한 텍스트만) */
.tray__head {
  grid-area: head;
  position: relative;
  max-width: calc(var(--stage-w, 420px) + var(--side));
  margin-top: 4px;
}

.tray__title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px;
  color: var(--ink);
  font: 600 16px/1.35 var(--f-serif);
  text-align: center;
  border-bottom: 1px solid transparent;
  transition: opacity .2s, border-color .25s var(--ease);
}

.tray__title i {
  font-style: normal;
  font: 400 12px/1 var(--f-label);
  color: var(--mute);
  transition: transform .25s var(--ease), color .2s;
}

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

.tray__title:hover i {
  color: var(--ink);
  transform: translate(2px, -2px);
}

.tray__title:focus-visible,
.tray__nav:focus-visible,
.tray__close:focus-visible,
.tray__ticks button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.tray__bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 6px 11px 5px;
  font: 400 11px/1 var(--f-label);
  letter-spacing: .06em;
  white-space: nowrap;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .2s, transform .3s var(--ease);
}

.tray__bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-top-color: var(--ink);
  transform: translateX(-50%);
}

.tray__head.show-nolink .tray__bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tray__head.show-nolink .tray__title {
  animation: nudge .4s cubic-bezier(.36, .07, .19, .97);
}

@keyframes nudge {
  20% { transform: translateX(-4px); }
  45% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
  100% { transform: none; }
}

.tray__desc {
  grid-area: desc;
  max-width: calc(var(--stage-w, 420px) + var(--side));
  padding: 2px 4px;
  font: 400 12.5px/1.5 var(--f-label);
  letter-spacing: .02em;
  color: var(--ink-2);
  text-align: center;
}

/* 사진 (슬라이드 트랙 방식으로 깜빡임 제거) */
.tray__stage {
  grid-area: stage;
  position: relative;
  touch-action: pan-y;
  transition: width .42s var(--ease), height .42s var(--ease);
}

.tray__stage.is-instant {
  transition: none !important;
}

.tray__frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tray-deep);
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 36px -22px rgba(0, 0, 0, .28);
}

.tray__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .42s var(--ease);
  will-change: transform;
}

.tray__track.is-instant {
  transition: none !important;
}

.tray__track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  display: block;
}

.tray__ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: flex;
  gap: 5px;
}

.tray__ticks button {
  flex: 1;
  height: 9px;
  position: relative;
}

.tray__ticks button::before {
  content: '';
  position: absolute;
  inset: 3px 0;
  border-radius: 2px;
  background: var(--line);
  transition: background .3s;
}

.tray__ticks button:hover::before {
  background: var(--mute);
}

.tray__ticks button.is-on::before {
  background: var(--ink);
}

/* 밀착인화(Contact Sheet) 미니멀 썸네일 바 */
.tray__sheet {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 5;
  max-width: calc(100% - 20px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(16, 16, 19, .78);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .55);
  overflow-x: auto;
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(.97);
  transition: opacity .28s var(--ease), transform .32s var(--ease);
}

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

.tray__sheet[hidden] {
  display: none;
}

.tray__stage.show-sheet .tray__sheet,
.tray__stage:has(.tray__ticks:hover) .tray__sheet,
.tray__sheet:hover,
.tray__sheet:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.tray__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  opacity: .56;
  transition: opacity .22s, transform .22s var(--ease), border-color .22s, box-shadow .22s;
}

.tray__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tray__thumb span {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font: 400 7.5px/1 var(--f-label);
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}

.tray__thumb:hover {
  opacity: .92;
  transform: translateY(-1.5px);
  border-color: rgba(255, 255, 255, .55);
}

.tray__thumb.is-on {
  opacity: 1;
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .55);
}

/* 좌우 버튼 */
.tray__nav {
  width: var(--side);
  height: min(110px, calc(var(--h) * .28));
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s, opacity .25s, transform .2s var(--ease);
}

.tray__nav--prev { grid-area: prev; }
.tray__nav--next { grid-area: next; }

.tray__nav[hidden] {
  display: grid;
  visibility: hidden;
}

.tray__nav:disabled {
  opacity: .24;
  cursor: default;
  pointer-events: none;
}

.tray__nav svg {
  width: 36%;
  max-width: 20px;
  fill: currentColor;
  transition: transform .3s var(--ease);
}

.tray__nav:hover {
  background: var(--slip);
  border-color: var(--mute);
  color: var(--ink);
}

.tray__nav--prev:hover svg { transform: translateX(-2px); }
.tray__nav--next:hover svg { transform: translateX(2px); }

.tray__nav:active svg { transform: scale(.9); }

/* 다크모드(sonohoka) 대응 */
body.is-dark .tray {
  --tray: #19191c;
  --tray-deep: #111113;
  --slip: #222226;
}

body.is-dark .tray__backdrop {
  background: rgba(0, 0, 0, .65);
}

/* ---------- Contact ---------- */
.contact {
  font-style: normal;
  text-align: center;
  font: 300 13px/1.9 var(--f-label);
  color: var(--ink-2);
}

.contact a {
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}

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

/* ---------- 하단 바 (고정 X) ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 34px;
}

.footer__inner {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.footer img {
  height: 40px;
  width: auto;
  mix-blend-mode: multiply;
}

.footer small {
  font: 400 10px/1 var(--f-label);
  color: var(--mute);
  letter-spacing: .06em;
}

/* ---------- 등장 애니메이션 ---------- */
.reveal {
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(14px);
}

.card.reveal.is-in {
  transition: opacity .8s var(--ease), transform .22s var(--ease), z-index 0s .35s;
}

.card.reveal.is-in:hover,
.card.reveal.is-in:focus-within {
  transition: transform .14s ease-out, z-index 0s;
}

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  :root {
    --bar-h: 50px;
    --gutter: 18px;
  }

  .topbar__logo img {
    height: 18px;
  }

  .nav-link {
    font-size: 14px;
  }

  .sites__popup {
    left: 0;
    transform: translate(-10%, -8px) scale(.96);
  }

  .sites__popup.is-open {
    transform: translate(-10%, 0) scale(1);
  }

  .sites__popup::before {
    left: 26%;
  }

  .hero {
    height: 46vw;
    min-height: 185px;
  }

  .hero__title img {
    width: 38vw;
  }

  .section {
    padding-block: 48px;
  }

  .section+.section>.container::before {
    top: -48px;
  }

  .news__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .news__arrow {
    display: none;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about__photo {
    margin: 0 auto;
    width: 62%;
    order: 2;
  }

  .about__body {
    order: 1;
  }

  .about__name img {
    height: 38px;
  }

  /* 그리드: 한 줄에 하나, 뒤집기 대신 설명을 사진 아래에 표시 */
  .grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .card {
    grid-row: auto !important;
    perspective: none;
    transform: none !important;
  }

  .card__inner {
    aspect-ratio: auto;
    transform: none !important;
    transform-style: flat;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 8px 22px -20px rgba(0, 0, 0, .5);
  }

  .card__face {
    position: static;
    border: 0;
    box-shadow: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }

  .card__front {
    aspect-ratio: var(--ratio);
    border-radius: 13px;
  }

  .card__overlay {
    display: none;
  }

  .card__back {
    display: flex;
    flex-direction: column;
    transform: none;
    padding: 14px 12px 10px;
    gap: 6px;
  }

  .card__no {
    display: none;
  }

  .card__title {
    font-size: 17px;
  }

  .card__desc {
    font-size: 13px;
    display: block !important;
    -webkit-line-clamp: unset !important;
  }

  .card__tag {
    margin-top: 8px;
  }

  /* 트레이 */
  .tray {
    --side: 30px;
    --gap: 8px;
    padding: 10px;
  }

  .tray__content {
    padding: 44px 12px 22px;
    row-gap: 24px;
  }

  .tray__meta {
    top: 17px;
    left: 16px;
  }

  .tray__title {
    font-size: 14.5px;
    padding: 2px 4px;
  }

  .tray__nav {
    height: 76px;
    border-radius: 3px;
  }

  .tray__nav svg {
    width: 55%;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}