:root {
    color-scheme: light;
    --font-ui: "Avenir Next", "Helvetica Neue", sans-serif;
    --font-ar: "DIN Next Arabic", "Geeza Pro", Tahoma, sans-serif;
    --page: #f3eee6;
    --surface: #faf7f2;
    --surface-raised: #f7f3ed;
    --surface-muted: #ebe5dc;
    --surface-strong: #ded5c8;
    --ink: #29211d;
    --ink-muted: #6a6058;
    --ink-faint: #776d63;
    --ink-soft: #81756a;
    --line: #ded6cc;
    --line-strong: #b7aa9b;
    --accent: #665044;
    --accent-strong: #29211d;
    --accent-dark: #1e1814;
    --accent-soft: #e9dfd2;
    --feature: #e5ddd1;
    --feature-ink: #302720;
    --feature-muted: #736254;
    --sidebar: #ece5db;
    --sidebar-raised: #f6f1e9;
    --sidebar-ink: #302720;
    --sidebar-muted: #6a6058;
    --sidebar-line: #d5cabc;
    --photo-stage: #e3dace;
    --success: #39745e;
    --success-soft: #ddf1e8;
    --danger: #a13d50;
    --danger-soft: #fae2e6;
    --warning: #866028;
    --warning-soft: #f9ecd1;
    --overlay: rgba(68, 45, 56, .48);
    --bg: var(--page);
    --shadow-sm: 0 10px 30px rgba(91, 47, 65, .07);
    --shadow-lg: 0 24px 70px rgba(91, 47, 65, .12);
    --radius-xs: 3px;
    --radius-sm: 4px;
    --radius-md: 4px;
    --container: 1200px;
    --measure: 68ch;
    --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --page: #211e1a;
        --surface: #29251f;
        --surface-raised: #302b24;
        --surface-muted: #39322a;
        --surface-strong: #4a4035;
        --ink: #f5efe5;
        --ink-muted: #cfc4b5;
        --ink-faint: #b8a996;
        --ink-soft: #bfb3a3;
        --line: #50473c;
        --line-strong: #776958;
        --accent: #dfc3a1;
        --accent-strong: #725f4b;
        --accent-dark: #665044;
        --accent-soft: #453a2d;
        --feature: #483d30;
        --feature-ink: #f5efe5;
        --feature-muted: #d5c4ac;
        --sidebar: #28231d;
        --sidebar-raised: #332c23;
        --sidebar-ink: #f5efe5;
        --sidebar-muted: #c9b79e;
        --sidebar-line: #504434;
        --photo-stage: #332d26;
        --success: #9ed5bc;
        --success-soft: #29483b;
        --danger: #ffabb6;
        --danger-soft: #5b303a;
        --warning: #f2cb82;
        --warning-soft: #554323;
        --overlay: rgba(35, 20, 27, .72);
        --bg: var(--page);
        --shadow-sm: 0 10px 30px rgba(20, 9, 14, .18);
        --shadow-lg: 0 24px 70px rgba(20, 9, 14, .3);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #211e1a;
    --surface: #29251f;
    --surface-raised: #302b24;
    --surface-muted: #39322a;
    --surface-strong: #4a4035;
    --ink: #f5efe5;
    --ink-muted: #cfc4b5;
    --ink-faint: #b8a996;
    --ink-soft: #bfb3a3;
    --line: #50473c;
    --line-strong: #776958;
    --accent: #dfc3a1;
    --accent-strong: #725f4b;
    --accent-dark: #665044;
    --accent-soft: #453a2d;
    --feature: #483d30;
    --feature-ink: #f5efe5;
    --feature-muted: #d5c4ac;
    --sidebar: #28231d;
    --sidebar-raised: #332c23;
    --sidebar-ink: #f5efe5;
    --sidebar-muted: #c9b79e;
    --sidebar-line: #504434;
    --photo-stage: #332d26;
    --success: #9ed5bc;
    --success-soft: #29483b;
    --danger: #ffabb6;
    --danger-soft: #5b303a;
    --warning: #f2cb82;
    --warning-soft: #554323;
    --overlay: rgba(35, 20, 27, .72);
    --bg: var(--page);
    --shadow-sm: 0 10px 30px rgba(20, 9, 14, .18);
    --shadow-lg: 0 24px 70px rgba(20, 9, 14, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); background: var(--page); }
body { margin: 0; color: var(--ink); background: var(--page); font-family: var(--font-ui); font-size: 16px; line-height: 1.55; text-rendering: optimizeLegibility; }
html[lang="ar"] body { font-family: var(--font-ar); }
body.menu-open, body.camera-open { overflow: hidden; }
img, canvas, video, svg { max-width: 100%; }
img { display: block; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
[hidden], .is-hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
::selection { color: var(--surface); background: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 3px; }

.button {
    min-height: 48px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    font-size: .86rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button-primary { color: #fff8fb; background: var(--accent-strong); box-shadow: 0 8px 22px rgba(132, 41, 72, .16); }
.button-primary:hover { background: var(--accent); }
.button-secondary { border-color: var(--line-strong); background: transparent; }
.button-secondary:hover { border-color: var(--ink); }
.button-inverse { color: var(--ink); background: var(--surface); }
.button-inverse:hover { background: var(--surface-muted); }
.button-wide { width: 100%; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    color: var(--ink);
    background: var(--surface);
    font-size: 16px;
}
textarea { min-height: 132px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

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