/* ==========================================================================
   RATIOM Design System
   Shared brand tokens + reusable components for the static Ratiom UK site.
   Loaded after Tailwind CDN on every page so component classes below win
   over Tailwind's generated utilities when both target the same property.
   ========================================================================== */

:root {
    --color-bg: #000000;
    --color-surface: #0a0a0a;
    --color-surface-2: #121212;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-strong: rgba(255, 255, 255, 0.24);
    --color-text: #ffffff;
    --color-muted: #8a8a8a;
    --color-accent: #C4EE18;
    --color-error: #ff6b6b;
    --color-surface-neutral: #0d0d0e;
    --color-surface-warm: #14100e;

    --font-heading: "Darker Grotesque", sans-serif;
    --font-body: "Inter", sans-serif;

    --radius: 4px;
    --nav-height: 80px;
    --layout-max: 1280px;
    --layout-padding-mobile: 24px;
    --layout-padding-desktop: 32px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

::selection { background-color: var(--color-accent); color: #000000; }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------- Accessible focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 16px 32px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.97) translateY(0); }

.btn-primary {
    background-color: var(--color-accent);
    color: #000000;
    border-color: var(--color-accent);
}
.btn-primary:hover { background-color: #ffffff; border-color: #ffffff; color: #000000; }

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.55);
}
.btn-secondary:hover { background-color: var(--color-accent); border-color: var(--color-accent); color: #000000; }

.btn-lg { padding: 20px 40px; font-size: 15px; }
.btn-sm { padding: 12px 24px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Ghost / ​text button — used where a second CTA needs to recede, not compete */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0;
    color: #ffffff;
    padding: 16px 2px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
}
.btn-ghost:hover { color: var(--color-accent); transform: translateY(-2px); }
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost__arrow { display: inline-block; transition: transform 0.2s ease; }
.btn-ghost:hover .btn-ghost__arrow { transform: translateX(4px); }

/* ---------- Navigation ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-nav.is-scrolled { border-color: var(--color-border-strong); box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.6); }
.site-nav__inner {
    max-width: var(--layout-max);
    margin: 0 auto;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 var(--layout-padding-mobile);
}
@media (min-width: 768px) { .site-nav__inner { padding: 0 var(--layout-padding-desktop); } }

.site-nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.site-nav__logo img { height: 26px; width: auto; display: block; }

.site-nav__links { display: none; align-items: center; gap: 40px; }

.nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: #ffffff; }
.nav-link.is-active { color: var(--color-accent); border-color: var(--color-accent); }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: #ffffff;
    cursor: pointer;
}

.nav-mobile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 24px;
    border-bottom: 1px solid transparent;
    background-color: #000000;
    transition: max-height 0.32s ease, opacity 0.22s ease, padding-top 0.32s ease, padding-bottom 0.32s ease, border-color 0.22s ease;
}
.nav-mobile.is-open {
    max-height: 720px;
    opacity: 1;
    padding-top: 8px;
    padding-bottom: 24px;
    border-bottom-color: var(--color-border);
}
.nav-mobile .nav-link {
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    width: 100%;
}
.nav-mobile .nav-link:last-of-type { border-bottom: none; }
.nav-mobile .btn { margin-top: 12px; }

@media (max-width: 767px) {
    :root { --nav-height: 64px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .nav-mobile { padding-left: 64px; padding-right: 64px; }
}

@media (min-width: 1024px) {
    .site-nav__links { display: flex; }
    .nav-toggle { display: none; }
    .nav-mobile { display: none !important; }
}

/* ---------- Cards ---------- */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    transition: border-color 0.25s ease;
}
.card:hover { border-color: rgba(196, 238, 24, 0.5); }
.card-flush { padding: 0; overflow: hidden; }
.card--danger:hover { border-color: rgba(255, 107, 107, 0.55); }
.card--accent { border: 2px solid var(--color-accent); }
.card--accent:hover { border-color: var(--color-accent); }

/* ---------- Homepage pricing ---------- */
.pricing-grid {
    align-items: stretch;
}
.pricing-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.pricing-card .btn {
    margin-top: auto;
}
.pricing-card--featured {
    box-shadow: 0 40px 80px -30px rgba(196, 238, 24, 0.22);
}
.pricing-trust-strip {
    margin-top: 0;
}
@media (min-width: 768px) {
    .pricing-grid {
        margin-bottom: 72px;
    }
}

/* ---------- Blog articles ---------- */
.article-content {
    color: rgba(255, 255, 255, 0.78);
}
.article-content h2 {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 900;
    line-height: 1.05;
    margin-top: 56px;
    margin-bottom: 18px;
}
.article-content h3 {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.12;
    margin-top: 34px;
    margin-bottom: 12px;
}
.article-content p,
.article-content li {
    font-size: 18px;
    line-height: 1.75;
}
.article-content p {
    margin-bottom: 22px;
}
.article-content ul {
    margin: 0 0 28px 0;
    padding-left: 22px;
}
.article-content li {
    margin-bottom: 10px;
}
.article-content strong {
    color: #ffffff;
    font-weight: 700;
}
.article-cta {
    margin-top: 56px;
    padding: 32px;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface-2);
}

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    z-index: 2147483001;
    background-color: #000000;
    border-top: 1px solid var(--color-border);
}
.site-footer > div {
    max-width: var(--layout-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--layout-padding-mobile);
    padding-right: var(--layout-padding-mobile);
}
.site-footer a { color: rgba(255, 255, 255, 0.55); transition: color 0.2s ease; }
.site-footer a:hover { color: #ffffff; }
.site-footer__logo img { height: 24px; width: auto; display: block; }
.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #ffffff !important;
    opacity: 1;
    transition: opacity 0.2s ease;
}
.site-footer__social-link:hover { opacity: 0.75; }
.site-footer__social-icon {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}
@media (min-width: 768px) {
    .site-footer > div {
        padding-left: var(--layout-padding-desktop);
        padding-right: var(--layout-padding-desktop);
    }
}

