:root {
  --small-title-size: clamp(13px, 1.1vw, 16px);
  color-scheme: dark;
  font-family: Arial, "Noto Sans KR", sans-serif;
  background: #101010;
}

* { box-sizing: border-box; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

html, body { margin: 0; min-height: 100%; }

body { overflow: hidden; }

button, a { color: inherit; font: inherit; }

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background: #111 center / cover no-repeat;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,.05) 44%, rgba(0,0,0,.48));
  pointer-events: none;
}

#water {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .3s ease;
  touch-action: none;
}

.ready #water { opacity: 1; }

.header, .footer {
  position: absolute;
  left: clamp(20px, 3vw, 48px);
  right: clamp(20px, 3vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: .08em;
  z-index: 2;
}

.header { top: max(22px, env(safe-area-inset-top)); }
.footer { bottom: max(22px, env(safe-area-inset-bottom)); color: rgba(255,255,255,.7); }
.brand {
  display: block;
  text-decoration: none;
  font-size: 36px;
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.04em;
}
.menu-wrap { position: relative; }
.menu { display: block; border: 0; background: none; padding: 10px 0 10px 16px; cursor: pointer; list-style: none; }
.menu::-webkit-details-marker { display: none; }
.menu span { margin-left: 8px; font-size: 7px; }

.motion-toggle {
  position: absolute;
  right: clamp(20px, 3vw, 48px);
  bottom: max(62px, calc(env(safe-area-inset-bottom) + 40px));
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.8);
  font-size: 14px;
  cursor: pointer;
}
.motion-toggle:hover { background: rgba(0,0,0,.4); }
a:focus-visible, button:focus-visible { outline: 2px solid white; outline-offset: 5px; }

