/* TLTBE Studio. Same voice as the public site (site/site.css): one dark ground, Bebas Neue for display,
   EB Garamond for text, orange only on the main actions. Controls are clear glass. */
@font-face { font-family: "Bebas Neue"; src: url(site/fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(site/fonts/eb-garamond-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(site/fonts/eb-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(site/fonts/eb-garamond-latin-400-italic.woff2) format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Bebas Fallback"; src: local("Arial Narrow"), local("Liberation Sans Narrow"), local("Arial"); size-adjust: 78%; ascent-override: 115%; }

:root {
  --bg: #0e0d0c;
  --field: #24201c;
  --ink: #ecebe7;
  --muted: #bdb8b0;
  --accent: #ff5a1f;
  --accent-strong: #ff7843;
  --accent-ink: #160700;
  --glass: rgba(255, 255, 255, .07);
  --glass-line: rgba(255, 255, 255, .16);
  --display: "Bebas Neue", "Bebas Fallback", sans-serif;
  --text: "EB Garamond", Garamond, "Times New Roman", serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--text); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
[hidden] { display: none !important; }

/* The current photo, blurred, lights the top of the page. */
#ambient { position: fixed; z-index: -1; top: -12vh; left: 0; width: 100vw; height: 78vh; filter: blur(70px) saturate(1.5); opacity: .45; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); transition: opacity .8s; }

/* Glass */
.glass, .bubble, .btn, .ui-segment, .ui-chips button, .ui-swatches button, .ui-grid button, .format, .studio-header {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .3);
}
.glass { border-radius: 30px; }
.bubble { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: #fff;
  transition: transform 220ms var(--ease), background-color 220ms, opacity 200ms; }
.bubble::before { content: ""; position: absolute; inset: 3px 8px auto; height: 45%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%); }
.bubble:disabled { opacity: .35; cursor: default; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (hover: hover) {
  .bubble:not(:disabled):hover, .btn:not(:disabled):not(.primary):not(.accent):hover, .ui-chips button:hover, .ui-swatches button:hover, .ui-grid button:hover, .format:hover { background-color: rgba(255, 255, 255, .14); }
}
.bubble:not(:disabled):active, .btn:not(:disabled):active, .ui-chips button:active, .ui-swatches button:active, .ui-grid button:active, .ui-segment button:active, .format:active, .slot:active { transform: scale(.95); }

/* Header */
.shell { padding-top: 64px; }
.studio-header { position: fixed; z-index: 100; inset: 0 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 clamp(16px, 3vw, 40px); border-width: 0 0 1px; border-radius: 0; background: rgba(14, 13, 12, .62); box-shadow: none; }
.studio-header-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.studio-home { color: var(--ink); text-decoration: none; font: 30px/1 var(--display); letter-spacing: .02em; }
.studio-home span { color: var(--accent); }
.studio-mode-label, .studio-tagline { font: 16px/1 var(--display); letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .studio-tagline { display: none; } }

.main { max-width: 1320px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 40px) 48px; }

/* The headline, with the photo set into the sentence (like the website's hero). */
.hero { padding: 8px 0 24px; }
.sentence { margin: 0; font: 400 clamp(64px, 8.5vw, 124px)/.88 var(--display); letter-spacing: .005em; display: flex; flex-wrap: wrap; align-items: center; gap: .04em .16em; text-wrap: balance; }
.slot { position: relative; width: 1.5em; height: .9em; padding: 0; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .3); background: var(--field); display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transition: transform 220ms var(--ease); }
.slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.slot svg { width: .32em; height: .32em; stroke-width: 1.6; opacity: 0; }
.slot.is-empty svg { opacity: .8; }
.slot.is-empty canvas { opacity: 0; }
.sentence-note { margin: 12px 0 0; font-style: italic; font-size: 19px; color: var(--muted); }
#sentence-end { transition: opacity .3s; }

/* Workspace: preview + tools. Writing a caption gives the tools more room. */
.workspace > *, .tools, .field { min-width: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr); gap: 24px; align-items: start; transition: grid-template-columns .6s var(--ease); }
body[data-studio="caption"] .workspace { grid-template-columns: minmax(0, .8fr) minmax(340px, 1.2fr); }
.workspace > .glass:first-child { position: sticky; top: 84px; overflow: hidden; }
.panelhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-head { padding: 12px 12px 0 22px; }
.preview-head .muted { font-size: 15px; }
.bubbles { display: flex; gap: 8px; }
.canvasarea { height: min(68vh, 720px); min-height: 0; padding: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: height .6s var(--ease); }
body[data-studio="caption"] .canvasarea { height: min(46vh, 440px); }
.canvasarea canvas { display: block; flex: none; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; border-radius: 18px; touch-action: none; cursor: grab;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); background: #18191f; }
.drop { text-align: center; max-width: 380px; padding: 24px; }
.drop strong { display: block; font: 40px/.95 var(--display); letter-spacing: .01em; margin-bottom: 10px; }
.drop p { color: var(--muted); margin: 0 0 20px; }
.preview-foot { margin: 0; padding: 0 22px 18px; font-style: italic; font-size: 15px; color: var(--muted); }

