/* eduwise.kr 1/2 — 바탕 · 공용 부품 · 머리 · 첫 화면 · 도구 띠. 값은 tokens.css에서 가져온다. */

:root {
  --edge-dark: color-mix(in srgb, var(--on-brand) 14%, transparent);
  --edge-light: color-mix(in srgb, var(--ink) 16%, transparent);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

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

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.78;
  letter-spacing: -0.015em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(24px, 3.5vw, 48px);
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--signal);
  color: var(--ink);
  border-radius: var(--radius-s);
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* 문장마다 줄을 나누고(마침표 하드랩), 한 문장 안에서는 줄 길이를 고르게 */
.sent {
  display: block;
  text-wrap: balance;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* 종이 입자 — 크림 면에 얹는다 */
.grain {
  position: relative;
  isolation: isolate;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--noise);
  opacity: 0.07;
  mix-blend-mode: multiply;
}

/* ── 공용 부품 ──────────────────────────── */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 7px 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--on-brand) 42%, transparent);
  background: color-mix(in srgb, var(--night) 32%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--on-brand);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
  white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.pill-btn i {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--signal);
  color: var(--ink);
  font-style: normal;
  transition: transform var(--dur-2) var(--ease-out);
}

.pill-btn:hover,
.pill-btn:focus-visible {
  border-color: var(--on-brand);
  background: color-mix(in srgb, var(--night) 55%, transparent);
}

.pill-btn:hover i,
.pill-btn:focus-visible i {
  transform: translateX(2px);
}

/* 크림 면 위의 진한 버튼(첫 화면 왼쪽) */
.pill-btn-ink {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-brand);
}

.pill-btn-ink:hover,
.pill-btn-ink:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}

.js .hero-cta {
  animation: fade-in 0.9s var(--ease-out) both 0.6s;
}

.pill-btn-s {
  height: 44px;
  padding-left: 18px;
  font-size: 0.875rem;
}

.pill-btn-s i {
  width: 30px;
  height: 30px;
}

.text-link {
  font-weight: 600;
  padding-bottom: 2px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color var(--dur-1) var(--ease-out);
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration-color: var(--signal);
}

/* ── 머리: 첫 화면을 지나면 내려온다 ─────── */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  background: color-mix(in srgb, var(--night) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--edge-dark);
  color: var(--on-brand);
  transform: translateY(-100%);
  transition: transform var(--dur-2) var(--ease-out);
}

.top.is-shown,
.top:focus-within {
  transform: none;
}

html:not(.js) .top {
  position: sticky;
  transform: none;
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}

.top-logo {
  font-size: 1.5rem;
  color: var(--on-brand);
}

.top-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 0.9375rem;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: color-mix(in srgb, var(--on-brand) 75%, transparent);
  transition: color var(--dur-1) var(--ease-out);
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--on-brand);
}

/* ── 첫 화면 ─────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;
  min-height: 720px;
  display: grid;
  grid-template-columns: 44% 56%;
  overflow: hidden;
  background: var(--night);
}

.hero-left {
  display: flex;
  flex-direction: column;
  padding: 48px clamp(20px, 3.6vw, 56px);
  background: var(--paper);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-brand .mono {
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 66%, transparent);
}

.hero-mark {
  border-radius: var(--radius-s);
}

/* 첫 문장 — 줄마다 아래에서 올라온다 */
.hero-claim {
  position: relative;
  z-index: 4;
  margin-top: clamp(24px, 6svh, 96px);
  max-width: 470px;
}

.hero-claim h1 {
  font-size: clamp(2.25rem, 1rem + 2.6vw, 3.5rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--ink);
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line > span {
  display: block;
}

.js .line > span {
  animation: line-up 0.9s var(--ease-out) both;
}

.js .line:nth-child(2) > span {
  animation-delay: 0.12s;
}

@keyframes line-up {
  from {
    transform: translateY(105%);
  }
}

/* 첫 화면 세 줄 — 하는 일을 한눈에 */
.hero-points {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 28px;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-points li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--signal);
}

.js .hero-points {
  animation: fade-in 0.9s var(--ease-out) both 0.45s;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.hero-right {
  position: relative;
  color: var(--on-brand);
  padding: 36px clamp(16px, 3vw, 48px);
  overflow: hidden;
}

/* 사진은 천천히 다가온다 */
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.js .hero-photo {
  animation: drift 14s var(--ease-out) both;
}

@keyframes drift {
  from {
    transform: scale(1.14);
    opacity: 0.4;
  }
}

.hero-right::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--night) 60%, transparent), transparent 40%),
    linear-gradient(0deg, color-mix(in srgb, var(--night) 66%, transparent), transparent 34%);
}

/* 떨어지는 픽셀 — site.js가 그린다 */
.pixels {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 거대 워드마크: 두 장을 겹쳐 분할선(44%) 왼쪽은 잉크, 오른쪽은 크림으로 자른다 */
.giant-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.giant-ink {
  clip-path: inset(0 56% 0 0);
}

.giant-cream {
  clip-path: inset(0 0 0 44%);
}

.giant {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, -50%);
  font-size: min(clamp(4.5rem, 1rem + 12.5vw, 15rem), 23svh);
}

.giant-ink .giant {
  color: var(--ink);
}

/* 사진 위 wise가 빛에 묻히지 않게 둘레에 어둠을 깐다 */
.giant-cream .giant {
  color: var(--on-brand);
  text-shadow: 0 0 0.35em color-mix(in srgb, var(--night) 75%, transparent), 0 0.04em 0.12em color-mix(in srgb, var(--night) 60%, transparent);
}

.giant .wm-wise {
  background-size: 100% 0.07em;
}

.js .giant {
  animation: rise 1.2s var(--ease-out) both 0.2s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, -36%);
    filter: blur(8px);
  }
}

.scroll-cue {
  position: absolute;
  z-index: 4;
  left: clamp(20px, 3.6vw, 56px);
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 44px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  overflow: hidden;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1px;
  height: 16px;
  background: var(--signal);
  animation: cue 1.8s var(--ease-out) infinite;
}

@keyframes cue {
  from {
    transform: translateY(-16px);
  }
  to {
    transform: translateY(44px);
  }
}

/* 낮은 화면에서도 문구와 워드마크 사이를 비운다 */
@media (min-width: 861px) and (max-height: 860px) {
  .hero-claim {
    margin-top: 32px;
  }

  .giant {
    top: 72%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .giant,
  .js .hero-photo,
  .js .line > span,
  .js .hero-points,
  .js .hero-cta,
  .scroll-cue i::after {
    animation: none;
  }
}
