
:root{--ink:#16140f;--muted:#6f6a61;--rule:#e8e4dc;--bg:#fbfaf8;--card:#fff;--accent:#2563eb;--radius:16px;--maxw:1080px;--readw:680px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:1.0625rem/1.7 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;letter-spacing:-.01em}
a{color:inherit}
h1,h2,h3{letter-spacing:-.02em;line-height:1.12}
img,iframe{max-width:100%}

.recipes-nav{display:flex;align-items:center;justify-content:space-between;max-width:var(--maxw);margin:0 auto;padding:22px 24px;border-bottom:1px solid var(--rule)}
.recipes-nav__brand{font-weight:800;font-size:1.2rem;text-decoration:none;letter-spacing:-.02em}
.recipes-nav__brand span{color:var(--muted)}
.recipes-nav nav a{margin-left:22px;text-decoration:none;color:var(--muted);font-weight:600;font-size:.95rem}
.recipes-nav nav a.active{color:var(--ink)}

.recipes-hero{max-width:var(--maxw);margin:0 auto;padding:72px 24px 12px}
.recipes-hero h1{font-size:clamp(2.4rem,6vw,3.4rem);margin:0 0 14px}
.recipes-hero p{color:var(--muted);font-size:1.15rem;max-width:620px;margin:0}

.recipes-grid{max-width:var(--maxw);margin:0 auto;padding:40px 24px 88px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}
.recipe-card{display:flex;flex-direction:column;background:var(--card);border:1px solid var(--rule);border-radius:var(--radius);overflow:hidden;text-decoration:none;color:inherit;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.recipe-card:hover{transform:translateY(-4px);box-shadow:0 18px 40px -22px rgba(0,0,0,.45);border-color:var(--accent)}
.recipe-card__icon{font-size:2rem;padding:26px 26px 0}
.recipe-card__body{padding:12px 26px 28px;display:flex;flex-direction:column;gap:6px;flex:1}
.recipe-card__badges{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.badge{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:4px 10px;border-radius:999px}
.badge-free{background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
.badge-pro{background:var(--accent);color:#fff}
.badge-cat{background:rgba(0,0,0,.05);color:var(--muted)}
.recipe-card__name{font-size:1.4rem;margin:.1em 0}
.recipe-card__tagline{color:var(--muted);margin:0}
.recipe-card__tags{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0 14px}
.tag{font-size:.78rem;color:var(--muted)}
.recipe-card__cta{margin-top:auto;font-weight:700;color:var(--accent)}

.recipe-detail{max-width:var(--readw);margin:0 auto;padding:32px 24px 96px}
.recipe-detail__back{display:inline-block;color:var(--muted);text-decoration:none;font-weight:600;font-size:.95rem;margin-bottom:28px}
.recipe-detail__back:hover{color:var(--ink)}
.recipe-detail__badges{display:flex;gap:8px;margin-bottom:18px}
.recipe-detail__head h1{font-size:clamp(2.2rem,6vw,3rem);margin:0 0 14px}
.recipe-detail__tagline{font-size:1.3rem;line-height:1.4;margin:0 0 16px}
.recipe-detail__desc{color:var(--muted);font-size:1.1rem;margin:0 0 24px}
.recipe-detail__meta{display:flex;gap:28px;flex-wrap:wrap;font-size:.92rem;color:var(--muted);padding:18px 0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}
.recipe-detail__meta strong{color:var(--ink)}
.recipe-detail h2{font-size:1.5rem;margin:56px 0 8px}

.recipe-preview__frame{width:100%;height:560px;border:1px solid var(--rule);border-radius:var(--radius);background:#fff;margin-top:14px;box-shadow:0 20px 50px -30px rgba(0,0,0,.5)}

.recipe-prompt__hint{color:var(--muted);margin:6px 0 26px;max-width:50ch;font-size:1.1rem}
.recipe-prompt__actions{display:flex;gap:16px;flex-wrap:wrap}
.recipe-prompt__actions .btn{flex:1 1 260px}
.recipe-prompt__src{display:none}
.btn{font:inherit;font-weight:800;cursor:pointer;border-radius:16px;padding:24px 40px;font-size:1.25rem;border:1.5px solid var(--ink);background:var(--ink);color:#fff;transition:transform .12s ease,opacity .12s ease;text-align:center}
.btn:hover{transform:translateY(-2px)}
.btn-copy{background:var(--accent);border-color:var(--accent);font-size:1.45rem;padding:28px 48px}
.btn-ghost{background:transparent;color:var(--ink)}
.btn[disabled]{opacity:.45;cursor:not-allowed;transform:none}

.recipe-how__steps{list-style:none;padding:0;margin:14px 0 0;display:flex;flex-direction:column;gap:22px}
.recipe-how__steps li{display:flex;gap:16px;align-items:flex-start;font-size:1.08rem;line-height:1.5}
.step-n{flex:0 0 30px;height:30px;border-radius:999px;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700;font-size:.9rem}

.recipe-pro{margin-top:56px;border:1px solid var(--rule);border-radius:var(--radius);padding:30px;background:color-mix(in srgb,var(--accent) 5%,var(--card))}
.recipe-pro h2{margin:0 0 6px}
.recipe-pro__teaser{color:var(--muted);margin:0 0 12px}
.recipe-pro__list{margin:0 0 24px;padding-left:20px;display:flex;flex-direction:column;gap:14px;line-height:1.5}

.recipes-footer{text-align:center;color:var(--muted);padding:40px;border-top:1px solid var(--rule);font-size:.9rem}

@media (max-width:640px){
  .recipe-preview__frame{height:460px}
  .recipe-detail{padding:24px 20px 72px}
  .recipes-hero{padding:48px 20px 8px}
  .btn-copy{width:100%}
}
@media (prefers-color-scheme:dark){
  :root{--ink:#f5f2ec;--muted:#a59f95;--rule:#2b2824;--bg:#100f0d;--card:#1a1815}
  .badge-cat{background:rgba(255,255,255,.08)}
  .btn-ghost{color:var(--ink);border-color:var(--ink)}
  .tier-switch{background:rgba(255,255,255,.08)}
}

/* ---- dynamic preview thumbnail on gallery cards ---- */
.recipe-card__preview{position:relative;height:200px;overflow:hidden;background:#e9eaee;border-bottom:1px solid var(--rule)}
.recipe-card__frame{width:100%;height:560px;border:0;display:block;pointer-events:none}
.recipe-card__icon{position:absolute;left:14px;bottom:12px;font-size:1.5rem;background:var(--card);width:42px;height:42px;border-radius:12px;display:grid;place-items:center;box-shadow:0 6px 16px -8px rgba(0,0,0,.5);z-index:1}

/* ---- segmented Free/Pro switch ---- */
.tier-switch{display:inline-flex;background:rgba(0,0,0,.06);border-radius:999px;padding:5px;gap:4px}
.tier-switch--gallery{margin-top:24px}
.tier-switch__btn{border:0;background:transparent;color:var(--muted);font:inherit;font-weight:700;padding:10px 28px;border-radius:999px;cursor:pointer;transition:background .15s ease,color .15s ease}
.tier-switch__btn.active{background:var(--card);color:var(--ink);box-shadow:0 2px 8px -2px rgba(0,0,0,.28)}

/* ---- typeui-style detail: preview stage (left) + details panel (right) ---- */
.recipe-detail{max-width:var(--maxw)}
.recipe-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:48px;align-items:start;margin-top:6px}
.recipe-stage{min-width:0}
.recipe-stage__frame{width:100%;height:800px;border:1px solid var(--rule);border-radius:var(--radius);background:#e9eaee;box-shadow:0 26px 64px -34px rgba(0,0,0,.55)}
.recipe-panel{position:sticky;top:24px;display:flex;flex-direction:column}
.recipe-panel__title{font-size:clamp(2rem,4vw,2.7rem);margin:14px 0 12px}
.recipe-panel__tagline{font-size:1.25rem;line-height:1.4;margin:0 0 14px}
.recipe-panel__desc{color:var(--muted);font-size:1.05rem;margin:0 0 22px}
.recipe-panel .tier-switch{margin:6px 0 24px;align-self:flex-start}
.tier-switch__btn{display:inline-flex;align-items:center;gap:7px}
.tier-switch__star{color:#e0b34d}
/* Pro tier = premium dark mode for the whole recipe page */
body.tier-pro{--ink:#f5f2ec;--muted:#a59f95;--rule:#2b2824;--bg:#0e0d0b;--card:#191714}
body.tier-pro .tier-switch{background:rgba(255,255,255,.1)}
body.tier-pro .badge-cat{background:rgba(255,255,255,.08)}
body.tier-pro .btn-ghost{color:var(--ink);border-color:var(--ink)}
body.tier-pro .recipe-stage__frame{box-shadow:0 28px 70px -30px rgba(0,0,0,.85)}
.recipe-panel .recipe-prompt__hint{margin:0 0 18px}
.recipe-panel .recipe-prompt__actions{flex-direction:column}
.recipe-panel .recipe-prompt__actions .btn{flex:none;width:100%}
.tier-pane[hidden]{display:none}
.recipe-how{max-width:var(--readw);margin:24px auto 0}
@media (max-width:860px){
  .recipe-layout{grid-template-columns:1fr;gap:28px}
  .recipe-panel{position:static;order:-1}
  .recipe-stage__frame{height:540px}
  .recipe-how{margin-top:8px}
}
