/* Betűk a saját domainről (SIL Open Font License), csak latin és latin-ext. */
/* Bricolage Grotesque – latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Bricolage Grotesque – latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Figtree – latin-ext */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(../fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Figtree – latin */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(../fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --paper: #D8D5CC;
    --paper-2: #CCC8BD;
    --ink: #1D201E;
    --ink-soft: #545852;
    --line: #ADA99E;
    --focus: #1F2D4A;
    --ok: #2E4A36;
    --err: #7A2230;
    --grain-opacity: .10;
    color-scheme: light;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #1F211E;
      --paper-2: #292B27;
      --ink: #E7E2D7;
      --ink-soft: #A6A297;
      --line: #42443E;
      --focus: #E3B23C;
      --ok: #9CC3A4;
      --err: #E8A0AB;
      --grain-opacity: .07;
      color-scheme: dark;
    }
  }
  *, *::before, *::after { box-sizing: inherit; }
  html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
  body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  /* címek: Bricolage, minden más: Figtree */
  h1, h2 {
    font-family: "Bricolage Grotesque", "Figtree", "Avenir Next", system-ui, sans-serif;
  }
  /* analóg szemcse az egész oldalon */
  body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  }

  .wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  }
  .logotype .mark { display: block; width: 132px; aspect-ratio: 2134 / 507; background: currentColor; -webkit-mask: url(../assets/logos/bratanki.svg) center / contain no-repeat; mask: url(../assets/logos/bratanki.svg) center / contain no-repeat; }
  .logotype { margin: 0 0 clamp(1.5rem, 4vw, 3rem); }

  .grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "stage" "pick" "order";
  }
  .head { grid-area: head; }
  .stage-col { grid-area: stage; min-width: 0; }
  .pick { grid-area: pick; }
  .order { grid-area: order; }
  @media (min-width: 880px) {
    .grid {
      grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
      grid-template-areas: "head head" "stage pick" "stage order";
      grid-template-rows: auto auto 1fr;
      column-gap: clamp(1.5rem, 4vw, 3.5rem);
      row-gap: 2rem;
      align-items: start;
    }
    .stage-col { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1.5rem); }
    .mini-gallery { display: block; }
    .live { display: none; }
  }

  /* a sapka színpada */
  .stage {
    background: var(--paper-2);
    border-radius: 28px;
    padding: clamp(.75rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: .5rem;
  }
  .stage svg { width: 100%; height: auto; display: block; }
  .views { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .views figure { margin: 0; }
  .views figcaption { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; text-align: center; font-size: .85rem; font-weight: 500; letter-spacing: .01em; color: var(--ink-soft); margin-top: -.35rem; }
  .stage-caption {
    margin: 0;
    font-size: .95rem;
    color: var(--ink-soft);
    text-align: center;
    min-height: 1.5em;
  }

  h1 {
    font-weight: 700;
    font-variation-settings: "opsz" 96;
    font-size: clamp(2.6rem, 6.5vw, 4.4rem);
    line-height: .95;
    letter-spacing: -.02em;
    margin: 0 0 .9rem;
  }
  .lede { margin: 0; max-width: 46ch; color: var(--ink-soft); font-size: 1.125rem; }
  /* sehol ne maradjon egyetlen szó árván a sor végén */
  p, .field-label, legend { text-wrap: pretty; }

  fieldset { border: 0; margin: 0 0 1.75rem; padding: 0; min-width: 0; }
  legend, .field-label {
    font-weight: 650;
    font-size: 1.0625rem;
    margin-bottom: .75rem;
    padding: 0;
  }
  .legend-value { font-weight: 400; color: var(--ink-soft); }

  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }

  /* színválasztó: szövetkorongok */
  .swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 48px)); gap: clamp(.45rem, 2vw, .7rem); }
  .swatch { position: relative; cursor: pointer; }
  .swatch span {
    display: block;
    width: 100%; aspect-ratio: 1;
    border-radius: 50%;
    background: var(--c);
    box-shadow: inset 0 -6px 10px rgba(0,0,0,.22), inset 0 4px 8px rgba(255,255,255,.14);
    outline: 2px solid transparent;
    outline-offset: 3px;
    transition: outline-color .15s, transform .15s;
  }
  .swatch input:checked + span { outline-color: var(--ink); }
  .swatch input:focus-visible + span { outline: 3px solid var(--focus); }
  .swatch:hover span { transform: scale(1.06); }

  /* minta-választó */
  .patterns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .pattern { cursor: pointer; display: flex; }
  .pattern span { flex: 1; }
  /* a B betű tömör, ezért kisebbre vesszük, hogy optikailag akkora legyen, mint az elem-logók */
  .pattern .icon-letter { -webkit-mask-size: auto 68%; mask-size: auto 68%; }
  .pattern span {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem .9rem;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: border-color .15s, background-color .15s;
  }
  .pattern .icon { width: 26px; height: 26px; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
  .pattern input:checked + span { border-color: var(--ink); background: var(--paper-2); }
  .pattern input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

  button {
    font: inherit;
    cursor: pointer;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    padding: .8rem 1.4rem;
    font-weight: 650;
    background: transparent;
    color: var(--ink);
  }
  button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  button[disabled] { opacity: .5; cursor: not-allowed; }
  .btn-solid { background: var(--ink); color: var(--paper); }

  /* a lista */
  .qty { display: flex; align-items: center; gap: .5rem; }
  .qty button { padding: 0; width: 44px; height: 44px; border-width: 1.5px; line-height: 1; font-size: 1.3rem; }
  .qty output { min-width: 2ch; text-align: center; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
  .pick fieldset:last-of-type { margin-bottom: 1.25rem; }
  .order { padding-top: 1.75rem; border-top: 1.5px solid var(--line); }
  .order .btn-solid { width: 100%; padding: 1rem 1.4rem; font-size: 1.0625rem; }
  .actions { display: flex; flex-direction: column; gap: .75rem; }
  .btn-ghost { width: 100%; padding: 1rem 1.4rem; border-color: var(--line); font-weight: 600; }
  .btn-ghost:hover { border-color: var(--ink); }
  .text-link { align-self: center; border: 0; padding: .6rem .25rem; background: none; font-weight: 600; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
  .text-link:hover { color: var(--ink); }

  /* ötlet-panel: mobilon alulról felcsúszik, asztalin középen nyílik */
  dialog.sheet { border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(520px, calc(100% - 2rem)); max-width: 100%; max-height: calc(100dvh - 2rem); overflow: auto; border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
  dialog.sheet::backdrop { background: rgba(12, 13, 12, .55); }
  .sheet-inner { padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
  .sheet h2 { font-size: clamp(1.8rem, 6vw, 2.2rem); line-height: 1; letter-spacing: -.02em; margin: 0 0 .5rem; }
  .sheet-lede { margin: 0 0 1.25rem; color: var(--ink-soft); }
  .sheet-handle { display: none; }
  #ideaDone .btn-ghost { width: 100%; }
  .sheet .status:empty { display: none; }
  .ts:empty { display: none; }
  .ts { margin: 0 0 1rem; }

  /* mobilon tömörebb fejléc, hogy a sapka és a színek már az első képernyőn látszódjanak */
  @media (max-width: 879px) {
    .wrap { padding-top: 1rem; }
    .logotype { margin-bottom: 1.1rem; }
    .logotype .mark { width: 100px; }
    h1 { font-size: clamp(2rem, 8.6vw, 2.6rem); margin-bottom: .5rem; }
    .lede { font-size: 1rem; }
    .grid { gap: 1.25rem; }
    .stage { padding: .5rem .75rem .75rem; }
    .stage-caption { font-size: .9rem; }
  }

  /* valódi fotók a sapka alatt (csak asztali nézetben) */
  .mini-gallery { margin-top: 1rem; }
  @media (max-width: 879px) { .mini-gallery { display: none; } }
  .mini-label { margin: 0 0 .5rem; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
  /* bármennyi kép egy sorban */
  .mini-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .6rem; }
  .mini-thumbs button { padding: 0; border: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; cursor: zoom-in; background: var(--paper-2); }
  .mini-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
  .mini-thumbs button:hover img { transform: scale(1.04); }
  dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1000px, 92vw); max-height: 90dvh; overflow: visible; }
  dialog.lightbox::backdrop { background: rgba(8, 9, 8, .82); }
  dialog.lightbox img { display: block; max-width: 100%; max-height: 90dvh; border-radius: 16px; }
  .lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; padding: 0 0 4px; border: 0; background: var(--paper); color: var(--ink); font-size: 2rem; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
  .lightbox-nav.prev { left: -24px; }
  .lightbox-nav.next { right: -24px; }
  @media (max-width: 700px) { .lightbox-nav.prev { left: .5rem; } .lightbox-nav.next { right: .5rem; } }
  .lightbox-count { position: absolute; left: 0; right: 0; bottom: -2rem; margin: 0; text-align: center; color: #E7E2D7; font-size: .9rem; font-variant-numeric: tabular-nums; }
  .lightbox-close { position: absolute; top: -.75rem; right: -.75rem; width: 44px; height: 44px; padding: 0; border: 0; background: var(--paper); color: var(--ink); font-size: 1.5rem; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
  .field-error { margin: .4rem 0 0; color: var(--err); font-size: .95rem; }
  @media (max-width: 640px) {
    dialog.sheet { width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92dvh; }
    dialog.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
    .sheet-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -.5rem auto 1rem; }
  }
  @media (min-width: 641px) { dialog.sheet[open] { animation: sheet-fade .2s ease-out; } }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes sheet-fade { from { opacity: 0; transform: translateY(8px); } }


  .field { display: block; margin-bottom: 1.1rem; }
  .field-label { display: block; margin-bottom: .35rem; }
  .field-hint { font-weight: 400; color: var(--ink-soft); }
  input[type="text"], input[type="email"], textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: .75rem .9rem;
  }
  textarea { resize: vertical; min-height: 5rem; }
  input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: .7; }
  input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }

  /* hozzájárulás */
  .check { display: flex; gap: .7rem; align-items: flex-start; margin: .25rem 0 .6rem; cursor: pointer; font-weight: 600; }
  .check input { flex: none; width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--ink); cursor: pointer; }
  .hp { position: absolute; left: -9999px; }
  .privacy { font-size: .9rem; color: var(--ink-soft); margin: 0 0 1.25rem; }

  .status { margin: 1rem 0 0; min-height: 1.5em; }
  .status.ok { color: var(--ok); }
  .status.err { color: var(--err); }

  .done {
    border-top: 1.5px solid var(--line);
    padding-top: 1.5rem;
  }
  .done h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1; letter-spacing: -.03em; margin: 0 0 .6rem; }
  .done p { color: var(--ink-soft); margin: 0 0 1.25rem; }
  .done .actions { max-width: 420px; }
  .done .btn-solid { width: 100%; padding: 1rem 1.4rem; }


  .live { margin-top: clamp(3rem, 8vw, 6rem); }
  .live h2 { font-weight: 750; font-variation-settings: "opsz" 72; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1; margin: 0 0 .6rem; }
  .live p { margin: 0 0 1.5rem; max-width: 64ch; color: var(--ink-soft); }
  .photos { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
  .photos button { padding: 0; border: 0; border-radius: 18px; overflow: hidden; cursor: zoom-in; background: var(--paper-2); }
  .photos img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
  .photos .wide { grid-column: 1 / -1; }
  .photos .wide img { aspect-ratio: 4 / 3; }
  @media (prefers-reduced-motion: reduce) {
    dialog.sheet[open] { animation: none; }
    *, *::before, *::after { transition: none !important; }
  }
