/* Álom Festő – oldal-elrendezések. tokens.css és components.css után töltődik. */
*,*::before,*::after{box-sizing:border-box}
body{margin:0;min-height:100vh;background:var(--surface-page);color:var(--ink);font-family:var(--font-body)}
a{color:var(--brand-700)}a:hover{color:var(--brand-900)}
button{font:inherit;color:inherit}
button:disabled{cursor:not-allowed;opacity:.5}
a:focus-visible,button:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.ic-svg{display:block;flex:none}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Márka (fejléc bal oldala) */
.af-brand{text-decoration:none;color:var(--on-brand)}
.af-brand:hover{color:var(--on-brand)}
.af-logo{flex:none}
.af-logo svg{width:55%;height:55%}

/* Lebegő / link gombok */
a.af-btn{text-decoration:none}
.af-btn--primary:hover{color:var(--on-brand)}
.af-btn--float .ic-svg{width:22px;height:22px}

/* ---------- Rajzoló ---------- */
.draw-top{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"brand prompt stars";align-items:center;gap:var(--space-6);padding:var(--space-4) var(--space-8);background:var(--brand-500);color:var(--on-brand)}
.draw-top .af-brand{grid-area:brand}
.draw-top .af-prompt{grid-area:prompt;margin:0 auto;width:100%}
.draw-top .af-stars{grid-area:stars;margin:0}
.af-logo{width:72px;height:72px}
.af-prompt .wave{margin-left:auto;flex:none;opacity:0}
.af-mic{display:grid;place-items:center;border:4px solid transparent}
.af-mic svg{width:30px;height:30px}
.af-mic[aria-pressed="true"]{border-color:var(--star)}
.af-mic[aria-pressed="true"] ~ .wave{opacity:1;animation:afwave .6s ease-in-out infinite alternate}
@keyframes afwave{to{transform:scaleY(.6)}}
@media (prefers-reduced-motion:reduce){.af-mic[aria-pressed="true"] ~ .wave{animation:none}}
.af-prompt-text{display:flex;flex-direction:column;min-width:0}
.af-stars-compact{display:none}

.draw-main{width:100%;max-width:1340px;margin:0 auto;padding:var(--space-6) var(--space-8) var(--space-8);display:flex;flex-direction:column;align-items:center;gap:var(--space-6)}
.float-row{align-self:stretch;display:flex;justify-content:flex-end;margin-bottom:calc(var(--space-2) * -1)}

.af-canvas{align-self:stretch;aspect-ratio:auto;height:clamp(320px,56vh,640px);overflow:hidden;touch-action:none}
.af-canvas canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
#paint{cursor:crosshair}
#lines{pointer-events:none;mix-blend-mode:multiply;opacity:0;transition:opacity .4s}
#lines.on{opacity:1}
.af-canvas .empty{position:relative;pointer-events:none;padding:var(--space-4)}
.af-canvas .empty svg{width:72px;height:72px;display:block;margin:0 auto var(--space-2)}
.af-canvas .loading{position:absolute;inset:0;background:var(--surface-card);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-4);font-family:var(--font-display);font-size:24px;font-weight:800;color:var(--brand-700)}
.af-canvas .loading[hidden],.af-canvas .empty[hidden]{display:none}
.spinner{width:56px;height:56px;border:6px solid var(--surface-page);border-top-color:var(--brand-500);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}

.tools-row{display:flex;flex-wrap:wrap;gap:var(--space-4);align-items:center;justify-content:center}
.af-tool svg{width:32px;height:32px;stroke:var(--brand-700)}
.af-tool[aria-pressed="true"] svg{stroke:var(--on-brand)}
.af-tool:hover{transform:translateY(-2px)}
.af-size i{background:var(--dot,var(--brand-500))}
.af-size.light i{box-shadow:inset 0 0 0 2px var(--brand-300)}
.af-palette{justify-content:center}
.af-crayon .stick{transition:transform .15s}
.af-crayon:hover .stick{transform:translateY(-3px)}
.actions{display:flex;flex-wrap:wrap;gap:var(--space-6);justify-content:center}
.af-btn .ic-svg{width:26px;height:26px}

