/* ==========================================================================
   Tiny Talents — 16th Anniversary Photo Frame
   Tokens lifted from design/html/parent-app.html. Palette values are fixed by
   PROJECT-BRIEF.md section 4 — do not adjust them.
   ========================================================================== */

/* Latin subsets extracted from the design export. Both are variable fonts, so
   one file per family covers every weight the UI uses. */
@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette */
  --sky: #6FC4DB;
  --green: #A6CB8C;
  --peach: #F1AC79;
  --rose: #E4808D;
  --deep-blue: #47B5CE;
  --yellow: #F1EB3D;
  --grey: #939598;
  --white: #FFFFFF;

  /* The only fill allowed under white text — the pastels fail contrast. */
  --button-blue: #2E7D91;

  /* Text */
  --text: #3A4A52;
  --text-soft: #6E8189;
  --text-muted: #8AA0A8;
  --text-faint: #9AAAB1;

  /* Surfaces */
  --bg-page: #EAF6FA;
  --surface: #F6FCFD;
  --surface-raised: #FFFFFF;
  --hairline: #E3EEF2;
  --fill-muted: #DCE8EC;
  --border-secondary: #A9C6CF;

  /* Shadows — chunky hard offsets, not blurs. That is the look. */
  --shadow-primary: 0 5px 0 rgba(46, 125, 145, 0.35);
  --shadow-primary-lg: 0 6px 0 rgba(46, 125, 145, 0.35), 0 14px 24px rgba(46, 125, 145, 0.25);
  --shadow-primary-pressed: 0 2px 0 rgba(46, 125, 145, 0.35);
  --shadow-drop: 0 4px 0 rgba(147, 149, 152, 0.3);
  --shadow-canvas: 0 10px 0 rgba(147, 149, 152, 0.28), 0 18px 34px rgba(58, 74, 82, 0.16);
  --shadow-tile: 0 4px 0 rgba(147, 149, 152, 0.4);

  /* Radii */
  --radius-pill: 999px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-canvas: 14px;

  /* Type */
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  /* Minimum tappable size, per brief section 4. */
  --tap: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--sky);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   Layout — one centred column. Mobile is the design; desktop is the same
   column on a brand background, deliberately narrow rather than stretched.
   -------------------------------------------------------------------------- */

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 481px) {
  .app {
    min-height: min(100dvh, 900px);
    margin-block: max(0px, calc((100dvh - 900px) / 2));
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(58, 74, 82, 0.2);
  }
}

/* Screens are mutually exclusive; app.js flips [hidden]. */
.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: var(--tap);
  transition: box-shadow 0.08s ease, transform 0.08s ease, border-color 0.12s ease;
}

.btn:disabled {
  cursor: default;
}

.btn--primary {
  width: 100%;
  height: 64px;
  border: none;
  background: var(--button-blue);
  color: var(--white);
  font-size: 24px;
  box-shadow: var(--shadow-primary);
}

.btn--primary:active {
  transform: translateY(3px);
  box-shadow: var(--shadow-primary-pressed);
}

.btn--primary:disabled {
  background: var(--fill-muted);
  color: var(--white);
  box-shadow: none;
  transform: none;
}

/* The intro call to action is the largest thing on its screen. */
.btn--hero {
  height: 66px;
  font-size: 25px;
  box-shadow: var(--shadow-primary-lg);
}

.btn--hero:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(46, 125, 145, 0.35);
}

.btn--secondary {
  width: 100%;
  height: 54px;
  border: 3px solid var(--border-secondary);
  background: var(--surface-raised);
  color: var(--button-blue);
  font-size: 19px;
}

.btn--secondary:hover {
  border-color: var(--button-blue);
}

.btn--tertiary {
  width: 100%;
  height: var(--tap);
  border: none;
  background: transparent;
  color: var(--button-blue);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Shared text
   -------------------------------------------------------------------------- */

.screen-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--button-blue);
  text-align: center;
  margin: 0;
}

.note {
  font-size: 13.5px;
  color: var(--grey);
  font-weight: 600;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Intro
   -------------------------------------------------------------------------- */

.intro__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 24px 28px 0;
}

