/* ============================================================
   Kanafay — Pharmaceutical Regulatory Consultancy
   Design system: Sora, rounded, light grey, deep-teal accent
   ============================================================ */

:root {
    /* Color */
    --bg: #eef0f0;
    --bg-alt: #e5e9e9;
    --surface: #ffffff;
    --ink: #16201f;
    --ink-soft: #44504e;
    --muted: #6b7775;
    --accent: #0d6e6e;
    --accent-dark: #0a5656;
    --accent-tint: #e4efef;
    --border: #e2e8e7;
    --border-strong: #cdd8d7;

    /* Radius */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* Typography */
    --font-sans: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    --max-width: 1140px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(16, 32, 31, 0.04), 0 1px 3px rgba(16, 32, 31, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 32, 31, 0.06), 0 2px 6px rgba(16, 32, 31, 0.05);
    --shadow-lg: 0 16px 40px rgba(16, 32, 31, 0.10);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-dark);
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.section {
    padding: var(--space-9) 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-head {
    max-width: 720px;
    margin: 0 auto var(--space-8);
    text-align: center;
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-tint);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-4);
}

.section-head h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    margin-bottom: var(--space-4);
}

.section-head p {
    color: var(--muted);
    font-size: 1.15rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    padding: 15px 28px;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease,
        border-color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 11px 20px;
    font-size: 1rem;
}

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(238, 240, 240, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
}

.nav-logo img {
    height: 34px;
    width: auto;
    border-radius: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.nav-link {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink-soft);
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--accent-dark);
}

.nav-cta {
    margin-left: var(--space-2);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: var(--space-9) 0;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -180px;
    right: -160px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(13, 110, 110, 0.12), transparent 65%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-8);
    align-items: center;
}

.hero-media img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-5);
    max-width: 22ch;
}

.hero-sub {
    font-size: 1.25rem;
    color: var(--muted);
    max-width: 52ch;
    margin-bottom: var(--space-6);
}

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--accent-tint);
    color: var(--accent-dark);
    margin-bottom: var(--space-5);
}

.service-icon svg {
    width: 26px;
    height: 26px;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
}

.service-card p {
    color: var(--muted);
    font-size: 1.08rem;
}

.service-card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
}

/* ---------- Why us (founder message) ---------- */
.chat {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    max-width: 780px;
    margin: 0 auto;
}

.chat-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--surface);
}

.chat-bubble {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow-sm);
}

.chat-bubble::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 24px;
    width: 18px;
    height: 18px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}

.chat-bubble p {
    color: var(--ink-soft);
    margin-bottom: var(--space-3);
    font-size: 1.1rem;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

/* ---------- CTA ---------- */
.cta-section {
    padding: var(--space-9) 0;
}

.cta-card {
    background: var(--accent);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-lg);
    background-image: radial-gradient(
        circle at 85% 20%,
        rgba(255, 255, 255, 0.12),
        transparent 45%
    );
}

.cta-card h2 {
    color: #ffffff;
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    margin-bottom: var(--space-4);
}

.cta-card p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 56ch;
    margin: 0 auto var(--space-6);
    font-size: 1.05rem;
}

.cta-card .btn-primary {
    background: #ffffff;
    color: var(--accent-dark);
    box-shadow: none;
}

.cta-card .btn-primary:hover {
    background: var(--accent-tint);
    color: var(--accent-dark);
}

/* ---------- Blog preview / list ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
    background: var(--bg-alt);
}

.blog-card-body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-date {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--space-3);
}

.blog-card h3 {
    font-size: 1.15rem;
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.blog-card h3 a {
    color: var(--ink);
}

.blog-card h3 a:hover {
    color: var(--accent-dark);
}

.blog-card p {
    color: var(--muted);
    font-size: 1.05rem;
    flex: 1;
}

.blog-card .read-more {
    margin-top: var(--space-4);
    font-weight: 600;
    font-size: 0.92rem;
}

/* ---------- Blog detail ---------- */
.article-header {
    padding: var(--space-8) 0 var(--space-6);
    text-align: center;
}

.article-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    max-width: 24ch;
    margin: 0 auto var(--space-4);
}

.article-meta {
    color: var(--muted);
    font-size: 1rem;
}

.article-cover {
    max-width: 860px;
    margin: 0 auto var(--space-6);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-cover img {
    width: 100%;
    border-radius: 0;
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: var(--space-8);
}

.article-body h2 {
    font-size: 1.5rem;
    margin: var(--space-7) 0 var(--space-3);
}

.article-body h3 {
    font-size: 1.2rem;
    margin: var(--space-6) 0 var(--space-2);
}

.article-body p {
    color: var(--ink-soft);
    margin-bottom: var(--space-6);
    font-size: 1.15rem;
    line-height: 1.85;
}

.article-body ul,
.article-body ol {
    margin: 0 0 var(--space-5) var(--space-5);
    color: var(--ink-soft);
}

.article-body li {
    margin-bottom: var(--space-2);
}

.article-body blockquote {
    border-left: 4px solid var(--accent);
    background: var(--accent-tint);
    padding: var(--space-4) var(--space-5);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: var(--space-5) 0;
    color: var(--ink-soft);
}

.article-body code {
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--ink);
    color: #e8f0f0;
    padding: var(--space-5);
    border-radius: var(--radius);
    overflow-x: auto;
    margin: var(--space-5) 0;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-body img {
    border-radius: var(--radius);
    margin: var(--space-5) 0;
}

/* ---------- Legal pages ---------- */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding-bottom: var(--space-8);
}

.legal-page h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: var(--space-4);
}

.legal-page .updated {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-6);
}

.legal-page h2 {
    font-size: 1.35rem;
    margin: var(--space-7) 0 var(--space-3);
}

.legal-page p,
.legal-page li {
    color: var(--ink-soft);
    margin-bottom: var(--space-3);
}

.legal-page ul {
    margin-left: var(--space-5);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-8) 0 var(--space-6);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: var(--space-6);
}

.footer-brand img {
    height: 30px;
    width: auto;
    border-radius: 0;
    margin-bottom: var(--space-4);
}

.footer-brand p {
    color: var(--muted);
    font-size: 1rem;
    max-width: 34ch;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--space-4);
}

.footer-col a,
.footer-col p {
    display: block;
    color: var(--ink-soft);
    font-size: 1rem;
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.footer-col a:hover {
    color: var(--accent-dark);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: var(--space-7) auto 0;
    padding: var(--space-5) var(--space-5) 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--muted);
    font-size: 0.95rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-media {
        max-height: 360px;
    }

    .services-grid,
    .blog-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .section {
        padding: var(--space-8) 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: var(--space-4) var(--space-5);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .nav-link {
        padding: var(--space-3) 0;
        width: 100%;
    }

    .nav-links .nav-cta {
        margin: var(--space-3) 0 0;
        width: 100%;
    }

    .nav-toggle {
        display: inline-block;
    }

    .services-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .hero-cta-row .btn {
        width: 100%;
    }
}
