/* onewise.oddlab.app 첫 화면. 색은 앱 theme.ts와 같다.
   이야기 순서: ① 시대 → ② 바뀌지 않는 것 → ③ 옛 사람의 지혜 → ④ 본질을 지키는 하루 → ⑤ 앱 소개 */
:root {
  --paper: #f4efe6;
  --ink: #1f1b16;
  --ink2: #6b6256;
  --line: #d8cfbf;
  --wet: #1d2c4c; /* 막 스며든 잉크. 마르면 ink가 된다 */
  --red: #b8412b;
  --bezel: #1a1714;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans KR", "Noto Sans JP", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17140f;
    --ink: #ece5d8;
    --ink2: #a39884;
    --line: #3a332a;
    --wet: #a9bbe0;
    --bezel: #000;
  }
}

/* 한글 명조는 기기에 없는 경우가 많아 이 페이지에 쓰인 글자만 넣었다(Noto Serif KR, OFL). */
@font-face {
  font-family: "Onewise Serif KR";
  src: url(fonts/serif-ko.woff2) format("woff2");
  font-display: swap;
  unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7A3, U+300C-300F, U+2018-2019;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 var(--serif);
  overflow-x: hidden;
}
[lang="ko"] { font-family: "Iowan Old Style", "Onewise Serif KR", "Noto Serif KR", AppleMyungjo, Georgia, serif; word-break: keep-all; }
[lang="ja"] { font-family: "Iowan Old Style", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", serif; line-break: strict; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
.stage p, .qs, .ink-text, .app-text h2 { text-wrap: balance; }
/* 일본어 큰 글은 <wbr> 자리에서만 줄을 바꾼다 */
[lang="ja"] .stage, [lang="ja"] .app-text h2 { word-break: keep-all; overflow-wrap: anywhere; }
p, ol, ul, figure, blockquote { margin: 0; }
button { font: inherit; color: inherit; }

section[lang] { display: none; }
section[lang].on { display: block; }

/* 머리: 첫 화면 위에 얹는다 */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px max(20px, calc((100% - 1120px) / 2));
}
.brand { display: flex; align-items: center; gap: 10px; font: 21px/1 var(--serif); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top-r { display: flex; align-items: center; gap: 18px; font: 14px/1 var(--sans); }
.top nav { display: flex; gap: 14px; }
/* FAQ 메뉴: 지금 언어의 링크 하나만 보인다(lang.js가 <html lang>을 바꾼다) */
.menu { display: none; color: var(--ink); text-decoration: none; padding: 6px 18px 6px 0; border-right: 1px solid var(--line); font-family: inherit; }
html[lang="ko"] .menu[lang="ko"], html[lang="en"] .menu[lang="en"], html[lang="ja"] .menu[lang="ja"] { display: inline; }
.menu:hover { text-decoration: underline; text-underline-offset: 5px; }
.menu, .top nav a { white-space: nowrap; }
.top nav a { color: var(--ink2); text-decoration: none; padding: 6px 0; font-family: inherit; }
.top nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wet); outline-offset: 3px; }

/* 장면: 한 화면에 한 가지 말 */
.scene { position: relative; }
.stage {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 96px 20px;
}

