/* 한재윤 아카이브: 심해와 해파리.
   푸르고 투명한 촉수의 색은 기록 층, 속에서 빛나는 살구빛은 표현 층에 쓴다. */
:root {
  --abyss: #000207;
  --deep: #020a1a;
  --navy: #0a2a52;
  --ice: #e6effc;
  --mist: #a6bbd9;
  --cyan: #bfe4ff;
  --lilac: #bdb5f0;
  --peach: #ffcfb2;
  --rose: #f4afc6;
  --thread: rgba(176, 208, 246, .24);
  --display: 'Diphylleia', 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: 'IBM Plex Sans KR', 'Pretendard', 'Malgun Gothic', system-ui, sans-serif;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', 'Batang', serif;
  --gutter: clamp(20px, 5.5vw, 44px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--abyss); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  font: 400 1rem/1.78 var(--sans); color: var(--ice);
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; position: relative; overflow-x: clip; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--cyan); text-decoration-color: rgba(191, 228, 255, .4); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: .5rem .9rem; background: var(--ice); color: var(--deep); border-radius: 6px; }
.skip:focus { top: .75rem; }

/* 바다 ------------------------------------------------------------
   화면 대부분은 어둠이다. 수면의 빛은 왼쪽 위 구석에만 스며들고, 밝은 것은 해파리뿐이다. */