.mode-head { padding: 14px 14px 6px; }
.mode-head .ui-segment { width: 100%; }
.tools { padding: 14px 20px 20px; }
#photo-tools, #logo-tools, #caption-tools, #caption-ideas > div, dialog[open] { animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* Fields */
.field { display: block; margin: 0 0 22px; }
.field-label { display: block; margin: 0 0 10px; font: 16px/1 var(--display); letter-spacing: .08em; color: var(--muted); }
.muted { color: var(--muted); font-size: 15px; }
.field .muted { display: block; margin-top: 8px; }
.hint { margin: -8px 0 0; }
input[type="text"], input:not([type]), textarea { display: block; width: 100%; border-radius: 18px; padding: 14px 16px; font-size: 18px; line-height: 1.45; color: var(--ink);
  background: rgba(0, 0, 0, .28); border: 1px solid var(--glass-line); transition: border-color .2s, background-color .2s; }
input[type="text"]:focus, input:not([type]):focus, textarea:focus { border-color: rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .4); }
textarea { resize: vertical; min-height: 140px; }
::placeholder { color: #8f8a83; }
input[type="range"] { display: block; width: 100%; height: 30px; margin: 0; accent-color: var(--ink); }
.field > input[type="range"] { margin-top: -4px; }

/* Buttons */
.btn { min-height: 44px; padding: 0 18px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); font-size: 17px; text-decoration: none;
  transition: transform 220ms var(--ease), background-color 220ms, color 220ms, opacity 200ms; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.accent { min-height: 52px; padding: 0 24px; border: 0; border-radius: 26px; background: var(--accent); color: var(--accent-ink); font: 22px/1 var(--display); letter-spacing: .04em; box-shadow: 0 10px 30px rgba(255, 90, 31, .25); }
.btn.accent:not(:disabled):hover { background: var(--accent-strong); }
.btn.quiet { background: transparent; box-shadow: none; border-color: rgba(255, 255, 255, .12); }
.btn.danger { color: #f3b2a0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
#generate-caption, #quick-final, #download, #logo-zip-choose { width: 100%; }
#reset-logo { margin-top: 12px; }

/* Tap controls built from the selects (studio-ui.js) */
.ui-native { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ui-segment { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 46px; padding: 3px; border-radius: 23px; }
.ui-segment button { position: relative; z-index: 1; border: 0; background: none; border-radius: 20px; font-size: 17px; color: var(--ink); white-space: nowrap; transition: color .3s, transform 220ms var(--ease); }
.ui-segment button[aria-pressed="true"] { color: var(--bg); }
.ui-ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 20px; background: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .48s var(--ease); }
.ui-chips, .ui-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-chips button, .ui-swatches button { height: 44px; padding: 0 18px; border-radius: 22px; font-size: 17px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  transition: background-color .26s, color .26s, border-color .26s, transform 220ms var(--ease); }
.ui-chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ui-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.ui-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.ui-scroll::-webkit-scrollbar { display: none; }
.ui-scroll button { scroll-snap-align: start; }
.ui-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); }
.ui-dot.is-none { border-style: dashed; border-color: var(--muted); }
.ui-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; }
.ui-grid button, .ui-gap { width: 44px; height: 44px; padding: 0; border-radius: 14px; display: grid; place-items: center; }
.ui-grid i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .4); transition: transform .3s var(--ease), background-color .24s; }
.ui-grid button[aria-pressed="true"] i { background: var(--accent); transform: scale(1.8); }

