/* ==========================================================================
   오름 건축 — 스크롤 비행 데모
   색, 글꼴, 간격, 부품 모양은 design.md(검은 영화관)의 값만 쓴다.
   ========================================================================== */

:root {
  --canvas: #000000;
  --surface: #0d0d0d;
  --ink: #ffffff;
  --body: #cccccc;
  --muted: #999999;
  --faint: #666666;
  --line: #262626;
  --line-strong: #3a3a3a;
  --error: #e8a08f;

  --font: "Noto Sans KR", sans-serif;

  /* 큰 문구 하나의 크기를 비행 자막과 상담 제목이 함께 쓴다. */
  --display: clamp(2.4rem, 6vw, 6rem);
  --small: 0.8125rem;
  --track: 0.12em;

  --header-h: 56px;
  --gutter: 64px;
  --section: 120px;

  --swap: 200ms ease-out;

  /* 가독성용 어두운 막 두 곳. 색은 검정의 투명도 변화뿐이다. */
  --film: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.72) 24%, rgba(0, 0, 0, 0.4) 44%, rgba(0, 0, 0, 0) 72%);
  --film-top: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.56) 40%, rgba(0, 0, 0, 0));
}

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

html {
  scroll-padding-top: var(--header-h);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--canvas);
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--canvas);
  font-size: var(--small);
  font-weight: 500;
  letter-spacing: var(--track);
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* 버튼 ---------------------------------------------------------------------
   모서리가 둥근 것은 이 버튼 하나뿐이다. 바탕 없이 흰 선만 두르고,
   마우스나 키보드가 닿으면 흰 바탕에 검은 글자로 뒤집힌다. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 32px;
  border: 1px solid var(--ink);
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--swap), color var(--swap);
}

.button:hover,
.button:focus-visible {
  background: var(--ink);
  color: var(--canvas);
}

/* 헤더 ---------------------------------------------------------------------
   영상 위에 투명하게 떠 있다. 뒤에는 위에서 내려오는 어두운 막 하나만 둔다.
   비행 구간을 벗어나면 막 대신 검은 면과 아래 선으로 바뀐다. */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: -1;
  height: 144px;
  background: var(--film-top);
  pointer-events: none;
}

.site-header.is-solid {
  border-bottom-color: var(--line);
  background: var(--canvas);
}

.site-header.is-solid::before {
  display: none;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  color: var(--ink);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.logo__en {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.5em;
}

.logo__ko {
  font-size: var(--small);
  font-weight: 500;
  letter-spacing: var(--track);
}

/* 장면: 기본은 나열형 -------------------------------------------------------
   자바스크립트가 꺼져 있거나 동작 줄이기가 켜져 있으면 구간별 대표 프레임
   다섯 장이 문구와 함께 세로로 놓인다. 프레임이 없으면 검은 면만 남는다. */

.scene--exterior { --frame: url("frames/f_0001.webp"); }
.scene--pool     { --frame: url("frames/f_0061.webp"); }
.scene--living   { --frame: url("frames/f_0104.webp"); }
.scene--dining   { --frame: url("frames/f_0146.webp"); }
.scene--terrace  { --frame: url("frames/f_0192.webp"); }

.scene {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(56.25vw, 100svh);
  padding: var(--gutter);
  background-color: var(--canvas);
  background-image:
    var(--film),
    var(--frame);
  background-size: cover;
  background-position: center;
}

/* 가늘고 넓게 놓는 큰 문구. 한 줄은 24자 안팎에서 끊는다. */
.caption {
  max-width: 20em;
  color: var(--ink);
  font-size: var(--display);
  font-weight: 200;
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.scene__hint,
.rail,
.backdrop,
.stage__canvas,
.stage__note {
  display: none;
}

/* 장면: 비행 모드 ------------------------------------------------------------ */

.flight-mode .flight {
  height: 600vh;
}

/* 화면 전체가 렌더다. 헤더도 이 위에 겹쳐 놓인다. */
.flight-mode .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
}

.flight-mode .backdrop,
.flight-mode .stage__canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 프레임이 없을 때 보이는 면 */
.backdrop {
  background: var(--canvas);
}

/* 문구가 놓이는 아래쪽에만 어두운 막을 깐다. 위쪽 막은 헤더가 갖고 있다. */
.flight-mode .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--film);
  pointer-events: none;
}

.flight-mode .scenes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* 문구는 왼쪽 아래 자막 자리에 둔다. 화면 가운데는 집에게 남긴다.
   오른쪽은 같은 줄에 놓이는 가상 이미지 안내만큼 비운다. */
