:root {
  color-scheme: dark;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.68);
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background: #171816;
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

.background-stack,
.background-layer,
.atmosphere,
.grain {
  position: fixed;
  inset: 0;
}

.background-stack {
  z-index: 0;
  overflow: hidden;
  background: #262724;
}

.background-layer {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.035);
  transition:
    opacity 1.25s var(--ease-soft),
    transform 8s var(--ease-out);
  will-change: opacity, transform;
}

.background-layer.is-active {
  opacity: 1;
  transform: scale(1);
}

.atmosphere {
  z-index: 1;
  background: transparent;
  pointer-events: none;
  transition: background 0.8s var(--ease-soft);
}

.grain {
  z-index: 2;
  opacity: 0.11;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.48'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  transition: opacity 0.8s var(--ease-soft);
}

body[data-background="photos"] .atmosphere {
  background:
    radial-gradient(ellipse at 50% 48%, rgba(5, 6, 5, 0.3) 0%, rgba(5, 6, 5, 0.22) 42%, rgba(5, 6, 5, 0.4) 100%),
    linear-gradient(180deg, rgba(5, 6, 5, 0.2) 0%, rgba(5, 6, 5, 0.1) 48%, rgba(5, 6, 5, 0.34) 100%);
}

body[data-background="solid"] .atmosphere {
  background: transparent;
}

body[data-background="solid"] .grain {
  opacity: 0;
}

body[data-background="gradient"] .atmosphere {
  background: rgba(0, 0, 0, 0.14);
}

body[data-background="gradient"] .grain {
  opacity: 0.06;
}

.viewport {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    max(2rem, env(safe-area-inset-top))
    max(1.5rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom))
    max(1.5rem, env(safe-area-inset-left));
  padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4rem));
  cursor: grab;
  scrollbar-width: none;
  touch-action: pan-y;
}

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

.viewport.is-dragging {
  cursor: grabbing;
}

.slide {
  width: min(47rem, 100%);
  margin-block: auto;
  transform: translate3d(0, 0, 0);
  opacity: 1;
  will-change: transform, opacity;
}

.slide.is-condensed .quote-text-ar {
  margin-top: 1rem;
}

.slide.is-condensed .quote-author {
  margin-top: 1.15rem;
}

.slide.is-entering {
  animation: slide-enter 0.9s var(--ease-out) both;
}

.slide.is-leaving-left {
  animation: slide-leave-left 0.44s var(--ease-soft) both;
}

.slide.is-leaving-right {
  animation: slide-leave-right 0.44s var(--ease-soft) both;
}

.quote {
  text-align: center;
  text-wrap: balance;
}

.quote-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.25rem, 4.5vw, 3.7rem);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.22;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.42);
  animation: first-reveal 1.1s 0.12s var(--ease-out) both;
}

.quote-text::before {
  content: "“";
  margin-inline-end: 0.05em;
  color: rgba(255, 255, 255, 0.52);
}

.quote-text::after {
  content: "”";
  margin-inline-start: 0.02em;
  color: rgba(255, 255, 255, 0.52);
}

.slide[data-length="long"] .quote-text {
  font-size: clamp(1.65rem, 3.25vw, 2.65rem);
  line-height: 1.28;
}

.quote-text-ar {
  width: min(39rem, 92%);
  margin: clamp(1.35rem, 3vh, 2.15rem) auto 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  font-size: clamp(1.48rem, 2.8vw, 2.1rem);
  font-weight: 400;
  line-height: 1.65;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.38);
  animation: first-reveal 1s 0.32s var(--ease-out) both;
}

.quote-text-ar:empty {
  display: none;
}

.translation-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.74rem;
  letter-spacing: 0.015em;
}

.translation-status[hidden] {
  display: none;
}

.translation-status button {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.46);
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.translation-status button:hover {
  border-color: #fff;
  color: #fff;
}