/* Photo tools */
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.format { padding: 9px 16px; border-radius: 18px; text-align: left; color: var(--ink); font-size: 16px; line-height: 1.25; transition: background-color .26s, color .26s, transform 220ms var(--ease); }
.format small { display: block; font-size: 13px; color: var(--muted); }
.format.selected { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.format.selected small { color: #4a4640; }

/* Logo tools */
.logo-selector-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.logo-selector-row .ui-chips { flex: 1; min-width: 0; }
.logo-stepper { display: flex; gap: 6px; }
.logo-library-import { margin-bottom: 22px; }
#logo-import-status { font-size: 14px !important; margin: 8px 0 0 !important; }
.logo-place { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 28px; }
#logo-size-value { float: right; font-family: var(--display); letter-spacing: .06em; color: var(--ink); }

/* Automatic preparation */
.quick-prepare { display: grid; gap: 14px; margin: 0 0 24px; padding: 18px; border-radius: 24px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .1); }
.quick-prepare strong { font: 22px/1 var(--display); letter-spacing: .02em; }
.quick-prepare label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; }
.quick-prepare label input { order: 2; }
.quick-prepare p { margin: 0; }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 15px; cursor: pointer;
  background: rgba(255, 255, 255, .18); border: 1px solid var(--glass-line); transition: background-color .3s; }
input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .35s var(--ease); }
input[type="checkbox"]:checked { background: var(--ink); }
input[type="checkbox"]:checked::after { transform: translateX(20px); background: var(--bg); }

/* Caption tools */
.engine-note { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px 16px; border-radius: 18px; background: rgba(0, 0, 0, .28); font-size: 16px; line-height: 1.4; }
.engine-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: background-color .4s, box-shadow .4s; }
.engine-note[data-state="mac"] .engine-dot { background: #7fd88a; box-shadow: 0 0 10px #7fd88a; }
.engine-note[data-state="cloud"] .engine-dot { background: #ffb86b; box-shadow: 0 0 10px #ffb86b; }
.engine-note[data-state="off"] .engine-dot { background: #ff8a7a; box-shadow: 0 0 10px #ff8a7a; }
.hint-link { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 15px; }
.hint-link:hover { color: var(--ink); }
#generate-caption { margin: 0 0 18px; }
#caption-ideas { display: grid; gap: 10px; margin-bottom: 20px; }
#caption-ideas > div { padding: 16px !important; border-radius: 22px !important; border: 1px solid var(--glass-line) !important; background: var(--glass); }
#caption-ideas > div strong { display: block; font: 15px/1 var(--display); letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
#caption-ideas > div p { font-size: 18px; margin: 0 0 12px; }
#caption-ideas > div .btn { margin: 4px 6px 0 0; }

/* Save, download and sync */
.download-actions { margin-top: 8px; }
.cloud-status { display: block; width: 100%; padding: 12px 0 0; border: 0; background: none; text-align: left; font-style: italic; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.status { min-height: 22px; margin-top: 4px; font-size: 15px; color: #e0c3b0; }

dialog { max-width: min(90vw, 400px); padding: 26px !important; border-radius: 26px !important; border: 1px solid var(--glass-line) !important; background: #191715 !important; color: var(--ink) !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6) !important; }
dialog::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#remove-title { font: 30px/1 var(--display); letter-spacing: .01em; }

/* Phones and tablets: one column that scrolls as a page. The photo leads, then moves out of the way. */
@media (max-width: 900px) {
  .main { padding: 12px 16px 32px; }
  .hero { padding: 4px 0 18px; }
  .sentence { font-size: clamp(56px, 17vw, 84px); }
  .sentence-note { font-size: 17px; margin-top: 8px; }
  .workspace, body[data-studio="caption"] .workspace { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .workspace > .glass:first-child { position: relative; top: 0; }
  .canvasarea { height: min(58dvh, 520px); padding: 12px; }
  body[data-studio="caption"] .canvasarea { height: 210px; }
  .tools { padding: 12px 16px 16px; }
  .formats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; }
  .formats::-webkit-scrollbar { display: none; }
  .format { flex: none; }
  /* The Studio / Final switcher from shared-project.js, as a floating glass bar. */
  body .tltbe-workflow { left: 16px; right: 16px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 4px; border-radius: 30px; border: 1px solid var(--glass-line);
    background: rgba(30, 27, 24, .62); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 40px rgba(0, 0, 0, .45); }
  body .tltbe-workflow-indicator { top: 4px; left: 4px; width: calc((100% - 12px) / 2); height: 48px; border-radius: 25px; background: var(--ink); transition: transform .48s var(--ease); }
  body .tltbe-workflow a { border-radius: 25px; color: var(--ink); font: 17px var(--text); }
  body .tltbe-workflow a[aria-current=page] { color: var(--bg); }
}
@media (max-width: 420px) {
  .logo-place { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Automatic preparation belongs with the photo, so the other tools start at the top. */
body[data-studio="logo"] .quick-prepare, body[data-studio="caption"] .quick-prepare { display: none; }
/* The Studio / Final switcher is a phone control; on larger screens "Continue to Final" does the job. */
@media (min-width: 901px) { .tltbe-workflow { display: none; } }
