/* 아이세 홈 — 공사 중 화면 · 404 화면 공용 스타일
   색은 모두 공용 테마(theme/theme.css) 변수에서 옵니다. 여기서 색 값을 직접 쓰지 않아요.
   글자 색은 테마가 대비를 보장하는 조합(바탕 · 면 · 노트 면 위 --ink · --ink-2)만 씁니다.
   디자인: 떠 있는 알약 메뉴 · 첫 화면 색 띠와 가벼운 종이 콜라주 · 노트 카드 · 여러 겹 그림자 */

/* 캐릭터 · 바리케이드 둘레 스티커 테두리와 그림 선 (밝기마다 테마 변수에서 계산) */
:root {
  --aise-edge: color-mix(in srgb, var(--ink) 82%, var(--hero-a));
  --aise-line: var(--canvas);
}
:root[data-mode="light"] {
  --aise-edge: var(--surface);
  --aise-line: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* 첫 칸(.hero)의 위 여백이 body 밖으로 새어 나가 한 화면짜리 404 가 살짝 스크롤되지 않게 */
  display: flow-root;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { display: block; flex: none; }
/* 모서리는 각 요소 모양을 그대로 따릅니다(공용 테마 단추 · 닫기 동그라미가 초점에서 네모로 바뀌지 않게).
   모서리가 없는 로고만 따로 둥글게 */
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.logo:focus-visible { border-radius: 10px; }

/* 무늬 정의용 SVG 는 자리를 차지하지 않게 */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.halftone-dot { fill: var(--scrap-a-dots); }
.ruled-line { fill: var(--scrap-line); }

/* 선 아이콘 공통 (선 굵기 통일) */
.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 큰 제목만 세리프(Hahmlet). 24px 보다 작은 글에는 쓰지 않아요 */
.serif {
  font-family: var(--font-serif);
  font-weight: 340;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
:root[data-mode="light"] .serif { font-weight: 400; }

/* ── 떠 있는 알약 메뉴 막대 ─────────────────────────── */
.nav {
  position: fixed;
  z-index: 40;
  top: 28px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(1040px, calc(100% - 96px));
  height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 24px;
  border-radius: 9999px;
  box-shadow: var(--sh-float);
}
/* 반투명 바탕 · 흐림은 뒤판(::before)에만. 막대 자체에 transform · backdrop-filter 를 걸면
   휴대폰에서 화면 기준(fixed)으로 뜨는 테마 고르기 판이 막대 기준으로 밀려나요 */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  padding: 9px 6px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.3;
}
.logo-sub { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-2); }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 4px; }
/* 테마 단추가 붙기 전에도 자리를 잡아 두어 메뉴가 들썩이지 않게 */
.picker-slot:empty { width: 92px; height: 44px; }

/* ── 첫 화면 위쪽: 색 띠 + 가벼운 콜라주 ───────────── */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 16px 16px 0;
  /* 아래쪽은 찢은 가장자리가 바탕색으로 덮으므로 위만 둥글게 */
  border-radius: 28px 28px 0 0;
  padding: 108px 24px 164px;
  text-align: center;
  background:
    radial-gradient(70% 60% at 50% 0%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--hero-a), var(--hero-b));
}
/* 종이 결 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  opacity: var(--grain-op);
  pointer-events: none;
}
/* 구름처럼 번지는 점 무늬 */
.cloud {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dots) 1.7px, transparent 2.1px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(closest-side, var(--ink) 30%, transparent 100%);
  mask-image: radial-gradient(closest-side, var(--ink) 30%, transparent 100%);
}
.cloud.c1 { width: 380px; height: 230px; top: 70px; right: -40px; }
.cloud.c2 { width: 300px; height: 190px; top: 220px; left: -60px; opacity: .8; }

/* 찢은 종이 조각: 왼쪽 점 무늬 색종이 · 흰 종이 / 오른쪽 줄 공책
   조각은 글자 대비 검사 대상이 아니어서, 어느 폭에서도 제목 · 안내 글과 겹치지 않게 둡니다
   (화면 폭에 따라 아래 미디어 쿼리에서 크기 · 위치를 바꿔요) */
