:root {
  --bg: #E7F0EA;
  --bg-deep: #D5E4DA;
  --surface: #F7FBF8;
  --ink: #132019;
  --muted: #5B6E64;
  --line: #C5D6CB;
  --amber: #E8A01E;
  --amber-ink: #2A1800;
  --forest: #1B5A42;
  --forest-2: #247A58;
  --coral: #E25A3A;
  --mist: #BFD4C8;
  --dusk: #2C3340;
  --good: #1F7A4D;
  --heart: #D64545;
  --scrim: rgba(12, 22, 18, .72);
  --radius: 18px;
  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --f-display: "Song Myung", "Gowun Batang", "Noto Serif KR", Georgia, serif;
  --f-body: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --shadow: 0 18px 50px rgba(19, 32, 25, .12);
  color-scheme: light;
}

* { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: calc(64px + var(--safe-t)) }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fff8e8 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #d9eee4 0%, transparent 50%),
    var(--bg);
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
}
img { max-width: 100%; display: block }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer }
a { color: inherit; text-decoration: none }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }

/* Top */
.top {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-t);
}
.top-in {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; max-width: 1280px; margin: 0 auto; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; letter-spacing: .04em; font-size: 20px;
}
.logo i {
  width: 34px; height: 34px; border-radius: 11px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(232, 160, 30, .35);
}
.logo i img { width: 100%; height: 100%; object-fit: cover }
.search {
  flex: 1 1 220px; max-width: 520px; margin-inline: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 14px;
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0 }
.top-act { display: flex; gap: 8px; align-items: center }

.btn {
  border: 0; border-radius: 999px; padding: 9px 16px; min-height: 42px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98) }
.btn-amber { background: var(--amber); color: var(--amber-ink) }
.btn-forest { background: var(--forest); color: #fff }
.btn-line { background: var(--surface); border: 1px solid var(--line) }
.btn-soft { background: var(--bg-deep) }
.btn-ghost { background: transparent; border: 1px solid color-mix(in srgb, #fff 40%, transparent); color: #fff }

/* Shell */
.shell { display: flex; max-width: 1280px; margin: 0 auto; align-items: flex-start }
.side {
  width: 220px; flex: none; position: sticky; top: calc(64px + var(--safe-t));
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100dvh - 70px); overflow: auto;
}
.side a, .side button.nav {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 14px; border: 0; background: none; text-align: left; width: 100%;
  color: var(--ink); font-weight: 600;
}
.side a:hover, .side button.nav:hover { background: color-mix(in srgb, var(--surface) 80%, var(--mist)) }
.side a.on, .side button.nav.on { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line) }
.side .lab { padding: 12px 14px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase }
.side .sep { height: 1px; background: var(--line); margin: 10px 8px }
.promo {
  margin-top: 12px; padding: 16px; border-radius: 18px;
  background: linear-gradient(145deg, var(--forest), #0f3b2c);
  color: #fff; display: block;
}
.promo small { color: var(--amber); font-weight: 800; letter-spacing: .06em }

main { flex: 1; min-width: 0; padding: 18px 18px 40px }

.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  justify-content: space-around; align-items: center;
  padding: 8px 4px calc(8px + var(--safe-b));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); min-width: 56px; font-weight: 600;
}
.tabbar a.on { color: var(--ink) }
.tabbar .up {
  width: 52px; height: 38px; border-radius: 14px;
  background: var(--amber); color: var(--amber-ink);
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
}

@media (max-width: 900px) {
  .side { display: none }
  main { padding: 12px 14px 28px }
  .top-in { padding: 8px 12px }
  .search { order: 3; flex-basis: 100%; max-width: none }
  .hide-sm { display: none !important }
  .tabbar { display: flex }
  body { padding-bottom: calc(var(--tab-h) + var(--safe-b)) }
}

/* Hero */
.hero {
  position: relative; isolation: isolate;
  border-radius: 28px; overflow: hidden;
  min-height: min(72vh, 620px); color: #fff; margin-bottom: 28px;
  box-shadow: var(--shadow);
  background: #132019;
  animation: heroIn .8s ease both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(12px) scale(.985) }
  to { opacity: 1; transform: none }
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(12,28,22,.78) 0%, rgba(12,28,22,.35) 48%, rgba(12,28,22,.55) 100%),
    url("../img/hero-pets.jpg") center/cover no-repeat;
  transform: scale(1.04);
  animation: ken 18s ease-in-out infinite alternate;
}
@keyframes ken {
  from { transform: scale(1.04) translate3d(0,0,0) }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0) }
}
.hero-body {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(24px, 5vw, 52px);
  min-height: inherit;
}
.brand-mark {
  font-family: var(--f-display);
  font-size: clamp(42px, 10vw, 84px);
  line-height: .95; letter-spacing: -.02em; margin: 0 0 14px;
  text-shadow: 0 10px 40px rgba(0,0,0,.35);
  animation: rise .9s .1s ease both;
}
.hero h1 {
  font-size: clamp(18px, 3.4vw, 28px); font-weight: 700; margin: 0 0 10px; max-width: 18em;
  animation: rise .9s .2s ease both;
}
.hero p {
  margin: 0 0 22px; max-width: 34em; color: rgba(255,255,255,.86); font-size: 15px;
  animation: rise .9s .3s ease both;
}
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; animation: rise .9s .4s ease both }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) }
  to { opacity: 1; transform: none }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero, .brand-mark, .hero h1, .hero p, .hero .cta { animation: none }
}

