/* dayever.net — 데이에버 랩스의 앱과 제작 노트.
 * 바탕은 조용한 종이색이고, 앱마다 그 앱의 색으로 된 방 하나를 가진다.
 * 색은 각 앱 사이트의 값을 가져왔다 (칼로리미터의 코랄, 픽시트의 초록, 데이리듬의 장밋빛, 차지노트의 흑백, PadCode의 파랑).
 * 글만 있는 부분은 모두 "왼쪽에 이름표, 오른쪽에 내용" 한 가지 틀을 쓴다 (.rows, .sec).
 * 스크립트는 없다. 움직임은 화면에 들어올 때 앱 화면이 살짝 올라오는 것 하나다.
 * HTML 은 build.py 가 만든다. */

:root {
  --paper: #FAFAF7;
  --ink: #111110;
  --sub: #5E5E5A;
  --line: #E4E4DF;
  --gutter: clamp(20px, 5vw, 56px);
  --wide: 1180px;
  --label: 11em;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E0E0D;
    --ink: #F3F3F0;
    --sub: #A4A49F;
    --line: #262624;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  z-index: 10;
}

.skip:focus { top: 12px; }

/* 머리 ------------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 24px var(--gutter);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.mark svg { width: 28px; height: 28px; }
.mark-bg { fill: var(--ink); }
.mark-fg { fill: var(--paper); }

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 26px);
  font-size: 15px;
  font-weight: 500;
}

.top-nav a { color: var(--sub); text-decoration: none; }
.top-nav a:hover { color: var(--ink); }

.top-nav .top-lang {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.top-nav .top-lang:hover { border-color: currentColor; }

@media (max-width: 479px) {
  .mark span { display: none; }
}

/* 소개 ------------------------------------------------------------------ */

.intro {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) var(--gutter) clamp(56px, 8vw, 104px);
}

.intro h1 {
  margin: 0;
  font-size: clamp(44px, 9.2vw, 128px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.052em;
}

.intro-body {
  max-width: 33em;
  margin: clamp(24px, 3.4vw, 40px) 0 0;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--sub);
}