.translation-status button:focus-visible {
  border-radius: 0.1rem;
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.translation-status button:disabled {
  cursor: wait;
  opacity: 0.58;
}

body[data-arabic="hidden"] .quote-text-ar,
body[data-arabic="hidden"] .translation-status {
  display: none;
}

.quote-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-top: clamp(1.65rem, 3.5vh, 2.5rem);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.19em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.48);
  animation: first-reveal 0.9s 0.5s var(--ease-out) both;
}

.quote-author span {
  width: clamp(1.6rem, 4.5vw, 2.8rem);
  height: 1px;
  opacity: 0.52;
}

.quote-author span:first-child {
  background: linear-gradient(90deg, transparent, currentColor);
}

.quote-author span:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.quote-author cite {
  font-style: normal;
  font-weight: 500;
  text-wrap: balance;
}

.translation-toggle {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(14, 15, 14, 0.28);
  padding: 0.45rem 0.65rem;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.translation-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(14, 15, 14, 0.46);
  color: #fff;
}

.translation-toggle:focus-visible,
.quota-notice button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.translation-toggle-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.translation-toggle-track {
  position: relative;
  width: 1.85rem;
  height: 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  transition:
    border-color 0.25s ease,
    background 0.25s ease;
}

.translation-toggle-track span {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 0.61rem;
  height: 0.61rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transition:
    background 0.25s ease,
    transform 0.3s var(--ease-out);
}

.translation-toggle[aria-checked="true"] .translation-toggle-track {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.2);
}

.translation-toggle[aria-checked="true"] .translation-toggle-track span {
  background: #fff;
  transform: translateX(0.8rem);
}