/* Tablet */
@media (max-width:1199px){
  .draw-top{grid-template-columns:auto 1fr;grid-template-areas:"brand stars" "prompt prompt";row-gap:var(--space-4)}
  .draw-top .af-stars{justify-self:end}
  .draw-top .af-prompt{max-width:none}
  .af-canvas{height:auto;aspect-ratio:4/3}
  .af-palette{max-width:calc(6 * 64px + 5 * var(--space-3) + 2 * var(--space-6))}
}

/* Mobil */
@media (max-width:767px){
  body.drawing{padding-bottom:96px}
  .draw-top{background:linear-gradient(var(--brand-500) 0 80px,transparent 80px);padding:var(--space-4);column-gap:var(--space-3);row-gap:calc(var(--space-4) * 2)}
  .af-logo{width:48px;height:48px;border-radius:14px}
  .af-brand{gap:var(--space-3)}
  .af-brand h1{font-size:26px;line-height:28px}
  .af-brand p{display:none}
  .draw-top .af-stars{display:none}
  .af-stars-compact{display:flex;align-items:center;gap:var(--space-1);justify-self:end;grid-area:stars;background:var(--brand-700);border-radius:var(--radius-pill);padding:6px 12px;font-weight:800;font-size:16px}
  .af-stars-compact svg{width:20px;height:20px}
  .af-prompt{background:var(--brand-500);padding:6px var(--space-4) 6px 6px;gap:var(--space-3)}
  .af-mic{width:56px;height:56px}
  .af-prompt strong{font-size:19px;line-height:23px}
  .af-prompt small{font-size:13px}
  .af-prompt .wave{display:none}
  .draw-main{padding:var(--space-4);gap:var(--space-4)}
  .float-row{margin:0}
  .float-row .af-btn{width:100%;justify-content:center}
  .tools-row{align-self:stretch;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;padding-bottom:var(--space-1)}
  .af-toolbar{flex:none}
  .af-tool{width:56px;height:56px;border-radius:16px}
  .af-tool svg{width:28px;height:28px}
  .af-sizes{flex:none;padding:var(--space-1) var(--space-2);gap:var(--space-1)}
  .af-palette{align-self:stretch;max-width:none;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;padding:var(--space-3);gap:var(--space-2)}
  .af-crayon{flex:none;width:60px}
  .af-crayon .stick{width:40px;height:40px}
  .actions{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--surface-card);padding:var(--space-3) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));gap:var(--space-2);flex-wrap:nowrap;box-shadow:0 -4px 14px rgba(214,31,105,.12)}
  .actions .af-btn{height:56px;padding:0;width:56px;flex:none;justify-content:center;font-size:20px}
  .actions .af-btn .lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .actions .af-btn--primary{flex:1;width:auto}
  .actions .af-btn--primary .lbl{position:static;width:auto;height:auto;clip:auto}
  .actions .af-btn .ic-svg{width:24px;height:24px}
}

/* Toast */
.toast{position:fixed;left:50%;bottom:var(--space-6);z-index:50;transform:translate(-50%,160%);background:var(--brand-900);color:var(--on-brand);padding:var(--space-3) var(--space-6);border-radius:var(--radius-pill);font-family:var(--font-display);font-size:20px;font-weight:800;box-shadow:var(--shadow-lift);visibility:hidden;transition:transform .3s ease,visibility 0s .3s;max-width:calc(100% - 2 * var(--space-4));text-align:center}
.toast.show{transform:translate(-50%,0);visibility:visible;transition:transform .3s ease}
@media (max-width:767px){.toast{bottom:104px}}

/* Megerősítő párbeszéd */
.af-dialog{border:0;border-radius:var(--radius-lg);padding:var(--space-8) var(--space-6);max-width:min(440px,calc(100% - 2 * var(--space-4)));text-align:center;color:var(--ink);box-shadow:var(--shadow-lift)}
.af-dialog::backdrop{background:rgba(107,26,63,.35)}
.af-dialog .big{width:96px;height:96px;margin:0 auto var(--space-4);border-radius:50%;background:var(--surface-soft);display:grid;place-items:center}
.af-dialog .big svg{width:52px;height:52px}
.af-dialog h2{margin:0 0 var(--space-6);font-family:var(--font-display);font-size:28px;line-height:34px;font-weight:800}
.af-dialog .row{display:flex;flex-wrap:wrap;gap:var(--space-3);justify-content:center}

