/*
 * raniajamal.me: additions on top of the Orisa theme (main.css).
 * Only classes this site introduces, plus a few fixes where the theme
 * expected its own JavaScript or stock imagery.
 */

/*
 * Maroon and cream palette. The theme colours everything through its
 * --at-neutral-* scale, so remapping that scale recolours the whole site
 * without touching structure. Every pairing is checked for WCAG contrast
 * (see tests/Feature/AccentContrastTest.php).
 */
:root {
    --at-neutral-0: #F7EEE6;    /* cream page */
    --at-neutral-0-rgb: 247, 238, 230;
    --at-neutral-50: #EFE2D6;   /* cream panels */
    --at-neutral-50-rgb: 239, 226, 214;
    --at-neutral-100: #E2D0C2;  /* hairlines */
    --at-neutral-200: #D3BCAB;
    --at-neutral-300: #B99C8D;
    --at-neutral-500: #6E4F50;  /* secondary text, 6.3:1 on cream */
    --at-neutral-700: #5C1219;
    --at-neutral-800: #3D0A0E;
    --at-neutral-900: #2A0A0D;  /* ink, 16:1 on cream */
    --at-neutral-950: #1C0608;
    --at-common-white: #F7EEE6;
    --at-common-black: #2A0A0D;

    --rj-accent: #6E1420;          /* maroon, 10.3:1 on cream */
    --rj-accent-ink: #6E1420;
    --rj-accent-on-dark: #F4C9C2;  /* blush, 9:1 or more on every maroon panel */
    --rj-panel-1: #4A0E14;
    --rj-panel-2: #5C1219;
    --rj-panel-3: #3D0A0E;
    --rj-panel-4: #2A070C;
    --rj-on-panel: #F7EEE6;        /* 11.7:1 or more on every panel */
}

[data-bs-theme=dark] {
    --at-neutral-0: #170608;    /* maroon-black page */
    --at-neutral-0-rgb: 23, 6, 8;
    --at-neutral-50: #21090C;
    --at-neutral-50-rgb: 33, 9, 12;
    --at-neutral-100: #34121A;
    --at-neutral-200: #461A22;
    --at-neutral-300: #5E2A32;
    --at-neutral-500: #C9AFA8;  /* 9.2:1 or more */
    --at-neutral-700: #6E3A40;
    --at-neutral-800: #EADCD2;
    --at-neutral-900: #F2E6DC;  /* 16:1 */
    --at-neutral-950: #F7EEE6;
    --at-common-white: #170608;
    --at-common-black: #F7EEE6;

    --rj-accent: #E8A0AE;       /* 9:1 or more */
    --rj-accent-ink: #E8A0AE;
}

/* Sections that stay dark in both modes become maroon. */
.changeless,
[data-bs-theme=dark] .changeless {
    --at-neutral-0: #F7EEE6;
    --at-neutral-50: #EFE2D6;
    --at-neutral-700: #5C1219;
    --at-neutral-800: #5C1219;
    --at-neutral-900: #3D0A0E;
    --at-neutral-950: #2A070C;
}

/* Dark panels: accents, links and focus rings switch to blush. */
.bento-statement,
.result-visual,
.blog-card__placeholder,
.sec-6-home-5 {
    --rj-accent: var(--rj-accent-on-dark);
    --rj-accent-ink: var(--rj-accent-on-dark);
}

:focus-visible {
    outline: 3px solid var(--rj-accent);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: var(--at-neutral-900);
    color: var(--at-neutral-0);
}

.skip-link:focus {
    top: 1rem;
}

html {
    scroll-padding-top: 6rem;
}

