:root {
  --bg: #FFF8EE;
  --paper: #FFFFFF;
  --ink: #2B1D14;
  --ink-2: #6B5848;
  --ink-3: #9C8A7A;
  --line: #EFE2D0;
  --brand: #F26B1D;
  --brand-ink: #FFFFFF;
  --brand-soft: #FFE9DA;
  --gold: #FFC93C;
  --cocoa: #3A2416;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(58, 36, 22, .06), 0 8px 24px rgba(58, 36, 22, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A120C; --paper: #251A12; --ink: #F6EBDD; --ink-2: #CDB9A5; --ink-3: #8F7B68;
    --line: #3A2B1F; --brand-soft: #3A2414; --cocoa: #120C08;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.02em; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* 상단 */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: #FFF8EE;
  display: grid; place-items: center; font-size: 18px; }
.nav { display: flex; gap: 4px; align-items: center; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.nav a { padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.nav a:hover { background: var(--brand-soft); color: var(--ink); }
.nav-saved { position: relative; color: var(--brand) !important; font-size: 18px; }
.saved-count { position: absolute; top: 2px; right: 0; background: var(--brand); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .nav a:not(.nav-saved):nth-child(-n+2) { display: none; }
  .logo { font-size: 17px; }
}

/* 히어로 */
.hero { background: radial-gradient(1200px 400px at 80% -10%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 60%),
  radial-gradient(900px 400px at -10% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%); padding: 40px 0 28px; }
.hero-date { color: var(--brand); font-weight: 700; margin: 0 0 6px; font-size: 14px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); font-weight: 800; letter-spacing: -0.04em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub { color: var(--ink-2); margin: 12px 0 20px; font-size: 17px; }
.search { position: relative; max-width: 640px; }
.search input { width: 100%; height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper);
  padding: 0 20px 0 48px; font: inherit; font-size: 16px; color: var(--ink); box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--brand); }
.search::before { content: "🔍"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.results { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 600;
  font-size: 14px; color: var(--ink-2); transition: .15s; }
.chip:hover, .chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.chips.big .chip { font-size: 15px; padding: 10px 16px; }

/* 섹션 */
.sec { margin: 36px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: 22px; font-weight: 800; }
.sec-head a { color: var(--ink-3); font-size: 14px; font-weight: 600; white-space: nowrap; }
.sec-desc { color: var(--ink-2); margin: -8px 0 14px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.rail .card { scroll-snap-align: start; }
@media (max-width: 640px) { .rail { grid-auto-columns: 46%; gap: 12px; } }

/* 카드 */
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(58, 36, 22, .12); }
.card-img { position: relative; aspect-ratio: 1; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-time { position: absolute; left: 10px; bottom: 10px; background: rgba(43, 29, 20, .78); color: #fff; font-size: 12px;
  font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.card-body { padding: 12px 14px 16px; }
.card-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft);
  padding: 2px 9px; border-radius: 999px; }
.card h3 { font-size: 17px; font-weight: 800; margin: 8px 0 2px; }
.card p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* 오늘의 추천 */
.feature { position: relative; display: block; border-radius: 24px; overflow: hidden; aspect-ratio: 21 / 8; margin: 36px 0;
  background: var(--cocoa); box-shadow: var(--shadow); }
.feature img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.feature-text { position: absolute; inset: auto 0 0 0; padding: 28px; color: #fff;
  background: linear-gradient(transparent, rgba(26, 14, 6, .85)); display: flex; flex-direction: column; gap: 4px; }
.feature-text span { color: var(--gold); font-weight: 800; font-size: 14px; }
.feature-text b { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.03em; }
.feature-text small { font-size: 15px; opacity: .9; }
@media (max-width: 640px) { .feature { aspect-ratio: 4 / 3; } .feature-text { padding: 18px; } }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool { background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; border: 1px solid transparent; transition: .15s; }
.tool:hover { border-color: var(--brand); }
.tool b { font-size: 17px; }
.tool span { color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) { .tools { grid-template-columns: 1fr; } }

/* 목록 페이지 */
.crumb { font-size: 13px; color: var(--ink-3); padding: 18px 0 6px; }
.crumb a:hover { color: var(--brand); }
.page-title { font-size: clamp(26px, 5vw, 36px); font-weight: 800; margin: 6px 0 6px; }
.page-desc { color: var(--ink-2); margin: 0 0 22px; }
.empty { color: var(--ink-3); padding: 40px 0; text-align: center; }

/* 레시피 */
.r-top { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; margin-top: 8px; }
.r-hero img { border-radius: 24px; aspect-ratio: 1; object-fit: cover; width: 100%; box-shadow: var(--shadow); }
.r-kicker { color: var(--ink-2); font-weight: 700; margin: 12px 0 0; }
.r-head h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 900; letter-spacing: -0.045em; margin: 2px 0 10px; }
.r-hook { font-size: 18px; color: var(--ink-2); margin: 0 0 18px; }
.r-hook b { color: var(--ink); background: linear-gradient(transparent 60%, color-mix(in srgb, var(--gold) 55%, transparent) 60%); }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.meta div { background: var(--paper); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.meta dt { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.meta dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; }
.r-detail { color: var(--ink-3); font-size: 13px; margin: 10px 0 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 11px 16px; font-weight: 700;
  font-size: 15px; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 820px) {
  .r-top { grid-template-columns: 1fr; gap: 18px; }
  .actions .btn.primary { flex: 1 0 100%; justify-content: center; }
  .actions .btn:not(.primary) { flex: 1; justify-content: center; }
}

.r-body { display: grid; grid-template-columns: 360px 1fr; gap: 28px; margin-top: 36px; align-items: start; }
@media (max-width: 900px) { .r-body { grid-template-columns: 1fr; } }
.box { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.box h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; }
.box h2 small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.sticky { position: sticky; top: 76px; }
@media (max-width: 900px) { .sticky { position: static; } }
.ings { list-style: none; padding: 0; margin: 0; }
.ing { display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); }
.ing:last-child { border-bottom: 0; }
.ing img, .ing-ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--bg);
  display: grid; place-items: center; }