/* ---------- Utilities ---------- */
.hairline-border { border: 1px solid var(--color-border); }
.transition-standard { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
@media (max-width: 767px) {
    .hide-on-mobile { display: none !important; }
}

/* ---------- Hero ---------- */
.hero-section {
    display: flex;
    flex-direction: column;
    background-color: #000000;
    min-height: max(600px, 86vh);
    min-height: max(600px, 86dvh);
}
@media (min-width: 768px) {
    .hero-section {
        min-height: max(640px, 100vh);
        min-height: max(640px, 100dvh);
    }
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-media picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 64% 25%;
    display: block;
    transform: scale(1.06);
    will-change: transform;
}
@media (min-width: 768px) {
    .hero-image { object-position: 68% 22%; }
}

.hero-media__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(140% 120% at 62% 40%, transparent 55%, rgba(0, 0, 0, 0.26) 100%),
        linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0) 22%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.66) 28%, rgba(0, 0, 0, 0.42) 55%, rgba(0, 0, 0, 0.16) 100%);
}
@media (max-width: 767px) {
    .hero-media__overlay {
        background:
            linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0) 20%),
            linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.72) 100%);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    padding-top: 64px;
    padding-bottom: 48px;
}
@media (min-width: 768px) {
    .hero-content {
        align-items: flex-start;
        padding-top: max(64px, calc(40vh - 64px));
        padding-bottom: 64px;
    }
}

.hero-copy {
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 14px;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background-color: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}
.hero-badge__icon { font-size: 15px; color: var(--color-accent); }

.hero-headline__soft { color: rgba(255, 255, 255, 0.6); }

.hero-trust {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: 76px;
    background-color: #101010;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 22px 0;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 48px;
    width: 100%;
    font-family: var(--font-body);
}
@media (max-width: 640px) {
    .hero-trust .px-gutter { padding-left: 20px; padding-right: 20px; }
    .trust-strip { gap: 12px 20px; }
}

.trust-strip__item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    line-height: 1;
    transition: transform 200ms ease;
}
.trust-strip__item:hover { transform: translateY(-2px); }

.trust-strip__icon {
    color: var(--color-accent);
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: filter 200ms ease;
}
.trust-strip__item:hover .trust-strip__icon { filter: brightness(1.3); }

.trust-strip__label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.01em;
    transition: color 200ms ease;
}
.trust-strip__item:hover .trust-strip__label { color: #ffffff; }

/* ---------- Reveal-on-load ---------- */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.reveal {
    animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reveal-1 { animation-delay: 0s; }
.reveal-2 { animation-delay: 0.08s; }
.reveal-3 { animation-delay: 0.16s; }
.reveal-4 { animation-delay: 0.24s; }
.reveal-5 { animation-delay: 0.36s; }
.reveal-6 { animation-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; }
    .btn:hover, .btn-ghost:hover { transform: none; }
    .nav-mobile { transition: none; }
}

/* ---------- Section background variants (subtle depth, same dark family) ---------- */
.bg-surface-neutral { background-color: var(--color-surface-neutral); }
.bg-surface-warm { background-color: var(--color-surface-warm); }

/* ---------- Feature rows (editorial, no boxes) ---------- */
.feature-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 0;
    border-top: 1px solid var(--color-border);
}
.feature-row:last-child { border-bottom: 1px solid var(--color-border); }
.feature-row__icon {
    font-size: 32px;
    line-height: 1;
    color: var(--color-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---------- Editorial statement (typography-only pause) ---------- */
.editorial-statement { position: relative; overflow: hidden; }
.editorial-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(120px, 22vw, 320px);
    color: rgba(255, 255, 255, 0.035);
    letter-spacing: -0.02em;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}
.editorial-statement__content { position: relative; z-index: 1; }

/* ---------- Before / after comparison slider ---------- */
.comparison-slider {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
}
.comparison-slider__viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: 0 36px 90px -42px rgba(196, 238, 24, 0.32);
}
.comparison-slider__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}
.comparison-slider__viewport picture,
.comparison-slider__after picture {
    display: block;
    width: 100%;
    height: 100%;
}
.comparison-slider__after {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
    will-change: clip-path;
}
.comparison-slider__divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 2px;
    background-color: var(--color-accent);
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 24px rgba(196, 238, 24, 0.55);
}
.comparison-slider__handle {
    position: absolute;
    top: 50%;
    left: var(--position);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-accent);
    color: #000000;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}