.facts {
  display: grid;
  gap: 16px 40px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.facts dt { font-size: 14px; font-weight: 600; color: var(--sub); }

.facts dd {
  margin-top: 2px;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.03em;
}

@media (min-width: 760px) {
  .facts { grid-template-columns: auto auto 1fr; }
}

.index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.index a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.index img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

.index a:hover span { text-decoration: underline; text-underline-offset: 5px; }

@media (min-width: 620px) { .index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .index { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* 칩: 기술 이름 하나씩 ---------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chips li {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

/* 방 안에서는 방의 글자색을 옅게 써서 테두리를 그린다 */
.chips-room { gap: 6px; }

.chips-room li {
  padding: 3px 11px;
  border-color: color-mix(in srgb, var(--fg) 26%, transparent);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  vertical-align: 1px;
}

/* 방 -------------------------------------------------------------------- */

.room, .work-hero, .next {
  --bg: var(--paper);
  --fg: var(--ink);
  --soft: var(--sub);
  --accent: var(--ink);
  --frame: #151514;
  background: var(--bg);
  color: var(--fg);
}

.room { position: relative; overflow: hidden; }

.room-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.room-text { padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 5vw, 56px); }

.room-name {
  margin: 0;
  font-size: clamp(48px, 8.4vw, 112px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.room-kind {
  margin: 14px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.room-line {
  max-width: 16em;
  margin: clamp(32px, 4.4vw, 56px) 0 0;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.room-desc {
  max-width: 29em;
  margin: 16px 0 0;
  color: var(--soft);
}

.room-meta {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  font-size: 15px;
}

.room-meta > div {
  display: grid;
  grid-template-columns: 5em minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.room-meta dt { color: var(--soft); }
.room-meta dd { font-weight: 600; }

.room-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 32px;
}

.room-link {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.room-link:hover { background: var(--accent); }

.room-more {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 15px;
  font-weight: 600;
}

.room-more a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 5px;
}

.room-more a:hover { text-decoration-color: currentColor; }

/* 앱 화면. 전화는 CSS 로 그린 테두리 안에 넣고, 아래를 방 밖으로 내보내 잘리게 한다. */

.room-shot { justify-self: center; }

.phone {
  width: min(64vw, 280px);
  margin-bottom: clamp(-200px, -34vw, -120px);
  padding: 9px;
  border-radius: 46px;
  background: var(--frame);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.45);
}

.phone img { border-radius: 37px; }

/* 픽시트는 Mac 앱이라 창 그림을 쓴다. 그림 둘레에 그림자가 들어 있어 여백만큼 당긴다. */
.window {
  justify-self: start;
  width: 190%;
  margin: -4% 0 -9% -7%;
}

/* PadCode 는 화면 그림 대신 에디터를 글자로 그린다. 밝은 화면에서도 에디터는 어둡다.
 * pre 안의 b/em/u/q/s 는 뜻 없이 구문 색을 입히는 고리로만 쓴다. */
.editor {
  justify-self: stretch;
  width: 100%;
  max-width: 560px;
  margin-bottom: clamp(48px, 7vw, 72px);
  border-radius: 14px;
  overflow: hidden;
  background: #1E1E1E;
  color: #D4D4D4;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  word-break: normal;
  overflow-wrap: normal;
}

.editor-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: #2A2A2A;
  color: #A8A8A8;
  font-size: 12px;
}

.editor-bar i { width: 10px; height: 10px; border-radius: 50%; background: #5A5A5A; }
.editor-bar span { margin-left: 10px; }

.editor pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: inherit; }
.editor code { font: inherit; }
.editor-term { border-top: 1px solid #333; background: #181818; color: #BDBDBD; }

.editor b, .editor em, .editor u, .editor q, .editor s { font: inherit; text-decoration: none; }
.editor q::before, .editor q::after { content: none; }
.editor-code b { color: #569CD6; }
.editor-code em { color: #4EC9B0; }
.editor-code u { color: #B5CEA8; }
.editor-code q { color: #CE9178; }
.editor-code s { color: #6A9955; }
.editor-term b { color: #6CC36C; }

@media (min-width: 900px) {
  .room-in {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: clamp(32px, 6vw, 96px);
    min-height: 700px;
  }

  .room-text { align-self: center; padding: 104px 0; }

  .room-shot { justify-self: end; }

  .phone {
    width: clamp(260px, 25vw, 312px);
    margin-top: 88px;
    margin-bottom: -150px;
  }

  .window {
    width: clamp(560px, 58vw, 860px);
    margin: 0 clamp(-260px, -16vw, -120px) -4% 0;
    align-self: center;
  }

  .editor {
    width: clamp(380px, 40vw, 520px);
    margin: 0;
    align-self: center;
  }
}

/* 방마다의 색 ----------------------------------------------------------- */

.room-calorie { --bg: #FFE9E3; --fg: #2B1410; --soft: #74463E; --accent: #C2281E; --frame: #2B1410; }
.room-peek    { --bg: #E2F3EA; --fg: #0F2219; --soft: #3E5248; --accent: #17703F; }
.room-rhythm  { --bg: #F3E4E7; --fg: #1B1B1A; --soft: #5F5557; --accent: #A6405A; --frame: #1B1B1A; }
.room-charge  { --bg: #000000; --fg: #FFFFFF; --soft: #A6A6A6; --accent: #FFFFFF; --frame: #1F1F1F; }
.room-pad     { --bg: #E4ECF7; --fg: #0F1B2D; --soft: #465468; --accent: #0A5FB4; }

.room-charge .room-link:hover { background: #D9D9D9; }
.room-charge .phone { box-shadow: 0 0 0 1px #2E2E2E; }

@media (prefers-color-scheme: dark) {
  .room-calorie { --bg: #241214; --fg: #FCEDE9; --soft: #D2ABA4; --accent: #FF8A7C; --frame: #0C0607; }
  .room-peek    { --bg: #0B1D15; --fg: #E8F2EC; --soft: #B0C4B9; --accent: #5FD597; }
  .room-rhythm  { --bg: #21171A; --fg: #F1F1EF; --soft: #B9AEB0; --accent: #EC97A6; --frame: #0B0809; }
  .room-pad     { --bg: #0E1622; --fg: #E9EFF7; --soft: #A9B6C6; --accent: #6CB2FF; }
  .room.room-charge { border-top: 1px solid #1F1F1F; border-bottom: 1px solid #1F1F1F; }
}

/* 들어올 때 한 번 올라온다 (지원하는 브라우저에서만, 움직임 줄이기를 켠 사람에게는 없다) */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .room-shot {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    @keyframes rise {
      from { transform: translateY(56px); }
      to { transform: translateY(0); }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* 글 구역 (기술, 논문) --------------------------------------------------- */

.block-in {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 148px) var(--gutter) clamp(64px, 9vw, 120px);
}

.block-line .block-in { border-top: 1px solid var(--line); }

.block-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.block-body {
  max-width: 33em;
  margin: clamp(20px, 3vw, 32px) 0 0;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--sub);
}

.eyebrow {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
}

.fine {
  max-width: 44em;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--sub);
}

/* 이름표 + 내용 줄 ------------------------------------------------------- */

.rows { margin-top: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  gap: 12px;
  padding: 20px 0 22px;
  border-top: 1px solid var(--line);
}

.row > dt {
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
}

.rows-tight { margin-top: 0; }
.rows-tight .row:first-child { border-top: 0; padding-top: 0; }

.row-used {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 15px;
}

.row-used-label { color: var(--sub); }

.used { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; }

.used a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}

.used a:hover { text-decoration-color: currentColor; }

@media (min-width: 760px) {
  .row {
    grid-template-columns: var(--label) minmax(0, 1fr);
    gap: 14px 24px;
    align-items: center;
  }

  .rows-stack .row-used { grid-column: 2; }
}

@media (min-width: 1040px) {
  .rows-stack .row { grid-template-columns: var(--label) minmax(0, 1fr) 17em; }
  .rows-stack .row-used { grid-column: auto; }
  .rows-stack .row-used-label { display: none; }
}

/* 숫자 ------------------------------------------------------------------ */

.nums {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.nums > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

.nums dt { margin-top: 4px; font-size: 15px; color: var(--sub); }

.nums strong {
  display: block;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.nums span { display: block; margin-top: 6px; font-size: 15px; color: var(--sub); }

@media (min-width: 760px) {
  .nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 논문의 숫자는 지표 이름이 위, 비교 대상이 아래 */
.nums-paper {
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 28px clamp(32px, 7vw, 96px);
  margin-top: clamp(36px, 5vw, 56px);
}

.nums-paper > div { flex-direction: column; justify-content: flex-start; }
.nums-paper dt { margin: 0 0 6px; font-weight: 600; }
.nums-paper strong { font-size: clamp(34px, 5vw, 60px); }

/* 논문 ------------------------------------------------------------------ */

.paper-title {
  max-width: 22em;
  margin: 12px 0 0;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.paper-meta { margin: 16px 0 0; font-size: 15px; font-weight: 600; }

.paper-desc { max-width: 36em; margin: 16px 0 0; color: var(--sub); }

.line-link {
  display: inline-block;
  margin-top: 32px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.line-link:hover { background: var(--ink); color: var(--paper); }

/* 제작 노트: 머리 -------------------------------------------------------- */

.work-hero-in {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) var(--gutter) clamp(48px, 7vw, 88px);
}

.back {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--soft);
  text-decoration: none;
}

.back::before { content: "←"; margin-right: 8px; }
.back:hover { color: var(--fg); }

.work-id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(40px, 7vw, 88px) 0 18px;
}

.work-id img {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

.work-id .room-kind { margin: 0; }

.work-hero .room-line { max-width: 20em; margin-top: clamp(20px, 3vw, 32px); }

.work-facts {
  display: grid;
  gap: 18px 40px;
  margin-top: clamp(36px, 5vw, 64px);
  padding-top: 22px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  font-size: 15px;
}

.work-facts dt { color: var(--soft); }
.work-facts dd { margin-top: 2px; font-weight: 600; }

@media (min-width: 760px) {
  .work-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 제작 노트: 본문 -------------------------------------------------------- */

.work-body {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) var(--gutter) clamp(56px, 8vw, 104px);
}

.sec {
  display: grid;
  gap: 20px;
  padding: clamp(36px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
}

.sec:first-child { border-top: 0; }

.sec-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.03em;
}

@media (min-width: 900px) {
  .sec { grid-template-columns: var(--label) minmax(0, 1fr); gap: 24px; }
}

.prose p {
  max-width: 36em;
  margin: 0 0 1em;
  font-size: clamp(17px, 1.45vw, 19px);
}

.prose p:last-child { margin-bottom: 0; }

/* 구조: 왼쪽에서 오른쪽으로 흐르는 상자들 */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.flow li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.flow li::after { content: "→"; color: var(--sub); font-weight: 400; }
.flow li:last-child::after { content: none; }

.flow span {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* 문제와 해결 */
.case { padding: 28px 0 30px; border-top: 1px solid var(--line); }
.case:first-child { padding-top: 0; border-top: 0; }
.case:last-child { padding-bottom: 0; }

.case h3 {
  margin: 0 0 18px;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.case dl { display: grid; gap: 14px; max-width: 46em; }

.case dl > div { display: grid; gap: 2px; }

.case dt { font-size: 14px; font-weight: 600; color: var(--sub); }

.case dd { color: var(--sub); }

.case .case-result dd { color: var(--ink); font-weight: 600; }

@media (min-width: 620px) {
  .case dl > div { grid-template-columns: 4em minmax(0, 1fr); gap: 16px; align-items: baseline; }
}

/* 다음 제작 노트 */
.next { display: block; text-decoration: none; }

.next-in {
  display: block;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter);
}

.next-label { display: block; font-size: 15px; font-weight: 600; color: var(--soft); }

.next-name {
  display: block;
  margin-top: 8px;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.next-name::after { content: " →"; font-weight: 400; }

.next-kind { display: block; margin-top: 10px; font-weight: 600; color: var(--accent); }

.next:hover .next-name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }

/* 바닥 ------------------------------------------------------------------ */

.foot { border-top: 1px solid var(--line); }

.foot-in {
  display: grid;
  gap: 18px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 44px var(--gutter) 56px;
  font-size: 15px;
  color: var(--sub);
}

.foot-name { margin: 0; font-weight: 700; color: var(--ink); }

.foot-facts { display: grid; gap: 4px; }
.foot-facts div { display: flex; gap: 12px; }
.foot-facts dt { min-width: 7.2em; }
.foot-facts dd { color: var(--ink); }
:lang(en) .foot-facts div { flex-wrap: wrap; gap: 0 12px; }
:lang(en) .foot-facts dt { min-width: 13em; }

.foot-copy { margin: 0; font-size: 14px; }

@media (min-width: 760px) {
  .foot-in { grid-template-columns: 1fr auto; align-items: end; }
  .foot-copy { grid-column: 2; grid-row: 1 / span 2; }
}