.menu-panel {
  position: absolute;
  top: 38px;
  right: 13px;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.menu-wrap[open] .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu-panel button {
  display: block;
  margin-left: auto;
  border: 0;
  padding: 8px 0;
  background: none;
  color: rgba(255,255,255,.8);
  font-size: calc(var(--small-title-size) * .7);
  letter-spacing: .16em;
  text-align: right;
  cursor: pointer;
}
.menu-panel button::before { content: "·"; margin-right: 6px; }

.portfolio-view {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  place-items: center;
  padding: max(86px, calc(env(safe-area-inset-top) + 68px)) clamp(20px, 4vw, 64px) max(64px, env(safe-area-inset-bottom));
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.portfolio-shell { position: relative; width: min(992px, 80vw); margin: 0 auto; }
.portfolio-close { position: absolute; right: 0; bottom: calc(100% + 14px); border: 0; padding: 8px 0 8px 14px; background: transparent; color: #fff; font-size: 8px; letter-spacing: .14em; cursor: pointer; }
.portfolio-close span { margin-left: 8px; font-size: 18px; vertical-align: -2px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); aspect-ratio: 2.5 / 1; border-top: 1px solid #555; background: transparent; }
.project-card { position: relative; display: grid; grid-template-columns: 40% 1fr; min-height: 0; aspect-ratio: 2.5 / 1; overflow: hidden; color: inherit; text-decoration: none; border-bottom: 1px solid #555; background: transparent; }
.project-card:nth-child(odd) { border-right: 1px solid #555; }
.project-visual { display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: 1; overflow: hidden; background: var(--project-ground); }
.project-visual img { display: block; width: min(68%, 136px); max-height: 74%; object-fit: contain; }
.project-card[data-theme="honey"] { --project-ground: #f6b91c; }
.project-card[data-theme="forest"] { --project-ground: #173e35; }
.project-card[data-theme="blue"] { --project-ground: #1e4eff; }
.project-card[data-theme="plum"] { --project-ground: #2b2038; }
.project-card[data-theme="planner"] { --project-ground: #f5c400; }
.project-card[data-theme="plum"] .project-visual img { clip-path: circle(39% at 50% 50%); }
.project-body { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: clamp(16px, 2vw, 24px); padding-bottom: 38px; overflow: hidden; background: rgba(0,0,0,.8); transition: background .18s ease; }
.project-card:hover .project-body, .project-card:focus-visible .project-body { background: rgba(0,0,0,.88); }
.project-meta { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 auto; color: #a3a3a3; font-size: 8px; line-height: 1.5; letter-spacing: .12em; }
.project-meta span:last-child { flex: none; white-space: nowrap; text-align: right; }
.project-body h3 { margin: 20px 0 8px; font-size: clamp(18px, 2vw, 29px); font-weight: 500; letter-spacing: -.035em; }
.project-body h3 small { display: block; margin-top: 4px; color: #8f8f8f; font-size: 8px; letter-spacing: .15em; }
.project-description { display: -webkit-box; margin: 0; padding-right: 22px; overflow: hidden; color: #d4d4d4; font-size: 9px; line-height: 1.55; word-break: keep-all; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.project-footer { position: absolute; left: clamp(16px, 2vw, 24px); right: clamp(16px, 2vw, 24px); bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 0; }
.project-tags { display: none; }
.project-link { flex: none; margin-left: auto; font-size: 14px; }
.portfolio-pages { display: flex; justify-content: flex-end; width: max-content; gap: 8px; margin: 16px 0 0 auto; padding: 7px 9px; background: rgba(0,0,0,.8); }
.portfolio-pages[hidden] { display: none; }
.portfolio-page { min-width: 24px; border: 0; padding: 5px 3px; background: transparent; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; cursor: pointer; }
.portfolio-page[aria-current="page"] { color: #fff; border-bottom: 1px solid #fff; }
.portfolio-active .copy,
.portfolio-active .greetings-view,
.portfolio-active .footer,
.portfolio-active .motion-toggle { opacity: 0; visibility: hidden; }
.portfolio-active .portfolio-view { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

.copy {
  position: absolute;
  left: clamp(20px, 8vw, 124px);
  top: 50%;
  transform: translateY(-46%);
  max-width: 880px;
  pointer-events: none;
  text-shadow: 0 2px 28px rgba(0,0,0,.62), 0 1px 2px rgba(0,0,0,.35);
  z-index: 2;
}

.eyebrow { margin: 0 0 20px .42em; font-size: var(--small-title-size); letter-spacing: .16em; opacity: .9; }
h1 { margin: 0; font-size: clamp(38px, 5.76vw, 86px); line-height: .98; letter-spacing: -.035em; font-weight: 600; opacity: .8; }
.hanja { display: inline-block; margin: 0 .04em; font-size: 1em; letter-spacing: -.035em; vertical-align: baseline; }
.hint { display: flex; align-items: center; gap: 10px; margin: 28px 0 0; font-size: 11px; letter-spacing: .05em; color: rgba(255,255,255,.75); }
.hint span { width: 28px; height: 1px; background: currentColor; }

.copy {
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}

.greetings-view {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 94px clamp(44px, 7vw, 110px) 72px 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .4s ease, visibility .4s;
}

.greetings-content {
  display: flex;
  align-items: stretch;
  gap: clamp(18px, 2.2vw, 34px);
}

.greetings-content img {
  align-self: stretch;
  width: clamp(120px, 11vw, 164px);
  height: auto;
  object-fit: cover;
  opacity: .9;
  box-shadow: 0 20px 60px rgba(0,0,0,.24);
}

.greetings-divider {
  width: 1px;
  background: rgba(255,255,255,.55);
}

.greetings-message {
  display: flex;
  flex-direction: column;
  min-width: clamp(250px, 25vw, 360px);
}

.greetings-title {
  margin: 0 0 14px;
  color: rgba(255,255,255,.85);
  font-size: var(--small-title-size);
  letter-spacing: .16em;
}

.greetings-copy {
  margin: 0;
  padding: 14px clamp(18px, 2vw, 28px);
  background: rgba(0,0,0,.4);
  color: rgba(255,255,255,.8);
  font-size: var(--small-title-size);
  line-height: 3.6;
  letter-spacing: .05em;
  text-shadow: 0 2px 20px rgba(0,0,0,.7);
}

.greetings-active .copy {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-42%);
}

.greetings-active .greetings-view {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 640px) {
  .copy { left: 20px; right: 20px; top: auto; bottom: 112px; transform: none; }
  h1 { font-size: clamp(25px, 8vw, 50px); line-height: 1.22; word-break: keep-all; }
  .eyebrow { margin-bottom: 14px; }
  .footer { align-items: flex-end; gap: 24px; font-size: 9px; }
  .footer p { margin: 0; }
  .footer p:first-child { max-width: 62%; }
  .footer p:last-child { text-align: right; }
  .hint { margin-top: 20px; }
  .greetings-view {
    justify-content: center;
    padding: 82px 18px 86px;
  }
  .greetings-content { width: 100%; gap: 14px; }
  .greetings-content img { width: 84px; }
  .greetings-message { flex: 1; min-width: 0; }
  .greetings-title { margin-bottom: 10px; font-size: 12px; }
  .greetings-copy { font-size: 13px; }
  .portfolio-view { display: block; padding: 98px 32px 28px; }
  .portfolio-shell { width: 100%; }
  .portfolio-grid { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); aspect-ratio: .625 / 1; }
  .project-card { grid-template-columns: 40% 1fr; min-height: 0; aspect-ratio: 2.5 / 1; }
  .project-card:nth-child(odd) { border-right: 0; }
  .project-visual { min-height: 0; }
  .project-body { padding: 12px 13px; }
  .project-body h3 { margin: 10px 0 6px; font-size: 17px; }
  .project-description { font-size: 8px; line-height: 1.45; }
  .project-footer { left: 13px; right: 13px; bottom: 8px; align-items: center; }
  .project-tags { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #water { display: none; }
  .hint { display: none; }
}