.stack { display: flex; flex-direction: column; gap: 28px }
.sec-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px }
.sec-h h2 { margin: 0; font-size: 20px }
.sec-h .more { margin-left: auto; border: 0; background: none; color: var(--muted); font-weight: 600 }
.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-weight: 600; white-space: nowrap; min-height: 38px;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink) }
.muted { color: var(--muted) }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; background: var(--bg-deep);
}
.pill-amber { background: var(--amber); color: var(--amber-ink) }
.pill-forest { background: color-mix(in srgb, var(--forest) 16%, white); color: var(--forest) }

.grid-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 20px 16px;
}
.grid-shorts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.grid-shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.vcard, .scard, .pcard, .acard {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: none; border: 0; padding: 0; width: 100%;
}
.thumb {
  position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9;
  background: var(--bg-deep);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease }
.vcard:hover .thumb img, .scard:hover .thumb img { transform: scale(1.04) }
.scard .thumb { aspect-ratio: 9/14 }
.badge {
  position: absolute; right: 8px; bottom: 8px;
  background: var(--scrim); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.tag {
  position: absolute; left: 8px; top: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
}
.vcard strong, .scard strong, .pcard strong { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.vcard small, .scard small, .pcard small, .acard small { color: var(--muted); font-size: 12px }
.reason {
  font-size: 12px; color: var(--forest); background: color-mix(in srgb, var(--forest) 10%, white);
  border-radius: 10px; padding: 6px 10px; margin-top: 2px;
}

.quick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.quick a, .quick button {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 700;
}

/* Watch / Shorts player */
.player-wrap { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start }
.player-main { flex: 999 1 560px; min-width: 0 }
.player-side { flex: 1 1 280px; min-width: 0; max-width: 400px; display: flex; flex-direction: column; gap: 12px }
.yt-frame {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden;
  background: #000; box-shadow: var(--shadow);
}
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0 }
.short-stage {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; align-items: flex-end;
}
.short-frame {
  width: min(380px, calc(100vw - 48px));
  aspect-ratio: 9/16; border-radius: 22px; overflow: hidden; background: #000;
  position: relative; box-shadow: var(--shadow);
}
.short-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0 }

.farm-box {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--forest) 92%, black), var(--forest-2));
  color: #fff; border-radius: 24px; padding: 22px; box-shadow: var(--shadow);
}
.farm-box input, .farm-box textarea {
  width: 100%; border: 0; border-radius: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.12); color: #fff; outline: 0;
}
.farm-box input::placeholder, .farm-box textarea::placeholder { color: rgba(255,255,255,.65) }
.farm-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.farm-prompts button {
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08);
  color: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px;
}

.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px }
.mem-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.mem-card.on { border: 2px solid var(--amber) }
.mem-detail {
  background: linear-gradient(160deg, #2a3340, #1a242c); color: #f4efe8;
  border-radius: 24px; padding: 24px;
}
.mem-detail h2 { font-family: var(--f-display); font-size: 30px; margin: 0 }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + var(--safe-b)); z-index: 80;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; max-width: calc(100% - 24px); text-align: center;
  box-shadow: var(--shadow);
}
.toast[hidden] { display: none }

.engine {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-deep); color: var(--muted);
}
.engine.llm { background: color-mix(in srgb, var(--amber) 30%, white); color: var(--amber-ink) }

.foot {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--muted); font-size: 13px;
}
.foot b { font-family: var(--f-display); color: var(--ink); font-size: 15px }

.upload-note {
  border-left: 4px solid var(--amber); padding: 12px 14px; background: var(--surface);
  border-radius: 0 14px 14px 0; margin-bottom: 16px;
}

@media (max-width: 420px) {
  .brand-mark { font-size: 46px }
  .hero { min-height: 68vh; border-radius: 22px }
  .grid-videos { grid-template-columns: 1fr }
}

@media (min-width: 421px) and (max-width: 760px) {
  .grid-videos { grid-template-columns: repeat(2, 1fr); gap: 14px 10px }
}