.intro__logo {
  width: min(246px, 64%);
  height: auto;
  display: block;
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.lockup__year,
.lockup__word {
  font-family: var(--font-display);
  paint-order: stroke fill;
  line-height: 0.9;
}

.lockup__year {
  font-weight: 800;
  font-size: 88px;
  color: var(--sky);
  -webkit-text-stroke: 9px var(--white);
  filter: drop-shadow(4px 6px 0 rgba(147, 149, 152, 0.45));
}

.lockup__word {
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.04em;
  color: var(--rose);
  -webkit-text-stroke: 7px var(--white);
  filter: drop-shadow(3px 4px 0 rgba(147, 149, 152, 0.4));
}

.intro__lede {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
  max-width: 290px;
  margin: 0;
}

.intro__footer {
  flex: none;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.note--alert {
  color: var(--rose);
  font-weight: 700;
}

/* The privacy line links to the policy. Underlined rather than coloured: it
   must read as a plain disclosure, not as a call to action competing with
   "Choose a Photo". */
.note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Editor — the core screen. Vertical budget is tight at 375x812, so the canvas
   takes the slack and everything else is fixed height.
   -------------------------------------------------------------------------- */

#screen-editor {
  background: var(--surface-raised);
}

.editor__hint {
  flex: none;
  font-size: 20px;
  padding: 8px 24px;
}

/* The area takes all remaining height; the square canvas is centred inside it.
   Its exact pixel size is set by the editor, which measures this box — CSS
   alone cannot reliably square a flex child against both axes. */
.editor__canvas-area {
  flex: 1;
  min-height: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor__canvas {
  position: relative;
  flex: none;
  /* Panning and pinching are handled by the editor, not the browser. */
  touch-action: none;
}

.editor__stage {
  width: 100%;
  height: 100%;
}

.editor__canvas canvas {
  border-radius: var(--radius-canvas);
  display: block;
}

.sticker-delete {
  position: absolute;
  z-index: 2;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* The visible badge is smaller than its 44px tap target. */
.sticker-delete::before {
  content: '✕';
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(58, 74, 82, 0.3);
  display: grid;
  place-items: center;
}

.sticker-delete[hidden] {
  display: none;
}

/* Zoom slider — the control that makes this work with a mouse. */
.zoom {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 30px 0;
}

.zoom__sign {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
}

.zoom__sign--plus {
  font-size: 20px;
}

.zoom__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: var(--tap); /* touch target; the visible track is drawn shorter */
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.zoom__slider::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--hairline);
}

.zoom__slider::-moz-range-track {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--hairline);
}

.zoom__slider::-moz-range-progress {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--sky);
}

.zoom__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--button-blue);
  box-shadow: 0 4px 10px rgba(58, 74, 82, 0.25);
}

.zoom__slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--button-blue);
  box-shadow: 0 4px 10px rgba(58, 74, 82, 0.25);
}

.zoom__label {
  flex: none;
  text-align: center;
  font-size: 12.5px;
  color: var(--grey);
  font-weight: 600;
  margin: 0;
  padding-top: 4px;
}

/* Sticker tray — the last tile is deliberately cut off so it reads scrollable. */
.tray {
  flex: none;
  background: var(--surface);
  border-top: 2px solid var(--hairline);
  padding: 12px 0;
  margin-top: 14px;
}

.tray__rail {
  display: flex;
  gap: 14px;
  padding-left: 20px;
  padding-right: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tray__rail::-webkit-scrollbar {
  display: none;
}

.tray__tile {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;
  border: 4px solid var(--white);
  background: var(--surface-raised) center / cover no-repeat;
  box-shadow: var(--shadow-drop);
  cursor: pointer;
  transition: opacity 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.tray__tile:active {
  transform: translateY(2px);
}

.tray__tile[data-placed='true'] {
  opacity: 0.45;
}

.tray__rail[data-full='true'] .tray__tile {
  opacity: 0.45;
  cursor: default;
}

.tray__note {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin: 10px 0 0;
  padding: 0 20px;
}

.tray__note[hidden] {
  display: none;
}

.editor__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 26px;
  background: var(--surface);
}

.btn--shrink {
  width: auto;
  flex: none;
  height: 58px;
  padding: 0 20px;
  background: transparent;
  font-size: 17px;
  white-space: nowrap;
}

.btn--grow {
  flex: 1;
  width: auto;
  height: 58px;
  font-size: 22px;
}

/* --------------------------------------------------------------------------
   Result
   -------------------------------------------------------------------------- */

#screen-result {
  overflow-y: auto;
}

#result-title {
  flex: none;
  padding: 2px 24px 14px;
}

.result__preview {
  flex: none;
  padding: 0 34px;
  display: flex;
  justify-content: center;
}