/* ---------- Közös felső navigáció (Kezdőlap, Galéria) ---------- */
.site-head{background:var(--brand-500);color:var(--on-brand)}
.site-nav{max-width:1280px;margin:0 auto;padding:var(--space-4) var(--space-8);display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-6)}
.site-nav .af-logo{width:64px;height:64px}
.site-nav .af-brand h1,.site-nav .af-brand .name{margin:0;font-family:var(--font-display);font-size:34px;line-height:36px;font-weight:800}
.site-nav .af-brand p{font-size:16px}
.nav-links{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-left:auto;align-items:center}
.nav-links a.lnk{color:var(--on-brand);text-decoration:none;font-weight:800;font-size:18px;padding:12px 18px;border-radius:var(--radius-pill)}
.nav-links a.lnk:hover{background:var(--brand-400)}
.nav-cta{display:inline-flex;align-items:center;gap:var(--space-2);height:52px;padding:0 var(--space-6);border-radius:var(--radius-pill);background:var(--surface-card);color:var(--brand-700);text-decoration:none;font-family:var(--font-display);font-size:20px;font-weight:800}
.nav-cta:hover{color:var(--brand-900)}
.nav-cta svg{width:20px;height:20px}
@media (max-width:767px){
  .site-nav{padding:var(--space-4);gap:var(--space-3)}
  .site-nav .af-logo{width:48px;height:48px}
  .site-nav .af-brand h1,.site-nav .af-brand .name{font-size:26px;line-height:28px}
  .nav-links{margin-left:0;width:100%}
  .nav-links a.lnk{padding:10px 12px;font-size:17px}
  .nav-links .nav-cta{margin-left:auto}
}

/* ---------- Kezdőlap ---------- */
.wrap{max-width:1280px;margin:0 auto;padding-left:var(--space-8);padding-right:var(--space-8)}
.hero{padding-top:72px;padding-bottom:56px;display:flex;flex-wrap:wrap;gap:56px;align-items:center}
.hero-copy{flex:1 1 420px;min-width:0;display:flex;flex-direction:column;gap:var(--space-6)}
.badge{align-self:flex-start;background:var(--surface-card);color:var(--brand-700);font-weight:800;font-size:15px;letter-spacing:.06em;text-transform:uppercase;padding:var(--space-2) var(--space-4);border-radius:var(--radius-pill)}
.hero h1{margin:0;font-family:var(--font-display);font-size:68px;line-height:70px;font-weight:800}
.lead{margin:0;font-size:20px;line-height:30px;font-weight:600;color:var(--ink-muted);max-width:520px}
.btn-row{display:flex;flex-wrap:wrap;gap:var(--space-4)}
.hero-art{flex:1 1 520px;min-width:0;display:flex;flex-direction:column;gap:var(--space-4)}
.hero-art .af-prompt{max-width:none;flex:none}
.hero-art .af-mic{width:56px;height:56px;cursor:default}
.hero-canvas{background:var(--surface-card);border:3px solid var(--brand-300);border-radius:var(--radius-lg);box-shadow:var(--shadow-soft);padding:var(--space-6);display:grid;place-items:center;aspect-ratio:4/3}
.hero-canvas img{width:100%;height:100%;object-fit:contain}
.how{padding-top:var(--space-6);padding-bottom:72px;display:flex;flex-direction:column;gap:var(--space-8)}
.how h2,.parents h2{margin:0;font-family:var(--font-display);font-size:44px;line-height:48px;font-weight:800;text-align:center}
.steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:var(--space-6)}
.step{background:var(--surface-card);border-radius:var(--radius-lg);padding:var(--space-8);box-shadow:var(--shadow-soft);display:flex;flex-direction:column;gap:var(--space-3)}
.step .tile{width:64px;height:64px;border-radius:var(--radius-md);display:grid;place-items:center}
.step .tile svg{width:32px;height:32px}
.step h3{margin:0;font-family:var(--font-display);font-size:26px;line-height:32px;font-weight:800}
.step p,.parents p{margin:0;font-size:17px;line-height:26px;font-weight:600;color:var(--ink-muted)}
.parents{background:var(--surface-card)}
.parents .wrap{padding-top:64px;padding-bottom:64px;display:flex;flex-wrap:wrap;gap:var(--space-12);align-items:flex-start}
.parents .intro{flex:1 1 360px;min-width:0;display:flex;flex-direction:column;gap:var(--space-4)}
.parents h2{font-size:40px;line-height:44px;text-align:left}
.overline-lbl{font-size:15px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--brand-700)}
.facts{flex:1 1 480px;min-width:0;margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:var(--space-4)}
.facts li{display:flex;gap:var(--space-4);align-items:flex-start;background:var(--surface-soft);border-radius:20px;padding:20px var(--space-6);font-size:17px;line-height:26px;font-weight:700}
.facts svg{width:28px;height:28px;flex:none}
.site-foot{padding-top:var(--space-8);padding-bottom:var(--space-8);display:flex;flex-wrap:wrap;gap:var(--space-6);justify-content:space-between;font-size:15px;font-weight:700;color:var(--ink-muted)}
.site-foot nav{display:flex;gap:var(--space-6)}
@media (max-width:767px){
  .wrap{padding-left:var(--space-4);padding-right:var(--space-4)}
  .hero{padding-top:var(--space-8);gap:var(--space-8)}
  .hero h1{font-size:44px;line-height:48px}
  .hero-art .af-prompt strong{font-size:19px;line-height:23px}
  .how h2,.parents h2{font-size:34px;line-height:38px}
  .step{padding:var(--space-6)}
}

