/* 알고나대 랜딩: 하나의 모양(나대의 A자 몸통)으로 그림 틀, 버튼, 글머리, 첫 화면을 만든다. */
:root {
  --gold: #F3B82D;
  --red: #791F23;
  --ivory: #F3E9D6;
  --ivory-2: #EADDC4;
  --ink: #242019;
  --antique: #B38A42;
  --muted: #4F473B;

  --ground: var(--ivory);
  --text: var(--ink);

  --display: "Hahmlet", "Pretendard Variable", serif;
  --body: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;

  /* 다섯 크기 */
  --s1: clamp(52px, 7vw, 112px);
  --s2: clamp(40px, 5.2vw, 84px);
  --s3: clamp(24px, 2.4vw, 34px);
  --s4: 18px;
  --s5: 15px;

  --m: clamp(16px, 4vw, 56px);       /* 바깥 여백 */
  --gap: clamp(120px, 14vw, 200px);  /* 섹션 사이 */

  /* 나대의 A: 윗변이 좁은 사다리꼴 + 아래 가운데 홈 */
  --a-shape: polygon(28% 0, 72% 0, 100% 100%, 62% 100%, 56% 80%, 44% 80%, 38% 100%, 0 100%);
  /* 버튼: 같은 사다리꼴, 홈 없이 */
  --a-btn: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--s4);
  line-height: 1.55;
  word-break: keep-all;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; margin: 0; letter-spacing: -0.03em; line-height: 1.02; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--ink); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 34px;
  font: 800 17px/1 var(--body); text-decoration: none; border: 0; cursor: pointer;
  clip-path: var(--a-btn);
  transition: transform .18s ease, background-color .18s ease;
}
.btn-sm { min-height: 44px; padding: 0 24px; font-size: var(--s5); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #FFC844; }
.btn-ink { background: var(--ink); color: var(--ivory); }
.btn-ink:hover { background: #3A332A; }
.btn:active { transform: translateY(2px) scale(.98); }
.btn-wide { width: 100%; min-height: 58px; }
.link {
  font: 700 var(--s4)/1.3 var(--body); color: var(--ink); background: none; border: 0; padding: 6px 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
  transition: color .15s ease;
}
.link:hover { color: var(--red); }

/* ---------- 머리 막대 ---------- */
.bar {
  position: absolute; z-index: 10; inset: 0 0 auto 0;
  display: flex; align-items: center; gap: 28px;
  padding: 22px var(--m);
}
.mark { font: 900 32px/1 var(--display); letter-spacing: -0.03em; text-decoration: none; color: var(--ink); margin-right: auto; }
.nav { display: flex; gap: 26px; }
.nav a { font-weight: 700; font-size: var(--s5); text-decoration: none; color: var(--ivory); transition: opacity .15s; }
.nav a:hover { opacity: .75; }

/* ---------- 첫 화면 ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px;
  padding: 120px var(--m) 64px; align-items: center;
}
.hero-a {
  position: absolute; z-index: 0;
  width: 120vh; height: 120vh; max-width: none;
  left: calc(78% - 60vh); top: calc(55% - 60vh);
  fill: var(--red);
}
.hero-copy { position: relative; z-index: 2; grid-column: 1 / span 6; }
.hero h1 { font-size: var(--s1); line-height: 1.0; }
.lede { margin-top: 36px; font-size: var(--s4); line-height: 1.6; max-width: 32em; font-weight: 500; }
.actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px 30px; }

.quiz {
  position: relative; z-index: 3; grid-column: 8 / span 4; align-self: center;
  background: var(--ivory); color: var(--ink);
  padding: 26px 26px 24px; border-radius: 22px;
  box-shadow: 0 6px 0 #C8B48D; /* taste-skill-ignore: 앱 카드의 판 두께(data-ui) */
}
.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.quiz-kind { font-weight: 800; font-size: 15px; color: var(--red); }
.quiz-clock {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: var(--gold); color: var(--ink); font: 900 18px/1 var(--display);
  clip-path: var(--a-btn);
}
.quiz-q { margin-top: 16px; font-size: var(--s4); line-height: 1.45; font-weight: 800; min-height: 4.35em; }
.quiz-choices { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  height: 92px; border: 0; cursor: pointer;
  font: 900 52px/1 var(--display); color: var(--ink); background: var(--ivory-2);
  clip-path: var(--a-btn);
  transition: transform .15s ease, background-color .15s ease;
}
.choice:hover { background: var(--gold); }
.choice:active { transform: scale(.96); }
.choice.right { background: var(--gold); }
.choice.wrong { background: var(--red); color: var(--ivory); }
.choice[disabled] { cursor: default; }
.quiz-verdict { margin-top: 18px; }
.verdict-line { font: 900 var(--s3)/1.2 var(--display); letter-spacing: -0.02em; }
.verdict-why { margin-top: 10px; font-size: var(--s5); line-height: 1.55; }
.verdict-src { margin-top: 8px; font-size: var(--s5); color: var(--muted); }
.quiz-next { margin-top: 10px; font-size: var(--s5); }
.hero-nade {
  position: absolute; z-index: 2; width: clamp(150px, 15vw, 240px); right: calc(var(--m) + 2vw); bottom: -8px;
  transform-origin: 50% 100%;
}

/* ---------- 한 판 ---------- */
.match { padding: var(--gap) var(--m) 0; }
.match h2 { font-size: var(--s2); margin-bottom: 64px; }
.stagebar { display: flex; gap: 6px; height: 22vh; min-height: 150px; }
.seg { min-width: 12%; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.seg-time { font: 900 var(--s3)/1 var(--body); letter-spacing: -0.02em; }
.seg-name { font-weight: 800; font-size: var(--s4); }
.seg-gold { background: var(--gold); color: var(--ink); }
.seg-red { background: var(--red); color: var(--ivory); }
.seg-ink { background: var(--ink); color: var(--ivory); }
.seg-antique { background: var(--antique); color: var(--ink); }
.seg-notes { display: flex; gap: 6px; margin-top: 18px; }
.seg-notes p { min-width: 12%; font-size: var(--s4); line-height: 1.5; padding-right: 18px; }
.match-proof {
  margin-top: 96px; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; align-items: end;
}
.phone { margin: 0; grid-column: span 3; }
.phone video, .phone img { width: 100%; border-radius: 34px; background: var(--ink); }
.phone figcaption { margin-top: 14px; font-size: var(--s5); color: var(--muted); }
.match-say { grid-column: 8 / span 5; align-self: center; }
.statement { font: 900 var(--s3)/1.3 var(--display); letter-spacing: -0.02em; margin-bottom: 22px; }

/* ---------- 수업 ---------- */
.lessons {
  margin-top: var(--gap); background: var(--red); color: var(--ivory);
  display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh;
}
.plate { display: grid; place-items: center; padding: 64px 20px 64px var(--m); }
.plate-img { width: min(100%, 640px); aspect-ratio: 1; object-fit: cover; clip-path: var(--a-shape); }
.lesson-side { display: flex; flex-direction: column; justify-content: space-between; padding: 64px var(--m) 64px 20px; gap: 48px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.tab {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font: 700 var(--s4)/1.3 var(--body); color: #D9B9A6;
  transition: color .15s;
}
.tab:hover { color: var(--ivory); }
.tab[aria-selected="true"] { color: var(--gold); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.lesson-body h2 { font-size: var(--s2); }
.lesson-title { margin-top: 40px; font-size: var(--s3); color: var(--gold); letter-spacing: -0.02em; }
.lesson-text { margin-top: 18px; font-size: var(--s4); line-height: 1.6; max-width: 34ch; }
.lesson-meta { margin-top: 22px; font-size: var(--s5); line-height: 1.6; max-width: 42ch; color: #F0DCC8; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell {
  height: 72px; display: grid; place-items: center; border: 0; cursor: pointer; text-decoration: none;
  font: 800 17px/1.2 var(--body); clip-path: var(--a-btn); transition: transform .15s, background-color .15s;
}
.cell:active { transform: scale(.97); }
.cell-ink { background: var(--ink); color: var(--ivory); }
.cell-ink:hover { background: #3A332A; }
.cell-tone { background: var(--gold); color: var(--ink); }
.cell-tone:hover { background: #FFC844; }

/* ---------- 시대 ---------- */
.eras { padding: 8px; background: var(--ivory); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.tile-word { font: 900 clamp(44px, 6.4vw, 110px)/1 var(--display); letter-spacing: -0.04em; text-align: center; padding: 0 6%; }
.tile-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 15px; }
.t-red { background: var(--red); color: var(--ivory); }
.t-gold { background: var(--gold); color: var(--ink); }
.t-ink { background: var(--ink); color: var(--gold); }
.t-ivory { background: var(--ivory-2); color: var(--red); }
.t-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.t-photo:hover img { transform: scale(1.04); }
.tile h2.tile-word { font-size: clamp(40px, 5.2vw, 84px); }

/* ---------- 매일 ---------- */
.habits { margin-top: var(--gap); }
.band {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  min-height: 20vh; padding: 28px var(--m);
  background: var(--ground); transition: background-color .35s ease;
}
.band-line { font-size: clamp(30px, 3.6vw, 58px); color: #6B6152; transition: color .3s; }
.band-more { max-height: 0; overflow: hidden; opacity: 0; font-size: var(--s4); line-height: 1.55; max-width: 56ch; transition: max-height .4s ease, opacity .3s ease, margin .3s; }
.band.on .band-line { color: inherit; }
.band.on .band-more { max-height: 6em; opacity: 1; margin-top: 12px; }
.band.on[data-color="gold"] { background: var(--gold); color: var(--ink); }
.band.on[data-color="red"] { background: var(--red); color: var(--ivory); }
.band.on[data-color="ink"] { background: var(--ink); color: var(--ivory); }
.band.on[data-color="antique"] { background: var(--antique); color: var(--ink); }
.band.on[data-color="ink"] .band-line, .band.on[data-color="red"] .band-line { color: var(--ivory); }
.switch {
  position: relative; width: 2.4em; height: 1.3em; font-size: clamp(30px, 3.6vw, 58px);
  border: 0; border-radius: 999px; background: #CDBFA5; cursor: pointer; transition: background-color .25s;
}
.switch span { position: absolute; top: .12em; left: .12em; width: 1.06em; height: 1.06em; border-radius: 50%; background: var(--ivory); transition: transform .25s ease; }
.band.on .switch { background: var(--ink); }
.band.on[data-color="ink"] .switch { background: var(--gold); }
.band.on .switch span { transform: translateX(1.1em); }
.band.on[data-color="ink"] .switch span { background: var(--ink); }

/* ---------- 묻고 답하기 ---------- */
.faq { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; }
.faq h2 { grid-column: 3 / span 8; font-size: var(--s2); margin-bottom: 56px; }
.drawer { grid-column: 3 / span 8; display: flex; flex-direction: column; }
.card { --i: 0; position: relative; }
.card:nth-child(2) { --i: 1; }
.card:nth-child(3) { --i: 2; }
.card:nth-child(4) { --i: 3; }
.card:nth-child(5) { --i: 4; }
.card-head {
  width: 100%; text-align: left; border: 0; cursor: pointer; padding: 0; background: none; color: inherit; font: inherit; display: block;
}
.card-tab {
  display: inline-flex; align-items: center; height: 40px; width: min(200px, 26%); margin-left: calc(var(--i) * 18.5%); padding: 0 22px;
  font-weight: 800; font-size: var(--s5); background: var(--card); color: var(--card-ink);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}
.card-q { display: block; background: var(--card); color: var(--card-ink); padding: 20px 28px 26px; font-weight: 800; font-size: var(--s4); line-height: 1.4; }
.card-a { background: var(--card); color: var(--card-ink); display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.card-a p { overflow: hidden; padding: 0 28px; font-size: var(--s4); line-height: 1.65; max-width: 56ch; }
.card.open .card-a { grid-template-rows: 1fr; }
.card.open .card-a p { padding-bottom: 30px; }
.c-gold { --card: var(--gold); --card-ink: var(--ink); }
.c-ivory { --card: var(--ivory-2); --card-ink: var(--ink); }
.c-red { --card: var(--red); --card-ink: var(--ivory); }
.c-ink { --card: var(--ink); --card-ink: var(--ivory); }
.card-head:hover .card-q { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ---------- 마무리 ---------- */
.cta {
  margin-top: 140px; background: var(--gold); color: var(--ink);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; align-items: center; padding: 120px var(--m);
}
.cta-copy { grid-column: 1 / span 6; }
.cta-copy h2 { font-size: var(--s2); line-height: 1; }
.cta-copy p { margin-top: 26px; font-size: var(--s4); line-height: 1.6; max-width: 34ch; font-weight: 500; }
.dialog {
  grid-column: 8 / span 4; align-self: center; width: 100%; max-width: 440px; justify-self: start;
  background: var(--ivory); padding: 28px; border-radius: 22px; box-shadow: 0 6px 0 #B98C1E; /* taste-skill-ignore: 앱 창의 판 두께(data-ui) */
}
.dialog-title { font: 900 var(--s3)/1.2 var(--display); letter-spacing: -0.02em; }
.field { display: block; margin-top: 22px; }
.field span { display: block; font-weight: 800; font-size: 15px; margin-bottom: 8px; color: var(--muted); }
.field input {
  width: 100%; height: 56px; padding: 0 16px; font: 700 19px/1 var(--body); color: var(--ink);
  background: #FFF8EA; border: 2px solid #D8C7A4; border-radius: 12px;
}
.field input:focus { outline: none; border-color: var(--ink); }
.seg-choice { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; background: var(--ivory-2); border-radius: 12px; padding: 4px; }
.sc { height: 46px; border: 0; border-radius: 9px; background: none; font: 800 16px/1 var(--body); color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.sc.on { background: var(--ink); color: var(--ivory); }
.dialog-preview { margin: 18px 0; font-size: 15px; color: var(--muted); }
.dialog-preview strong { color: var(--ink); }

/* ---------- 바닥 ---------- */
.foot { background: var(--ink); color: var(--ivory); padding: 64px var(--m) 32px; }
.blocks { display: block; width: 100%; height: auto; max-height: 40svh; }
.foot-links { margin-top: 56px; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; row-gap: 32px; }
.foot-links > div { grid-column: span 2; display: flex; flex-direction: column; gap: 8px; }
.foot-links .foot-note { grid-column: 9 / span 4; }
.foot-h { font: 800 15px/1.4 var(--body); letter-spacing: 0; color: var(--gold); margin-bottom: 4px; }
.foot-links a { font-size: 15px; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-note p { font-size: 15px; line-height: 1.6; color: #D8CCB6; }
.foot-last { margin-top: 48px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }

/* ---------- 등장 ---------- */
.rise { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
.rise.in { opacity: 1; transform: none; }
.shutter { clip-path: inset(0 0 0 100%); }
.shutter.in { animation: shutter 1.1s cubic-bezier(.7,0,.2,1) forwards; }
@keyframes shutter { to { clip-path: inset(0 0 0 0); } }
.hero-a { animation: a-in 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes a-in { from { transform: translateX(14vw) rotate(4deg); } to { transform: none; } }
.hero-nade { animation: nade-in .9s .5s cubic-bezier(.3,1.4,.4,1) both, nade-sway 5s 1.6s ease-in-out infinite; }
@keyframes nade-in { from { transform: translateY(110%) rotate(-6deg); } to { transform: none; } }
@keyframes nade-sway { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-2.5deg); } }
.quiz.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.02); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; transform: none; }
  .shutter { clip-path: none; }
}

/* ---------- 태블릿 ---------- */
@media (max-width: 1080px) {
  .quiz { grid-column: 7 / span 6; }
  .hero-copy { grid-column: 1 / span 6; }
  .phone { grid-column: span 4; }
  .match-say { grid-column: 1 / -1; margin-top: 56px; }
  .faq h2, .drawer { grid-column: 1 / -1; }
  .cta-copy { grid-column: 1 / span 6; }
  .dialog { grid-column: 7 / span 6; }
}

/* ---------- 휴대폰 ---------- */
@media (max-width: 760px) {
  :root { --gap: 104px; }
  .nav { display: none; }
  .mark { font-size: 26px; }
  .hero { display: block; padding: 96px 16px 0; min-height: auto; }
  .hero-a { width: 130vw; height: 130vw; left: -15vw; top: auto; bottom: -10vw; }
  .hero h1 { font-size: 13vw; }
  .lede { margin-top: 22px; }
  .actions { margin-top: 26px; }
  .quiz { margin: 56px 0 0; padding: 22px 20px; }
  .hero-nade { position: relative; width: 44vw; right: auto; bottom: auto; margin: 24px 0 0 auto; }
  .match h2 { margin-bottom: 36px; font-size: 11vw; }
  .stagebar { flex-direction: column; height: auto; }
  .seg { min-height: 72px; flex-basis: auto; padding: 16px; }
  .seg-time { font-size: 20px; }
  .seg-gold { height: 160px; } .seg-red { height: 190px; } .seg-ink { height: 160px; } .seg-antique { height: 72px; }
  .seg-notes { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
  .seg-notes p { padding-right: 0; }
  .match-proof { margin-top: 72px; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .phone { grid-column: span 1; }
  .phone video, .phone img { border-radius: 22px; }
  .match-say { grid-column: 1 / -1; }
  .lessons { grid-template-columns: 1fr; }
  .plate { padding: 40px 16px 0; }
  .lesson-side { padding: 32px 16px 48px; }
  .lesson-body h2 { font-size: 10vw; }
  .cells { grid-template-columns: 1fr; }
  .cell { height: 60px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 6px; }
  .eras { padding: 6px; }
  .tile-word { font-size: 12vw; }
  .tile h2.tile-word { font-size: 10vw; }
  .tile-cap { font-size: 13px; bottom: 12px; }
  .band { min-height: 132px; padding: 22px 16px; }
  .band-line { font-size: 6.4vw; }
  .switch { font-size: 26px; }
  .faq { display: block; }
  .faq h2 { font-size: 11vw; margin-bottom: 36px; }
  .card-tab { width: 30%; margin-left: calc(var(--i) * 17.5%); padding: 0 14px; }
  .card-q { padding: 16px 20px 20px; }
  .card-a p { padding: 0 20px; }
  .cta { display: block; padding: 72px 16px; }
  .cta-copy { padding-bottom: 40px; }
  .cta-copy h2 { font-size: 11vw; }
  .dialog { max-width: none; }
  .foot-links { grid-template-columns: 1fr 1fr; }
  .foot-links > div, .foot-links .foot-note { grid-column: span 1; }
  .foot-links .foot-note { grid-column: 1 / -1; }
}
