@import url('https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@500;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,700;1,9..144,500&display=swap');

/* Alyamama — "bookcloth & saffron": madder-red cloth binding, saffron foil, ink-teal endpapers, warm paper */
:root {
    --paper: #f7efe1;
    --paper-deep: #efe3cd;
    --card: #fbf6ec;
    --ink: #22192b;
    --ink-soft: #5a4d5e;
    --madder: #9b2c35;
    --madder-deep: #6f1b25;
    --saffron: #e3a23b;
    --saffron-soft: #f3d9a6;
    --teal: #276b67;
    --teal-soft: #cfe3dc;
    --line: #dccbb0;
    --radius: 18px;
    --shadow: 0 1px 0 rgba(34,25,43,.06), 0 18px 40px -24px rgba(111,27,37,.35);
    --font-display: 'Fraunces', 'Reem Kufi', serif;
    --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --ease: cubic-bezier(.2,.7,.2,1);
}
[dir="rtl"] { --font-display: 'Reem Kufi', 'Fraunces', serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0; background: var(--paper); color: var(--ink);
    font-family: var(--font-body); font-size: 17px; line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .35; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--madder); }
code { font-family: ui-monospace, monospace; background: rgba(34,25,43,.12); padding: .05em .45em; border-radius: 6px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: 8px; z-index: 200; }
.skip-link:focus { top: 1rem; }

/* Demo banner */
.demo-banner {
    display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: center;
    background: repeating-linear-gradient(-45deg, var(--saffron) 0 14px, #e9ad4c 14px 28px);
    color: var(--ink); padding: .55rem 1rem; font-size: .9rem; text-align: center;
}
.demo-tag { background: var(--ink); color: var(--saffron-soft); padding: .1rem .7rem; border-radius: 99px; font-weight: 600; font-size: .8rem; letter-spacing: .04em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247,239,225,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; margin: 0 auto; padding: .8rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.wordmark { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--madder); }
.wordmark-bird { width: 40px; height: 40px; transition: transform .5s var(--ease); }
[dir="rtl"] .wordmark-bird { transform: scaleX(-1); }
.wordmark:hover .wordmark-bird { transform: translateY(-3px) rotate(-6deg); }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark-text strong { font-family: var(--font-display); font-size: 1.45rem; color: var(--ink); }
.wordmark-text small { font-size: .72rem; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
.site-nav { display: flex; gap: .3rem; margin-inline-start: auto; }
.site-nav a { color: var(--ink); text-decoration: none; padding: .4rem .8rem; border-radius: 99px; font-weight: 500; position: relative; transition: background .25s; }
.site-nav a:hover { background: var(--paper-deep); }
.header-tools { display: flex; align-items: center; gap: .6rem; }
.culture-form, .logout-form { margin: 0; }
.lang-switch, .link-button {
    font: inherit; font-size: .9rem; cursor: pointer; background: transparent; color: var(--ink);
    border: 1.5px solid var(--ink); border-radius: 99px; padding: .3rem .9rem; transition: background .2s, color .2s;
}
.lang-switch:hover, .link-button:hover { background: var(--ink); color: var(--paper); }
.lang-switch[lang="ar"] { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.user-chip { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--paper); font-weight: 600; }

/* Buttons */
.button, .button-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    padding: .8rem 1.5rem; border-radius: 99px; border: 2px solid var(--madder);
    background: var(--madder); color: var(--paper);
    box-shadow: 0 4px 0 var(--madder-deep); transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--madder-deep); }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--madder-deep); }