/* ---------- Galéria ---------- */
.gal-main{max-width:1280px;margin:0 auto;padding:40px var(--space-8) 64px;display:flex;flex-direction:column;gap:28px}
.gal-head{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-4);justify-content:space-between}
.gal-head h1{margin:0;font-family:var(--font-display);font-size:48px;line-height:52px;font-weight:800}
.gal-head p{margin:var(--space-1) 0 0;font-size:18px;font-weight:700;color:var(--ink-muted)}
.seg{display:flex;gap:var(--space-2);padding:6px;background:var(--surface-card);border-radius:var(--radius-pill)}
.seg button{height:44px;padding:0 20px;border:0;border-radius:var(--radius-pill);background:transparent;color:var(--ink);font-size:16px;font-weight:800;cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--brand-500);color:var(--on-brand)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--space-6)}
.card{background:var(--surface-card);border-radius:var(--radius-lg);box-shadow:var(--shadow-soft);padding:var(--space-4);display:flex;flex-direction:column;gap:var(--space-3)}
.card .thumb{aspect-ratio:4/3;border:3px solid var(--brand-300);border-radius:20px;overflow:hidden;display:grid;place-items:center;background:var(--surface-card)}
.card .thumb img{width:100%;height:100%;object-fit:contain}
.card .title-row{display:flex;align-items:center;gap:var(--space-2)}
.card h2{margin:0;flex:1;min-width:0;font-family:var(--font-display);font-size:22px;line-height:26px;font-weight:800;overflow-wrap:anywhere}
.card .meta{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
.card .meta span{font-size:15px;font-weight:700;color:var(--ink-muted)}
.icon-btn{width:44px;height:44px;flex:none;border:0;border-radius:50%;background:var(--surface-soft);display:grid;place-items:center;cursor:pointer}
.icon-btn svg{width:24px;height:24px}
.icon-btn[aria-pressed="true"]{background:var(--brand-500)}
.icon-btn[aria-pressed="true"] svg path{fill:var(--on-brand);stroke:var(--on-brand)}
.new-card{aspect-ratio:4/3;border:3px dashed var(--brand-700);border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);text-decoration:none;color:var(--brand-700);background:var(--surface-soft);font-family:var(--font-display);font-size:22px;font-weight:800}
.new-card svg{width:44px;height:44px}
.empty-note{margin:0;font-size:15px;font-weight:700;color:var(--ink-muted)}
@media (max-width:767px){
  .gal-main{padding:var(--space-6) var(--space-4) 48px}
  .gal-head h1{font-size:36px;line-height:40px}
}
