/* Alhamzi Style — public website.
   The palette, the two typefaces and the two-corner shape are the app's own
   (my_theme.dart, the contact card on the app's home screen). */

@font-face {
    font-family: "Tajawal";
    src: url("fonts/Tajawal-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Tajawal";
    src: url("fonts/Tajawal-Medium.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "Tajawal";
    src: url("fonts/Tajawal-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "El Messiri";
    src: url("fonts/ElMessiri-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "El Messiri";
    src: url("fonts/ElMessiri-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --silk: #6D3E8A;
    --silk-deep: #49285D;
    --aubergine: #2C1639;
    --lilac: #C5A6D9;
    --mist: #F4EEF8;
    --paper: #FCFCFC;
    --ink: #1D1D1D;
    --ink-soft: #55505A;
    --rule: #E4D9EC;

    --display: "El Messiri", "Tajawal", serif;
    --body: "Tajawal", system-ui, sans-serif;

    --gutter: clamp(20px, 5vw, 64px);
    --measure: 1180px;
    /* The app rounds two opposite corners and leaves the other two square. */
    --leaf: 44px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.85;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--lilac);
    outline-offset: 3px;
}

.wrap {
    width: min(100% - 2 * var(--gutter), var(--measure));
    margin-inline: auto;
}

.skip {
    position: absolute;
    inset-inline-start: 16px;
    top: -60px;
    z-index: 20;
    padding: 8px 16px;
    background: #fff;
    color: var(--silk-deep);
}
.skip:focus {
    top: 12px;
}

/* ---------- Silk: the folds of the app's splash screen ---------- */

.silk {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--silk);
    color: #fff;
}
.silk__folds {
    position: absolute;
    inset: -12% -6%;
    z-index: -1;
    width: 112%;
    height: 124%;
}
.silk__folds path {
    transform-origin: 50% 50%;
    animation: drape 22s ease-in-out infinite alternate;
}
.silk__folds path:nth-child(2n) {
    animation-duration: 29s;
    animation-direction: alternate-reverse;
}
@keyframes drape {
    from { transform: translate3d(-1.2%, 0, 0) skewX(-1deg); }
    to   { transform: translate3d(1.6%, 1%, 0) skewX(1.4deg); }
}

/* ---------- Header ---------- */

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-block: 22px;
}
.masthead__logo img {
    width: 132px;
    height: auto;
}
.masthead__nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.4vw, 34px);
    font-weight: 500;
}
.masthead__nav a {
    text-decoration: none;
    padding-block: 6px;
    border-bottom: 1px solid transparent;
}
.masthead__nav a:hover,
.masthead__nav a[aria-current="page"] {
    border-bottom-color: currentColor;
}
.masthead__nav .lang {
    padding: 4px 16px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-start-start-radius: 14px;
    border-end-end-radius: 14px;
}
.masthead__nav .lang:hover {
    background: #fff;
    color: var(--silk-deep);
}

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: end;
    gap: clamp(24px, 5vw, 80px);
    padding-block: clamp(32px, 6vw, 84px) 0;
}
.hero__text {
    padding-block-end: clamp(48px, 8vw, 112px);
}
.hero h1 {
    margin: 0 0 24px;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6.2vw, 5rem);
    line-height: 1.22;
    text-wrap: balance;
}
.hero__lead {
    max-width: 34em;
    margin: 0 0 36px;
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    color: #EFE5F6;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 10px 30px;
    font: 700 1.0625rem/1.3 var(--body);
    text-decoration: none;
    border: 1.5px solid #fff;
    border-start-start-radius: 20px;
    border-end-end-radius: 20px;
    transition: background-color .18s ease, color .18s ease;
}
.btn--solid {
    background: #fff;
    color: var(--silk-deep);
}
.btn--solid:hover {
    background: var(--mist);
}
.btn--ghost {
    color: #fff;
}
.btn--ghost:hover {
    background: rgba(255, 255, 255, .14);
}
.hero__note {
    margin: 18px 0 0;
    font-size: .9375rem;
    color: #E3D3EE;
}

.phone {
    justify-self: center;
    width: min(100%, 300px);
    margin-block-end: -56px;
    padding: 10px;
    background: var(--aubergine);
    border-radius: 42px 42px 0 0;
    box-shadow: 0 30px 60px -20px rgba(28, 10, 40, .65);
    animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
}
.phone img {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 17;
    object-fit: cover;
    border-radius: 33px 33px 0 0;
}
@keyframes rise {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(64px, 9vw, 128px);
}
.section__title {
    margin: 0 0 16px;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.875rem, 3.6vw, 2.875rem);
    line-height: 1.3;
    color: var(--silk-deep);
}
.section__lead {
    max-width: 38em;
    margin: 0;
    color: var(--ink-soft);
}

/* What is in the app: a ruled list, not a set of cards. */
.inside {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.inside__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(24px, 4vw, 56px);
    margin: 0;
    padding: 0;
    list-style: none;
}
.inside__list li {
    padding-block: 22px 26px;
    border-top: 1px solid var(--rule);
}
.inside__list h3 {
    margin: 0 0 6px;
    font: 700 1.1875rem/1.5 var(--body);
    color: var(--silk);
}
.inside__list p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink-soft);
}

