/* ── The lettering designer: ideas, tabs, tiles, letter colours, and a preview that stays in view ──
   (its own file, so work on the rest of the site's styles doesn't clash with it) */

/* ideas, above the tabs: little cards, each in its design's own font and colours */
.lt-top { margin-bottom: 16px; }
.lt-ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lt-idea {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 58px; padding: 6px 8px;
  overflow: hidden; border: 1px solid rgba(0, 0, 0, .14); border-radius: 12px; background: var(--bg); color: var(--fg);
  font-size: 1.08rem; line-height: 1.05; text-align: center; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; transition: transform .2s var(--ease-out, ease), box-shadow .2s;
}
.lt-idea:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .55); }
.lt-idea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lt-idea-bg { position: absolute; inset: 0; opacity: .3; pointer-events: none; }
.lt-idea-bg svg { width: 100%; height: 100%; display: block; }
.lt-idea-icon, .lt-idea-name { position: relative; }
.lt-idea-icon svg { display: block; width: 18px; height: 18px; }
.lt-idea-name { text-shadow: 0 1px 0 rgba(0, 0, 0, .12); overflow-wrap: break-word; min-width: 0; }
@media (max-width: 520px) {
  .lt-idea { flex-direction: column; gap: 3px; min-height: 66px; padding: 6px 4px; font-size: .9rem; }
  .lt-idea-icon svg { width: 15px; height: 15px; }
}
/* the neon one glows */
.lt-idea.glow .lt-idea-name { color: #fff; text-shadow: 0 0 4px #fff, 0 0 10px #c86bff, 0 0 18px #6be4ff; }
@media (prefers-reduced-motion: reduce) { .lt-idea { transition: none; } .lt-idea:hover { transform: none; } }

.lt-panel[hidden] { display: none; }
.lt-panel > .field:last-child { margin-bottom: 0; }
.lt-sub { margin-top: 10px; }
/* section headings inside a tab (Plate, Background) */
.lt-head { margin: 4px 0 12px; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.lt-head:not(:first-child) { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.lt-head[hidden] { display: none; }
/* a slider with its own label, sharing a field with an option below it */
.lt-slider { display: block; }
.lt-slider > span:first-child { display: block; margin-bottom: 8px; font-weight: 500; font-size: .95rem; }
.lt-panel select.input { appearance: auto; }

/* fonts: all of them in view (no scrolling box), each shown in its own face */
.lt-fonts { padding: 2px; align-content: start; }

/* tiles with little drawings: icons, backing shapes, patterns */
.lt-tiles { display: grid; gap: 8px; }
.lt-icons { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.lt-shapes { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.lt-patterns { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.lt-tile {
  --art-bg: var(--panel);
  display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 48px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); color: var(--ink); cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.lt-tile:hover { border-color: var(--ink); }
.lt-tile[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); --art-bg: #f1f4fd; background: #f1f4fd; }
.lt-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lt-tile small { font-size: .72rem; line-height: 1.15; color: var(--muted); text-align: center; }
.lt-art { display: grid; place-items: center; }
.lt-icons .lt-art svg { width: 30px; height: 30px; }
.lt-shapes .lt-art svg { width: 44px; height: 27px; }
.lt-pattern .lt-art { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 7px; background: var(--art-bg); }
.lt-pattern .lt-art svg { width: 100%; height: 100%; color: #2c5a3a; }
.lt-none { font-size: 1.2rem; color: var(--muted); }
.lt-pattern .lt-none { font-size: 1.4rem; }
.lt-group { grid-column: 1 / -1; margin: 6px 0 -2px; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

/* colour each letter */
.lt-each { margin: -4px 0 14px; }
.lt-letters { display: flex; flex-wrap: wrap; gap: 6px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lt-letter-break { flex-basis: 100%; height: 0; }
.lt-letter {
  min-width: 38px; height: 44px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
  color: var(--ink); font: 600 1.15rem/1 var(--body); cursor: pointer; box-shadow: inset 0 -6px 0 var(--c);
}
.lt-letter[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 -6px 0 var(--c), 0 0 0 2px var(--accent); }
.lt-letter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lt-each .hint { margin: 8px 0; }
.lt-each-tools { display: flex; flex-wrap: wrap; gap: 8px; }
/* "Same as the letters" */
.swatch-same { display: grid; place-items: center; background: var(--panel); border: 1px dashed var(--line-2); color: var(--muted); font: 600 .9rem/1 var(--body); }

/* the 3D preview (with Undo and Start again on it) stays in view while they scroll through the settings, just
   below the pinned progress bar (which also shows the price). On computers the whole column follows: preview,
   size and price, Download and "Can't make it here?", the preview shrinking on shorter screens so it all fits
   (very short screens just let the column scroll by). */
.lt-stage { position: sticky; top: 92px; z-index: 6; }
.lt-stage .lt-viewer { margin: 0; }
@media (min-width: 901px) { .est-letter .lt-side { align-self: stretch; } }
@media (min-width: 901px) and (min-height: 680px) {
  .est-letter .lt-side { position: sticky; top: 92px; align-self: start; }
  .est-letter .lt-stage { position: relative; top: auto; }
  .est-letter .lt-viewer { aspect-ratio: auto; width: 100%; height: clamp(240px, calc(100vh - 92px - 300px), 620px); }
}
/* computers: the designer spreads out wider than the rest of the form, settings in a column on the left and a big
   preview taking the rest; "Can't make it here?" becomes one slim row under it */
@media (min-width: 1100px) {
  .est-form > .est-letter { margin-inline: calc(50% - min(680px, 50vw - 40px)); }
  .est-letter .lt-grid { grid-template-columns: minmax(400px, 440px) minmax(0, 1fr); gap: 32px; }
  .drop.lt-ref-drop { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 12px 16px; }
  .lt-ref-btn { grid-column: auto; }
  .lt-ref { margin-top: 12px; }
}
@media (max-width: 900px) {
  .lt-stage { top: 74px; order: -1; }
  .lt-stage .lt-viewer { width: 100%; aspect-ratio: 16 / 9; max-height: 40vh; max-height: 40dvh; box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .55); } /* (room left for the controls on a zoomed-in or short screen) */
}
.lt-tools { position: absolute; top: 10px; right: 10px; left: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; pointer-events: none; }
.lt-tools button { pointer-events: auto; }
.lt-tools button[hidden] { display: none; }
.lt-tools button {
  padding: 7px 11px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(18, 18, 18, .55);
  color: #fff; font: 500 .8rem/1 var(--body); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lt-tools button:hover { background: rgba(18, 18, 18, .8); }
.lt-tools button[aria-pressed="true"] { background: #fff; border-color: #fff; color: #121212; }
@media (max-width: 480px) { .lt-tools button { padding: 6px 9px; font-size: .75rem; } }
.lt-tools button:disabled { opacity: .4; cursor: default; }
.lt-tools button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lt-tile { transition: none; } }

/* the formatting bar above the text box, like a word processor's */
.lt-format { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; margin-bottom: -1px; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--bg-2); }
.lt-format > button, .lt-align-btns button, .lt-float > button {
  flex: none; min-width: 34px; height: 36px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--ink); font: 500 1rem/1 var(--body); cursor: pointer;
}
.lt-format button small, .lt-float button small { font-size: .7em; margin-left: 1px; }
.lt-format > button:hover, .lt-align-btns button:hover, .lt-float > button:hover { background: var(--panel); border-color: var(--line-2); }
.lt-format button[aria-pressed="true"], .lt-float > button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lt-format button:focus-visible, .lt-float button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lt-format [data-fmt="clear"] { margin-left: auto; font-size: .85rem; color: var(--muted); }
.lt-align-btns { display: inline-flex; gap: 2px; }
.lt-align-btns[hidden] { display: none; }
.lt-align-btns button { padding: 0 7px; }
.lt-align-btns svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; display: block; }
.lt-format-hint { margin: 8px 0 0; }
.lt-format-hint[hidden] { display: none; }
.lt-textwrap { position: relative; }
.lt-textwrap textarea { display: block; width: 100%; border-top-left-radius: 0; border-top-right-radius: 0; }
.lt-format .lt-fontpick { flex: 1 1 110px; max-width: 200px; }
.lt-format.is-covered { opacity: .3; pointer-events: none; transition: opacity .15s; }
@media (prefers-reduced-motion: reduce) { .lt-format.is-covered { transition: none; } }

.lt-light-btn[hidden] { display: none !important; }
.lt-depth-btn svg, .lt-light-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.lt-float-depth {
  position: absolute; z-index: 40; right: 0; width: min(300px, 86vw); padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .35);
}
.lt-float-depth[hidden] { display: none; }
.lt-float-light {
  position: absolute; z-index: 40; right: 0; width: min(260px, 86vw); padding: 8px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .35); display: grid; gap: 2px;
}
.lt-float-light[hidden] { display: none; }
.lt-float.is-below .lt-float-light { top: calc(100% + 6px); }
.lt-float:not(.is-below) .lt-float-light { bottom: calc(100% + 6px); }
.lt-pop-title { margin: 2px 8px 6px; font-size: .78rem; color: var(--muted); }
.lt-float-light button { padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 .92rem var(--body); text-align: left; cursor: pointer; }
.lt-float-light button small { color: var(--muted); font-weight: 400; }
.lt-float-light button:hover { background: var(--bg-2); }
.lt-float-light button[aria-pressed="true"] { background: #e8eefc; box-shadow: inset 3px 0 0 var(--accent); }
.lt-float.is-below .lt-float-depth { top: calc(100% + 6px); }
.lt-float:not(.is-below) .lt-float-depth { bottom: calc(100% + 6px); }
.lt-float-depth .lt-slider { display: block; margin: 0; }
.lt-depth-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.lt-depth-foot small { color: var(--muted); }
.lt-depth-foot button:disabled { opacity: .45; cursor: default; }
.lt-notes { display: block; margin-top: 14px; }
.lt-notes textarea { width: 100%; resize: vertical; }

/* the font menu: every font shown in its own lettering */
.lt-fontpick { position: relative; flex: 1 1 auto; min-width: 0; }
.lt-fp-btn {
  display: flex !important; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 36px; padding: 0 10px !important;
  border: 1px solid var(--line-2) !important; border-radius: 8px; background: var(--panel) !important; color: var(--ink) !important; cursor: pointer;
}
.lt-fp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 1.05rem; }
.lt-fp-chev { flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: translateY(-2px) rotate(45deg); opacity: .6; }
.lt-fp-list {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 230px; max-height: min(340px, 55vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .35);
}
.lt-fp-list[hidden] { display: none; }
.lt-fp-list button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left;
  font-size: 1.25rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.lt-fp-list button:hover { background: var(--bg-2); }
.lt-fp-list button[aria-selected="true"] { background: #e8eefc; box-shadow: inset 3px 0 0 var(--accent); }

/* the little bar that floats over the selected letters */
.lt-float {
  position: absolute; z-index: 30; display: flex; align-items: center; gap: 2px; padding: 4px; max-width: calc(100% + 12px);
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .35);
}
.lt-float[hidden] { display: none; }
.lt-float > button { min-width: 32px; height: 34px; padding: 0 7px; }
.lt-float .lt-fontpick { flex: 0 1 140px; }
.lt-float .lt-fp-btn { height: 34px; }
.lt-float.is-below .lt-fp-list { top: calc(100% + 6px); }
.lt-float:not(.is-below) .lt-fp-list { top: auto; bottom: calc(100% + 6px); }
.lt-colour-btn { display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.lt-colour-btn span { font-weight: 600; line-height: 1; }
.lt-colour-btn i { display: block; width: 18px; height: 4px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.lt-float-colours {
  position: absolute; z-index: 40; right: 0; width: min(260px, 86vw); padding: 10px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .35);
}
.lt-float-colours[hidden] { display: none; }
.lt-float.is-below .lt-float-colours { top: calc(100% + 6px); }
.lt-float:not(.is-below) .lt-float-colours { bottom: calc(100% + 6px); }
@media (max-width: 480px) {
  .lt-float > button { min-width: 30px; padding: 0 5px; }
  .lt-float .lt-fontpick { flex-basis: 110px; }
  .lt-float .lt-fp-list { left: auto; right: -40px; }
}

/* the setting a tap opened lights up for a moment */
.lt-flash { animation: lt-flash 1.4s ease; border-radius: 12px; }
@keyframes lt-flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(44, 86, 210, .35); background: #f1f4fd; } 100% { box-shadow: 0 0 0 3px rgba(44, 86, 210, 0); } }
@media (prefers-reduced-motion: reduce) { .lt-flash { animation: none; box-shadow: 0 0 0 3px rgba(44, 86, 210, .35); } }

/* home page: "Try my custom lettering tool" */
.lt-promo {
  display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: center; gap: 22px; width: 100%; margin: 0 0 36px; padding: 14px;
  border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .3s, transform .3s;
}
.lt-promo:hover { border-color: var(--ink); box-shadow: 0 18px 36px -26px rgba(0, 0, 0, .5); }
.lt-promo:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lt-promo-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: var(--bg-2); }
.lt-promo-img img { width: 100%; height: 100%; object-fit: cover; }
.lt-promo-img .render-tag { position: absolute; left: 8px; top: 8px; }
.lt-promo-text { display: grid; gap: 8px; }
.lt-promo-text b { font: 400 clamp(1.6rem, 3.4vw, 2.2rem)/1.05 var(--display); letter-spacing: -.01em; }
.lt-promo-text > span:not(.lt-promo-go) { color: var(--muted); }
.lt-promo-go { justify-self: start; margin-top: 4px; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; }
@media (max-width: 640px) { /* a slim row with its picture beside it, so the cards below show sooner */
  .lt-promo { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; margin-bottom: 20px; padding: 10px; }
  .lt-promo-img { aspect-ratio: 1; }
  .lt-promo-text { gap: 5px; }
  .lt-promo-text b { font-size: 1.25rem; }
  .lt-promo-text > span:not(.lt-promo-go) { font-size: .86rem; line-height: 1.35; }
  .lt-promo-go { margin-top: 2px; padding: 8px 14px; font-size: .9rem; }
}
@media (prefers-reduced-motion: no-preference) { .lt-promo:hover { transform: translateY(-2px); } }

/* ── The sections: one list, each heading saying what it's set to; tap to open (one at a time) ── */
.lt-secs { border-top: 1px solid var(--line); overflow-anchor: none; } /* (the page keeps the tapped heading still itself) */
.lt-sec { border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.lt-sec[hidden] { display: none; }
@media (max-width: 900px) { .lt-sec { scroll-margin-top: calc(74px + 56vw + 12px); } }
.lt-sec-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: 100%; padding: 15px 4px;
  border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.lt-sec-head:hover .lt-sec-name { text-decoration: underline; text-underline-offset: 3px; }
.lt-sec-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.lt-sec-name { font: 500 1.02rem/1.2 var(--body); }
.lt-sec-sum { overflow: hidden; color: var(--muted); font-size: .88rem; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.lt-sec-chev { width: 9px; height: 9px; margin-right: 4px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.lt-sec.is-open .lt-sec-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.lt-sec.is-open .lt-sec-sum { visibility: hidden; }
.lt-sec .lt-panel { padding: 4px 4px 22px; }
@media (prefers-reduced-motion: reduce) { .lt-sec-chev { transition: none; } }

/* icons: tap one to add it; each on the sign gets a row (where, size, colour, mirror, remove) */
.lt-icons.full .lt-tile { opacity: .45; pointer-events: none; }
.lt-upload { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; cursor: pointer; }
.lt-upload:hover { border-color: var(--ink); }
.lt-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lt-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lt-upload-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg-2); font-size: 1.2rem; }
.lt-upload b { display: block; font-weight: 500; }
.lt-upload small { color: var(--muted); }
.lt-svg-msg { margin: -8px 0 14px; color: #9a5b00; }
.lt-icon-list { display: grid; gap: 8px; }
.lt-icon-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); }
.lt-icon-row .lt-art svg { width: 30px; height: 30px; }
.lt-icon-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-icon-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.lt-icon-x:hover { background: var(--bg-2); color: var(--ink); }
.lt-icon-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.lt-mini select { height: 34px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 400 .88rem var(--body); }
.lt-mirror { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 400 .88rem var(--body); cursor: pointer; }
.lt-mirror[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lt-mini select:focus-visible, .lt-mirror:focus-visible, .lt-icon-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* border styles */
.lt-borders { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.lt-borders .lt-art svg { width: 44px; height: 28px; }

/* an icon's turn */
.lt-turn { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.lt-turn output { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.lt-icon-tip { margin: 0 0 10px; }

/* a very short screen (a laptop zoomed right in, a phone on its side): the preview scrolls with the page rather than
   staying pinned over the controls */
@media (max-height: 520px) {
  .lt-stage, .est-letter .lt-stage { position: relative; top: auto; }
  .lt-stage .lt-viewer { max-height: none; }
}