#result-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  height: auto;
  display: block;
  border-radius: var(--radius-canvas);
  box-shadow: 0 8px 0 rgba(147, 149, 152, 0.28), 0 16px 30px rgba(58, 74, 82, 0.14);
  background: var(--hairline);
}

/* Tier 3 — the universal escape hatch. */
.press-hold {
  flex: none;
  margin: 20px 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: var(--surface-raised);
  border: 3px dashed var(--sky);
  border-radius: 20px;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}

.press-hold[hidden] {
  display: none;
}

.press-hold__dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sky);
}

.result__actions {
  flex: 1;
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The Facebook link is an <a> so it survives the in-app browser; make it match
   the secondary button exactly. */
a.btn--secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.caption-hint {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-muted);
}

.result__back {
  text-align: center;
  margin: 2px 0 0;
}

.result__back a {
  color: var(--button-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Giveaway (Phase 2) — entry card, sheet, confirmation
   -------------------------------------------------------------------------- */

.giveaway-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-lg);
  background: #FFF9DC;
  border: 3px solid var(--yellow);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.giveaway-card[hidden] { display: none; }

.giveaway-card__dot {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--white);
  box-shadow: 0 3px 0 rgba(147, 149, 152, 0.35);
}

.giveaway-card__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.giveaway-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.giveaway-card__sub { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.giveaway-card__chev { font-size: 22px; color: var(--button-blue); font-weight: 800; }

/* The sheet sits over the result screen. */
.sheet-screen { position: relative; justify-content: flex-end; }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(58, 74, 82, 0.5);
}

.sheet {
  position: relative;
  height: 86%;
  border-radius: 32px 32px 0 0;
  background: var(--surface-raised);
  box-shadow: 0 -12px 40px rgba(58, 74, 82, 0.25);
  padding: 12px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet__handle {
  flex: none;
  width: 54px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--fill-muted);
  align-self: center;
}

.sheet__head { flex: none; }

.sheet__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 27px;
  color: var(--button-blue);
  line-height: 1.15;
  margin: 0;
}

.sheet__sub { font-size: 13.5px; color: var(--text-soft); font-weight: 600; margin: 2px 0 0; }

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Room for the iOS keyboard to not clip the last field. */
  padding-bottom: 4px;
}

.sheet__foot { flex: none; display: flex; flex-direction: column; gap: 8px; }
.sheet__foot .btn--primary { height: 62px; font-size: 23px; }
.sheet__foot .btn--tertiary { height: 42px; color: var(--text-soft); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 800; color: var(--text); }
.field__optional { color: var(--grey); font-weight: 600; }

.field__input {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  border: 3px solid var(--fill-muted);
  background: #F9FCFD;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px or iOS zooms the page on focus */
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.field__input:focus { border-color: var(--sky); background: var(--surface-raised); }

.field__input[aria-invalid='true'] { border-color: var(--rose); background: #FFF7F8; }

select.field__input { appearance: none; font-size: 15px; font-weight: 700; padding: 0 12px; }

.field__error { font-size: 12.5px; font-weight: 700; color: var(--rose); }
.field__error[hidden] { display: none; }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
}

.consent__box {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 9px;
  accent-color: var(--button-blue);
}

.consent__text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #4C5F68;
  font-weight: 600;
  text-wrap: pretty;
}

/* Confirmation */
.confirm__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 26px 30px 0;
  overflow-y: auto;
}

.confirm__tick {
  flex: none;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--green);
  border: 7px solid var(--white);
  box-shadow: 0 8px 0 rgba(147, 149, 152, 0.35);
  display: grid;
  place-items: center;
  font-size: 50px;
  color: var(--white);
  font-weight: 800;
}

.confirm__headings { text-align: center; display: flex; flex-direction: column; gap: 6px; }

.confirm__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  color: var(--button-blue);
  margin: 0;
}