/* The store: the app's contact card, at website size. */
.store {
    background: var(--mist);
}
.store__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
}
.store__text p {
    max-width: 34em;
    margin: 0 0 20px;
    color: var(--ink-soft);
}
.link {
    font-weight: 700;
    color: var(--silk);
    text-underline-offset: 6px;
}
.link:hover {
    color: var(--silk-deep);
}
.contact {
    padding: clamp(28px, 4vw, 48px);
    border-start-start-radius: var(--leaf);
    border-end-end-radius: var(--leaf);
}
.contact h3 {
    margin: 0 0 22px;
    font: 700 1.5rem/1.4 var(--display);
}
.contact dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px 24px;
    margin: 0;
}
.contact dt {
    color: #DCC9E9;
}
.contact dd {
    margin: 0;
    font-weight: 500;
}
.contact dd a {
    text-underline-offset: 5px;
}
.contact [dir="ltr"] {
    display: inline-block;
}

/* Policies: one row each. */
.policies {
    margin: clamp(32px, 4vw, 56px) 0 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--rule);
}
.policies a {
    display: grid;
    grid-template-columns: minmax(0, 18em) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px 32px;
    padding-block: 26px;
    border-top: 1px solid var(--rule);
    text-decoration: none;
    transition: padding-inline-start .2s ease;
}
.policies a:hover {
    padding-inline-start: 12px;
}
.policies strong {
    font: 700 clamp(1.25rem, 2vw, 1.5rem)/1.4 var(--display);
    color: var(--silk-deep);
}
.policies span {
    color: var(--ink-soft);
}
.policies em {
    font-style: normal;
    font-weight: 700;
    color: var(--silk);
}

/* ---------- Policy page ---------- */

.pagehead {
    padding-block: clamp(28px, 5vw, 64px) clamp(40px, 6vw, 80px);
}
.pagehead h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2.125rem, 5vw, 3.5rem);
    line-height: 1.3;
}
.pagehead p {
    margin: 10px 0 0;
    color: #E3D3EE;
}

.reading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
    padding-block: clamp(40px, 6vw, 80px) clamp(64px, 9vw, 120px);
}
.aside {
    position: sticky;
    top: 28px;
    padding: 26px 26px 14px;
    background: var(--mist);
    border-start-start-radius: 28px;
    border-end-end-radius: 28px;
}
.aside h2 {
    margin: 0 0 8px;
    font: 700 1.125rem/1.5 var(--display);
    color: var(--silk-deep);
}
.aside ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.aside a {
    display: block;
    padding-block: 11px;
    border-top: 1px solid var(--rule);
    text-decoration: none;
    color: var(--ink-soft);
}
.aside a:hover {
    color: var(--silk);
}
.aside a[aria-current="page"] {
    font-weight: 700;
    color: var(--silk);
}

/* Text written in the admin panel's editor: its markup is not ours to trust. */
.prose {
    max-width: 44em;
    overflow-wrap: anywhere;
}
.prose > :first-child {
    margin-top: 0;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    margin: 2.2em 0 .6em;
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.45;
    color: var(--silk-deep);
}
.prose h1,
.prose h2 {
    font-size: 1.5rem;
}
.prose h3,
.prose h4 {
    font-size: 1.25rem;
}
.prose p,
.prose ul,
.prose ol {
    margin: 0 0 1.1em;
}
.prose ul,
.prose ol {
    padding-inline-start: 1.4em;
}
.prose li {
    margin-bottom: .45em;
}
.prose li::marker {
    color: var(--silk);
}
.prose a {
    color: var(--silk);
    text-underline-offset: 5px;
}
.prose font {
    color: inherit;
}
.prose img,
.prose table {
    max-width: 100%;
    height: auto;
}
.prose .fill {
    padding: 1px 8px;
    background: #FFF1C2;
    border-radius: 4px;
    font-weight: 700;
}
.notice {
    margin: 0 0 28px;
    padding: 14px 20px;
    background: var(--mist);
    border-inline-start: 3px solid var(--silk);
    color: var(--ink-soft);
}
.empty {
    max-width: 34em;
}
.empty h2 {
    margin: 0 0 10px;
    font: 700 1.5rem/1.4 var(--display);
    color: var(--silk-deep);
}
.empty p {
    margin: 0 0 20px;
    color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.foot {
    background: var(--aubergine);
    color: #E9DDF1;
    padding-block: clamp(48px, 6vw, 80px) 28px;
}
.foot__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
    gap: 40px clamp(24px, 5vw, 80px);
}
.foot img {
    width: 150px;
    height: auto;
    margin-bottom: 18px;
}
.foot p {
    max-width: 26em;
    margin: 0;
    color: #CDBBD9;
}
.foot h2 {
    margin: 0 0 14px;
    font: 700 1.125rem/1.5 var(--display);
    color: #fff;
}
.foot ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.foot li {
    margin-bottom: 8px;
}
.foot a {
    text-decoration: none;
}
.foot a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 5px;
}
.foot [dir="ltr"] {
    display: inline-block;
}
.foot__company {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    font-style: normal;
    font-size: .9375rem;
    color: #CDBBD9;
}
.foot__company strong {
    /* The name is Arabic on both pages; keep it on the column's start edge. */
    justify-self: start;
    color: #fff;
}
.foot__end {
    margin-top: clamp(36px, 5vw, 64px);
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .9375rem;
    color: #B7A3C5;
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
    .masthead__nav a:not(.lang) {
        display: none;
    }
    .hero,
    .inside,
    .store__grid,
    .reading {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero__text {
        padding-block-end: 8px;
    }
    .phone {
        width: min(72%, 260px);
        margin-block-end: -40px;
    }
    .policies a {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .policies span {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .aside {
        position: static;
    }
    .foot__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .inside__list {
        grid-template-columns: minmax(0, 1fr);
    }
    .btn {
        width: 100%;
    }
    .contact dl {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
    .contact dd {
        margin-bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .silk__folds path,
    .phone {
        animation: none;
    }
    .policies a,
    .btn {
        transition: none;
    }
}
