:root {
  color-scheme: light;

  --haze: #f5e3dc;        /* 노을 아래 흐린 하늘: 페이지 바탕 */
  --ink: #2e2236;         /* 저녁 자줏빛 글자 */
  --ink-soft: #5b4866;
  --wood: #7a4127;        /* 안내판 나무 */
  --wood-dark: #4f2716;
  --wood-light: #8f4f2f;
  --cream: #fff1d6;       /* 안내판 위 글자 */
  --wheat: #f2b544;       /* 밀밭 금빛: 주요 행동 */
  --wheat-deep: #c98612;
  --leaf: #2f6b3a;        /* 성공 */
  --rust: #a3301f;        /* 실패 */

  --font-display: "Do Hyeon", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Gowun Dodum", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;

  --measure: 40rem;
}

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

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

body {
  margin: 0;
  background: var(--haze);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--wheat-deep);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 풍경과 안내판 ---------- */

.hero {
  padding: 0 0 2.5rem;
}

.hero__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  max-height: 38vh; /* 1366×768 노트북 첫 화면에서 안내판 버튼까지 보이게 */
  object-fit: cover;
  object-position: center 60%;
  /* 이미지가 늦게 뜰 때 보이는 노을색 바탕 */
  background: linear-gradient(#5a3a6b, #d9775a 55%, #f2b544);
}

.sign {
  position: relative;
  max-width: 46rem;
  margin: -3.5rem auto 0;
  margin-inline: max(16px, calc((100% - 46rem) / 2));
  padding: 2rem 2rem 1.75rem;
  color: var(--cream);
  border-radius: 6px;
  border: 3px solid var(--wood-dark);
  background:
    repeating-linear-gradient(
      to bottom,
      var(--wood) 0 3.25rem,
      rgb(79 39 22 / 0.3) 3.25rem calc(3.25rem + 2px),
      var(--wood-light) calc(3.25rem + 2px) 6.5rem,
      rgb(79 39 22 / 0.3) 6.5rem calc(6.5rem + 2px)
    );
  background-color: var(--wood-dark);
  box-shadow: 0 10px 0 -2px rgb(79 39 22 / 0.35);
}

/* 판자를 고정한 못 두 개 */
.sign::before,
.sign::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  width: 8px;
  height: 8px;
  background: var(--wood-dark);
}

.sign::before {
  left: 0.75rem;
}

.sign::after {
  right: 0.75rem;
}

.sign__title {
  font-size: clamp(2.5rem, 9vw, 4.25rem);
  letter-spacing: -0.01em;
  color: var(--wheat);
  text-shadow: 0 3px 0 var(--wood-dark);
}

.sign__lead {
  max-width: 34rem;
  margin: 0.75rem 0 1.75rem;
  font-size: 1.125rem;
}

.sign__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 40rem) {
  .sign__actions {
    grid-template-columns: 1fr 1fr;
  }
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.85rem 1.1rem;
  border-radius: 6px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action__label {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.2;
}

.action__value {
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.action:active {
  transform: translateY(2px);
}

.action--download {
  background: var(--wheat);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--wheat-deep);
}

.action--download:hover {
  background: #f6c665;
}

.action--copy {
  background: var(--wood-dark);
  color: var(--cream);
  border: 3px solid var(--cream);
}

.action--copy:hover {
  background: #5f3220;
}

.sign .action:focus-visible,
.sign a:focus-visible {
  outline-color: var(--wheat);
  outline-offset: 4px;
}

.action-note {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.copy-feedback:empty {
  display: none;
}

.copy-feedback {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--cream);
}

.copy-feedback[data-result="success"] {
  background: var(--leaf);
}

.copy-feedback[data-result="failure"] {
  background: var(--rust);
}

@media (max-width: 30rem) {
  .sign {
    margin-top: -2rem;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .hero__image {
    aspect-ratio: 4 / 3;
  }
}

/* 키가 낮은 가로 화면(1366×768 노트북 등): 안내판을 풍경 위로 더 올리고 줄인다 */
@media (min-width: 40rem) and (max-height: 50rem) {
  .sign {
    margin-top: -5rem;
    padding: 1.5rem 2rem 1.25rem;
  }

  .sign__title {
    font-size: clamp(2.5rem, 7vh, 3.5rem);
  }

  .sign__lead {
    margin: 0.5rem 0 1rem;
    line-height: 1.6;
  }
}

/* ---------- 본문 ---------- */

.guide {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem 16px 3rem;
}

.guide section + section {
  margin-top: 3.5rem;
}

.guide h2 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin-bottom: 1rem;
}

.guide p {
  margin: 0.5rem 0 0;
}

.checklist {
  margin: 0;
  padding-left: 1.25rem;
}

.checklist li::marker {
  color: var(--wheat-deep);
}

/* 화면에 보이는 버튼·메뉴 이름 */
strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05em;
}

.filename,
kbd {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-all;
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: rgb(46 34 54 / 0.08);
}

kbd {
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  background: var(--cream);
  font-weight: 700;
}

.callout {
  padding: 0.75rem 1rem;
  border-left: 6px solid var(--wheat-deep);
  background: rgb(255 241 214 / 0.7);
  border-radius: 0 6px 6px 0;
}

/* 설치 순서: 블록 숫자와 그 아래로 이어지는 울타리 선 */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps:focus {
  outline: none;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 2rem 3.75rem;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--ink);
  background: var(--wheat);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -5px 0 var(--wheat-deep);
}

.step::after {
  content: "";
  position: absolute;
  left: calc(1.25rem - 2px);
  top: 2.75rem;
  bottom: 0.25rem;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--wood-light) 0 10px, transparent 10px 16px);
}

.step:last-child {
  padding-bottom: 0;
}

.step:last-child::after {
  display: none;
}

.step h3 {
  font-size: 1.5rem;
  padding-top: 0.35rem;
}

/* 셰이더: 선택 단계라 별도 판으로 묶음 */
.shader {
  padding: 1.75rem 1.5rem;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(170deg, #4a3159, #2e2236);
  color: var(--cream);
}

.shader a {
  color: var(--cream);
}

.shader h2 {
  color: var(--wheat);
}

.shader-steps {
  margin: 1rem 0 0;
  padding-left: 1.5rem;
}

.shader-steps li + li {
  margin-top: 0.75rem;
}

.shader-steps li::marker {
  font-family: var(--font-display);
  color: var(--wheat);
}

.shader .filename {
  background: rgb(255 241 214 / 0.14);
}

.shader kbd {
  color: var(--ink);
}

.shader .callout {
  margin-top: 1.25rem;
  background: rgb(255 241 214 / 0.1);
  border-left-color: var(--wheat);
}

.shader :focus-visible {
  outline-color: var(--wheat);
}

.footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px 3rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  .action:active {
    transform: none;
  }
}