.confirm__sub { font-size: 16px; font-weight: 700; color: #4C5F68; margin: 0; }
.confirm__date { color: var(--rose); }

.confirm__preview {
  width: 190px;
  height: 190px;
  border-radius: 12px;
  box-shadow: 0 7px 0 rgba(147, 149, 152, 0.28);
  background: var(--hairline);
  display: block;
}

.confirm__actions {
  flex: none;
  padding: 20px 24px 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm__actions .btn--primary { height: 62px; font-size: 23px; }

/* --------------------------------------------------------------------------
   Unsupported browser — must never be a blank page.
   -------------------------------------------------------------------------- */

.unsupported__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px 32px 0;
}

.unsupported__message {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.25;
  text-align: center;
  text-wrap: pretty;
  color: var(--text);
  margin: 0;
}

.url-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  background: var(--surface-raised);
  border: 3px dashed var(--sky);
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unsupported__footer {
  flex: none;
  padding: 0 24px 46px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Site header and footer
   ------------------------------------------------------------------------
   A same-origin rebuild of the tinytalents.com.hk chrome, at the size it is
   on the main site. The real one is an Elementor/ElementsKit build needing
   jQuery and two dozen more stylesheets from another origin, which this
   app's default-src 'self' CSP forbids — so it is rebuilt here from the
   site's own design tokens, with its logo and icons copied to this origin.

   Palette below is lifted verbatim from the site's Elementor kit
   (uploads/elementor/css/post-10.css), so these are the real brand values,
   not eyeballed approximations.
   -------------------------------------------------------------------------- */

:root {
  --tt-pink:   #F6A5C0;  /* --e-global-color-primary   */
  --tt-blue:   #A2D2FF;  /* --e-global-color-secondary */
  --tt-ink:    #171717;  /* --e-global-color-text      */
  --tt-accent: #7CB8E0;  /* --e-global-color-accent    */
  --tt-lilac:  #FAF6FF;  /* header/footer background   */
  --tt-mid:    #6FC4DB;  /* page behind the app card   */

  --tt-max: 1200px;   /* content width of the site's boxed sections */
  --tt-bar: 92px;     /* header height on desktop */
  --tt-bar-sm: 68px;  /* header height on phones  */
}

/* --------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------
   The chrome now sits outside .app, so the page — not the 480px card — is
   the scroll container: full-width header, the app card centred in the
   middle, full-width footer. .app keeps its own width and styling.
   -------------------------------------------------------------------------- */

body {
  background: var(--tt-mid);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Overrides the mobile-first rule further up: the card no longer owns the
   viewport, it just fills whatever the header and footer leave. */
.app {
  flex: 1 0 auto;
  min-height: calc(100dvh - var(--tt-bar-sm));
  border-radius: 0;
}

@media (min-width: 481px) {
  .app {
    /* Tall enough for the editor, short enough to leave the footer in view. */
    min-height: min(820px, max(640px, 100dvh - var(--tt-bar) - 96px));
    margin-block: 40px;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(58, 74, 82, 0.16);
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.sitebar {
  background: var(--tt-lilac);
  border-bottom: 1px solid rgba(23, 23, 23, 0.06);
}

.sitebar__inner {
  max-width: var(--tt-max);
  min-height: var(--tt-bar-sm);
  margin-inline: auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sitebar__brand {
  flex: none;
  display: flex;
  align-items: center;
}

.sitebar__brand img {
  display: block;
  width: auto;
  height: 38px;
}

.sitebar__nav {
  display: flex;
  align-items: center;
}

.sitebar__nav a {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--tt-ink);
  text-decoration: none;
  white-space: nowrap;
}

.sitebar__lang {
  color: var(--text-soft) !important;
}

/* Pink pill, the site's primary call to action. */
.sitebar__cta {
  flex: none;
  margin-left: auto;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--tt-pink);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s ease;
}

/* --------------------------------------------------------------------------
   Burger — a checkbox toggle, so it works with no JavaScript (inline script
   is CSP-blocked). Deliberately not <details>: Chrome hides a closed
   <details>'s content with content-visibility on ::details-content, which a
   child display rule cannot override. Here the visibility is entirely ours,
   and the desktop nav is simply always shown.
   -------------------------------------------------------------------------- */

.sitebar__burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  cursor: pointer;
  list-style: none;
}

.sitebar__toggle { position: absolute; }

.sitebar__burger-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 15px;
}

.sitebar__burger-box i {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--tt-ink);
}

@media (max-width: 979px) {
  .sitebar { position: relative; }

  .sitebar__nav { display: none; }

  .sitebar__toggle:checked ~ .sitebar__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 20px 18px;
    background: var(--tt-lilac);
    border-bottom: 1px solid rgba(23, 23, 23, 0.08);
    box-shadow: 0 18px 30px rgba(23, 23, 23, 0.08);
  }

  .sitebar__toggle:checked ~ .sitebar__nav a {
    width: 100%;
    padding: 11px 0;
    border-bottom: 1px solid rgba(23, 23, 23, 0.06);
  }

  /* Logo left, then the pink CTA, then the burger hard right. */
  .sitebar__cta { order: 2; margin-left: auto; }
  .sitebar__burger { order: 3; margin-right: -10px; }

  /* Keyboard focus lands on the visually-hidden checkbox; show it on the burger. */
  .sitebar__toggle:focus-visible ~ .sitebar__burger .sitebar__burger-box i {
    background: var(--tt-pink);
  }
}