.quota-notice {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(31rem, calc(100vw - 2rem));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(24, 22, 19, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  line-height: 1.4;
  transform: translateX(-50%);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  animation: notice-in 0.45s var(--ease-out) both;
}

.quota-notice[hidden] {
  display: none;
}

.quota-notice button {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.credits {
  position: fixed;
  left: 50%;
  bottom: max(1.35rem, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.66rem;
  letter-spacing: 0.035em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.credits-sources,
.powered-by {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.credits a {
  color: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  transition: color 0.2s ease;
}

.powered-by {
  color: rgba(255, 255, 255, 0.48);
  letter-spacing: 0.06em;
}

.powered-by strong {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  transition: color 0.2s ease;
}

.powered-by:hover strong {
  color: rgba(255, 255, 255, 0.96);
}

.content-notice-trigger {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font: inherit;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.content-notice-trigger:hover {
  border-color: rgba(255, 255, 255, 0.65);
  color: rgba(255, 255, 255, 0.82);
}

.content-notice-trigger:focus-visible {
  border-radius: 0.15rem;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.content-notice-dialog {
  width: min(31rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.1rem;
  background: rgba(20, 21, 20, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.content-notice-dialog::backdrop {
  background: rgba(5, 6, 5, 0.58);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.content-notice-panel {
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.content-notice-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.content-notice-panel header span {
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.content-notice-panel h2 {
  margin-top: 0.3rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.content-notice-panel p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.84rem;
  line-height: 1.65;
}

.content-notice-panel p + p {
  margin-top: 0.8rem;
}

.content-notice-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.content-notice-close:focus-visible,
.content-notice-email:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.content-notice-email {
  display: inline-flex;
  margin-top: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.62rem 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.content-notice-email:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
}

.credits a:hover {
  color: rgba(255, 255, 255, 0.92);
}

.credits a:focus-visible {
  border-radius: 0.15rem;
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.download,
.background-control {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 5;
}

.download {
  right: max(1.25rem, env(safe-area-inset-right));
  display: flex;
  gap: 0.55rem;
}

.background-control {
  left: max(1.25rem, env(safe-area-inset-left));
}

.download-trigger,
.share-trigger,
.background-trigger {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(14, 15, 14, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s var(--ease-out);
}

.download-trigger:hover,
.download-trigger[aria-expanded="true"],
.share-trigger:hover,
.background-trigger:hover,
.background-trigger[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(14, 15, 14, 0.48);
  color: #fff;
  transform: translateY(-2px);
}

.download-trigger:disabled {
  cursor: wait;
}

.download-trigger:focus-visible,
.share-trigger:focus-visible,
.download-option:focus-visible,
.share-option:focus-visible,
.background-trigger:focus-visible,
.background-option:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.download-trigger svg,
.share-trigger svg,
.background-trigger svg {
  width: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-trigger.is-copied {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.share-trigger .share-arrow {
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.share-trigger:hover .share-arrow,
.share-trigger:focus-visible .share-arrow {
  transform: translateY(-1px);
}

.share-trigger:active .share-arrow {
  transform: translateY(0);
}

.background-trigger svg {
  stroke-width: 1.35;
}

.download-trigger.is-exporting svg {
  animation: export-pulse 0.85s ease-in-out infinite alternate;
}

.download-trigger.is-exporting {
  position: relative;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(14, 15, 14, 0.56);
  color: #fff;
  transform: none;
}

.download-trigger.is-exporting::after {
  content: "";
  position: absolute;
  inset: -0.3rem;
  border: 1px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.9);
  border-right-color: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  animation: export-spin 0.8s linear infinite;
}

.download-menu,
.share-menu,
.background-menu {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  background: rgba(18, 19, 18, 0.72);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  padding: 0.35rem;
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  animation: menu-in 0.3s var(--ease-out) both;
}

.download-menu {
  right: 0;
  width: 12.5rem;
}

.share-menu {
  right: calc(2.75rem + 0.55rem);
  width: 12.5rem;
}

.background-menu {
  left: 0;
  width: 10.5rem;
}

.download-menu[hidden],
.share-menu[hidden],
.background-menu[hidden] {
  display: none;
}

.download-option,
.share-option,
.background-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  padding: 0.72rem 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.download-option:hover,
.share-option:hover,
.background-option:hover,
.background-option[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.09);
}

.download-option span,
.share-option span,
.background-option > span:last-child {
  font-size: 0.78rem;
  font-weight: 500;
}

.download-option small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}

.share-option small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}

.background-option {
  justify-content: flex-start;
}

.background-swatch {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.swatch-photos {
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)),
    url("https://images.unsplash.com/photo-1501785888041-af3ef285b470?auto=format&fit=crop&w=60&q=40") center / cover;
}

.swatch-solid {
  background: #2f7180;
}

.swatch-gradient {
  background: radial-gradient(circle at center, #7f7fd5, #2d6a6a);
}

.swatch-black {
  background: #000;
}

.swatch-white {
  border-color: rgba(0, 0, 0, 0.2);
  background: #fff;
}

.color-picker-anchor {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.pcr-app {
  z-index: 20;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(20, 21, 20, 0.96);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
}

.pcr-app[data-theme="nano"] .pcr-selection .pcr-color-palette .pcr-palette,
.pcr-app[data-theme="nano"] .pcr-selection .pcr-color-palette .pcr-palette::before {
  border-radius: calc(1rem - 1px) calc(1rem - 1px) 0.2rem 0.2rem;
}

.pcr-app .pcr-interaction .pcr-result {
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-family: "DM Sans", system-ui, sans-serif;
}

.pcr-app .pcr-interaction .pcr-save,
.pcr-app .pcr-interaction .pcr-cancel {
  border-radius: 0.5rem;
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.notification-stack {
  position: fixed;
  top: max(4.45rem, calc(env(safe-area-inset-top) + 3.5rem));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 7;
  display: flex;
  width: min(22rem, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
  transition: top 0.35s var(--ease-out);
}

.notification-card {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.9rem;
  background: rgba(30, 22, 22, 0.9);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  padding: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  pointer-events: auto;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  animation: notification-in 0.45s var(--ease-out) both;
}

.notification-card.is-leaving {
  pointer-events: none;
  animation: notification-out 0.32s var(--ease-soft) both;
}

.notification-card .notification-icon {
  width: 1.25rem;
  fill: none;
  stroke: rgba(255, 190, 190, 0.9);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.notification-card .notification-icon-success {
  display: none;
}

.notification-card[data-type="success"] {
  background: rgba(20, 31, 27, 0.9);
}

.notification-card[data-type="success"] .notification-icon-error {
  display: none;
}

.notification-card[data-type="success"] .notification-icon-success {
  display: block;
  stroke: rgba(190, 255, 218, 0.92);
}

.notification-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.notification-card strong {
  font-size: 0.75rem;
  font-weight: 500;
}

.notification-card-content span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
}

.notification-card button {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.68);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.notification-card button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.notification-countdown {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  shape-rendering: geometricPrecision;
}

.notification-countdown rect {
  x: 1px;
  y: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  rx: 13px;
  ry: 13px;
  fill: none;
  stroke: rgba(255, 190, 190, 0.72);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: notification-countdown var(--notification-duration) linear forwards;
}

.notification-card[data-type="success"] .notification-countdown rect {
  stroke: rgba(190, 255, 218, 0.72);
}

body[data-foreground="dark"] {
  --text: rgba(12, 14, 13, 0.92);
  --muted: rgba(12, 14, 13, 0.62);
}

body[data-foreground="dark"] .quote-text,
body[data-foreground="dark"] .quote-text-ar,
body[data-foreground="dark"] .quote-author {
  text-shadow: none;
}

body[data-foreground="dark"] .quote-text::before,
body[data-foreground="dark"] .quote-text::after {
  color: rgba(12, 14, 13, 0.38);
}

body[data-foreground="dark"] .quote-text-ar {
  color: rgba(12, 14, 13, 0.72);
}

body[data-foreground="dark"] .translation-status {
  color: rgba(12, 14, 13, 0.62);
}

body[data-foreground="dark"] .translation-status button {
  border-color: rgba(12, 14, 13, 0.4);
  color: rgba(12, 14, 13, 0.88);
}

body[data-foreground="dark"] .translation-toggle,
body[data-foreground="dark"] .download-trigger,
body[data-foreground="dark"] .share-trigger,
body[data-foreground="dark"] .background-trigger {
  border-color: rgba(12, 14, 13, 0.2);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  color: rgba(12, 14, 13, 0.72);
}

body[data-foreground="dark"] .translation-toggle:hover,
body[data-foreground="dark"] .download-trigger:hover,
body[data-foreground="dark"] .share-trigger:hover,
body[data-foreground="dark"] .background-trigger:hover,
body[data-foreground="dark"] .background-trigger[aria-expanded="true"],
body[data-foreground="dark"] .download-trigger[aria-expanded="true"] {
  border-color: rgba(12, 14, 13, 0.38);
  background: rgba(255, 255, 255, 0.58);
  color: #090a09;
}

body[data-foreground="dark"] .translation-toggle-track {
  border-color: rgba(12, 14, 13, 0.26);
  background: rgba(12, 14, 13, 0.08);
}

body[data-foreground="dark"] .translation-toggle-track span {
  background: rgba(12, 14, 13, 0.66);
}

body[data-foreground="dark"]
  .translation-toggle[aria-checked="true"]
  .translation-toggle-track {
  border-color: rgba(12, 14, 13, 0.4);
  background: rgba(12, 14, 13, 0.16);
}

body[data-foreground="dark"]
  .translation-toggle[aria-checked="true"]
  .translation-toggle-track
  span {
  background: #0b0c0b;
}

body[data-foreground="dark"] .credits {
  color: rgba(12, 14, 13, 0.4);
}

body[data-foreground="dark"] .credits a {
  color: rgba(12, 14, 13, 0.62);
}

body[data-foreground="dark"] .powered-by {
  color: rgba(12, 14, 13, 0.48);
}

body[data-foreground="dark"] .powered-by strong {
  color: rgba(12, 14, 13, 0.72);
}

body[data-foreground="dark"] .powered-by:hover strong {
  color: #090a09;
}

body[data-foreground="dark"] .content-notice-trigger {
  border-color: rgba(12, 14, 13, 0.22);
  color: rgba(12, 14, 13, 0.5);
}

body[data-foreground="dark"] .content-notice-trigger:hover {
  border-color: rgba(12, 14, 13, 0.58);
  color: rgba(12, 14, 13, 0.84);
}

body[data-foreground="dark"] .credits a:hover {
  color: #090a09;
}

body[data-foreground="dark"] .translation-toggle:focus-visible,
body[data-foreground="dark"] .download-trigger:focus-visible,
body[data-foreground="dark"] .share-trigger:focus-visible,
body[data-foreground="dark"] .background-trigger:focus-visible,
body[data-foreground="dark"] .credits a:focus-visible {
  outline-color: #090a09;
}

@keyframes first-reveal {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translate(-50%, -0.6rem);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes notification-in {
  from {
    opacity: 0;
    transform: translateX(1rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes notification-out {
  to {
    opacity: 0;
    transform: translateX(1rem) scale(0.96);
  }
}

@keyframes notification-countdown {
  to {
    stroke-dashoffset: 1;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(0.45rem) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes export-pulse {
  to {
    opacity: 0.35;
    transform: translateY(2px);
  }
}

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

@keyframes slide-enter {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(var(--enter-x, 3.5rem), 0, 0);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slide-leave-left {
  to {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(-5rem, 0, 0);
  }
}

@keyframes slide-leave-right {
  to {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(5rem, 0, 0);
  }
}

@media (max-width: 600px) {
  .viewport {
    padding-top: max(4.75rem, calc(env(safe-area-inset-top) + 3.75rem));
    padding-bottom: max(5.25rem, calc(env(safe-area-inset-bottom) + 4.25rem));
    padding-inline: 1.4rem;
  }

  .quote-text {
    font-size: clamp(1.9rem, 8vw, 2.25rem);
    line-height: 1.25;
  }

  .slide[data-length="long"] .quote-text {
    font-size: clamp(1.35rem, 5.8vw, 1.65rem);
    line-height: 1.32;
  }

  .quote-text-ar {
    font-size: clamp(1.25rem, 5.3vw, 1.48rem);
    line-height: 1.7;
  }

  .download {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .background-control {
    left: max(1rem, env(safe-area-inset-left));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .credits {
    bottom: max(1.35rem, calc(env(safe-area-inset-bottom) + 0.5rem));
    gap: 0.25rem;
    font-size: 0.58rem;
  }

  .translation-toggle {
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
  }

  .quota-notice {
    top: max(4.4rem, calc(env(safe-area-inset-top) + 3.5rem));
    width: calc(100vw - 2rem);
    justify-content: space-between;
    border-radius: 0.85rem;
  }

  .notification-stack {
    top: max(4.4rem, calc(env(safe-area-inset-top) + 3.5rem));
    right: max(1rem, env(safe-area-inset-right));
  }

  .notification-stack.below-quota {
    top: max(8.4rem, calc(env(safe-area-inset-top) + 7.5rem));
  }
}

@media (max-width: 480px) {
  .credits-sources > span:not([aria-hidden]) {
    display: none;
  }
}

@media (prefers-contrast: more) {
  .atmosphere {
    background: rgba(0, 0, 0, 0.68);
  }

  .quote-text-ar,
  .quote-author {
    color: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .background-layer,
  .slide,
  .quote-text,
  .quote-text-ar,
  .quote-author {
    animation: none !important;
    transition: none !important;
  }

  .download-menu,
  .share-menu,
  .background-menu,
  .quota-notice,
  .notification-card,
  .notification-countdown rect,
  .download-trigger.is-exporting svg,
  .download-trigger.is-exporting::after {
    animation: none !important;
  }
}
