:root {
  --forest: #10160f;
  --deep: #17261b;
  --soil: #2c1a10;
  --kraft: #bd9a71;
  --ink: #20170e;
  --paper: #f1ecdd;
  --en: 'Gambetta', 'Times New Roman', serif;
  --ko: 'Spoqa Han Sans Neo', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --gut: 3.4vw;
}
* { box-sizing: border-box; }
html { background: var(--forest); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--paper); font: 500 17px/1.75 var(--ko); word-break: keep-all; overflow-wrap: break-word; overflow-x: clip; }
img, video, canvas { display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* 줄바꿈: 위치는 문구마다 직접 정하고, 나머지는 브라우저가 고르게 맞춘다 */
h1, h2, .lead, .line, #next-title p, #season p { text-wrap: balance; word-break: keep-all; }
p, li { text-wrap: pretty; word-break: keep-all; }
.b-mo { display: none; }
@media (max-width: 767px) { .b-mo { display: inline; } .b-pc { display: none; } }

/* 로딩: 나무의 잎이 받은 양만큼 돋는다 */
#loader { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--forest); color: var(--paper); transition: opacity .7s ease, visibility .7s; }
#loader.done { opacity: 0; visibility: hidden; }
#loader .tree { width: clamp(90px, 11vw, 150px); height: auto; overflow: visible; }
#loader .leaves path { opacity: .08; transform-box: fill-box; transform-origin: 50% 100%; transform: scale(.55); transition: opacity .45s ease, transform .6s cubic-bezier(.2,.8,.2,1); fill-opacity: 0; }
#loader .leaves path.on { opacity: 1; transform: none; }

/* 메뉴 */
#nav.off { opacity: 0; }
#nav.off a, #nav.off button { pointer-events: none; }
#nav { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: max(12px, env(safe-area-inset-top)) var(--gut) 12px; color: #fff; transition: color .4s ease, opacity .25s ease; pointer-events: none; }
#nav a, #nav button { pointer-events: auto; }
#nav.light { color: var(--ink); }
.logo { justify-self: start; }
.logo img { height: 46px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(0,0,0,.35)); transition: filter .4s ease; }
#nav.light .logo img { filter: brightness(0); }
#menu { display: flex; gap: 2.6vw; font: 500 18px/1 var(--en); text-shadow: 0 0 12px rgba(0,0,0,.35); }
#nav.light #menu, #nav.light .shop, #nav.light #menu-btn { text-shadow: none; }
.nav-right { justify-self: end; display: flex; gap: 20px; align-items: center; }
.shop, #menu-btn { font: 500 19px/1 var(--en); text-shadow: 0 0 12px rgba(0,0,0,.4); }
#menu-btn { display: none; background: none; border: 0; color: inherit; padding: 8px 0; cursor: pointer; }