@media (min-width: 980px) {
  .sitebar__inner { min-height: var(--tt-bar); }
  .sitebar__brand img { height: 48px; }
  .sitebar__burger { display: none; }

  .sitebar__nav {
    display: flex;
    gap: 30px;
    margin-left: 42px;
  }

  .sitebar__nav a { font-size: 15px; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.sitefoot {
  background: var(--tt-lilac);
  padding: 52px 20px 26px;
  font-family: var(--font-body);
}

.sitefoot__inner {
  max-width: var(--tt-max);
  margin-inline: auto;
  display: grid;
  gap: 36px 28px;
  grid-template-columns: 1fr;
}

.sitefoot__brand img {
  display: block;
  width: auto;
  height: 44px;
}

.sitefoot__copy {
  margin: 20px 0 0;
  max-width: 34ch;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--tt-ink);
}

.sitefoot__social {
  display: flex;
  gap: 18px;
  margin-top: 22px;
}

.sitefoot__icon {
  display: block;
  width: 21px;
  height: 21px;
  fill: var(--tt-blue);
  transition: fill 0.15s ease;
}

.sitefoot__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}

.sitefoot__head {
  margin: 0 0 5px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--tt-blue);
}

.sitefoot__col a {
  font-size: 15px;
  font-weight: 600;
  color: var(--tt-ink);
  text-decoration: none;
}

.sitefoot__addr {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--tt-ink);
}

.sitefoot__line {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
}

.sitefoot__glyph {
  flex: none;
  width: 17px;
  height: 17px;
  fill: var(--tt-blue);
}

.sitefoot__line a {
  font-size: 15px;
  font-weight: 600;
  color: var(--tt-ink);
  text-decoration: none;
}

/* The site's Elementor "wave" divider, reproduced as a repeating inline SVG.
   data: URIs are permitted by this app's img-src, unlike a remote asset. */
.sitefoot__wave {
  max-width: var(--tt-max);
  height: 16px;
  margin: 44px auto 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' overflow='visible' height='100%25' viewBox='0 0 24 24' fill='none' stroke='%23F6A5C0' stroke-width='1.3' stroke-linecap='square' stroke-miterlimit='10'%3E%3Cpath d='M0,6c6,0,0.9,11.1,6.9,11.1S18,6,24,6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 24px 16px;
}

.sitefoot__bottom {
  max-width: var(--tt-max);
  margin: 22px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}

.sitefoot__powered,
.sitefoot__legal {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tt-ink);
}

.sitefoot__legal {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sitefoot__powered a,
.sitefoot__legal a {
  color: var(--tt-ink);
  text-decoration: none;
}

.sitefoot__legal span { color: rgba(23, 23, 23, 0.3); }

@media (min-width: 720px) {
  .sitefoot__inner { grid-template-columns: 1.6fr 1fr 1fr 1.3fr; }
}

@media (min-width: 980px) {
  .sitefoot { padding: 70px 20px 30px; }
  .sitefoot__inner { gap: 40px; }
  .sitefoot__brand img { height: 52px; }
}

/* --------------------------------------------------------------------------
   Interaction and small-screen behaviour
   -------------------------------------------------------------------------- */

/* Hover only on real pointers; a tap on a phone gets the plain look. */
@media (hover: hover) {
  .sitebar__nav a:hover,
  .sitefoot__col a:hover,
  .sitefoot__line a:hover,
  .sitefoot__powered a:hover,
  .sitefoot__legal a:hover { text-decoration: underline; }

  .sitebar__cta:hover { filter: brightness(0.95); }
  .sitefoot__social a:hover .sitefoot__icon { fill: var(--tt-accent); }
}

/* The frame editor and the giveaway sheet need the whole viewport on a phone:
   the sheet is a modal with a full-bleed scrim, and the canvas wants every
   pixel. On a desktop there is room for both, so the chrome stays put. */
@media (max-width: 979px) {
  body[data-screen='editor'] .sitebar,
  body[data-screen='editor'] .sitefoot,
  body[data-screen='entry']  .sitebar,
  body[data-screen='entry']  .sitefoot { display: none; }

  body[data-screen='editor'] .app,
  body[data-screen='entry']  .app { min-height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .sitebar__cta,
  .sitefoot__icon { transition: none; }
}