/* ① 시대: 화면을 메운 글 조각이 하나씩 사라지고 큰 문장만 남는다 */
.noise {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-around;
  padding: 72px 0; color: var(--ink2); font-family: var(--sans); pointer-events: none; user-select: none;
  -webkit-mask-image: radial-gradient(ellipse 52% 40% at 50% 50%, transparent 35%, #000 80%);
  mask-image: radial-gradient(ellipse 52% 40% at 50% 50%, transparent 35%, #000 80%);
}
.row { overflow: hidden; white-space: nowrap; }
.track { display: inline-block; }
.row:nth-child(even) .track { transform: translateX(-18%); }
.track span { display: inline-block; padding-right: 30px; font-size: 15px; opacity: .55; transition: opacity 1.2s; }
.noise.quiet .track span { opacity: 0; }
.row:nth-child(2) span, .row:nth-child(6) span { font-size: 24px; opacity: .35; }
.row:nth-child(4) span { font-size: 13px; }
.row:nth-child(n+8) { display: none; } /* 데스크톱은 7줄. 모바일은 아래에서 16줄 모두 */
.track .dot::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; vertical-align: 2px;
  border-radius: 50%; background: var(--red);
}
.age-text { position: relative; z-index: 1; max-width: 980px; }
.s-age h1 { font-size: clamp(44px, 8vw, 108px); line-height: 1.1; letter-spacing: -.015em; }
[lang="ko"] .s-age h1 { line-height: 1.2; letter-spacing: -.025em; }
[lang="ja"] .s-age h1 { font-size: clamp(36px, 6.4vw, 88px); line-height: 1.25; letter-spacing: -.02em; }
.lede { font-size: clamp(17px, 2vw, 22px); color: var(--ink2); margin-top: 28px; }
.cue {
  position: absolute; left: 50%; bottom: 28px; width: 1px; height: 44px; background: currentColor; opacity: .5;
  transform-origin: top; animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ② ③: 장면이 화면에 붙어 있는 동안, 내리는 만큼 움직인다 */
.s-same { height: 280vh; }
.s-old { height: 240vh; }
.s-same .stage, .s-old .stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; }

/* ② 바뀌지 않는 것: 질문 셋이 하나씩 남는다 */
.s-same h2 { font-size: clamp(32px, 5vw, 64px); line-height: 1.25; }
.qs { list-style: none; padding: 0; margin-top: 44px; font-size: clamp(22px, 3vw, 36px); line-height: 1.7; }
.qs li { opacity: .12; filter: blur(4px); transition: opacity .7s, filter .7s; }
.same-end { margin-top: 40px; color: var(--ink2); font-size: clamp(17px, 2vw, 21px); opacity: 0; transition: opacity .8s; }
.s-same[data-step="1"] li:nth-child(1),
.s-same[data-step="2"] li:nth-child(-n+2),
.s-same[data-step="3"] li, .s-same[data-step="4"] li { opacity: 1; filter: none; }
.s-same[data-step="4"] .same-end { opacity: 1; }

/* ③ 옛 사람의 지혜: 내리는 만큼 단어가 차례로 또렷해진다. 막 또렷해진 단어는 남색, 마르면 먹색 */
.s-old h2 { font-size: clamp(26px, 3.6vw, 44px); line-height: 1.3; max-width: 18em; }
.s-old .ink { margin-top: 56px; width: min(880px, 100%); }
.s-old .ink-text { max-width: 17em; margin: 0 auto; }
.era { font: 600 12.5px/1 var(--sans); letter-spacing: .08em; color: var(--ink2); margin-bottom: 20px; }
.ink { position: relative; -webkit-tap-highlight-color: transparent; }
.ink[data-ink="words"] { cursor: pointer; }
.ink-text { font-size: clamp(26px, 3.8vw, 48px); line-height: 1.45; }
.ink-text .iw { display: inline-block; filter: blur(6px); opacity: .55; }
.ink[data-ink="scroll"] .iw {
  filter: blur(calc((1 - var(--k, 0)) * 7px)); opacity: calc(.35 + .65 * var(--k, 0));
  color: color-mix(in srgb, var(--wet) calc((1 - var(--k, 0)) * 100%), var(--ink));
}
[lang="ja"] .ink-text .iw { white-space: pre; }
.ink.open .ink-text .iw { animation: soak 1.6s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i) * 80ms); }
@keyframes soak {
  0% { filter: blur(6px); opacity: .55; color: var(--ink); }
  28% { filter: blur(0); opacity: 1; color: var(--wet); }
  100% { filter: blur(0); opacity: 1; color: var(--ink); }
}
.ink-cite { font: 14px/1.6 var(--sans); color: var(--ink2); margin-top: 20px; opacity: 0; transition: opacity .6s; }
.ink.done .ink-cite { opacity: 1; }
.ink-tap {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 28px auto 0; padding: 8px 14px;
  background: none; border: 0; font: 600 14px/1.4 var(--sans); cursor: pointer; transition: opacity .4s;
}
.ink.open .ink-tap { opacity: 0; pointer-events: none; }
.old-end { margin-top: 56px; opacity: 0; transform: translateY(12px); transition: opacity .8s, transform .8s; }
.s-old.done .old-end { opacity: 1; transform: none; }
.now { font-size: clamp(20px, 2.6vw, 28px); }
.names { margin-top: 14px; color: var(--ink2); font-size: 15px; line-height: 1.7; }