/* Header ---------------------------------------------------------------- */
.at-header-logo a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.at-main-menu nav > ul {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.at-main-menu nav > ul > li > a {
    display: inline-block;
    padding-block: 10px;
    font-weight: 500;
    color: var(--at-neutral-900);
}

.at-main-menu nav > ul > li > a:hover,
.at-main-menu nav > ul > li > a[aria-current] {
    color: var(--rj-accent-ink);
}

.header-cv-link {
    font-weight: 600;
    color: var(--at-neutral-900);
    text-decoration: underline;
    text-decoration-color: var(--rj-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
    white-space: nowrap;
}

.drawer-menu nav > ul {
    margin: 0;
    padding: 0;
}

.drawer-menu nav > ul > li > a {
    display: block;
    padding-block: 10px;
    font-size: 28px;
    font-weight: 600;
    color: var(--at-neutral-900);
}

/* The theme only reveals its floating menu button after scrolling. */
@media (min-width: 1200px) {
    .hamburger-sticky-menu:not(.header-sticky) {
        visibility: hidden;
    }
}

/* Hero ------------------------------------------------------------------ */
.hero-grid-lines {
    grid-template-columns: repeat(7, 1fr);
    pointer-events: none;
}

.hero-grid-lines > div + div {
    border-left: 1px solid var(--at-neutral-900);
}

.hero-name {
    font-size: clamp(3.5rem, 11vw, 9.5rem);
    letter-spacing: -0.045em;
    text-wrap: balance;
}

@media (min-width: 992px) {
    .hero-name {
        font-size: clamp(4rem, 8.4vw, 9.5rem);
    }
}

.hero-portrait {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin-inline: auto;
    border-radius: 24px;
    object-fit: cover;
}

/* What I do ------------------------------------------------------------- */
.bento-statement {
    min-height: 320px;
    background: var(--rj-panel-1);
    background-image: radial-gradient(circle at 85% 15%, rgba(244, 201, 194, 0.18), transparent 55%);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
}

.ledger-table th {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--at-neutral-200);
    font-size: 13px;
    font-weight: 500;
    color: var(--at-neutral-500);
    text-align: left;
}

.ledger-table th:last-child,
.ledger-table td:last-child {
    text-align: right;
}

.ledger-table td {
    padding: 14px 0;
    border-bottom: 1px solid var(--at-neutral-200);
    color: var(--at-neutral-900);
    font-weight: 500;
    vertical-align: middle;
}

.ledger-table tr:last-child td {
    border-bottom: 0;
}

.ledger-table td span {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--at-neutral-500);
}

