/* The Logo Forge (CL-213): ONE set of styles for /logo-forge/, home's Brand Studio and /branding/. Markup: site/_build/parts/forge.html.
   On the page it loads with the page; on home and /branding/ akarec-forge-panel.js adds it when the forge comes near the screen.
   Everything is scoped under .lfg (the page wrapper, or the embed host), so nothing leaks into the template. Colours come from
   the site's tokens and roles, so Day/Night and the visitor's colour mix work here as everywhere else. */
.lfg { --lfg-pri: var(--mx-pri, var(--p-amber)); --lfg-hi: var(--mx-hi, var(--p-citron)); --lfg-r: 18px; --lfg-violet: #7C5CFF; }
.lfg [hidden] { display: none !important; }

/* buttons inside the stage and cards (the template's .ak-button is used for the big ones) */
.lfg .lfg-btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--ak-border);
  background: transparent; color: var(--ak-text-main); font: 600 .9rem/1.1 Inter, sans-serif; cursor: pointer; text-decoration: none; transition: transform .15s, border-color .2s, background .2s; }
.lfg .lfg-btn:hover { transform: translateY(-1px); border-color: var(--lfg-pri); }
.lfg .lfg-btn:focus-visible, .lfg .lfg-chip:focus-visible, .lfg-dlg input:focus-visible, .lfg-dlg .lfg-btn:focus-visible { outline: 3px solid var(--ak-sky); outline-offset: 2px; }
.lfg .lfg-btn--gold, .lfg-dlg .lfg-btn--gold { background: linear-gradient(135deg, var(--lfg-hi), var(--lfg-pri) 55%, var(--p-gold)); color: var(--p-obsidian, #060A12); border-color: transparent; box-shadow: 0 8px 24px -10px var(--lfg-pri); }
.lfg .lfg-btn--gold .lfg-price { font-weight: 800; padding-left: .55rem; border-left: 1px solid rgba(6, 10, 18, .25); }
.lfg .lfg-btn[disabled], .lfg-dlg .lfg-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.lfg .lfg-btn--sm { min-height: 40px; padding: .45rem .9rem; font-size: .84rem; }

/* the forge stage */
.lfg-forge { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); margin-top: 2rem; border: 1px solid var(--ak-border); border-radius: 24px; overflow: hidden; background: var(--ak-surface); scroll-margin-top: 90px; }
.lfg-stage { position: relative; min-height: clamp(320px, 46vw, 540px); background: radial-gradient(at 50% 30%, #16233F, #04070F 75%); }
/* CL-289 (Frank): Day keeps the same blue studio as Night inside the spin area (no Day override here or in forge-service.js) */
.lfg-stage canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.lfg-still { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ak-text-muted); font-size: .9rem; }
.lfg-still:has(img) { background: #05070C; }   /* the bands round the still match its dark studio edges, Day and Night */
.lfg-still img { width: 100%; height: auto; max-height: 100%; object-fit: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); }   /* no hard line where the band meets the still */   /* the whole logo shows, whatever the stage shape */
.lfg-tag { position: absolute; left: 14px; top: 14px; z-index: 2; font: 600 .72rem/1 Inter, sans-serif; letter-spacing: .06em; padding: .45rem .7rem; border-radius: 999px;
  background: rgba(6, 10, 18, .62); color: #FAF8F5; border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); pointer-events: none; }
.lfg-tag.is-proof { background: rgba(232, 181, 74, .92); color: #060A12; border-color: transparent; }
.lfg-cap { position: absolute; right: 14px; bottom: 12px; z-index: 2; font-size: .72rem; color: rgba(250, 248, 245, .78); pointer-events: none; }
.lfg .lfg-pause { position: absolute; right: 12px; top: 12px; z-index: 3; min-height: 36px; padding: .4rem .8rem; font-size: .78rem; background: rgba(6, 10, 18, .55); color: #FAF8F5; border-color: rgba(255, 255, 255, .2); }
.lfg-panel { padding: clamp(18px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 1.05rem; border-left: 1px solid var(--ak-border-subtle); }
.lfg-panel h2 { font-size: 1.35rem; margin: .3rem 0 0; }
.lfg-group { display: flex; justify-content: space-between; align-items: baseline; font: 700 .72rem/1 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--ak-text-muted); margin-bottom: .55rem; }
.lfg-group span:last-child { letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--ak-amber); }
.lfg-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.lfg-pickgroup + .lfg-pickgroup { margin-top: .7rem; }   /* CL-244: the second label no longer touches the chips above it (phones lay the chips out as one grid, below) */
.lfg .lfg-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--ak-border-subtle); background: transparent; color: var(--ak-text-main); font: 500 .86rem Inter, sans-serif; cursor: pointer; }
.lfg .lfg-chip[aria-pressed="true"] { border-color: var(--lfg-pri); background: color-mix(in srgb, var(--lfg-pri) 16%, transparent); font-weight: 700; }
.lfg-sw { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); display: inline-block; }
.lfg-sw--gold { background: linear-gradient(135deg, #FFE7A3, #E8B54A 50%, #8A6420); } .lfg-sw--chrome { background: linear-gradient(135deg, #fff, #C9CED6 50%, #6B7280); }
.lfg-sw--rose { background: linear-gradient(135deg, #FFD9CC, #E7A28C 50%, #9A5A48); } .lfg-sw--black { background: linear-gradient(135deg, #6B7280, #2A2D33 55%, #0B0C0F); }
.lfg-sw--plate { background: repeating-linear-gradient(45deg, #E5E7EB 0 3px, #9AA1AB 3px 6px); } .lfg-sw--diamond { background: conic-gradient(from 30deg, #fff, #BFE3FF, #F5D0FE, #fff, #C7F9E5, #fff); }
.lfg-sw--molten { background: radial-gradient(circle at 40% 40%, #FFE08A, #FF7A1A 45%, #3A1206 80%); } .lfg-sw--matter { background: radial-gradient(circle at 35% 35%, #7C5CFF, #05050A 55%); }
.lfg-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; border: 1px solid var(--ak-border-subtle); }
.lfg-seg button { min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--ak-text-main); font: 600 .84rem Inter, sans-serif; cursor: pointer; }
.lfg-seg button[aria-pressed="true"] { background: var(--ak-text-main); color: var(--ak-obsidian); }
.lfg-note { font-size: .86rem; color: var(--ak-text-muted); min-height: 2.6em; margin: 0; }
.lfg-note b { color: var(--ak-text-main); }
.lfg-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.lfg-msg { font: 500 .78rem/1.4 'JetBrains Mono', ui-monospace, monospace; color: var(--ak-text-muted); margin: 0; }
.lfg-proofbar { display: none; grid-column: 1 / -1; padding: 14px clamp(18px, 2.4vw, 28px); border-top: 1px solid var(--ak-border-subtle); gap: .8rem 1.2rem; align-items: center; flex-wrap: wrap; background: color-mix(in srgb, var(--lfg-pri) 7%, transparent); }
.lfg-forge.is-proof .lfg-proofbar { display: flex; }
.lfg-proofbar p { flex: 1 1 320px; font-size: .86rem; color: var(--ak-text-muted); margin: 0; } .lfg-proofbar p b { color: var(--ak-text-main); }

/* phones: the label and the Pause button would meet at the top of the stage, so Pause moves to the bottom corner */
@media (max-width: 560px) { .lfg .lfg-pause { top: auto; bottom: 12px; } .lfg-cap { display: none; } }

/* L1: the line under the hero still when the live 3D doesn't load */
.lfg-still-note { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; margin: 0; padding: .5rem .75rem; border-radius: 12px; font-size: .8rem; line-height: 1.4;
  background: rgba(6, 10, 18, .72); color: #FAF8F5; backdrop-filter: blur(6px); }

/* CL-205 (GM): on first load at 1440x900 the "Mix the brand colors" bar (signature feature, fixed bottom right) lay over
   the fourth Atelier chip. Page side only: a slightly wider panel and tighter spacing let three Atelier chips share the
   first row, so the fourth starts a row at the panel's left edge, clear of the bar (also at 1366x768). The bar is untouched. */
@media (min-width: 861px) {
  .lfg-forge { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
  .lfg-panel { gap: .8rem; }
}

/* stacked layout (tablet and phone) */
@media (max-width: 860px) {
  .lfg-forge { grid-template-columns: minmax(0, 1fr); } .lfg-panel { min-width: 0; border-left: 0; border-top: 1px solid var(--ak-border-subtle); }   /* minmax(0,…): the sideways chip row may not widen the column */
  .lfg-stage { min-height: 340px; }
}

/* CL-213 phone layout (Frank: the stage, the material picker and the result all visible together, no scrolling up and down).
   About 430 px in all at 375 px wide: the stage (16:10), ONE sideways row with all 8 materials, the price line, the buttons.
   The heading and the Live/Proof switch drop below (the switch) or go (the heading: the page or section above already says it). */
@media (max-width: 600px) {
  .lfg-forge { border-radius: 18px; }
  .lfg-stage { min-height: 0; aspect-ratio: 16 / 10; }
  .lfg-panel { padding: 10px 12px 14px; gap: .55rem; }
  .lfg-head { display: none; }
  /* CL-231 (Frank, on his iPhone): all 8 materials show at once, 2 rows of 4, nothing to swipe to */
  .lfg-pick { order: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: 0; }
  .lfg-pickgroup { display: contents; }
  .lfg-group { display: none; }
  .lfg-chips { display: contents; }
  .lfg .lfg-chip { flex-direction: column; justify-content: center; gap: .2rem; min-height: 44px; padding: .3rem .25rem; border-radius: 12px; font-size: .72rem; line-height: 1.1; text-align: center; white-space: normal; }
  .lfg .lfg-chip .lfg-sw { width: 16px; height: 16px; flex: none; }
  .lfg-note { order: 2; min-height: 0; font-size: .8rem; line-height: 1.35; }
  .lfg-actions { order: 3; flex-wrap: nowrap; }
  .lfg-actions .lfg-btn { flex: 1 1 0; padding-left: .6rem; padding-right: .6rem; }
  .lfg-seg { order: 4; }
  .lfg-msg { order: 5; }
}

/* the embed on home and /branding/ (the host div gets class "lfg lfg-embed"): a card like the rest of Brand Studio */
.lfg-embed { display: block; }
.lfg-embed .lfg-forge { margin-top: 0; }
/* CL-244: under the embed, the four packages in one line each (name, what's in it, price); each goes to its card on /logo-forge/ */
.lfg-embed .lfg-next { margin: 1.1rem 0 0; }
.lfg-embed .lfg-next p { margin: 0 0 .8rem; max-width: 74ch; font-size: .95rem; line-height: 1.5; color: var(--ak-text-muted); }
.lfg-embed .lfg-next p b { color: var(--ak-text-main); }
.lfg-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.lfg-ladder a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .6rem; align-items: baseline; height: 100%; box-sizing: border-box; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--ak-border-subtle); background: var(--ak-surface); color: var(--ak-text-main); text-decoration: none; transition: transform .15s, border-color .2s; }
.lfg-ladder a:hover { transform: translateY(-1px); border-color: var(--lfg-pri); }
.lfg-ladder a:focus-visible { outline: 3px solid var(--ak-sky); outline-offset: 2px; }
.lfg-ladder b { font: 800 1rem/1.2 Montserrat, sans-serif; }
.lfg-ladder i { font: 800 1.15rem/1 Montserrat, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; color: var(--tier, var(--ak-amber)); }
.lfg-ladder span { grid-column: 1 / -1; font-size: .84rem; line-height: 1.45; color: var(--ak-text-muted); }
html[data-theme="day"] .lfg-ladder i { color: var(--tier-deep, var(--p-amber-brown, #B45309)); }
@media (max-width: 1060px) { .lfg-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lfg-ladder { grid-template-columns: 1fr; } }