/* ④ 본질을 지키는 하루: 로고(아이콘 A)의 한 획이 왼쪽부터 그어진다 */
.stroke {
  width: min(280px, 64vw); height: auto; margin-bottom: 36px;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%); mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0;
  transition: -webkit-mask-position 1.8s cubic-bezier(.6, .1, .2, 1), mask-position 1.8s cubic-bezier(.6, .1, .2, 1);
}
@media (prefers-color-scheme: dark) { .stroke { filter: invert(1) hue-rotate(180deg); } }
.s-keep.in .stroke { -webkit-mask-position: 0 0; mask-position: 0 0; }
.s-keep h2 { font-size: clamp(34px, 5.6vw, 72px); line-height: 1.22; }
.s-keep p { margin-top: 26px; color: var(--ink2); font-size: clamp(17px, 2vw, 22px); }
.s-keep h2, .s-keep p { opacity: 0; transform: translateY(14px); transition: opacity 1s .5s, transform 1s .5s; }
.s-keep p { transition-delay: .9s; }
.s-keep.in h2, .s-keep.in p { opacity: 1; transform: none; }

/* ⑤ 앱 소개 */
.app { max-width: 1120px; margin: 0 auto; padding: clamp(80px, 10vw, 140px) 20px 40px; border-top: 1px solid var(--line); }
.app-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.phone {
  position: relative; width: min(300px, 72vw); aspect-ratio: 1320 / 2868;
  border-radius: 50px; padding: 9px; background: var(--bezel);
  box-shadow: 0 40px 80px -36px rgba(31, 27, 22, .5);
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 88px; height: 25px; margin-left: -44px; border-radius: 14px; background: #000; z-index: 1; }
.phone .ink {
  height: 100%; border-radius: 42px; padding: 0 22px 40px; text-align: left;
  display: flex; flex-direction: column; justify-content: center;
  --ink: #1f1b16; --ink2: #6b6256; --wet: #1d2c4c; background: #f4efe6; color: var(--ink);
}
.phone .ink-text { font-size: 17px; line-height: 1.55; }
.phone .ink-cite { font-size: 11px; margin-top: 12px; }
.phone .ink-tap { font-size: 12px; margin-top: 22px; }
.phone .ink-tap span { font: 400 11px/1.4 var(--serif); color: var(--ink2); }
.brand-line { display: flex; align-items: center; gap: 12px; font: 24px/1 var(--serif); }
.brand-line img { width: 44px; height: 44px; border-radius: 10px; }
.app-text h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.3; margin-top: 26px; }
.app-p { color: var(--ink2); margin-top: 14px; }
.feats { list-style: none; padding: 0; margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.feats li { border-top: 1px solid var(--line); padding-top: 14px; }
.feats h3 { font-size: 18px; line-height: 1.4; }
.feats p { font-size: 15px; line-height: 1.6; color: var(--ink2); margin-top: 4px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 168px; min-height: 54px; padding: 8px 20px; border-radius: 14px;
  border: 1.5px solid var(--ink); text-decoration: none; line-height: 1.15; font-family: var(--sans);
}
.store b { font-size: 18px; font-weight: 600; }
.store small { font-size: 11.5px; }
.store-ios { background: var(--ink); color: var(--paper); }
.store:hover { opacity: .85; }
.fine { font: 13px/1.5 var(--sans); color: var(--ink2); margin-top: 14px; }

.shots { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: clamp(64px, 8vw, 104px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0 16px; }
.shots > * { flex: 0 0 auto; scroll-snap-align: center; }
.device { width: 200px; padding: 6px; border-radius: 32px; background: var(--bezel); }
.device img { border-radius: 26px; }
/* 위젯: 앱 OnewiseWidget.swift와 같은 색·구성 */
.home {
  width: 320px; padding: 20px; border-radius: 32px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: linear-gradient(160deg, #b9b2a6, #8e96a3 70%, #737c8b);
}
.wg {
  grid-column: span 4; aspect-ratio: 2.14; border-radius: 20px; padding: 14px 16px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #f4efe6; color: #1f1b16; font-family: "Iowan Old Style", "Onewise Serif KR", "Hiragino Mincho ProN", Georgia, serif;
}
@media (prefers-color-scheme: dark) { .wg { background: #221e1a; color: #efe7da; } }
.wg-q { font-size: 15px; line-height: 1.45; filter: blur(4px); opacity: .55; transition: filter .5s, opacity .5s; }
.wg-wait, .wg-who { font: 600 11px/1.3 var(--sans); }
.wg-who { display: none; font-weight: 400; opacity: .65; }
.wg.open .wg-q { filter: none; opacity: 1; }
.wg.open .wg-wait { display: none; }
.wg.open .wg-who { display: block; }
.apps { grid-column: span 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.apps i { aspect-ratio: 1; border-radius: 22%; background: rgba(255, 255, 255, .28); }


/* 앱 받기: 첫 화면을 지나면 아래에 뜨고, 앱 소개에 닿으면 사라진다 */
.get {
  position: fixed; left: 50%; bottom: 20px; z-index: 6; transform: translate(-50%, 160%);
  padding: 14px 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper); font: 600 15px/1 var(--sans);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45); transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}
body.show-get .get { transform: translate(-50%, 0); }

footer {
  display: flex; flex-wrap: wrap; gap: 8px 20px; max-width: 1120px; margin: 72px auto 0; padding: 28px 20px 48px;
  border-top: 1px solid var(--line); font: 13px/1.5 var(--sans); color: var(--ink2);
}
footer a { color: var(--ink2); }
footer span { margin-left: auto; }

/* 좁은 화면: 언어 이름은 KO·EN·JA로, 아주 좁으면 로고 글자를 숨긴다 */
@media (max-width: 480px) {
  .top-r { gap: 12px; font-size: 13px; }
  .top nav { gap: 10px; }
  .menu { padding-right: 12px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .top nav a { font-size: 0; }
  .top nav a::after { content: attr(data-s); font-size: 13px; letter-spacing: .04em; }
}
@media (max-width: 360px) { .brand .wm { display: none; } }

@media (max-width: 768px) {
  body { font-size: 16px; }
  .top { padding: 16px; }
  .stage { padding: 88px 16px; }
  .track span { font-size: 13px; padding-right: 22px; }
  /* 모바일: 16줄을 촘촘히 채우고, 제목 바로 뒤만 비운다. 제목에는 종이색 번짐을 둘러 읽히게 한다 */
  .noise {
    justify-content: space-evenly; padding: 64px 0 24px;
    -webkit-mask-image: radial-gradient(ellipse 100% 25% at 50% 50%, transparent 50%, #000 95%);
    mask-image: radial-gradient(ellipse 100% 25% at 50% 50%, transparent 50%, #000 95%);
  }
  .row:nth-child(n+8) { display: block; }
  .row span { font-size: 13px; opacity: .55; }
  .row:nth-child(4n+2) span { font-size: 18px; opacity: .38; }
  .row:nth-child(5n) span { font-size: 12px; }
  .age-text h1, .age-text .lede { text-shadow: 0 0 2px var(--paper), 0 0 10px var(--paper), 0 0 22px var(--paper); }
  .app { padding-left: 16px; padding-right: 16px; }
  .app-head { grid-template-columns: 1fr; }
  .phone { margin: 0 auto; width: min(280px, 72vw); }
  .feats { grid-template-columns: 1fr; }
  .store { min-width: 0; flex: 1 1 150px; }
  .shots { justify-content: flex-start; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .device { width: 180px; }
  .home { width: 290px; }
  footer { padding-left: 16px; padding-right: 16px; }
  footer span { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cue { animation: none !important; }
  .scene { height: auto !important; }
  .scene .stage { position: relative !important; height: auto !important; min-height: 100vh; }
  .qs li, .same-end, .old-end, .s-keep h2, .s-keep p { opacity: 1 !important; filter: none !important; transform: none !important; transition: none !important; }
  .ink-text .iw { filter: none !important; opacity: 1 !important; animation: none !important; color: inherit !important; }
  .ink-cite { opacity: 1; }
  .ink-tap { display: none; }
  .stroke { -webkit-mask-image: none; mask-image: none; }
  .track span { transition: none; }
}
