/*
  노곡농산 생면
  팔레트: Forest (본색 배경 + 짙은 숲색 + 호박색 강조 1개)
  모서리 규칙: 버튼·선택 버튼은 둥근 알약형, 사진과 블록은 6px
  테마: 라이트 고정. QR은 밝은 바탕 위 어두운 칸이어야 잘 읽히고,
        스크롤로 QR 안에 들어갈 때 밝은 칸이 페이지 배경과 이어져야 해서입니다.
*/
:root {
  --bg: #eceee6;
  --surface: #e0e4d8;
  --ink: #17211a;
  --muted: #535d50;
  --line: #c6cdbd;
  --forest: #1d3527;
  --forest-ink: #e4eadf;
  --forest-muted: #a9b8a6;
  --accent: #e3a52b;
  --radius: 6px;
  --font: 'Pretendard Variable', Pretendard, system-ui, -apple-system, sans-serif;
  --hero-p: 0;
  --spare: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.22; }
p { margin: 0; text-wrap: pretty; } /* 좁은 화면에서 마지막 줄에 단어 하나만 남지 않게 */
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), background-color .2s;
}
.btn:active { transform: scale(.98); }
.btn .ph { font-size: 1.15em; }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--sm { padding: 8px 16px; font-size: 14px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: 64px; padding: 0 max(16px, 3vw);
  padding-top: env(safe-area-inset-top);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(236, 238, 230, .88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -0.02em; color: var(--forest); }
.brand-mark { width: 22px; height: 22px; }

/* ---------- 첫 화면 ---------- */
.hero { position: relative; height: 200vh; }
.hero-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
#field {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; cursor: pointer;
  touch-action: pan-y;
}
/* QR 칸 모양으로 잘린 농장 사진. 잘리는 범위는 field.js가 매 프레임 알려 줍니다. */
/* 사진이 아직 없으면 본문의 빈 사진 자리(.photo)와 같은 색으로 채워짐 */
.portal { position: absolute; inset: 0; visibility: hidden; pointer-events: none; background: var(--surface); }
.portal img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 84px 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  opacity: calc(1 - var(--hero-p) * 4);
}
.hero-copy button { pointer-events: auto; }
body.is-scrolled .hero-copy button { pointer-events: none; }
.hero-head { translate: 0 var(--spare); }
.hero-controls {
  translate: 0 calc(var(--spare) * -1);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.eyebrow { font-size: 14px; font-weight: 600; color: var(--forest); margin-bottom: 12px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 52px); font-weight: 800; }

.hint {
  border: 1px solid var(--line); background: rgba(236, 238, 230, .85);
  border-radius: 999px; padding: 6px 16px;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.hint-qr { display: none; }
body.is-qr .hint-field { display: none; }
body.is-qr .hint-qr { display: inline; }
.crop-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  width: min(360px, 100%);
  padding: 4px; border-radius: 999px; background: var(--surface);
}
.crop-switch button {
  border: 0; border-radius: 999px; padding: 9px 0;
  background: transparent; font-size: 14px; color: var(--muted); cursor: pointer;
  transition: background-color .2s, color .2s;
}
.crop-switch button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(29, 53, 39, .12); }
.scroll-cue { font-size: 12px; color: var(--muted); }

/* ---------- 사진 자리 ---------- */
.photo {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot { display: none; }
.photo.is-empty .photo-slot {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 16px; text-align: center;
  font-size: 13px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: inherit;
}
.photo-slot code { font-size: 12px; color: var(--ink); background: var(--bg); padding: 2px 8px; border-radius: 999px; }
/* 첫 화면 QR 창문과 똑같이 잘리도록 화면 크기 그대로 */
.photo--full { height: 100vh; height: 100dvh; border-radius: 0; }
.photo--portrait { aspect-ratio: 4 / 5; }
.photo--square { aspect-ratio: 1; }
.photo--card { aspect-ratio: 3 / 4; }

/* ---------- 삼척 ---------- */
.place-grid {
  display: grid; grid-template-columns: 5fr 6fr; gap: 64px;
  padding: 96px 0 120px;
}
.place-head { align-self: start; position: sticky; top: 96px; }
.place-head h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 20px; }
.place-head p { color: var(--muted); font-size: 17px; max-width: 32em; }
.place-points { list-style: none; margin: 0; padding: 0; }
.place-points li { padding: 28px 0; }
.place-points li + li { border-top: 1px solid var(--line); }
.place-points li:first-child { padding-top: 6px; }
.place-points h3 { font-size: 22px; margin-bottom: 8px; }
.place-points p { color: var(--muted); }

