/* Font */
@font-face {
  font-family: 'Jukotha';
  src: url('/static/fonts/Jukotha-Stamp.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* BASE Navbar — dark on all typecast pages */
body:has(.ct-page) .site-nav { background: #1a1a1a !important; box-shadow: none !important; }
body:has(.ct-page) .site-nav .brand { background-image: url("/static/core/images/logo-white.svg") !important; }
body:has(.ct-page) .site-nav .nav-center { background: rgba(255, 255, 255, 0.18); }
body:has(.ct-page) .site-nav .nav-center a { color: #fff; }
body:has(.ct-page) .site-nav .nav-center a:hover { background: rgba(255, 255, 255, 0.25); }
body:has(.ct-page) .site-nav .btn-login { background: #e2fea9; color: #0b0b0c; }
body:has(.ct-page) .site-nav .btn-login:hover { background: #c8e696; }
body:has(.ct-page) .site-nav .btn-signup { background: #fff; color: #0b0b0c !important; }
body:has(.ct-page) .site-nav .btn-signup:hover { background: #e8e8e8; }
body:has(.ct-page) .site-nav .nav-toggle span,
body:has(.ct-page) .site-nav .nav-toggle span::before,
body:has(.ct-page) .site-nav .nav-toggle span::after { background: #fff; }
body:has(.ct-page) .site-nav .nav-menu { background: #1a1a1a; backdrop-filter: blur(8px); }
body:has(.ct-page) .site-nav .nav-menu a { color: #fff; }
body:has(.ct-page) .site-nav .nav-menu .btn-login { color: #0b0b0c !important; }
body:has(.ct-mosaic) .site-nav { background: transparent !important; }
body:has(.ct-mosaic) .site-footer { display: none; }
body:has(.ct-page) .site-nav .platform-menu__toggle { color: #fff; }
body:has(.ct-page) .site-nav .platform-menu__dropdown { background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); }
body:has(.ct-page) .site-nav .platform-menu__dropdown { background: rgba(40, 40, 40, 0.95); backdrop-filter: blur(12px); }
body:has(.ct-page) .site-nav .platform-menu__item { color: #fff; }
body:has(.ct-page) .site-nav .platform-menu__item:hover:not(.platform-menu__item--disabled) { background: rgba(255, 255, 255, 0.12); }
body:has(.ct-page) .site-nav .nav-menu-platform__toggle { color: #fff; }
body:has(.ct-page) .site-nav .nav-menu-platform__chevron { color: #fff; }
body:has(.ct-page) .site-nav .nav-menu-sub { border-left-color: rgba(255, 255, 255, 0.2); }
body:has(.ct-page) .site-nav .nav-menu-sub a { color: rgba(255, 255, 255, 0.75) !important; }

/* ACCOUNTS navbar overrides (logged-in users) */
body:has(.ct-page) .nav-logo__img { content: url("/static/core/images/logo-white.svg"); }
body:has(.ct-page) .content-area { background: transparent; padding: 0; }
body:has(.ct-page) .main-content { margin-top: 0; padding: 0; }
body:has(.ct-page) .nav-pills { background: rgba(255, 255, 255, 0.12); }
body:has(.ct-page) .nav-pills a { color: #fff; }
body:has(.ct-page) .nav-pills a:hover:not(.is-active) { background: rgba(255, 255, 255, 0.18); }
body:has(.ct-page) .nav-pills a.is-active { background: rgba(255, 255, 255, 0.25); color: #fff; }
body:has(.ct-page) .nav-settings-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
body:has(.ct-page) .nav-settings-btn:hover:not(.is-active) { background: rgba(255, 255, 255, 0.18); }
body:has(.ct-page) .nav-settings-btn.is-active { background: rgba(255, 255, 255, 0.25); color: #fff; }
body:has(.ct-page) .nav-bell { background: rgba(255, 255, 255, 0.12); color: #fff; }
body:has(.ct-page) .nav-bell:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
body:has(.ct-page) .user-menu__toggle { background: rgba(255, 255, 255, 0.12); }
body:has(.ct-page) .user-menu__toggle:hover { background: rgba(255, 255, 255, 0.18); }
body:has(.ct-page) .user-menu__icon { color: #fff !important; }
body:has(.ct-page) .user-menu__chevron { color: #fff; }
body:has(.ct-page) .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.1);
}
body:has(.ct-page) .mobile-bottom-nav .nav-item { color: #fff; }
body:has(.ct-page) .mobile-bottom-nav .nav-item.active { background: rgba(255, 255, 255, 0.25); color: #fff; }
body:has(.ct-page) .mobile-top-nav .nav-bell {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}
body:has(.ct-page) .mobile-top-nav .user-menu__toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.1);
}
body:has(.ct-page) .tools-menu__toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
body:has(.ct-page) .tools-menu__toggle:hover { background: rgba(255, 255, 255, 0.18); }
body:has(.ct-page) .tools-menu__toggle.is-active { background: rgba(255, 255, 255, 0.25); color: #fff; }
body:has(.ct-page) .tools-menu__toggle i { color: #fff; }
body:has(.ct-page) .tools-menu__dropdown { background: rgba(40, 40, 40, 0.95); }
body:has(.ct-page) .tools-menu__item { color: #fff; }
body:has(.ct-page) .tools-menu__item i { color: rgba(255, 255, 255, 0.6); }
body:has(.ct-page) .tools-menu__item:hover:not(.tools-menu__item--disabled) { background: rgba(255, 255, 255, 0.12); }

/* Shared layout */
.ct-page {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 100vh;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  box-sizing: border-box;
  overflow: hidden;
}

.ct-container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Mosaic background */
.ct-mosaic { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.ct-mosaic-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(8deg);
  display: grid;
  grid-template-columns: repeat(6, clamp(160px, 16vw, 260px));
  grid-template-rows: repeat(3, auto);
  gap: 24px;
  opacity: 0.80;
}

.ct-mosaic-slot { border-radius: 8px; overflow: hidden; }
.ct-mosaic-slot img { width: 100%; height: auto; display: block; filter: grayscale(30%); }

.ct-mosaic-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(26,26,26,0.3) 15%, #1a1a1a 70%);
}

/* Title */
.ct-title-wrapper { perspective: 280px; margin-bottom: 40px; }

.ct-title {
  font-family: 'Jukotha', sans-serif;
  font-size: 6.5rem;
  font-weight: normal;
  color: #ffffff;
  margin: 0;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform: rotateX(32deg);
  transform-origin: center bottom;
  text-shadow:
    0 2px 0 rgba(255,255,255,0.04),
    0 4px 0 rgba(0,0,0,0.15),
    0 6px 0 rgba(0,0,0,0.1),
    0 0 60px rgba(101,78,240,0.15);
}

.ct-title .ct-accent { color: #7B68EE; }

/* Upload area — desktop only */
.ct-upload-area {
  position: relative;
  width: 260px;
  height: 340px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 32px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ct-upload-area:hover {
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 30px rgba(123,104,238,0.08);
}

.ct-upload-area.has-preview {
  border-color: rgba(255,255,255,0.15);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
}

.ct-upload-area.has-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10,10,10,0) 50%, rgba(10,10,10,0.35) 100%);
}

.ct-upload-area.has-preview:hover { border-color: rgba(123,104,238,0.4); }

.ct-upload-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ct-upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 1.2rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.ct-upload-area:hover .ct-upload-icon { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }

.ct-upload-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.02em;
}

.ct-upload-hint {
  font-family: 'Poppins', sans-serif;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.02em;
}

.ct-upload-preview { display: none; width: 100%; height: 100%; }
.ct-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.ct-upload-area.has-preview .ct-upload-empty { display: none; }
.ct-upload-area.has-preview .ct-upload-preview { display: block; }
.ct-file-input { display: none; }

/* Mobile action buttons — hidden on desktop, shown via media query */
.ct-mobile-actions { display: none; }
.ct-mobile-actions.is-hidden { display: none !important; }
.ct-mobile-preview { display: none; }

.ct-mobile-preview.has-preview {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.15);
  margin-bottom: 32px;
  cursor: pointer;
  position: relative;
}

.ct-mobile-preview.has-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10,10,10,0) 50%, rgba(10,10,10,0.35) 100%);
}

.ct-mobile-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ct-mobile-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ct-mobile-btn:active { border-color: rgba(255,255,255,0.25); box-shadow: 0 0 30px rgba(123,104,238,0.08); }
.ct-mobile-btn i { color: rgba(255,255,255,0.3); font-size: 1.2rem; }

.ct-mobile-btn span {
  font-family: 'Poppins', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Blob button */
.ct-submit-row { margin-bottom: 24px; }

.ct-blob-btn {
  z-index: 1;
  position: relative;
  padding: 16px 40px;
  text-align: center;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #0b0b0c;
  background-color: #f5e642;
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 30px;
  transition: color 0.5s;
  overflow: hidden;
}

.ct-blob-btn:hover { color: #0b0b0c; box-shadow: inset 0 0 0 3px #7B68EE; }

.ct-blob-btn__inner {
  z-index: -1;
  overflow: hidden;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: transparent;
}

.ct-blob-btn__blobs { position: relative; display: block; height: 100%; filter: url('#ct-goo'); }

.ct-blob-btn__blob {
  position: absolute;
  top: 2px;
  width: 25%;
  height: 100%;
  background: #7B68EE;
  border-radius: 100%;
  transform: translate3d(0, 150%, 0) scale(1.7);
  transition: transform 0.45s;
}

@supports (filter: url('#ct-goo')) {
  .ct-blob-btn__blob { transform: translate3d(0, 150%, 0) scale(1.4); }
}

.ct-blob-btn__blob:nth-child(1) { left: 0%; transition-delay: 0s; }
.ct-blob-btn__blob:nth-child(2) { left: 30%; transition-delay: 0.08s; }
.ct-blob-btn__blob:nth-child(3) { left: 60%; transition-delay: 0.16s; }
.ct-blob-btn__blob:nth-child(4) { left: 90%; transition-delay: 0.24s; }

.ct-blob-btn:hover .ct-blob-btn__blob { transform: translateZ(0) scale(1.7); }

@supports (filter: url('#ct-goo')) {
  .ct-blob-btn:hover .ct-blob-btn__blob { transform: translateZ(0) scale(1.4); }
}

/* Error / signup */
.ct-error {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  color: #ff6b6b;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.15);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  max-width: 340px;
  line-height: 1.5;
}

.ct-signup-link {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  color: rgb(226,254,169);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.ct-signup-link:hover { opacity: 0.8; }

/* Previous result / try another link */
.ct-prev-result {
  font-family: 'Jukotha', sans-serif;
  font-size: 1.2rem;
  color: #7B68EE;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
  margin-top: 8px;
}

.ct-prev-result:hover { color: #f5e642; }

/* Processing state */
.ct-processing { display: none; flex-direction: column; align-items: center; }
.ct-processing.active { display: flex; }
.ct-form.is-processing { display: none; }
.ct-form.is-processing ~ .ct-prev-result { display: none; }
.ct-form.is-processing ~ .ct-mobile-actions { display: none !important; }
.ct-form.is-processing ~ .ct-mobile-preview { display: none !important; }

.ct-spinner-wrapper {
  position: relative;
  width: 260px;
  height: 340px;
  border-radius: 14px;
  overflow: hidden;
}

.ct-spinner-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.ct-spinner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ct-spinner-icon {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ct-spin 0.8s linear infinite;
}

@keyframes ct-spin { to { transform: rotate(360deg); } }

.ct-processing-text {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ct-processing-text::after { content: ''; animation: ct-dots 1.5s steps(4, end) infinite; }

@keyframes ct-dots {
  0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } 100% { content: ''; }
}

/* Result + share pages */
.ct-result-page { padding: 140px 24px 80px; }

.ct-result-container {
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ct-result-card {
  width: 100%;
  max-width: 428px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
}

.ct-result-card img { width: 100%; height: auto; display: block; }

.ct-result-type {
  font-family: 'Jukotha', sans-serif;
  font-size: 2.4rem;
  font-weight: normal;
  color: #ffffff;
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ct-result-actions { display: flex; gap: 12px; margin-bottom: 32px; }
.ct-btn-download { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

.ct-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 30px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ct-btn-share:hover { background: rgba(255,255,255,0.18); }

#ctCopyBtn {
    padding: 14px 18px;
    min-width: auto;
}

.ct-result-failed-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
}

.ct-result-failed-text {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 24px;
}

/* Share panel — desktop fallback */
.ct-share-panel {
  display: none;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}

.ct-share-panel[style*="flex"],
.ct-share-panel.is-visible {
  display: flex !important;
}

.ct-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ct-share-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.ct-share-whatsapp:hover { background: rgba(37, 211, 102, 0.25); }
.ct-share-twitter:hover { background: rgba(255, 255, 255, 0.2); }
.ct-share-facebook:hover { background: rgba(24, 119, 242, 0.25); }

/* Share page */
.ct-share-cta {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
  .ct-page { padding: 110px 20px 60px; }
  .ct-title { font-size: clamp(3rem, 14vw, 4.5rem); padding: 0 12px; }
  .ct-title-wrapper { margin-bottom: 32px; }
  .ct-upload-area { display: none; }
  .ct-mobile-actions { display: flex; gap: 20px; margin-bottom: 32px; }
  .ct-blob-btn { padding: 14px 32px; font-size: 0.8rem; }
  .ct-spinner-wrapper { width: 160px; height: 160px; border-radius: 50%; }
  .ct-result-page { padding: 110px 20px 60px; }
  .ct-result-card { max-width: 360px; }
  .ct-result-type { font-size: 1.8rem; }
  .ct-result-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .ct-btn-download, .ct-btn-share { justify-content: center; width: 100%; }
  .ct-share-link { width: 48px; }
}

/* Tablet portrait (601–900px) */
@media (min-width: 601px) and (max-width: 900px) {
  .ct-title { font-size: clamp(4rem, 10vw, 5.5rem); padding: 0 16px; }
  .ct-upload-area { display: none; }
  .ct-mobile-actions { display: flex; gap: 24px; margin-bottom: 32px; }
  .ct-mobile-btn { width: 120px; height: 120px; }
  .ct-mobile-btn i { font-size: 1.4rem; }
  .ct-mobile-btn span { font-size: 0.6rem; }
  .ct-mobile-preview.has-preview { width: 180px; height: 180px; }
  .ct-spinner-wrapper { width: 180px; height: 180px; border-radius: 50%; }
}