.scrap {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  height: auto;
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--shadow-c) 14%, transparent));
}
.scrap-a { width: 300px; left: -40px; bottom: 44px; transform: rotate(-7deg); }
.scrap-c { width: 220px; left: 13%; bottom: 34px; transform: rotate(4deg); }
.scrap-b { width: 220px; right: 1.5%; bottom: -60px; transform: rotate(7deg); }
.scrap-a .fill { fill: var(--scrap-a); }
.scrap-a .dots { fill: url(#halftone); }
.scrap-c .fill { fill: var(--paper); }
.scrap-b .fill { fill: var(--scrap-b); }
.scrap-b .lines { fill: url(#ruled); }

/* 띠 아래 찢은 가장자리 */
.tear { position: absolute; z-index: -1; left: 0; bottom: -1px; width: 100%; height: 150px; pointer-events: none; }
.tear .p { fill: var(--paper); }
.tear .c { fill: var(--canvas); }

/* ── 캐릭터 ────────────────────────────────────────── */
/* 정사각형 무대. 화면이 낮으면 함께 줄어듭니다 */
.stage {
  position: relative;
  width: clamp(210px, min(26vw, 31vh), 280px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.stage--small { width: clamp(190px, min(24vw, 30vh), 240px); }

.aise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 그림의 짙은 선이 바탕에 묻히지 않게 스티커처럼 테두리 */
  filter:
    drop-shadow(2.5px 0 0 var(--aise-edge)) drop-shadow(-2.5px 0 0 var(--aise-edge))
    drop-shadow(0 2.5px 0 var(--aise-edge)) drop-shadow(0 -2.5px 0 var(--aise-edge));
  animation: float 6.5s ease-in-out infinite;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

/* 발밑 그림자 — 캐릭터가 떠오르면 조금 작아집니다 */
.ground {
  position: absolute;
  left: 27%;
  width: 40%;
  bottom: -1%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--shadow-c) 45%, transparent), transparent);
  animation: ground 6.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes ground {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(.86); opacity: .65; }
}

/* 공사 중 바리케이드 (꾸밈) */
.sign {
  position: absolute;
  right: -17%;
  bottom: 0;
  width: 37%;
  height: auto;
  filter:
    drop-shadow(2px 0 0 var(--aise-edge)) drop-shadow(-2px 0 0 var(--aise-edge))
    drop-shadow(0 2px 0 var(--aise-edge)) drop-shadow(0 -2px 0 var(--aise-edge));
}
.sign-lines { fill: none; stroke: var(--aise-line); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.sign-leg { fill: var(--line-2); }
.sign-board { fill: url(#sign-stripes); }
.sign-stripe-a { fill: var(--warning); }
.sign-stripe-b { fill: var(--warning-bg); }
.sign-lamp { fill: var(--warning); }

/* ── 제목 ─────────────────────────────────────────── */
.title {
  margin-top: 18px;
  font-size: clamp(34px, 2.6vw + 22px, 56px);
  text-wrap: balance;
}
.lead {
  margin-top: 14px;
  font-size: 19px;
  color: var(--ink-2);
  text-wrap: balance;
}

/* ── 바로가기: 앱 창처럼 떠 있는 종이 판 + 노트 카드 ── */
.board {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: -112px auto 0;
  padding: 0 16px 56px;
}
.board-in {
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 30px;
  padding: 14px 24px 24px;
  box-shadow: var(--sh-float);
}
/* 창 윗줄: 점 세 개 · 가운데 탭 */
.win-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 40px;
  margin: 0 -8px 16px;
}
.win-dots { display: flex; gap: 8px; }
.win-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--n-pink); }
.win-dots i:nth-child(2) { background: var(--n-yellow); }
.win-dots i:nth-child(3) { background: var(--n-green); }
.win-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 7px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: var(--sh-note);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.win-tab .ico { color: var(--ink-2); }

/* 넉 장을 한 줄로 늘어놓으면 흔한 기능 카드처럼 보여서, 넓은 화면에서도 두 장씩 큰 노트로 */
.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.links li { display: flex; min-width: 0; }

/* 노트 카드(기준 시안의 노트): 세리프 제목 + 화살표 동그라미, 제목 아래 밑줄, 그 아래 설명.
   기본은 흰 종이, 색 노트만 굵은 색 테두리 */
.note {
  --nc: var(--line);
  --nb: var(--surface);
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 22px;
  background: var(--nb);
  color: var(--ink);
  box-shadow: var(--sh-note);
  transition: transform .18s ease, box-shadow .18s ease;
}
.note.pink, .note.yellow { border: 5px solid var(--nc); padding: 18px 20px 16px; }
.note.pink { --nc: var(--n-pink); --nb: var(--n-pink-bg); }
.note.yellow { --nc: var(--n-yellow); --nb: var(--n-yellow-bg); }
.note:hover { transform: translateY(-3px); box-shadow: var(--sh-float); }
/* 초점 고리는 카드에서 넉넉히 띄워서(사이에 바탕색이 보이게) 굵은 색 테두리와 헷갈리지 않게.
   화살표 동그라미도 마우스를 올렸을 때처럼 채워집니다 */
.note:focus-visible { outline-offset: 7px; }

.note-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid color-mix(in srgb, var(--nc) 60%, transparent);
}
.note-t {
  flex: 1;
  min-width: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.note-go {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  transition: background-color .15s, color .15s, transform .15s;
}
.note-go .ico { width: 18px; height: 18px; }
.note:hover .note-go,
.note:focus-visible .note-go { background: var(--btn); color: var(--btn-ink); transform: rotate(-12deg); }
.note-d {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ── 404 ───────────────────────────────────────────── */
/* 바로가기 판이 없으니 색 띠가 화면을 채우고 내용은 가운데로 */
.hero--404 {
  min-height: calc(100vh - 16px);
  min-height: calc(100dvh - 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 150px;
}
.btn {
  margin-top: 28px;
  min-height: 52px;
  padding: 0 26px 0 22px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--sh-btn);
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 20px; height: 20px; }

/* ── 화면 폭에 따라 ─────────────────────────────────── */
/* 태블릿: 제목 · 안내 글이 화면 폭에 비해 넓어서, 데스크톱 자리 그대로면 콜라주 조각이 글자 밑으로 들어가요.
   조각을 화면 폭에 맞춰 작게 줄여 띠의 양쪽 가장자리로 붙이고, 가운데 흰 종이와 왼쪽 구름 점은 숨깁니다 */
@media (min-width: 761px) and (max-width: 1199px) {
  .cloud.c2, .scrap-c { display: none; }
  .scrap-a { width: calc(30vw - 80px); left: -40px; bottom: 44px; }
  .scrap-b { width: calc(26vw - 70px); right: -40px; bottom: calc(300px - 34vw); }
}

@media (max-width: 760px) {
  .nav { top: 14px; width: calc(100% - 32px); height: 58px; padding: 0 6px 0 16px; }
  .logo { font-size: 18px; gap: 7px; }
  .logo-sub { font-size: 15px; }

  .hero { margin: 8px 8px 0; border-radius: 24px 24px 0 0; padding: 96px 16px 150px; }
  .hero--404 { min-height: calc(100vh - 8px); min-height: calc(100dvh - 8px); padding-bottom: 130px; }
  .title { margin-top: 16px; }
  .lead { margin-top: 12px; font-size: 17px; }
  .cloud.c1 { width: 240px; height: 170px; top: 64px; right: -70px; }
  .cloud.c2 { display: none; }
  /* 안내 글 둘째 줄과 띄우려고 조각을 판 쪽으로 내림 */
  .scrap-a { width: 170px; left: -50px; bottom: 6px; }
  .scrap-c { display: none; }
  .scrap-b { width: 140px; right: -40px; bottom: -40px; }
  .tear { height: 120px; }

  /* 휴대폰: 판 없이 노트 카드만 한 줄씩 */
  .board { margin-top: -96px; padding-bottom: 40px; }
  .board-in { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .win-bar { display: none; }
  .links { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .note { min-height: 0; padding: 18px 18px 16px 20px; border-radius: 20px; }
  .note.pink, .note.yellow { border-width: 4px; padding: 15px 15px 13px 17px; }
  .note-h { padding-bottom: 10px; margin-bottom: 10px; }
  .note-t { font-size: 24px; }
  .note-go { width: 36px; height: 36px; }
}

/* 가로로 눕힌 휴대폰처럼 낮은 화면: 메뉴 막대를 작게 줄이고, 화면에 붙박지 않고 함께 올라가게 */
@media (max-height: 500px) {
  .nav { position: absolute; top: 14px; height: 58px; padding: 0 6px 0 16px; }
  .hero { padding-top: 88px; }
  /* 위 여백이 줄어 올라온 제목에 오른쪽 구름 점이 닿지 않게 */
  .cloud.c1 { top: 40px; height: 190px; }
}

/* 움직임 줄이기를 켠 사람에게는 둥실 떠오름 · 들썩임을 모두 멈춥니다 */
@media (prefers-reduced-motion: reduce) {
  .aise, .ground { animation: none; }
  .note, .note-go, .btn { transition: none; }
  .note:hover, .note:hover .note-go, .note:focus-visible .note-go, .btn:active { transform: none; }
}