.sea {
  position: fixed; inset: 0; height: 100vh; height: 100lvh; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(74% 36% at 10% -8%, rgba(96, 158, 216, .34), rgba(36, 92, 160, .13) 42%, rgba(10, 40, 90, 0) 76%),
    linear-gradient(180deg, #061a38 0%, #041127 16%, #020a1a 36%, #01050e 62%, #000207 100%);
}
.sea canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 아래에서 올려다본 수면의 일렁임 */
.surface {
  position: absolute; left: -20%; right: -20%; top: -4%; height: 24%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='360'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.009 .042' numOctaves='2' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .92 0 0 0 0 1 2.6 0 0 0 -1.12'/%3E%3C/filter%3E%3Crect width='900' height='360' filter='url(%23f)'/%3E%3C/svg%3E") center top / 100% 100% no-repeat;
  -webkit-mask-image: radial-gradient(52% 100% at 26% 0, #000 6%, rgba(0, 0, 0, .3) 50%, transparent 88%);
  mask-image: radial-gradient(52% 100% at 26% 0, #000 6%, rgba(0, 0, 0, .3) 50%, transparent 88%);
  mix-blend-mode: screen; opacity: .26; transform: perspective(600px) rotateX(-38deg); transform-origin: 50% 0;
}
/* 수면에서 비스듬히 스며드는 빛줄기. 화면 위쪽에서 사라진다. */
.rays, .rays::before, .rays::after { position: absolute; inset: -12% -12% 0 -12%; }
.rays { mix-blend-mode: screen; filter: blur(9px); }
.rays::before, .rays::after {
  content: ''; inset: 0;
  -webkit-mask-image: radial-gradient(88% 52% at 16% 0, #000 0, rgba(0, 0, 0, .42) 40%, rgba(0, 0, 0, .08) 74%, transparent 100%);
  mask-image: radial-gradient(88% 52% at 16% 0, #000 0, rgba(0, 0, 0, .42) 40%, rgba(0, 0, 0, .08) 74%, transparent 100%);
}
.rays::before {
  background: conic-gradient(from 0deg at 20% -14%,
    transparent 119deg, rgba(170, 212, 250, .12) 124deg, transparent 129deg,
    rgba(170, 212, 250, .22) 136deg, transparent 142deg,
    rgba(170, 212, 250, .1) 148deg, rgba(170, 212, 250, .26) 153deg, transparent 159deg,
    rgba(170, 212, 250, .13) 166deg, transparent 171deg,
    rgba(170, 212, 250, .08) 178deg, transparent 184deg);
  animation: shimmer 13s ease-in-out infinite alternate;
}
.rays::after {
  background: conic-gradient(from 0deg at 25% -18%,
    transparent 126deg, rgba(190, 224, 255, .15) 131deg, transparent 135deg,
    rgba(190, 224, 255, .08) 145deg, transparent 150deg,
    rgba(190, 224, 255, .17) 160deg, transparent 165deg,
    rgba(190, 224, 255, .07) 173deg, transparent 177deg);
  animation: shimmer 17s ease-in-out -6s infinite alternate-reverse;
}
@keyframes shimmer { from { opacity: .4; } to { opacity: 1; } }
/* 읽는 화면에서는 빛을 더 낮춘다 */
body:not([data-layer='home']) .rays { opacity: .6; }
body:not([data-layer='home']) .surface { opacity: .18; }
body[data-layer='expression'] .sea::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(70% 46% at 82% 34%, rgba(255, 190, 160, .1), rgba(244, 160, 196, .04) 48%, transparent 76%);
}

/* 머리와 발 -------------------------------------------------------- */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: max(1.05rem, env(safe-area-inset-top)) var(--gutter) .6rem;
  position: relative; z-index: 2;
}
.brand { font: 400 1.14rem/1.2 var(--display); color: var(--ice); text-decoration: none; letter-spacing: .01em; text-shadow: 0 0 14px rgba(4, 22, 52, .7); }
.top nav { display: flex; gap: clamp(.9rem, 4vw, 1.7rem); }
.top nav a { color: var(--ice); text-decoration: none; font-size: .95rem; padding: .45rem 0; text-shadow: 0 0 12px rgba(4, 22, 52, .8); border-bottom: 1px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { border-bottom-color: var(--cyan); }
.foot { padding: 3.2rem var(--gutter) max(2.2rem, env(safe-area-inset-bottom)); color: var(--mist); font-size: .86rem; line-height: 1.7; max-width: 46rem; width: 100%; margin: 0 auto; }
.foot p + p { margin-top: .35rem; }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter); }
body:not([data-layer='home']) main { padding-top: clamp(1.6rem, 6vw, 3.4rem); }

/* 첫 화면 ---------------------------------------------------------- */
.hero {
  min-height: calc(100vh - 3.6rem); min-height: calc(100svh - 3.6rem);
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(2rem, 6vh, 4rem);
  position: relative;
}
.hero::after { content: ''; position: absolute; inset: 45% 0 0; z-index: -1; background: linear-gradient(180deg, transparent, rgba(0, 2, 7, .5) 62%, rgba(0, 2, 7, .15)); pointer-events: none; }
.hero-text { max-width: 29rem; animation: surface-in 2.6s 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 {
  font: 400 clamp(2.05rem, 8.9vw, 3.5rem)/1.34 var(--display); letter-spacing: -.012em;
  text-shadow: 0 0 26px rgba(3, 14, 36, .9), 0 0 60px rgba(255, 207, 178, .16);
}
.lede { margin-top: 1.05rem; color: #cfdcf0; font-size: .97rem; line-height: 1.82; text-shadow: 0 0 14px rgba(2, 8, 21, .95), 0 0 3px rgba(2, 8, 21, .7); }
.tally { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .95rem; font-size: .86rem; }
.tally > a { color: var(--ice); margin-right: .1rem; }
@keyframes surface-in { from { opacity: 0; transform: translateY(14px); } }

/* 증거 표시 -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .42em; font-size: .8rem; line-height: 1.5; white-space: nowrap; font-weight: 500; }
.badge i { width: .7em; height: .7em; border-radius: 50%; flex: none; }
.badge-public { color: var(--cyan); }
.badge-public i { background: var(--cyan); box-shadow: 0 0 9px 1px rgba(160, 216, 255, .85); }
.badge-private { color: var(--lilac); }
.badge-private i { border: 1.5px solid var(--lilac); background: linear-gradient(90deg, var(--lilac) 50%, transparent 50%); }
.badge-none { color: var(--mist); }
.badge-none i { border: 1.5px dashed var(--mist); }
.legend { display: grid; gap: .5rem; margin-top: 1.1rem; font-size: .88rem; color: var(--mist); }
.legend li { display: grid; grid-template-columns: 6.6em 1fr; gap: .7rem; align-items: baseline; }
.todo { display: inline; padding: .08em .5em .12em; border: 1px dashed rgba(255, 207, 178, .6); border-radius: 5px; color: var(--peach); font-size: .9em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.todo b { font-weight: 600; margin-right: .5em; }

/* 두 층 ------------------------------------------------------------ */
.layers { display: grid; gap: 2.6rem; padding-top: clamp(3rem, 9vh, 5.5rem); }
.layer h3 { font: 400 1.55rem/1.3 var(--display); }
.layer h3 a { color: inherit; text-decoration: none; }
.layer h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.layer > p { margin-top: .6rem; }
.layer-record { padding-left: 1.15rem; border-left: 1px solid var(--thread); }
.layer-record h3 { color: var(--cyan); }
.layer-expr { font-family: var(--serif); line-height: 1.9; padding: .2rem 0 .2rem 1.15rem; position: relative; }
.layer-expr::before { content: ''; position: absolute; inset: -2.2rem -1.5rem -2.2rem -1rem; z-index: -1; background: radial-gradient(60% 60% at 30% 50%, rgba(255, 196, 164, .16), rgba(244, 166, 198, .06) 55%, transparent 78%); }
.layer-expr h3 { color: var(--peach); }

.block { margin-top: clamp(3.4rem, 10vh, 5.5rem); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.block-head h2, .block > h2 { font: 400 1.5rem/1.3 var(--display); }
.block > h2 { margin-bottom: 1.2rem; }
.block-head a { font-size: .88rem; white-space: nowrap; }

/* 기록 층: 촉수 같은 가는 선 위에 날짜를 꿴다 ------------------------- */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: .28rem; top: .6rem; bottom: 0; width: 1px; background: linear-gradient(180deg, rgba(196, 226, 255, .6), rgba(150, 196, 246, .22) 70%, transparent); }
.entry { position: relative; padding-bottom: 2.3rem; }
.entry:last-child { padding-bottom: .4rem; }
.entry::before { content: ''; position: absolute; left: -1.5rem; top: .52rem; width: .62rem; height: .62rem; border-radius: 50%; background: var(--deep); }
.entry-public::before { background: var(--cyan); box-shadow: 0 0 12px 2px rgba(160, 216, 255, .8); }
.entry-private::before { border: 1.5px solid var(--lilac); background: linear-gradient(90deg, var(--lilac) 50%, var(--deep) 50%); }
.entry-none::before { border: 1.5px dashed var(--mist); }
.entry time { display: block; font-size: .86rem; color: var(--mist); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.entry h3 { font: 500 1.1rem/1.5 var(--sans); margin-top: .1rem; }
.entry > p { margin-top: .35rem; color: #d3dff1; }
.entry-project { font-size: .88rem; }
.evidence { margin-top: .8rem; display: grid; gap: .7rem; }
.ev { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; align-items: baseline; font-size: .92rem; }
.ev p { grid-column: 1 / -1; color: var(--mist); font-size: .86rem; line-height: 1.65; }
.ev-none .ev-label { color: var(--mist); }

/* 프로젝트 --------------------------------------------------------- */
.proj-rows li + li { border-top: 1px solid rgba(176, 208, 246, .14); }
.proj-rows a { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; align-items: baseline; padding: .95rem 0; color: var(--ice); text-decoration: none; }
.pr-name { font: 400 1.22rem/1.35 var(--display); }
.pr-kind { grid-column: 1; color: var(--mist); font-size: .88rem; }
.proj-rows .badge { grid-column: 2; grid-row: 1; }
.proj-rows a:hover .pr-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.proj-list { margin-top: 2.2rem; display: grid; gap: 2.4rem; }
.proj-list li { padding-left: 1.15rem; border-left: 1px solid var(--thread); }
.proj-list h2 { font: 400 1.6rem/1.3 var(--display); }
.proj-list h2 a { color: var(--ice); text-decoration: none; }
.proj-list h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.proj-list p { margin-bottom: .5rem; }
.kindline { color: var(--mist); font-size: .9rem; }

/* 읽는 화면 -------------------------------------------------------- */
.crumb { font-size: .88rem; margin-bottom: .5rem; }
.page-h { font: 400 clamp(2rem, 8vw, 2.9rem)/1.3 var(--display); text-shadow: 0 0 22px rgba(3, 14, 36, .8); }
.layer-note { margin-top: 1.1rem; font-size: .9rem; line-height: 1.7; color: var(--mist); padding-left: .9rem; border-left: 1px solid var(--thread); }
.layer-note b { display: block; color: var(--cyan); font-weight: 500; }
.layer-note + .legend { margin-bottom: 2.6rem; }
.lede-p { margin-top: 1.5rem; font-size: 1.1rem; line-height: 1.75; }
.facts { margin: 1.5rem 0 2rem; border-top: 1px solid rgba(176, 208, 246, .16); }
.facts div { display: grid; grid-template-columns: 5.6em 1fr; gap: .8rem; padding: .62rem 0; border-bottom: 1px solid rgba(176, 208, 246, .16); font-size: .95rem; }
.facts dt { color: var(--mist); }
.prose > * + * { margin-top: 1.05rem; }
.prose h2 { font: 400 1.4rem/1.35 var(--display); margin-top: 2.4rem; }
.prose ul { display: grid; gap: .6rem; }
.prose li { padding-left: 1.1rem; position: relative; }
.prose li::before { content: ''; position: absolute; left: .1rem; top: .78em; width: .32rem; height: .32rem; border-radius: 50%; background: var(--mist); }

/* 표현 층: 선과 표지 없이, 살구빛과 바탕체로 ------------------------- */
.expr { font-family: var(--serif); line-height: 1.95; }
.expr .block-head h2, .expr .page-h { color: var(--peach); text-shadow: 0 0 28px rgba(255, 190, 150, .35); }
.expr .layer-note { border-left-color: rgba(255, 207, 178, .35); font-family: var(--sans); }
.expr .layer-note b { color: var(--peach); }
.expr .crumb, .expr .note-meta { font-family: var(--sans); }
.note-list { display: grid; gap: 1.5rem; }
.wrap.expr > .note-list { margin-top: 2.4rem; }
.note-list a { display: block; color: var(--ice); text-decoration: none; }
.note-title { display: block; font-size: 1.24rem; line-height: 1.5; }
.note-list a:hover .note-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: var(--peach); }
.note-sum { display: block; color: #d9dcec; }
.note-meta { display: block; color: var(--mist); font-size: .84rem; font-family: var(--sans); margin-top: .15rem; }
.essay .prose { margin-top: 2.2rem; font-size: 1.06rem; }
.essay .prose li::before { background: var(--peach); }

@media (min-width: 820px) {
  .hero { align-items: center; padding-bottom: 8vh; }
  .hero-text { max-width: 33rem; margin-left: max(0px, calc((100vw - 76rem) / 2)); }
  .hero::after { display: none; }
  .lede { font-size: 1.04rem; }
  .layers { grid-template-columns: 1.15fr 1fr; gap: 3.5rem; }
  .ev { grid-template-columns: 7em 1fr; }
  .ev p { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rays::before, .rays::after, .hero-text { animation: none; }
}