.comparison-slider__handle .material-symbols-outlined {
    font-size: 30px;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}
.comparison-slider__label {
    position: absolute;
    top: 20px;
    z-index: 2;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.74);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    pointer-events: none;
}
.comparison-slider__label--before { left: 20px; }
.comparison-slider__label--after { right: 20px; }
.comparison-slider__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 3;
    touch-action: pan-y;
}
.comparison-slider:focus-within .comparison-slider__handle {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}
@media (max-width: 640px) {
    .comparison-slider__handle {
        width: 48px;
        height: 48px;
    }
    .comparison-slider__handle .material-symbols-outlined {
        font-size: 24px;
    }
    .comparison-slider__label {
        top: 12px;
        padding: 7px 10px;
    }
    .comparison-slider__label--before { left: 12px; }
    .comparison-slider__label--after { right: 12px; }
}

/* ---------- FAQ list (divider-based, no boxes) ---------- */
.faq-list { border-top: 1px solid var(--color-border); }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary::-webkit-details-marker { display: none; }

/* ---------- Mobile-only section rhythm ----------
   Desktop/tablet (>=768px) keep the existing 80px stack-lg scale untouched.
   Small screens get a tighter, fluid rhythm so sections don't read as mostly
   empty space before content on short viewports. */
@media (max-width: 767px) {
    .py-stack-lg { padding-top: clamp(48px, 11vw, 64px); padding-bottom: clamp(48px, 11vw, 64px); }
    .pt-stack-lg { padding-top: clamp(48px, 11vw, 64px); }
    .pb-stack-lg { padding-bottom: clamp(48px, 11vw, 64px); }
    .mb-stack-lg { margin-bottom: clamp(48px, 11vw, 64px); }
    .mt-stack-lg { margin-top: clamp(48px, 11vw, 64px); }
    .p-stack-lg { padding: clamp(48px, 11vw, 64px); }
}

/* ---------- Touch devices: neutralise hover-only reveal states ----------
   Several cards/thumbnails only reach full colour/opacity on :hover
   (group-hover:grayscale-0, group-hover:opacity-100). Touch screens have no
   hover, so those elements would otherwise stay permanently desaturated/dim. */
@media (hover: none) {
    .grayscale { filter: none; }
    .opacity-80 { opacity: 1; }
}

/* ---------- Mobile comparison-table swipe affordance ---------- */
@media (max-width: 767px) {
    .table-scroll-fade { position: relative; }
    .table-scroll-fade::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 28px;
        background: linear-gradient(to right, transparent, var(--color-bg));
        pointer-events: none;
    }
}

/* ---------- Elfsight WhatsApp Chat ---------- */
.elfsight-app-ec87ddda-835f-48ec-9e85-411f7c078357,
.eapps-whatsapp-chat-ec87ddda-835f-48ec-9e85-411f7c078357-custom-css-root {
    position: relative;
    z-index: 2147483000;
}

/* ---------- Scrollbar (was duplicated with minor variations across pricing.html,
   portfolio.html and blog.html — unified into a single site-wide definition) ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000000; }
::-webkit-scrollbar-thumb { background: #262626; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ---------- About page: founder portrait dividers (extracted from about.html <style>) ---------- */
.hairline-divider {
    height: 1px;
    background-color: var(--color-border);
    width: 100%;
}

/* ---------- Process page: step numerals (extracted from process.html <style>) ---------- */
.step-number { font-family: var(--font-heading); line-height: 0.8; }
@media (max-width: 767px) {
    .step-number { font-size: clamp(56px, 20vw, 110px) !important; }
}

/* ---------- Legal page: policy typography + tab state (extracted from legal.html <style>) ---------- */
.legal-content h2 {
    border-bottom: 1px solid #222222;
    padding-bottom: 8px;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--color-accent);
    transition: letter-spacing 0.3s ease;
}
.legal-content h2:hover { letter-spacing: 0.05em; }
.legal-content p {
    margin-bottom: 24px;
    color: var(--color-muted);
}
.legal-content ul {
    margin-bottom: 24px;
    padding-left: 20px;
}
.legal-content li {
    margin-bottom: 8px;
    color: var(--color-muted);
    list-style-type: square;
}
.active-legal-tab {
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
}