.ledger-num {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Selected work: typographic panels in place of stock photography. ------ */
.result-visual {
    display: flex;
    flex-direction: column;
    padding: 30px;
    min-height: 360px;
    background: var(--rj-panel-1);
}

.result-visual--2 { background: var(--rj-panel-2); }
.result-visual--3 { background: var(--rj-panel-3); }
.result-visual--4 { background: var(--rj-panel-4); }

.result-summary {
    max-width: 30ch;
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
    color: var(--rj-on-panel);
}

.result-visual .card_case__studies-metric-value {
    font-variant-numeric: tabular-nums;
}

.card_case__studies-footer {
    gap: 12px;
}

@media (max-width: 575.98px) {
    .result-visual {
        min-height: 0;
        aspect-ratio: auto;
        gap: 24px;
        padding: 24px;
    }

    /* The theme hides this box on phones; here the number is the point of the card. */
    .result-visual .card_case__studies-metric-overlay {
        display: flex;
        visibility: visible;
        align-self: flex-start;
    }

    .result-visual .card_case__studies-metric-overlay,
    .result-visual .card_case__studies-tags-overlay {
        position: static;
        max-width: none;
        justify-content: flex-start;
    }
}

/* Figures --------------------------------------------------------------- */
.figure-item {
    max-width: 200px;
}

.figure-item .h1 {
    font-variant-numeric: tabular-nums;
}

/* Experience ------------------------------------------------------------ */
.project-item + .project-item {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.project-question {
    color: var(--rj-accent);
    font-weight: 500;
}

/* Blog ------------------------------------------------------------------ */
.blog-card__thumb {
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card__placeholder {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding: 24px;
    background: var(--rj-panel-1);
    background-image: radial-gradient(circle at 85% 15%, rgba(244, 201, 194, 0.16), transparent 60%);
    color: var(--rj-on-panel);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.post-title {
    font-size: clamp(2.25rem, 5vw, 4rem);
    text-wrap: balance;
}

.post-cover {
    max-height: 640px;
    object-fit: cover;
}

.post-lede {
    color: var(--at-neutral-900);
    line-height: 1.4;
}

.post-toc li + li {
    margin-top: 8px;
}

.post-toc a {
    color: var(--at-neutral-900);
    text-decoration: underline;
    text-decoration-color: var(--at-neutral-300);
    text-underline-offset: 0.2em;
}

.post-body {
    font-size: 19px;
    line-height: 1.7;
    color: var(--at-neutral-900);
}

.post-body > * + * {
    margin-top: 1.25em;
}

.post-body h2 {
    margin-top: 2.2em;
    font-size: 32px;
    line-height: 1.15;
}

.post-body h3 {
    margin-top: 1.8em;
    font-size: 23px;
    line-height: 1.25;
}

.post-body p,
.post-body li {
    font-size: 19px;
    line-height: 1.7;
    color: var(--at-neutral-900);
}

.post-body a {
    color: var(--at-neutral-900);
    text-decoration: underline;
    text-decoration-color: var(--rj-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

.post-body ul,
.post-body ol {
    padding-left: 1.3em;
}

.post-body li + li {
    margin-top: 0.4em;
}

.post-body blockquote {
    padding-left: 1.2em;
    border-left: 3px solid var(--rj-accent);
    font-size: 22px;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.post-body figcaption {
    margin-top: 8px;
    font-size: 15px;
    color: var(--at-neutral-500);
    text-align: center;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.post-body th,
.post-body td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--at-neutral-200);
    text-align: left;
}

.post-adjacent a {
    color: var(--at-neutral-900);
}

/* Footer ---------------------------------------------------------------- */
.footer-email a {
    text-decoration: underline;
    text-decoration-color: var(--rj-accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 0.2em;
    overflow-wrap: anywhere;
}

.footer-links li + li {
    margin-top: 10px;
}

.footer-links a {
    font-size: 18px;
    font-weight: 500;
    color: var(--at-neutral-900);
}

.footer-wordmark {
    overflow: hidden;
    font-size: clamp(3rem, 13vw, 12.5rem);
    font-weight: 600;
    letter-spacing: -0.05em;
    color: var(--at-neutral-900);
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Stat values stay on one line ("Top 2%", "SAR 18M"). */
.sec-2-home-5__stat,
.figure-item .h1 {
    white-space: nowrap;
}

/* The theme inverts header logos in dark mode; this one is already two-tone. */
[data-bs-theme=dark] .at-header-logo img,
[data-bs-theme=dark] .at-offcanvas-logo img {
    filter: none;
}

.at-offcanvas-contact a {
    text-transform: none;
}

/* Colour-mode switch. The theme hides the checkbox with display:none, which
   takes it out of the tab order, and swaps the icons on #switch, an id this
   site doesn't use. Keep the input focusable over the hit area instead and
   swap the icons from its checked state. */
.dark-light-mode .toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50px;
    color: var(--at-neutral-900);
}

.dark-light-mode .input {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.dark-light-mode .icon {
    pointer-events: none;
}

.dark-light-mode .toggle:has(.input:focus-visible) {
    outline: 3px solid var(--rj-accent);
    outline-offset: 3px;
}

.dark-light-mode .input:checked ~ .icon--moon {
    transform: rotate(360deg) scale(0);
    transition-delay: 0ms;
}

.dark-light-mode .input:checked ~ .icon--sun {
    transform: scale(1) rotate(360deg);
    transition-delay: 200ms;
}

/* Experience accordion. Native <details>: Enter/Space toggle it, screen
   readers announce expanded/collapsed, and name="experience" keeps one
   role open at a time in browsers that support it. */
.role-details__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.role-details__summary::-webkit-details-marker {
    display: none;
}

.role-details__heading {
    display: block;
    min-width: 0;
}

.role-details__heading .journey-list__desc {
    display: block;
}

.role-details__icon {
    position: relative;
    flex: none;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border: 1px solid rgba(247, 238, 230, 0.4);
    border-radius: 50%;
}

.role-details__icon::before,
.role-details__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    margin: -1px 0 0 -6px;
    background: var(--rj-on-panel);
    transition: transform 0.25s ease;
}

.role-details__icon::after {
    transform: rotate(90deg);
}

.role-details[open] .role-details__icon::after {
    transform: rotate(0deg);
}

.role-details__summary:hover .role-details__icon {
    border-color: var(--rj-accent);
}

.role-details__panel {
    padding-top: 20px;
    color: var(--rj-on-panel);
}

.role-details__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    margin: 0 0 16px;
}

.role-details__facts dt {
    font-size: 13px;
    font-weight: 500;
    color: var(--rj-accent);
}

.role-details__facts dd {
    margin: 2px 0 0;
    font-size: 16px;
    font-weight: 500;
}

.block-journey .role-details__about {
    margin: 0 0 14px;
    color: var(--rj-on-panel);
    font-size: 16px;
    line-height: 1.5;
    font-style: italic;
}

.role-details__highlights {
    margin: 0;
    padding-left: 1.2em;
}

.role-details__highlights li {
    font-size: 16px;
    line-height: 1.55;
}

.role-details__highlights li + li {
    margin-top: 8px;
}

.role-details__highlights li::marker {
    color: var(--rj-accent);
}
