/* =========================================================
   Emma Davies — Personal Website
   Clean, professional, trustworthy design
   ========================================================= */

:root {
    --white: #ffffff;
    --bg: #fafafa;
    --bg-alt: #f3f4f6;
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #1d4ed8;
    --accent-hover: #1e40af;
    --accent-light: #eff6ff;
    --accent-border: #bfdbfe;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
strong { font-weight: 600; color: var(--text); }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================  NAVIGATION  ========================= */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(250,250,250,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 64px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.nav-logo:hover { color: var(--text); }

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover { color: var(--text); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

/* =========================  HERO  ========================= */
.hero {
    padding: 10rem 0 6rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}

.hero-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.hero-intro {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 540px;
    line-height: 1.8;
}

.hero-detail {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 540px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-photo img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}

/* =========================  BUTTONS  ========================= */
.btn-solid {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.6rem;
    background: var(--accent);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-solid:hover {
    background: var(--accent-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    transition: color var(--transition);
}

.btn-ghost:hover { color: var(--accent-hover); }

/* =========================  SECTIONS  ========================= */
.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.section-sub a { color: var(--accent); }

.section-footer {
    text-align: center;
    margin-top: 2.5rem;
}

/* =========================  CARDS  ========================= */
.cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
}

/* Pill tags */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

/* Credential list */
.cred-list {
    list-style: none;
}

.cred-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-alt);
}

.cred-list li:last-child { border-bottom: none; }

.cred-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1.5;
}

.cred-list li div {
    display: flex;
    flex-direction: column;
}

.cred-list li strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.cred-list li span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Achievements */
.achievements-card {
    background: var(--white);
}

.achievements-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.achievement { text-align: center; }

.achievement-stat {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.achievement p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================  ARTICLES  ========================= */
.articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.article-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.article-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-tag {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
}

.article-card h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.article-card h4 a { color: var(--text); }
.article-card h4 a:hover { color: var(--accent); }

.article-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

.article-link:hover { gap: 0.5rem; }

/* Articles skeleton loader */
.skeleton-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.skeleton-line {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 0.75rem;
}

.skeleton-line:nth-child(1) { width: 35%; height: 10px; }
.skeleton-line:nth-child(2) { width: 90%; height: 18px; }
.skeleton-line:nth-child(3) { width: 100%; }
.skeleton-line:nth-child(4) { width: 80%; }
.skeleton-line:last-child { width: 25%; margin-bottom: 0; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================  TRUST BAR (E-E-A-T)  ========================= */
.trust-bar {
    background: var(--accent-light);
    border-bottom: 1px solid var(--accent-border);
    padding: 0.85rem 0;
}

.trust-bar-inner {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.trust-item svg {
    flex-shrink: 0;
    color: var(--accent);
}

/* =========================  EXPERIENCE TIMELINE (E-E-A-T)  ========================= */
.experience-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 2rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--accent);
    z-index: 1;
}

.timeline-item:first-child .timeline-marker {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.timeline-content {
    margin-left: 0.5rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.timeline-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.timeline-org {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-org a {
    color: var(--accent);
}

.timeline-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-alt);
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =========================  LEGAL PAGES  ========================= */
.legal-page {
    padding: 8rem 0 4rem;
}

.legal-content {
    max-width: 720px;
    margin: 0 auto;
}

.legal-content h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.legal-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-content ul {
    margin: 0.75rem 0 1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.legal-content li {
    margin-bottom: 0.4rem;
}

.legal-content a {
    color: var(--accent);
}

/* =========================  FOOTER  ========================= */
.footer {
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

.footer-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

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

.footer-sep {
    color: var(--border);
}

.footer-right {
    align-items: flex-end;
}

.footer-updated {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.footer-updated small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* =========================  REVEAL ANIMATION  ========================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================  RESPONSIVE  ========================= */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        gap: 0.75rem;
        box-shadow: var(--shadow-md);
    }
    .nav-toggle { display: block; }

    .hero { padding: 7rem 0 3rem; }
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .hero-grid .hero-photo { order: -1; }
    .hero-photo img { width: 180px; height: 180px; margin: 0 auto; }
    .hero h1 { font-size: 2.5rem; }
    .hero-intro, .hero-detail { max-width: 100%; }
    .hero-actions { justify-content: center; }

    .trust-bar-inner { gap: 1rem; }
    .trust-item { font-size: 0.72rem; }

    .cards-row { grid-template-columns: 1fr; }
    .achievements-row { grid-template-columns: 1fr; gap: 1.5rem; }
    .articles { grid-template-columns: 1fr; }

    .experience-timeline { padding-left: 1.5rem; }

    .timeline-header { flex-direction: column; gap: 0.25rem; }

    .footer-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
    .footer-col { align-items: center; }
    .footer-right { align-items: center; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .section-heading { font-size: 1.5rem; }
    .legal-content h1 { font-size: 1.75rem; }
}