/* 내려가는 구간 */
#descent { position: relative; height: 700svh; background: var(--forest); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--forest); }
#film, #loop { position: absolute; inset: 0; width: 100%; height: 100%; }
#loop { object-fit: cover; z-index: 2; }
#film { z-index: 1; }
.word { position: absolute; z-index: 3; left: var(--gut); bottom: var(--base, 22vh); color: #ece9db; will-change: transform; visibility: hidden; }
.word h2 { margin: 0 0 -.06em -.03em; font: 500 clamp(96px, 13.6vw, 240px)/1 var(--en); letter-spacing: -.035em; }
.word p { position: absolute; left: .1vw; top: 100%; margin: 26px 0 0; white-space: nowrap; font-size: 20px; line-height: 1.4; color: #f4efe0; text-shadow: 0 0 10px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.5); }
.word.dark h2 { color: #fff7e2; text-shadow: 0 2px 26px rgba(30,22,4,.5); }
.word.warm h2 { color: #f0dcc0; }
[data-scent="got"] { --base: 15vh; }
[data-scent="benzul"] { --base: 24vh; }
[data-scent="kum"] { --base: 25vh; }
[data-scent="heuk"] { --base: 16vh; }

/* 흙에서 크라프트로 */
.bridge { position: relative; z-index: 4; height: 70svh; margin-top: -45svh; background: linear-gradient(to bottom, rgba(44,26,16,0) 0, var(--soil) 40%, var(--kraft) 100%); pointer-events: none; }

/* 네 향 */
#scents { position: relative; z-index: 5; background: var(--kraft); color: var(--ink); padding-block: 2vh 6vh; }
.line-wrap { position: relative; }
.line { width: 100%; height: auto; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 90%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 90%, transparent 100%); }
.names { position: relative; height: clamp(120px, 12vw, 180px); }
.nm { position: absolute; top: 0; left: var(--x); transform: translateX(-50%); display: grid; justify-items: center; gap: 12px; white-space: nowrap; transition: opacity .35s ease; }
.nm strong { font: 500 clamp(38px, 4.9vw, 84px)/1 var(--en); letter-spacing: -.035em; color: var(--ink); background: var(--scene) center / 900px auto; -webkit-background-clip: text; background-clip: text; transition: color .35s ease; }
.nm span { font-size: 17px; line-height: 1.4; }
.names:hover .nm { opacity: .45; }
.names .nm:hover, .names .nm:focus-visible { opacity: 1; }
.nm:hover strong, .nm:focus-visible strong { color: transparent; }

/* 다음 시즌: 잎 모양 창이 열린다 */
#next { position: relative; z-index: 5; height: 340svh; background: var(--kraft); }
.next-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--kraft); }
.leaf-open { position: absolute; inset: 0; visibility: hidden; background: var(--img) center / cover no-repeat; }
#next-title { position: absolute; left: 0; right: 0; top: 15vh; text-align: center; color: var(--ink); }
#next-title .eng { margin: 0; font: 500 clamp(64px, 11.5vw, 210px)/1 var(--en); letter-spacing: -.035em; }
#next-title .ko { margin: 14px 0 0; font-size: 20px; font-weight: 500; }
.leaf-open::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; background: linear-gradient(to top, rgba(12,16,12,.62), rgba(12,16,12,0)); pointer-events: none; }
.next-word { z-index: 1; position: absolute; left: var(--gut); bottom: 9vh; right: var(--gut); color: #fff; opacity: 0; text-shadow: 0 0 22px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.45); }
.next-word .tag { font: 500 clamp(20px, 2vw, 30px)/1 var(--en); margin-bottom: 12px; }
.next-word h2 { margin: 0 0 14px -.03em; font: 500 clamp(64px, 10vw, 180px)/1 var(--en); letter-spacing: -.035em; white-space: nowrap; overflow-wrap: normal; }
.next-word p { margin: 0; font-size: 18px; max-width: 40em; }
.next-word .mean { margin-bottom: 4px; font-weight: 700; font-size: 20px; }

/* 이야기: 나무가 자란다 */
#story { position: relative; z-index: 5; height: 170svh; background: var(--deep); }
.story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 5vw; padding: 92px var(--gut) 36px; overflow: hidden; }
.founder-wrap { height: 100%; min-height: 0; display: flex; justify-content: center; align-items: center; }
#founder { height: 100%; max-height: 80vh; width: auto; max-width: 100%; object-fit: cover; }
.story-text { max-width: 33em; font-size: 18px; line-height: 1.75; }
.story-text > * { opacity: 0; }
.story-text p { margin: 0 0 16px; }
.story-text .lead { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.35; font-weight: 700; margin-bottom: 22px; letter-spacing: -.02em; }
.story-text .lin { color: #d6d7c6; font-size: 16px; }
.who { margin-top: 30px; }
.who .name { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.4; }
.who .name span { font: 500 20px/1 var(--en); margin-left: 8px; }
.who .role { margin: 2px 0 0; font: 500 19px/1.4 var(--en); color: #d6d7c6; }
.career { list-style: none; margin: 16px 0 0; padding: 0; font-size: 16px; line-height: 1.85; }

/* 향 설명: 한 장씩 위로 덮으며 넘어간다 */
#details { position: relative; z-index: 5; }
.detail { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--bg); color: var(--fg); overflow: hidden; }
.detail.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.detail.flip .pic { order: 2; }
.detail .pic { min-height: 0; }
.detail .pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.detail .txt { align-self: end; padding: 0 5vw 11vh; font-size: 18px; line-height: 1.75; }
.detail .sub { margin: 0 0 10px; font-size: 19px; font-weight: 500; }
.detail h2 { margin: 0 0 30px -.03em; font: 500 clamp(76px, 9.4vw, 170px)/1 var(--en); letter-spacing: -.035em; }
.detail .line { font-size: clamp(22px, 2vw, 29px); line-height: 1.62; font-weight: 700; letter-spacing: -.015em; margin: 0 0 16px; }
.detail p { margin: 0 0 14px; }


/* 나무 사진 */
#season { position: relative; z-index: 5; height: 110svh; overflow: hidden; background: var(--deep); }
#season img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
#season p { position: absolute; left: var(--gut); top: 13vh; margin: 0; color: #17261b; font: 500 clamp(44px, 7.2vw, 128px)/1.04 var(--en); letter-spacing: -.03em; }

/* 끝 */
#contact { position: relative; z-index: 5; background: var(--deep); color: var(--paper); min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 44px; padding-block: 12vh 5vh; padding-inline: var(--gut); text-align: center; }
.big-logo { width: min(64vw, 780px); height: auto; filter: brightness(0) invert(1); }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px; font-size: 20px; }
.links [data-en] { font: 500 22px/1.7 var(--en); }
.links a { border-bottom: 1px solid transparent; transition: border-color .25s ease; }
.links a:hover { border-color: currentColor; }
#contact footer { margin-top: 5vh; font-size: 14px; line-height: 1.75; color: #c9ccbb; }
#contact footer p { margin: 0; }