/* ---------- 두 가지 산나물 ---------- */
.greens { padding: 40px 0 120px; }
.greens h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 56px; }
.greens-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; }
.green--offset { margin-top: 120px; }
.green h3 { font-size: 28px; margin: 24px 0 8px; }
.green-lead { font-size: 17px; color: var(--muted); max-width: 30em; }
.facts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: baseline; }
.facts li::before { content: ''; width: 14px; height: 2px; background: var(--accent); translate: 0 -4px; }
.note { margin-top: 56px; font-size: 13px; color: var(--muted); }

/* ---------- 농장 사진 (가로 스크롤) ---------- */
.process { padding: 0 0 120px; }
.process h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 40px; }
.process-track {
  list-style: none; margin: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 27vw, 340px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  padding: 0 max(16px, calc((100% - 1180px) / 2)) 16px;
  scroll-padding-inline: max(16px, calc((100% - 1180px) / 2));
}
.process-track li { scroll-snap-align: start; }
.process-track h3 { font-size: 19px; margin: 18px 0 6px; }
.process-track p { color: var(--muted); font-size: 15px; }

/* ---------- 생면 가격 ---------- */
.products { padding: 0 0 120px; }
.products h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 40px; }
.product-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product {
  display: grid; gap: 4px; align-content: start;
  padding: 32px; border-radius: var(--radius); background: var(--surface);
}
.product:first-child { background: var(--ink); color: var(--bg); }
.product:first-child .product-unit, .product:first-child .product-desc { color: var(--forest-muted); }
.product-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.product-unit { font-size: 14px; color: var(--muted); }
.product-price { margin-top: 40px; font-size: clamp(40px, 5vw, 60px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.product-price small { font-size: .4em; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.product-desc { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* ---------- 전화 주문 (페이지에서 한 번만 쓰는 숲색 블록) ---------- */
.order { background: var(--forest); color: var(--forest-ink); padding-top: 120px; }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-bottom: 120px; }
.order h2 { font-size: clamp(32px, 4.2vw, 56px); font-weight: 800; }
.order-body > p { color: var(--forest-muted); font-size: 17px; max-width: 28em; }
.order-phone {
  display: inline-grid; gap: 2px; margin-top: 32px;
  padding: 20px 32px; border-radius: 999px;
  background: var(--accent); color: var(--ink); text-decoration: none;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}
.order-phone:active { transform: scale(.98); }
.order-phone-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.order-phone-number { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.info { margin: 40px 0 0; display: grid; gap: 10px; }
.info div { display: grid; grid-template-columns: 88px 1fr; }
.info dt { color: var(--forest-muted); }
.info dd { margin: 0; }
.footer {
  display: flex; justify-content: space-between;
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(228, 234, 223, .16);
  font-size: 13px; color: var(--forest-muted);
}

/* ---------- 등장 모션: 섹션이 들어올 때 순서대로 보여 줌 ---------- */
.js .reveal { opacity: 0; translate: 0 24px; transition: opacity .7s cubic-bezier(.16, 1, .3, 1), translate .7s cubic-bezier(.16, 1, .3, 1); }
.js .reveal.is-in { opacity: 1; translate: 0 0; }
.place-points li.reveal:nth-child(2) { transition-delay: .08s; }
.place-points li.reveal:nth-child(3) { transition-delay: .16s; }

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
  .place-grid, .greens-grid, .order-grid, .product-list { grid-template-columns: 1fr; }
  .place-grid { gap: 32px; padding: 64px 0 80px; }
  .place-head { position: static; }
  .greens, .process, .products { padding-bottom: 80px; }
  .greens h2 { margin-bottom: 32px; }
  .green--offset { margin-top: 32px; }
  .product { padding: 24px; }
  .product-price { margin-top: 28px; }
  .order { padding-top: 80px; }
  .order-grid { gap: 24px; padding-bottom: 80px; }
  .order-phone { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
}
