/* ─────────────────────────────────────────────────────────────
   portal.css  |  횡성도담농원 인트로 포털
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: DodamSans;
  src: url("../assets/SUIT-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: DodamGmarket;
  src: url("../assets/GmarketSansTTFMedium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: DodamGmarket;
  src: url("../assets/GmarketSansTTFBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

/* ── 토큰 ── */
:root {
  --paper: #fbf7f0;
  --deep:  #0d2e1c;
  --green: #2d6e4e;
  --ink:   #18352a;
  --muted: #637068;
  --line:  rgba(13, 46, 28, 0.13);
  --sun:   #f2c56f;
  --coral: #e8806e;
  --coral-soft: #f8e2dc;
  --mint:  #e4ede0;
  --white: #fffdf8;

  --f-head: DodamGmarket, DodamSans, "Noto Sans KR", sans-serif;
  --f-body: DodamSans, "Noto Sans KR", sans-serif;

  /* 포인터 글로우 기본값 */
  --gx: 50%;
  --gy: 42%;
}

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

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--deep);
}

.portal-page { position: relative; min-height: 100svh; }

body {
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: #fff;
  background: var(--deep);
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 520;
  line-height: 1.6;
  letter-spacing: -0.025em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

body.page-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid rgba(242, 197, 111, 0.7);
  outline-offset: 3px;
}

/* ── 페이지 로더 ── */
.page-loader {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--deep);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
body.page-loading .page-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.loader-ring {
  width: 36px;
  height: 36px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: var(--sun);
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }

/* ── 배경 슬라이드쇼 ── */
.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.portal-bg-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.85s ease, transform 9s ease;
}
.portal-bg-slide.is-visible {
  opacity: 1;
  transform: scale(1.0);
}
.portal-bg-veil {
  position: absolute;
  inset: 0;
  /* 어두운 좌측 그라디언트 — 텍스트 가독성 */
  background:
    linear-gradient(105deg, rgba(8, 32, 20, 0.84) 0%, rgba(8, 32, 20, 0.52) 46%, rgba(8, 32, 20, 0.12) 78%),
    linear-gradient(180deg, rgba(8, 32, 20, 0.22) 0%, rgba(8, 32, 20, 0.65) 100%);
  /* 포인터 글로우 */
  background-image:
    radial-gradient(ellipse 55% 55% at var(--gx) var(--gy), rgba(242, 197, 111, 0.08), transparent),
    linear-gradient(105deg, rgba(8, 32, 20, 0.84) 0%, rgba(8, 32, 20, 0.52) 46%, rgba(8, 32, 20, 0.12) 78%),
    linear-gradient(180deg, rgba(8, 32, 20, 0.22) 0%, rgba(8, 32, 20, 0.65) 100%);
}

/* ── 포털 쉘 ── */
.portal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding-inline: clamp(24px, 5.5vw, 80px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.portal-shell.is-visible {
  opacity: 1;
  transform: none;
}
.portal-shell.is-leaving {
  opacity: 0;
  transform: translateY(-10px) scale(0.99);
  transition-duration: 0.28s;
}

/* ── 헤더 ── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1.1;
}
.portal-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 13px 13px 13px 3px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}
.portal-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.portal-brand-name { display: grid; gap: 2px; font-size: 15px; }
.portal-brand-sub {
  display: block;
  color: rgba(255,255,255,0.55);
  font-family: var(--f-body);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}
.portal-header-right { display: flex; align-items: center; gap: 12px; }
.portal-lang-wrap { position: relative; }
.portal-lang {
  min-height: 34px;
  padding: 0 28px 0 11px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 6px;
}
.portal-lang option { color: var(--ink); background: var(--white); }

/* ── 메인 콘텐츠 (3열 그리드) ── */
.portal-main {
  display: grid;
  grid-template-columns: 36px 1fr clamp(300px, 38vw, 540px);
  gap: 0 clamp(28px, 4vw, 60px);
  align-items: center;
  padding: 48px 0 56px;
}

/* ── 씬 인디케이터 바 ── */
.portal-scene-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.portal-scene-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal-scene-dot {
  width: 4px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  cursor: pointer;
  transition: background 0.25s ease, height 0.25s ease;
}
.portal-scene-dot.is-active {
  height: 36px;
  background: var(--sun);
}
.portal-scene-dot:hover:not(.is-active) { background: rgba(255,255,255,0.5); }
.portal-scene-counter {
  color: rgba(255,255,255,0.5);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

/* ── 카피 ── */
.portal-copy { max-width: 580px; }

.portal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--sun);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.portal-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(242,197,111,0.18);
  font-size: 14px;
}