@media (max-width: 767px) {
  body { font-size: 16px; }
  :root { --gut: 5vw; }
  #nav { grid-template-columns: 1fr auto; }
  .logo img { height: 36px; }
  #menu-btn { display: block; }
  #menu { position: fixed; top: 0; left: 0; right: 0; flex-direction: column; gap: 22px; padding: 90px var(--gut) 34px; background: var(--deep); color: var(--paper); font-size: 34px; text-shadow: none; visibility: hidden; opacity: 0; transition: opacity .25s ease; z-index: -1; }
  #menu.open { visibility: visible; opacity: 1; }
  #nav.menu-open { color: var(--paper); }
  #nav.menu-open .logo img { filter: brightness(0) invert(1); }
  .word { left: var(--gut); bottom: 11svh; }
  [data-scent] { --base: 11svh; }
  .word h2, .word.dark h2, .word.warm h2 { font-size: 21vw; color: #f1ecdd; }
  .word p { margin-top: 14px; font-size: 16px; }
  #scents { padding-block: 4vh 6vh; }
  .line-wrap, .names { display: none; }
  .m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3vw 0; padding-block: 2vh 4vh; }
  .m-line { display: grid; gap: 6px; justify-items: center; }
  .m-line .crop { width: 100%; height: calc(30 * var(--u, 1svh)); overflow: hidden; position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent calc(50% - 7.2 * var(--u, 1svh)), #000 calc(50% - 5.4 * var(--u, 1svh)), #000 calc(50% + 5.4 * var(--u, 1svh)), transparent calc(50% + 7.2 * var(--u, 1svh))), linear-gradient(to bottom, transparent 6%, #000 16%, #000 88%, transparent 98%);
    mask-image: linear-gradient(to right, transparent calc(50% - 7.2 * var(--u, 1svh)), #000 calc(50% - 5.4 * var(--u, 1svh)), #000 calc(50% + 5.4 * var(--u, 1svh)), transparent calc(50% + 7.2 * var(--u, 1svh))), linear-gradient(to bottom, transparent 6%, #000 16%, #000 88%, transparent 98%);
    -webkit-mask-composite: source-in; mask-composite: intersect; }
  .m-line .crop img { position: absolute; top: 0; height: 100%; width: auto; max-width: none; left: 50%; transform: translateX(calc(-1 * var(--x))); }
  .m-line strong { font: 500 9.4vw/1 var(--en); letter-spacing: -.035em; color: var(--ink); }
  .m-line span { font-size: 14px; line-height: 1.4; white-space: nowrap; }
  .next-word { bottom: 7vh; }
  .next-word h2 { font-size: 15.2vw; }
  .next-word p { font-size: 16px; }
  .next-word .mean { font-size: 17px; }
  #story { height: 210svh; }
  .story-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38svh auto; align-content: start; gap: 2.4svh; padding: 76px var(--gut) 12px; }
  #founder { height: 100%; max-height: none; }
  .story-text { font-size: 15px; line-height: 1.65; }
  .story-text p { margin-bottom: 8px; }
  .story-text .lead { font-size: 25px; margin-bottom: 8px; }
  .story-text .lin { font-size: 14px; }
  .who { margin-top: 12px; }
  .who .name { font-size: 18px; }
  .who .name span { font-size: 15px; }
  .who .role { font-size: 15px; }
  .career { font-size: 14px; line-height: 1.6; margin-top: 8px; }
  .detail, .detail.flip { grid-template-columns: minmax(0, 1fr); grid-template-rows: 44svh auto; }
  .detail.flip .pic { order: 0; }
  .detail .txt { align-self: start; padding: 22px var(--gut) 0; font-size: 16px; line-height: 1.65; }
  .detail .sub { font-size: 16px; margin-bottom: 4px; }
  .detail h2 { font-size: 19vw; margin-bottom: 14px; }
  .detail .line { font-size: 19px; line-height: 1.62; margin-bottom: 10px; }
  .detail p { margin-bottom: 8px; }
  #next-title { top: 15svh; }
  #next-title .eng { font-size: 17.5vw; }
  #next-title .ko { font-size: 17px; }
  .next-word .tag { font-size: 18px; margin-bottom: 8px; }
  #season { height: 100svh; }
  #season p { font-size: 10.6vw; top: 13svh; }
  .big-logo { width: 84vw; }
  .links { flex-direction: column; gap: 4px; }

  /* 휴대폰 높이 고정 */
  .stage, .next-stage, .story-stage, .detail { height: calc(100 * var(--u, 1svh)); }
  .bridge { height: calc(70 * var(--u, 1svh)); margin-top: calc(-45 * var(--u, 1svh)); }
  #next { height: calc(340 * var(--u, 1svh)); }
  #story { height: calc(170 * var(--u, 1svh)); }
  #season { height: calc(100 * var(--u, 1svh)); }
  #contact { min-height: 0; padding-block: 9vh 5vh; }
  
  .detail, .detail.flip { grid-template-rows: calc(44 * var(--u, 1svh)) auto; }
  .story-stage { grid-template-rows: calc(38 * var(--u, 1svh)) auto; }
}

@media (min-width: 768px) {
  .m-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #loader, #nav, .nm, .nm strong { transition: none; }
}

/* 10K 시험판: 잘라 쓴 프레임을 화면에 맞추고, 글은 병 아래 조용한 곳에 둔다 */
#film { object-fit: cover; }
@media (max-width: 767px) {
  .word, [data-scent] { --base: calc(7.5 * var(--u, 1svh)); }
  .word { bottom: calc(7.5 * var(--u, 1svh)); }
  .word p { margin-top: 8px; }
}

/* 영상 재생판: 앞 영상과 거꾸로 영상을 겹쳐 두고, 보이는 쪽만 위로 올린다. 덮개는 방향을 바꿀 때 쓴다. */
.vid, #cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid { z-index: 0; }
.vid.on { z-index: 1; }
#cover { z-index: 1; opacity: 0; pointer-events: none; }
#film { display: none; }
