/* Photoryfy design system: paper/ink + vivid mood colors. Logical properties only. */
:root {
  --paper: #FBFAFF; --paper-2: #F0EDFA; --ink: #1B1530; --ink-soft: #5B5475; --line: #E2DDF0;
  --sun: #FFC93C; --rose: #FF8FB1; --volt: #2C5BFF; --mint: #3CCFB4; --magenta: #FF2E88;
  --on-vivid: #1B1530;
  --display: "Bricolage Grotesque", "Readex Pro", system-ui, sans-serif;
  --body: "Readex Pro", system-ui, sans-serif;
  --shadow: 0 22px 44px -22px rgb(27 21 48 / .5);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #17122A; --paper-2: #221B3B; --ink: #F4F1FF; --ink-soft: #ADA5C9; --line: #312A52; --shadow: 0 22px 44px -18px rgb(0 0 0 / .75); }
}
/* Bricolage has no Arabic glyphs: Readex Pro carries the display role in Arabic. */
:root:lang(ar) { --display: "Readex Pro", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img, canvas { display: block; max-inline-size: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: 0; text-wrap: balance; }
:lang(ar) :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--volt); outline-offset: 3px; border-radius: 6px; }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: var(--sun); } }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
.wrap { inline-size: min(1180px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.soft { color: var(--ink-soft); }
.flip:dir(rtl) { transform: scaleX(-1); }

/* Buttons: they say exactly what happens. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-block-size: 48px; padding-inline: 22px;
  border-radius: 999px; border: 2px solid transparent; background: var(--magenta); color: var(--on-vivid);
  font: 600 1rem/1.1 var(--body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .12s; }
.btn:hover { background: #ff4b9a; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { min-block-size: 58px; padding-inline: 30px; font-size: 1.125rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-quiet { background: var(--paper-2); color: var(--ink); }
.btn-quiet:hover { background: var(--line); }
.btn-sm { min-block-size: 38px; padding-inline: 14px; font-size: .875rem; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--ink-soft); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 12px; padding-block: 14px; }
.topbar .spacer { flex: 1; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 800 1.375rem/1 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.03em; text-decoration: none; }
.logo svg { inline-size: 26px; block-size: 26px; }
.pill { display: inline-flex; align-items: center; min-block-size: 34px; padding-inline: 14px; border-radius: 999px; background: var(--paper-2); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.pill.empty { background: var(--sun); color: var(--on-vivid); }

/* Forms */
label, .label { display: block; font-size: .875rem; font-weight: 500; color: var(--ink-soft); margin-block-end: 6px; }
input[type=text], select, textarea { inline-size: 100%; min-block-size: 48px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink); font: 400 1rem/1.3 var(--body); }
input[type=text]:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input[type=text]:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--volt); outline-offset: 1px; }
.title-input { font: 700 1.5625rem/1.2 var(--display); letter-spacing: -.02em; }
select.lang { inline-size: auto; min-block-size: 38px; padding: 4px 10px; font-size: .875rem; border-radius: 999px; }

/* Signature element: the instant frame. Color = story mood. */
.frame { --frame: var(--sun); --on-frame: var(--on-vivid); position: relative; display: flex; flex-direction: column;
  background: var(--frame); padding: 14px 14px 0; border-radius: 18px; box-shadow: var(--shadow); color: var(--on-frame); }
.frame-media { position: relative; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #0d0a18; }
.frame-media > canvas, .frame-media > img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.frame-cap { block-size: 56px; display: flex; align-items: center; gap: 8px; padding-inline: 4px; min-inline-size: 0;
  font: 700 1.25rem/1.1 var(--display); letter-spacing: -.02em; }
.frame-cap > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.frame.sm { padding: 8px 8px 0; border-radius: 12px; box-shadow: none; }
.frame.sm .frame-media { border-radius: 4px; }
.frame.sm .frame-cap { block-size: 38px; font-size: 1rem; padding-inline: 2px; }
.mood-happy { --frame: var(--sun); }
.mood-nostalgic { --frame: var(--rose); }
.mood-epic { --frame: var(--volt); --on-frame: #fff; }
.mood-calm { --frame: var(--mint); }
.mood-party { --frame: var(--magenta); }

/* Round play button over a frame */
.play { position: absolute; inset: 0; margin: auto; inline-size: 84px; block-size: 84px; border-radius: 50%; border: 0;
  background: rgb(255 255 255 / .92); color: #1B1530; cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 30px rgb(0 0 0 / .35); transition: transform .15s; }
.play:hover { transform: scale(1.06); }
.play svg { inline-size: 34px; block-size: 34px; margin-inline-start: 5px; }
.play:dir(rtl) svg { margin-inline: 0 5px; } /* media icons are not mirrored in RTL; keep optical offset to the right */
.chip { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; min-block-size: 36px; padding-inline: 12px; border-radius: 999px; border: 0;
  background: rgb(255 255 255 / .9); color: #1B1530; font: 500 .8125rem/1 var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }

/* Footer */
.footer { border-block-start: 2px solid var(--line); margin-block-start: 96px; padding-block: 28px 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: .875rem; color: var(--ink-soft); }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .spacer { flex: 1; }

/* Overlay dialog, toast, progress */
dialog.sheet { border: 0; padding: 32px; border-radius: 20px; background: var(--paper); color: var(--ink); inline-size: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.sheet::backdrop { background: rgb(27 21 48 / .6); }
dialog.sheet h2 { font-size: 1.5625rem; margin-block-end: 10px; }
.toast { position: fixed; inset-block-end: 20px; inset-inline-start: 50%; translate: -50% 0; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-size: .9375rem; z-index: 50; max-inline-size: calc(100vw - 32px); }
.toast:dir(rtl) { translate: 50% 0; }
.progress { block-size: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.progress > i { display: block; block-size: 100%; inline-size: 0; background: var(--magenta); transition: inline-size .2s; }
.spinner { inline-size: 40px; block-size: 40px; border-radius: 50%; border: 4px solid var(--paper-2); border-block-start-color: var(--magenta); animation: spin 0.9s linear infinite; margin-block-end: 20px; }
@keyframes spin { to { rotate: 360deg; } }

/* Prose pages (privacy, terms, expired) */
.prose { max-inline-size: 66ch; padding-block: 48px; }
.prose h1 { font-size: clamp(2rem, 5vw, 3.0625rem); margin-block-end: 24px; }
.prose h2 { font-size: 1.25rem; margin-block: 32px 8px; }
.prose p { margin-block-end: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Shown on top of the landing page for unknown URLs and server errors */
.notice { margin-block: 16px 0; padding: 14px 18px; border-radius: 14px; background: var(--sun); color: var(--on-vivid); font-weight: 600; }