.ing-name { display: flex; flex-direction: column; line-height: 1.3; }
.ing-name small { color: var(--ink-3); font-size: 12px; }
.ing-amt { font-weight: 800; color: var(--brand); white-space: nowrap; }
.buy { font-size: 12px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.buy:hover { color: var(--brand); border-color: var(--brand); }
.ing-extra { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.disclosure { font-size: 11px; color: var(--ink-3); margin: 12px 0 0; }
.toolbox { display: flex; gap: 12px; align-items: center; margin-top: 16px; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.toolbox-ic { font-size: 28px; }
.toolbox b { font-size: 12px; color: var(--ink-3); }
.toolbox p { margin: 0; font-weight: 800; }
.toolbox small { color: var(--ink-2); font-size: 13px; }

.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; counter-reset: s; }
.step { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; scroll-margin-top: 80px; }
.step-pic { position: relative; }
.step-pic img { border-radius: 16px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.step-no { position: absolute; left: -8px; top: -8px; width: 36px; height: 36px; border-radius: 50%; background: var(--brand);
  color: #fff; font-weight: 900; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(242, 107, 29, .4); }
.step-txt h3 { font-size: 18px; font-weight: 800; }
.step-txt p { margin: 6px 0 0; font-size: 17px; }
.timer { margin-top: 10px; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 800; padding: 8px 14px;
  border-radius: 999px; font-size: 14px; }
.timer.running { background: var(--brand); color: #fff; }
@media (max-width: 640px) { .step { grid-template-columns: 112px 1fr; gap: 14px; } .step-txt p { font-size: 16px; } }

.times { width: 100%; border-collapse: collapse; }
.times th, .times td { text-align: left; padding: 10px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.times th { width: 36%; color: var(--ink-2); font-weight: 700; padding-right: 12px; }
.times td { font-weight: 700; }
.note { font-size: 13px; color: var(--ink-3); margin: 12px 0 0; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin: 6px 0; }
.vars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.var { background: var(--bg); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.var span { font-size: 24px; }
.var small { color: var(--ink-3); }
@media (max-width: 640px) { .vars { grid-template-columns: 1fr; } .var { flex-direction: row; align-items: center; gap: 10px; } }

.next { display: flex; align-items: center; gap: 14px; background: var(--cocoa); color: #fff; border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px; }
.next span { color: var(--gold); font-weight: 800; font-size: 13px; }
.next b { flex: 1; font-size: 19px; }
.next i { font-style: normal; font-weight: 800; color: var(--gold); white-space: nowrap; }
.next.soon i { font-size: 13px; opacity: .8; }
.ad-slot:empty { display: none; }

/* 냉장고 */
.fridge-hint { color: var(--ink-3); margin: 18px 0; }
.fridge-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.f-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center; background: var(--paper);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.f-item img { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; }
.f-item h3 { font-size: 17px; }
.f-item p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.f-item .have { color: var(--brand); font-weight: 700; }
.f-score { font-weight: 900; font-size: 18px; color: var(--brand); white-space: nowrap; }

/* 요리 모드 */
.cook { position: fixed; inset: 0; z-index: 50; background: var(--cocoa); color: #FFF8EE; display: flex; flex-direction: column; }
.cook[hidden] { display: none; }
.cook-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; gap: 12px; }
.cook-bar { flex: 1; display: flex; gap: 4px; }
.cook-bar i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.cook-bar i.on { background: var(--gold); }
.cook-x { background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.cook-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 22px;
  text-align: center; gap: 18px; overflow: auto; }
.cook-body img { width: min(62vw, 46vh); aspect-ratio: 1; object-fit: cover; border-radius: 22px; }
.cook-no { color: var(--gold); font-weight: 900; font-size: 18px; }
.cook-txt { font-size: clamp(24px, 4.6vw, 40px); font-weight: 800; line-height: 1.35; max-width: 820px; letter-spacing: -0.02em; }
.cook-timer { font-size: 20px; padding: 14px 24px; }
.cook-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
.cook-nav button { border: 0; border-radius: 16px; padding: 18px; font-size: 18px; font-weight: 800; }
.cook-prev { background: rgba(255, 255, 255, .12); color: #fff; }
.cook-next { background: var(--brand); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 정적 글 */
.prose { max-width: 760px; padding-bottom: 40px; }
.prose p { color: var(--ink-2); font-size: 17px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose a { color: var(--brand); font-weight: 700; }
.center { text-align: center; padding-top: 80px; }

/* 푸터 */
.foot { margin-top: 56px; padding: 36px 0 48px; border-top: 1px solid var(--line); }
.ig-cta { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); font-size: 16px; }
.ig-cta span:nth-child(2) { flex: 1; }
.ig-dot { width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: radial-gradient(circle at 30% 110%, #FFD776 0 25%, #F8582B 45%, #D92E7F 65%, #8A3AB9 90%); }
.foot-links { margin: 18px 0 4px; font-size: 14px; color: var(--ink-2); }
.foot-links a:hover { color: var(--brand); }
.foot-note { margin: 2px 0; font-size: 12px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
