:root {
  color-scheme: dark;
  --ref-w: 599;
  --ref-h: 837;
  --x: calc(100vw / var(--ref-w));
  --y: calc(100svh / var(--ref-h));
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.liquid-glass-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

html {
  background: #5698fc;
}

body {
  background: transparent;
  color: #fff;
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  font: inherit;
}

[data-draggable] {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.desktop {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: url("./assets/wallpaper.jpg") center center / 100% 100% no-repeat;
}

.desktop::before {
  display: none;
}

.desktop::after {
  display: none;
}

.menu-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  height: 27px;
  background: linear-gradient(rgba(84, 84, 84, 0.1), transparent);
  font-size: 12px;
  font-weight: 500;
  line-height: 15px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.menu-bar a {
  position: absolute;
  top: 6px;
  white-space: nowrap;
}

.menu-name {
  left: 16px;
}

.menu-links a:nth-child(1) {
  left: calc(363 * var(--x));
}

.menu-links a:nth-child(2) {
  left: calc(427 * var(--x));
}

.menu-links a:nth-child(3) {
  left: calc(485 * var(--x));
}

.menu-links a:nth-child(4) {
  left: calc(536 * var(--x));
}

@media (hover: hover) and (pointer: fine) {
  .dock a:hover img {
    transform: translateY(-4px) scale(1.04);
  }
}

/* 창이 열려 있는 동안에는 그 아이콘이 솟은 채로 유지된다.
   기기와 무관하게 상태로 결정되므로 터치에서도 창을 닫으면 제자리로 돌아온다. */
.dock a.is-open img {
  transform: translateY(-4px) scale(1.04);
}

/* 누르는 동안만 살짝 눌리는 반응 */
.dock a:active img {
  transform: scale(0.94);
}

[data-dragging] {
  cursor: grabbing !important;
  transition: none !important;
  user-select: none;
}

.dock img {
  transition: transform 180ms ease;
}

.app-window {
  position: absolute;
  z-index: 30;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(241, 244, 246, 0.78);
  box-shadow: 0 28px 90px rgba(0, 28, 94, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  color: #111;
  backdrop-filter: blur(28px) saturate(1.45);
}

.app-window[hidden],
.video-overlay[hidden] {
  display: none;
}

.app-window.active {
  animation: windowIn 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes windowIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.finder-window {
  left: calc(50% - 340px);
  top: 72px;
  width: 680px;
  max-width: calc(100vw - 34px);
  height: min(590px, calc(100svh - 142px));
}

.gallery-window {
  left: calc(50% - 280px);
  top: 92px;
  width: 560px;
  max-width: calc(100vw - 34px);
  height: min(604px, calc(100svh - 150px));
}

.about-window {
  left: calc(50% - 365px);
  top: 54px;
  width: 730px;
  max-width: calc(100vw - 34px);
  height: min(665px, calc(100svh - 120px));
}

.detail-window {
  left: calc(50% - 280px);
  top: 86px;
  width: 560px;
  max-width: calc(100vw - 34px);
}

.contact-window {
  left: calc(50% - 215px);
  top: 112px;
  width: 430px;
  max-width: calc(100vw - 34px);
}

.window-titlebar {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(247, 248, 248, 0.64);
  cursor: grab;
}

.window-titlebar strong {
  color: rgba(0, 0, 0, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.traffic-lights {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 0;
}

.traffic-lights button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.traffic-lights button:nth-child(n + 2) {
  display: none;
}

.traffic-lights button:first-child {
  position: relative;
  display: grid;
  place-items: center;
  background: #ff3b30;
  overflow: visible;
}

.traffic-lights button:first-child::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: url("./assets/window-close-x.svg") center / contain no-repeat;
  content: "";
  transform: translate(-50%, -50%);
}

.window-content {
  height: calc(100% - 38px);
  overflow: auto;
  padding: 16px;
}

.eyebrow {
  color: rgba(0, 0, 0, 0.48);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.projects-content {
  padding: 0;
}

.projects-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 18px 18px;
  background: rgba(255, 255, 255, 0.26);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.projects-hero h2 {
  max-width: 420px;
  margin: 5px 0 0;
  font-size: 28px;
  line-height: 1.02;
  letter-spacing: 0;
}

.projects-hero > strong {
  color: rgba(0, 0, 0, 0.2);
  font-size: 54px;
  line-height: 0.85;
}

.project-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.project-filters span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.table-header,
.project-row {
  display: grid;
  grid-template-columns: 1.45fr 0.78fr 0.88fr 48px;
  gap: 14px;
  align-items: center;
}

.table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(245, 247, 248, 0.88);
  color: rgba(0, 0, 0, 0.52);
  font-size: 12px;
  font-weight: 700;
}

.project-row {
  min-height: 64px;
  margin: 0 8px;
  padding: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  color: rgba(0, 0, 0, 0.76);
  font-size: 13px;
}

.project-row:hover,
.project-row:focus-visible {
  background: rgba(10, 132, 255, 0.15);
  outline: none;
}

.project-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.project-name img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}

.project-name > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.project-name strong {
  overflow: hidden;
  color: rgba(0, 0, 0, 0.82);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name small {
  overflow: hidden;
  color: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-content {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-x: hidden;
}

.showreel-tile {
  position: relative;
  display: grid;
  min-height: clamp(180px, 34svh, 250px);
  overflow: hidden;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.showreel-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showreel-tile::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
  content: "";
}

.showreel-tile > span {
  position: relative;
  z-index: 1;
}

.showreel-tile > span:last-child {
  align-self: end;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 800;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.gallery-grid figure {
  position: relative;
  min-height: clamp(104px, 17svh, 132px);
  overflow: hidden;
  margin: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.08);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  min-height: clamp(104px, 17svh, 132px);
  object-fit: cover;
}

.gallery-grid figcaption {
  position: absolute;
  left: 10px;
  bottom: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.play-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(12px);
}

.play-icon::before {
  display: block;
  width: 0;
  height: 0;
  margin: 18px 0 0 23px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid #fff;
  content: "";
}

.gallery-content p {
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
}

.about-content {
  display: grid;
  grid-template-columns: 164px 1fr;
  gap: 18px;
  padding: 0;
}

.about-content aside {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 3px;
  padding: 14px 10px;
  border-right: 1px solid rgba(0, 0, 0, 0.09);
  background: rgba(255, 255, 255, 0.22);
}

.about-content aside a {
  border-radius: 7px;
  padding: 7px 9px;
  color: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  font-weight: 650;
}

.about-content aside a:hover {
  background: rgba(10, 132, 255, 0.16);
}

.about-content article {
  overflow: auto;
  padding: 20px 22px 32px 0;
}

.about-content h2 {
  margin: 0 0 28px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

.about-content h2 span {
  color: #0a82ff;
}

.about-content section {
  margin-top: 22px;
}

.about-content h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.about-content p {
  margin: 0 0 8px;
  color: rgba(0, 0, 0, 0.66);
  font-size: 13px;
  line-height: 1.45;
}

.about-content p a {
  color: #0a66d8;
  font-weight: 700;
}

.service-grid,
.about-stats,
.client-list {
  display: grid;
  gap: 8px;
}

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

.service-grid p,
.about-stats div,
.client-list span {
  margin: 0;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.055);
  padding: 11px;
}

.service-grid strong,
.service-grid span {
  display: block;
}

.service-grid strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.service-grid span {
  color: rgba(0, 0, 0, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.about-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}

.about-stats strong,
.about-stats span {
  display: block;
}

.about-stats strong {
  font-size: 24px;
  line-height: 1;
}

.about-stats span,
.client-list span {
  color: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  font-weight: 750;
}

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

.detail-content {
  display: grid;
  gap: 14px;
}

.detail-hero-wrap {
  display: grid;
  gap: 14px;
}

.detail-hero {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.detail-content h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-meta div {
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
}

.detail-meta dt {
  margin-bottom: 4px;
  color: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.detail-content p {
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
  font-size: 14px;
  line-height: 1.45;
}

.detail-sections {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
}

.detail-sections section {
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.055);
  padding: 12px;
}

.detail-sections h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.detail-sections ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-sections li {
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.13);
  color: #0057d9;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.contact-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.contact-card {
  display: grid;
  gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  padding: 16px;
}

.contact-content h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.contact-content p {
  margin: 0;
  color: rgba(0, 0, 0, 0.62);
  font-size: 14px;
  line-height: 1.45;
}

.email-link {
  display: block;
  width: fit-content;
  border-radius: 9px;
  padding: 10px 12px;
  background: rgba(10, 132, 255, 0.14);
  color: #0057d9;
  font-size: 15px;
  font-weight: 800;
}

.email-link:hover,
.email-link:focus-visible {
  background: rgba(10, 132, 255, 0.22);
  outline: none;
}

.newsletter-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.newsletter-form h3 {
  margin: 0;
  font-size: 16px;
}

.newsletter-form label {
  display: grid;
  gap: 6px;
}

.newsletter-form label span {
  color: rgba(0, 0, 0, 0.52);
  font-size: 12px;
  font-weight: 800;
}

.newsletter-form input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 9px;
  background: #ffffff;
  color: #111;
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 0 11px;
}

.newsletter-form input:focus {
  border-color: rgba(10, 132, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.newsletter-form button {
  width: fit-content;
  min-width: 92px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: #0a84ff;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 14px;
}

.newsletter-form button:disabled {
  cursor: default;
  opacity: 0.58;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(16px);
}

.video-frame {
  position: relative;
  width: min(760px, calc(100vw - 34px));
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
}

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

.video-frame span {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%);
}

.video-frame span::before {
  display: block;
  width: 0;
  height: 0;
  margin: 23px 0 0 31px;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 21px solid #fff;
  content: "";
}

.video-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
}

.dock {
  /* 아이콘 개수(--dock-count)는 script.js가 넣어 준다.
     아이콘 크기 = min(기본 크기, 화면 폭에 맞춰 나눈 크기) 라서
     아이콘을 더 넣어도 독이 잘리지 않고 스스로 줄어든다. */
  --dock-count: 4;
  --dock-icon-max: 72px;
  --dock-gap: 1px;
  --dock-pad-x: 12px;
  --dock-side-margin: 80px;
  --dock-fit: calc(
    (100vw - var(--dock-side-margin) - var(--dock-pad-x) * 2 - (var(--dock-count) - 1) * var(--dock-gap)) /
      var(--dock-count)
  );
  --dock-icon: min(var(--dock-icon-max), var(--dock-fit));
  --dock-dot: clamp(4px, calc(var(--dock-icon) * 0.07), 5px);
  --dock-dot-gap: clamp(2px, calc(var(--dock-icon) * 0.035), 2.5px);
  --dock-radius: calc(var(--dock-icon) * 0.4167);
  --dock-tile-radius: calc(var(--dock-icon) * 0.25);
  --dock-rise-duration: 72ms;
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 16px;
  display: flex;
  width: auto;
  min-width: 0;
  max-width: calc(100vw - var(--dock-side-margin));
  height: calc(var(--dock-icon) + 15px);
  align-items: center;
  justify-content: center;
  gap: var(--dock-gap);
  padding: 6px var(--dock-pad-x) 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--dock-radius);
  background:
    linear-gradient(180deg, rgba(214, 224, 236, 0.36) 0%, rgba(168, 186, 208, 0.38) 48%, rgba(134, 156, 184, 0.42) 100%),
    linear-gradient(110deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.035) 52%, rgba(255, 255, 255, 0.12) 100%),
    rgba(150, 172, 198, 0.34);
  box-shadow:
    inset 0 -16px 28px rgba(70, 90, 120, 0.24),
    inset 16px 0 26px rgba(255, 255, 255, 0.04),
    0 15px 34px rgba(50, 68, 96, 0.3),
    0 1px 4px rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(12px) saturate(1.45) brightness(1.02) contrast(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.45) brightness(1.02) contrast(1.05);
  clip-path: inset(0 round var(--dock-radius));
  isolation: isolate;
  overflow: hidden;
  animation: dockRise var(--dock-rise-duration) cubic-bezier(0.18, 0.98, 0.32, 1) both;
}

@keyframes dockRise {
  from {
    transform: translate3d(-50%, calc(100% + 18px), 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.dock::before,
.dock::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.dock::before {
  inset: 1px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.012) 42%, rgba(255, 255, 255, 0.012) 66%, rgba(235, 255, 202, 0.1) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0.72;
}

.dock::after {
  inset: 0;
  border: 0;
  background:
    linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.08) 13%, transparent 27%, rgba(255, 255, 255, 0.09) 56%, transparent 74%, rgba(255, 255, 255, 0.07) 88%, transparent 100%),
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(25, 60, 17, 0.16) 100%);
  filter: none;
  opacity: 0.68;
  mix-blend-mode: screen;
}

.dock a {
  position: relative;
  z-index: 1;
  display: grid;
  width: var(--dock-icon);
  height: var(--dock-icon);
  flex: 0 0 var(--dock-icon);
  border-radius: calc(var(--dock-tile-radius) + 1px);
  place-items: center;
}

.dock a::before {
  position: absolute;
  inset: 4px;
  z-index: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 52%, rgba(196, 238, 142, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(48, 86, 35, 0.16),
    0 1px 8px rgba(214, 255, 173, 0.08);
  content: "";
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 180ms ease, transform 180ms ease;
  display: none;
}

.dock a.is-open::before {
  opacity: 0;
  transform: scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .dock a:hover::before {
    opacity: 0;
    transform: scale(1);
  }
}

.dock a::after {
  position: absolute;
  top: calc(100% - var(--dock-dot-gap));
  left: 50%;
  z-index: 3;
  width: var(--dock-dot);
  height: var(--dock-dot);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
}

.dock a.is-open::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.dock img {
  display: block;
  position: relative;
  z-index: 2;
  width: var(--dock-icon);
  height: var(--dock-icon);
  border-radius: var(--dock-tile-radius);
  object-fit: cover;
}

@media (min-width: 810px) {
  :root {
    --x: 1px;
    --y: 1px;
  }

  .menu-links a:nth-child(1) {
    left: auto;
    right: 196px;
  }

  .menu-links a:nth-child(2) {
    left: auto;
    right: 130px;
  }

  .menu-links a:nth-child(3) {
    left: auto;
    right: 78px;
  }

  .menu-links a:nth-child(4) {
    left: auto;
    right: 16px;
  }

}

@media (max-width: 520px) {
  :root {
    --x: calc(100vw / 599);
    --y: calc(100dvh / 837);
  }

  .desktop {
    height: 100dvh;
    min-height: 0;
    background-position: 74% center;
  }

  .mobile-safari .desktop {
    height: calc(100dvh + 52px);
  }

  .menu-links {
    position: absolute;
    top: 6px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .menu-links a,
  .menu-links a:nth-child(n) {
    position: static;
    inset: auto;
  }

  .dock {
    --dock-side-margin: 32px;
    --dock-icon: min(clamp(52px, 14.5vw, 58px), var(--dock-fit));
    --dock-radius: calc(var(--dock-icon) * 0.5);
    --dock-tile-radius: clamp(11px, calc(var(--dock-icon) * 0.26), 15px);
    bottom: max(16px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .mobile-safari .dock {
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px);
  }

  .window-titlebar {
    cursor: default;
  }

  .traffic-lights button:first-child::after {
    position: absolute;
    inset: -8px;
    border-radius: 999px;
    content: "";
  }

  .app-window {
    left: 12px;
    top: 42px;
    width: calc(100vw - 24px);
    max-width: none;
  }

  .projects-hero {
    padding: 18px 14px 14px;
  }

  .projects-hero h2 {
    font-size: 22px;
  }

  .projects-hero > strong {
    font-size: 42px;
  }

  .finder-window,
  .gallery-window,
  .about-window {
    height: calc(100svh - 150px);
  }

  .about-window {
    overscroll-behavior: contain;
  }

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

  .about-content aside {
    min-height: auto;
    flex-flow: row wrap;
    flex-shrink: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
  }

  .about-content article {
    overscroll-behavior: contain;
    padding: 18px;
  }

  .service-grid,
  .about-stats,
  .client-list,
  .detail-sections {
    grid-template-columns: 1fr;
  }

  .about-stats {
    margin-top: 10px;
  }

  .detail-hero {
    height: 220px;
  }

  .detail-content h2 {
    font-size: 26px;
  }

  .gallery-grid figure,
  .gallery-grid img {
    min-height: 116px;
  }

  .table-header,
  .project-row {
    grid-template-columns: 1.3fr 56px;
  }

  .table-header span:nth-child(2),
  .table-header span:nth-child(3),
  .project-row > span:nth-child(2),
  .project-row > span:nth-child(3) {
    display: none;
  }

}

/* ---- 내용이 비어 있을 때 쓰는 스타일 ---- */
[hidden] {
  display: none !important;
}

.empty-notice {
  margin: 0;
  padding: 28px 4px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.42);
  text-align: center;
}

.project-thumb-blank {
  display: block;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.08);
}

.about-content aside[hidden] ~ article {
  grid-column: 1 / -1;
}

.newsletter-button {
  display: inline-flex;
  width: fit-content;
  min-width: 92px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 9px;
  background: #0a84ff;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.newsletter-button:hover {
  background: #0071e3;
}

/* ---- 뉴스레터 폼 ---- */
.contact-content .newsletter-desc {
  margin: -2px 0 2px;
  color: rgba(0, 0, 0, 0.58);
  font-size: 13px;
  line-height: 1.5;
}

.newsletter-form label.consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.newsletter-form label.consent input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 0;
  background: #ffffff;
  margin: 1px 0 0;
  flex: none;
  accent-color: #0a84ff;
}

.newsletter-form label.consent span {
  color: rgba(0, 0, 0, 0.78);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}

.contact-content .consent-detail {
  margin: -5px 0 0 23px;
  color: rgba(0, 0, 0, 0.3);
  font-size: 10.5px;
  line-height: 1.5;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-message.is-error {
  color: #d70015;
}