.portal-headline {
  margin: 0;
  font-family: var(--f-head);
  font-size: clamp(46px, 5.6vw, 82px);
  font-weight: 700;
  letter-spacing: -0.09em;
  line-height: 1.06;
  color: #fff;
}
.portal-hl-em {
  display: block;
  color: var(--sun);
  font-style: normal;
}
/* 타이핑 커서 */
.portal-caret {
  display: inline-block;
  width: 4px;
  height: 0.75em;
  margin-left: 6px;
  vertical-align: -0.05em;
  border-radius: 99px;
  background: var(--sun);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.portal-hl-line { display: block; }

.portal-subline {
  display: grid;
  gap: 2px;
  max-width: 480px;
  margin: 24px 0 0;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
  line-height: 1.72;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.portal-subline-piece { display: block; }
.portal-shell.is-sub-visible .portal-subline {
  opacity: 1;
  transform: none;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.38s 0.1s ease, transform 0.38s 0.1s ease;
}
.portal-shell.is-copy-done .portal-actions {
  opacity: 1;
  transform: none;
}

.portal-enter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 18px 0 7px;
  border: 1.5px solid var(--sun);
  border-radius: 999px;
  color: var(--deep);
  background: var(--sun);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(242, 197, 111, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.portal-enter:hover {
  transform: translateY(-3px);
  background: #f0c35a;
  box-shadow: 0 18px 36px rgba(242, 197, 111, 0.38);
}
.portal-enter-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 46, 28, 0.12);
  font-size: 17px;
}
.portal-enter-arrow { font-size: 19px; margin-left: 4px; }

.portal-stores {
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-stores-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.2);
}
.portal-store-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  color: rgba(255,255,255,0.82);
  font-size: 11px;
  font-weight: 750;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.portal-store-link:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* ── 오른쪽 프리뷰 프레임 ── */
.portal-preview {
  position: relative;
  align-self: center;
}
.portal-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 0.87;
  overflow: hidden;
  border-radius: 30px 30px 30px 6px;
  background: rgba(13, 46, 28, 0.5);
  box-shadow:
    0 28px 70px rgba(4, 22, 13, 0.5),
    0 0 0 1px rgba(255,255,255,0.1);
}
.portal-preview-img {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.75s ease;
}
.portal-preview-img.is-visible { opacity: 1; }

.portal-preview-shine {
  position: absolute;
  z-index: 2;
  inset: -30% 50% 55% -25%;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  filter: blur(6px);
  transform: rotate(-18deg);
  pointer-events: none;
}
/* 안쪽 테두리 */
.portal-preview-frame::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 20px 20px 20px 3px;
  pointer-events: none;
}
/* 하단 그라디언트 */
.portal-preview-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,22,13,0.02) 40%, rgba(4,22,13,0.55) 100%);
  pointer-events: none;
}
.portal-preview-topbar {
  position: absolute;
  z-index: 4;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.82);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.portal-preview-label,
.portal-preview-stamp { display: inline-block; }
.portal-preview-caption {
  position: absolute;
  z-index: 4;
  left: 24px;
  right: 24px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.portal-preview-caption-icon { font-size: 19px; }
.portal-preview-caption small {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.portal-preview-caption strong {
  display: block;
  font-family: var(--f-head);
  font-size: 19px;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

/* 스티커 칩 */
.portal-preview-chip {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,0.52);
  border-radius: 999px;
  color: var(--deep);
  background: rgba(255, 253, 248, 0.92);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(4, 22, 13, 0.2);
}
.portal-chip-a { top: 23%; right: 18px; transform: rotate(3deg); }
.portal-chip-b { left: 18px; bottom: 26%; transform: rotate(-3deg); }

/* ── 푸터 ── */
.portal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.42);
  font-size: 10px;
  font-weight: 600;
}
.portal-biz { margin: 0; }
.portal-footer-copy { flex: 0 0 auto; }

/* ── 반응형 ── */
@media (max-width: 1040px) {
  .portal-main {
    grid-template-columns: 30px 1fr clamp(260px, 35vw, 460px);
    gap: 0 clamp(20px, 3vw, 44px);
  }
}

@media (max-width: 820px) {
  .portal-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 32px 0;
    padding: 36px 0 44px;
  }
  .portal-scene-bar {
    flex-direction: row;
    justify-content: flex-start;
    order: -1;
    grid-column: 1;
  }
  .portal-scene-track {
    flex-direction: row;
    gap: 6px;
  }
  .portal-scene-dot {
    width: 22px;
    height: 4px;
  }
  .portal-scene-dot.is-active {
    width: 36px;
    height: 4px;
  }
  .portal-scene-counter {
    writing-mode: horizontal-tb;
    transform: none;
  }
  .portal-copy { order: 1; max-width: none; }
  .portal-preview { order: 2; max-width: 520px; width: 100%; margin: 0 auto; }
  .portal-preview-frame { aspect-ratio: 1.18; }
  .portal-headline { font-size: clamp(40px, 9.5vw, 62px); }
}

@media (max-width: 540px) {
  .portal-shell { padding-inline: 18px; }
  .portal-header { padding: 14px 0; }
  .portal-brand-mark { width: 36px; height: 36px; }
  .portal-brand-name { font-size: 13px; }
  .portal-brand-sub { font-size: 7px; }
  .portal-lang { min-height: 32px; font-size: 10px; }
  .portal-main { padding: 28px 0 34px; gap: 24px; }
  .portal-eyebrow { font-size: 10px; margin-bottom: 14px; }
  .portal-headline { font-size: clamp(36px, 11vw, 54px); }
  .portal-subline { font-size: 13.5px; margin-top: 18px; }
  .portal-actions { gap: 10px; margin-top: 22px; }
  .portal-enter { min-height: 50px; font-size: 13px; }
  .portal-enter-icon { width: 36px; height: 36px; font-size: 15px; }
  .portal-preview-frame { aspect-ratio: 1.04; border-radius: 22px 22px 22px 5px; }
  .portal-preview-frame::before { inset: 9px; border-radius: 15px 15px 15px 2px; }
  .portal-chip-a { right: 12px; }
  .portal-chip-b { left: 12px; }
  .portal-footer { justify-content: center; text-align: center; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