.button.button-secondary, .button-secondary { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.button-secondary:hover { background: var(--card); }
.button-small { padding: .4rem 1rem; font-size: .9rem; box-shadow: 0 3px 0 var(--madder-deep); }
.button-light { background: var(--saffron); color: var(--ink); border-color: var(--saffron); box-shadow: 0 4px 0 #a86e17; }
.button-light:hover { box-shadow: 0 6px 0 #a86e17; }
.button[disabled], .button-secondary[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

main { display: block; }
.eyebrow { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--madder); font-weight: 600; margin-bottom: .8rem; display: inline-flex; align-items: center; gap: .6rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
section { padding: clamp(3.5rem, 8vw, 6.5rem) 1.5rem; }
section > * { max-width: 1240px; margin-inline: auto; }
.section-head { margin-bottom: 2.5rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; max-width: 1240px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 1.08; letter-spacing: -.02em; }
.hero h1 span { display: block; }
.hero h1 em { display: block; font-style: italic; color: var(--madder); font-weight: 500; }
[dir="rtl"] .hero h1 { line-height: 1.35; letter-spacing: 0; }
[dir="rtl"] .hero h1 em { font-style: normal; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 2.5rem; }
.facts { display: flex; gap: 2.2rem; margin: 0; padding-top: 1.5rem; border-top: 1px dashed var(--line); }
.facts dt { font-family: var(--font-display); font-size: 2.2rem; color: var(--teal); line-height: 1; }
.facts dd { margin: .3rem 0 0; font-size: .88rem; color: var(--ink-soft); max-width: 11em; }
.hero-art { margin: 0; position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; }
figcaption, .hero-art figcaption { position: absolute; bottom: 4%; inset-inline-end: 4%; font-size: .75rem; background: var(--card); border: 1px solid var(--line); padding: .15rem .7rem; border-radius: 99px; color: var(--ink-soft); }
.float-a, .float-b, .float-c { transform-box: fill-box; transform-origin: center; }
.float-b { animation: bob 6s var(--ease) infinite; }
.float-c { animation: glide 9s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes glide { 50% { transform: translate(-14px, -10px); } }

/* Route */
.route { background: var(--ink); color: var(--paper); border-radius: 36px; margin: 0 1rem; }
.route .eyebrow { color: var(--saffron); }
.route-grid { display: grid; grid-template-columns: 1fr 220px 1fr; align-items: center; gap: 1.5rem; margin-top: 2rem; }
.route-line { width: 100%; height: 80px; }
[dir="rtl"] .route-line { transform: scaleX(-1); }
.route-line path { animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.station { background: rgba(247,239,225,.06); border: 1px solid rgba(247,239,225,.15); border-radius: var(--radius); padding: 2rem; position: relative; transition: transform .35s var(--ease), background .35s; }
.station:hover { transform: translateY(-4px); background: rgba(247,239,225,.1); }
.station p { color: #d9cdd9; margin: 0; }
.station-mark { font-family: 'Fraunces', serif; font-size: 3.4rem; line-height: 1; display: block; margin-bottom: .6rem; }
.station-china .station-mark { color: var(--madder); -webkit-text-stroke: 1px var(--saffron-soft); }
.station-uae .station-mark { color: var(--teal); -webkit-text-stroke: 1px var(--teal-soft); }

/* Catalog */
.catalog-grid { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; max-width: 1240px; }
.product-card { border-radius: var(--radius); min-height: 220px; }
.product-card > a {
    display: flex; flex-direction: column; height: 100%; padding: 1.4rem 1.4rem 1.2rem; text-decoration: none; color: var(--ink);
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.product-card > a::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px; background: var(--tone); transition: width .35s var(--ease); }
.product-card > a:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: var(--shadow); border-color: var(--tone); }
.product-card > a:hover::before { width: 10px; }
.tone-0 { --tone: var(--madder); } .tone-1 { --tone: var(--teal); } .tone-2 { --tone: var(--saffron); } .tone-3 { --tone: var(--ink); }
.card-index { position: absolute; top: .9rem; inset-inline-end: 1.1rem; font-family: 'Fraunces', serif; font-size: .9rem; color: var(--ink-soft); opacity: .7; }
.card-glyph { width: 48px; height: 36px; color: var(--tone); margin-bottom: 1rem; transition: transform .35s var(--ease); }
.product-card > a:hover .card-glyph { transform: scale(1.12); }
.card-name { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; }
.card-alt { font-size: .85rem; color: var(--ink-soft); margin-top: .2rem; }
.card-meta { margin-top: auto; padding-top: 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.pill { background: var(--paper-deep); padding: .1rem .7rem; border-radius: 99px; }
.card-cta { font-weight: 600; color: var(--madder); display: inline-flex; gap: .35rem; }
.arrow { display: inline-block; transition: transform .3s var(--ease); }
[dir="rtl"] .arrow { transform: scaleX(-1); }
.product-card > a:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .product-card > a:hover .arrow { transform: scaleX(-1) translateX(4px); }
.skeleton { background: linear-gradient(90deg, var(--paper-deep), var(--card), var(--paper-deep)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 3rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }
.empty-state svg { width: 80px; }
.catalog-note { margin-top: 2rem; }

/* Process */
.process { background: var(--teal-soft); }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; top: 26px; inset-inline: 5%; border-top: 2px dashed var(--teal); }
.step { position: relative; padding-top: 4.2rem; }
.step-num { position: absolute; top: 0; inset-inline-start: 0; width: 54px; height: 54px; border-radius: 50%; background: var(--paper); border: 2px solid var(--teal); display: grid; place-items: center; font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--teal); transition: background .3s, color .3s, transform .3s var(--ease); }
.step:hover .step-num { background: var(--teal); color: var(--paper); transform: scale(1.08); }
.step p { color: var(--ink-soft); font-size: .95rem; }

/* Promise */
.promise h2 { margin-bottom: 2rem; }
.promise-list { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2.5rem; }
.promise-rule { display: block; height: 4px; width: 48px; background: var(--saffron); margin-bottom: 1.2rem; transition: width .4s var(--ease); }
.promise-list article:hover .promise-rule { width: 96px; }
.promise-list article:first-child h3 { font-size: 1.6rem; color: var(--madder); }
.promise-list p { color: var(--ink-soft); }

/* Closing */
.closing-card { background: var(--madder); color: var(--paper); border-radius: 36px; padding: clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.closing-card::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; border: 40px solid rgba(227,162,59,.25); inset-inline-end: -100px; top: -120px; }
.closing-card h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
.closing-card p { max-width: 32em; opacity: .9; margin-bottom: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 1.5rem; font-size: .9rem; color: var(--ink-soft); }
.footer-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 1rem; }
.footer-inner a { color: var(--ink); }

/* Account / auth */
.auth-section { padding: clamp(2rem, 6vw, 5rem) 1.5rem; }
.auth-shell { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.5rem; align-items: start; }
.auth-intro h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.auth-intro p { color: var(--ink-soft); }
.auth-panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow); border-top: 6px solid var(--madder); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
    font: inherit; padding: .7rem .9rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(39,107,103,.18); }
.checkbox-field { display: flex; align-items: flex-start; gap: .6rem; font-size: .95rem; }
.checkbox-field input { width: 20px; height: 20px; accent-color: var(--madder); margin-top: .25rem; flex-shrink: 0; }
.notice { background: var(--saffron-soft); border-inline-start: 4px solid var(--saffron); padding: .9rem 1.1rem; border-radius: 12px; color: var(--ink); }
.error, .validation-message { color: var(--madder-deep); font-size: .9rem; }
div.error, p.error { background: #f6d9d6; border-inline-start: 4px solid var(--madder); padding: .8rem 1rem; border-radius: 12px; }
.status-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.status-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.demo-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }

/* Responsive */
@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; }
    .hero-art { max-width: 420px; margin-inline: auto; }
    .route-grid { grid-template-columns: 1fr; }
    .route-line { transform: rotate(90deg); height: 60px; width: 120px; margin: 0 auto; }
    [dir="rtl"] .route-line { transform: rotate(90deg); }
    .steps { grid-template-columns: 1fr; }
    .steps::before { top: 0; bottom: 0; inset-inline: 26px auto; border-top: 0; border-inline-start: 2px dashed var(--teal); }
    .step { padding-top: .6rem; padding-inline-start: 4.5rem; min-height: 64px; }
    .promise-list { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .header-inner { flex-wrap: wrap; gap: .6rem 1rem; padding: .6rem 1rem; }
    .site-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
    .header-tools { margin-inline-start: auto; }
    .facts { flex-wrap: wrap; gap: 1.2rem; }
    .form-grid { grid-template-columns: 1fr; }
    .route { margin: 0 .5rem; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