.flight-mode .scene {
  position: absolute;
  left: var(--gutter);
  right: calc(var(--gutter) + 240px);
  bottom: var(--gutter);
  min-height: 0;
  padding: 0;
  background: none;
  opacity: 0;
}

.flight-mode .scene:first-child {
  opacity: 1;
}

.flight-mode .scene__hint {
  display: block;
  margin-top: 24px;
  color: var(--body);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--track);
}

/* 진행 표시: 오른쪽 가장자리의 세로선. 눈금 간격이 곧 구간 길이다. */
.flight-mode .rail {
  position: absolute;
  top: 20%;
  bottom: 32%;
  right: var(--gutter);
  z-index: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--faint);
}

.rail__mark {
  position: relative;
  flex: 1 1 0;
  padding-right: 32px;
  color: var(--faint);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track);
  text-align: right;
  text-decoration: none;
  transition: color var(--swap);
}

.rail__mark::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  border-top: 1px solid var(--faint);
}

.rail__mark > span {
  display: block;
  transform: translateY(-50%);
}

.rail__mark:hover,
.rail__mark[aria-current="step"] {
  color: var(--ink);
}

/* 현재 위치: 눈금보다 긴 흰 선 하나 */
.rail__marker {
  position: absolute;
  top: calc(var(--p, 0) * 100%);
  right: 0;
  width: 24px;
  height: 1px;
  background: var(--ink);
}

.flight-mode .stage__note {
  display: block;
  position: absolute;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 1;
  color: var(--body);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--track);
}

/* 상담 신청 ------------------------------------------------------------------
   왼쪽에 큰 문구와 고지, 오른쪽에 양식. 면도 카드도 없이 선만 쓴다. */

.consult {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: 64px;
  padding: var(--section) var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* 비행의 마지막 화면 위로 아래쪽 어두운 막이 차오른다. 영상은 재생되는 채로 가라앉는다. */
.flight-mode .consult::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 48vh;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.64) 56%, #000000);
  pointer-events: none;
}

.consult__title {
  color: var(--ink);
  font-size: var(--display);
  font-weight: 200;
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.consult__lead {
  max-width: 24em;
  margin-top: 40px;
}

.field {
  margin-bottom: 40px;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--track);
  transition: color var(--swap);
}

.field:focus-within label {
  color: var(--ink);
}

/* 입력 칸은 면 없이 아래 선 하나로만 그린다. 포커스가 오면 그 선이 흰색이 된다. */
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 300;
  caret-color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--swap);
}

.field input {
  height: 48px;
}

.field textarea {
  padding: 8px 0 16px;
  line-height: 1.8;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.field [aria-invalid="true"] {
  border-bottom-color: var(--error);
}

/* 자동 완성이 칸에 밝은 면을 채우지 않게 한다. */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
}

.field__error {
  margin-top: 8px;
  color: var(--error);
  font-size: var(--small);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--track);
}

.form .button {
  margin-top: 8px;
}

.form__note {
  margin-top: 24px;
  color: var(--muted);
}

.done {
  padding-top: 40px;
  border-top: 1px solid var(--line-strong);
}

.done:focus {
  outline: none;
}

.done__title {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 200;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.done p {
  margin: 24px 0 40px;
}

/* 푸터 --------------------------------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 2;
  padding: 64px var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--canvas);
  color: var(--muted);
}

.site-footer p {
  max-width: 36em;
}

/* 좁은 화면 ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .consult {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 24px;
    --section: 72px;
  }

  .site-header .button {
    padding: 0 24px;
  }

  .logo {
    gap: 12px;
  }

  /* 자막 아래에 가상 이미지 안내가 한 줄 들어갈 자리를 남긴다. */
  .flight-mode .scene {
    right: calc(var(--gutter) + 32px);
    bottom: 64px;
  }

  .flight-mode .scene__hint {
    margin-top: 16px;
  }

  .flight-mode .rail {
    top: 16%;
    bottom: 52%;
  }

  /* 눈금은 남기고 이름은 지금 구간만 보인다. */
  .rail__mark {
    padding-right: 24px;
    color: transparent;
  }

  .rail__mark[aria-current="step"] {
    color: var(--ink);
  }

  .flight-mode .stage__note {
    left: var(--gutter);
    right: auto;
    bottom: var(--gutter);
  }

  .form .button {
    width: 100%;
  }

  .site-footer {
    padding-block: 40px;
  }
}

@media (max-width: 359px) {
  .logo__ko {
    display: none;
  }
}
