@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@200;300;400;500;600&display=swap');

/* ============================================================
   Case Study — Shared Stylesheet
   Extends the portfolio design tokens from style.css
   ============================================================ */

:root {
    --bg: #e3e3e3;
    --surface: #f5f5f7;
    --border: #d2d2d7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --black: #000000;

    --font-hero: 54px;
    --font-h1: 48px;
    --font-h2: 34px;
    --font-h3: 24px;
    --font-body-large: 19px;
    --font-body: 14px;
    --font-small: 12px;
    --font-caption: 10px;
    --font-label: 9px;

    --font-display: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    --font-text: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
    --bg: #141414;
    --surface: #1e1e1e;
    --border: #2e2e2e;
    --text-primary: #f0f0f0;
    --text-secondary: #8e8e93;
    --text-tertiary: #5a5a5f;
    --black: #f0f0f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-text);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.cs-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.cs-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 100%;
}

.cs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-small);
    color: var(--text-secondary);
    transition: color 150ms ease;
}

.cs-back:hover { color: var(--text-primary); }

.cs-back svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.cs-nav-label {
    font-size: var(--font-small);
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 150ms ease, border-color 150ms ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.theme-icon {
    width: 14px;
    height: 14px;
    display: block;
}

.theme-icon--sun { display: none; }
.theme-icon--moon { display: block; }

[data-theme="dark"] .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* Dark mode: navbar glassmorphism */
[data-theme="dark"] .cs-nav {
    background: rgba(20, 20, 20, 0.85);
}

/* Dark mode: hero image shadow */
[data-theme="dark"] .cs-hero-image {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Scroll Progress
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--text-primary);
    z-index: 200;
    pointer-events: none;
    transform-origin: left center;
}

/* ==========================================================================
   Page Hero
   ========================================================================== */
.cs-hero {
    padding-top: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.cs-hero-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 96px 40px 80px;
}

.cs-eyebrow {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.cs-eyebrow-tag {
    font-size: var(--font-label);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px;
}

.cs-eyebrow-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.cs-eyebrow-company {
    font-size: var(--font-small);
    color: var(--text-tertiary);
    font-weight: 400;
}

.cs-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 800px;
    margin-bottom: 32px;
}

.cs-subtitle {
    font-size: var(--font-body-large);
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.6;
    margin-bottom: 56px;
}

/* Key metrics strip */
.cs-metrics-strip {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    max-width: 720px;
}

.cs-metric-item {
    flex: 1;
    padding: 24px 28px;
    border-right: 1px solid var(--border);
}

.cs-metric-item:last-child { border-right: none; }

.cs-metric-value {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.cs-metric-label {
    font-size: var(--font-caption);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Hero screenshot */
.cs-hero-image {
    margin-top: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
    line-height: 0;
}

.cs-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cs-hero-image:hover img {
    transform: scale(1.03);
}

/* ==========================================================================
   Page Body / Sections
   ========================================================================== */
.cs-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 40px 120px;
}

/* Section */
.cs-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border);
}

.cs-section:last-child { border-bottom: none; }

.cs-section-label {
    display: block;
    font-size: var(--font-label);
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.cs-section-title {
    font-family: var(--font-display);
    font-size: var(--font-h2);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    max-width: 560px;
}

/* Two-column layout */
.cs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.cs-two-col-wide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 64px;
    align-items: start;
}

/* Body text */
.cs-body-text {
    font-size: var(--font-body-large);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.cs-body-text:last-child { margin-bottom: 0; }

/* Highlight callout */
.cs-callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-primary);
    border-radius: 0 8px 8px 0;
    padding: 24px 28px;
    margin: 32px 0;
}

.cs-callout p {
    font-size: var(--font-body-large);
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
}

/* Numbered list */
.cs-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
    list-style: none;
    counter-reset: steps;
}

.cs-step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 20px;
    align-items: start;
    counter-increment: steps;
}

.cs-step-num {
    font-family: var(--font-display);
    font-size: var(--font-h3);
    font-weight: 400;
    color: var(--text-tertiary);
    line-height: 1;
    padding-top: 3px;
}

.cs-step-content h4 {
    font-size: var(--font-body-large);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.cs-step-content p {
    font-size: var(--font-body);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Bullet list */
.cs-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-list li {
    font-size: var(--font-body);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 18px;
    position: relative;
}

.cs-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
    font-weight: 300;
}

/* Info cards */
.cs-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.cs-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 24px;
}

.cs-card-icon {
    display: block;
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 16px;
}

.cs-card h4 {
    font-size: var(--font-small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.cs-card p {
    font-size: var(--font-body);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Outcome cards */
.cs-outcomes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.cs-outcome-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px 28px;
}

.cs-outcome-value {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.cs-outcome-title {
    font-size: var(--font-body);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.cs-outcome-desc {
    font-size: var(--font-small);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Timeline (journey page) */
.cs-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 32px;
}

.cs-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.cs-timeline-item {
    position: relative;
    padding-bottom: 48px;
}

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

.cs-timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--border);
}

.cs-timeline-item.active::before {
    background: var(--text-primary);
    border-color: var(--text-primary);
}

.cs-timeline-period {
    font-size: var(--font-caption);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 6px;
}

.cs-timeline-role {
    font-size: var(--font-body-large);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cs-timeline-company {
    font-size: var(--font-small);
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 400;
}

.cs-timeline-desc {
    font-size: var(--font-body);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 600px;
}

/* Learnings / Tags */
.cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.cs-tag {
    font-size: var(--font-caption);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px;
    background: var(--surface);
}

/* Divider */
.cs-divider {
    height: 1px;
    background: var(--border);
    margin: 40px 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.cs-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 40px;
}

.cs-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cs-footer-left p {
    font-size: var(--font-small);
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.cs-footer-left a {
    font-size: var(--font-body);
    font-weight: 500;
    color: var(--text-primary);
    transition: opacity 150ms ease;
}

.cs-footer-left a:hover { opacity: 0.6; }

.cs-footer-nav {
    display: flex;
    gap: 24px;
}

.cs-footer-nav a {
    font-size: var(--font-small);
    color: var(--text-secondary);
    transition: color 150ms ease;
}

.cs-footer-nav a:hover { color: var(--text-primary); }

/* Overview image */
.cs-overview-image {
    position: relative;
    align-self: stretch;
    min-height: 200px;
}

.cs-overview-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 8px;
    display: block;
}

/* ==========================================================================
   Career Flowchart
   ========================================================================== */
.cs-flowchart {
    display: flex;
    align-items: stretch;
    margin-top: 48px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.cs-flow-node {
    flex: 1;
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
}

.cs-flow-node.active {
    border-color: var(--text-primary);
}

.cs-flow-period {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.cs-flow-role {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 3px;
}

.cs-flow-company {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.cs-flow-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.cs-flow-badge {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 7px;
}

.cs-flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    flex-shrink: 0;
    gap: 8px;
    min-width: 80px;
}

.cs-flow-arrow-icon {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.cs-flow-unlock {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
    font-style: italic;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .cs-nav-inner { padding: 0 20px; }
    .cs-nav-label { display: none; }

    .cs-hero-inner { padding: 80px 20px 60px; }
    .cs-body { padding: 0 20px 80px; }
    .cs-footer { padding: 40px 20px; }

    .cs-title { font-size: 28px; }
    .cs-subtitle { font-size: 15px; margin-bottom: 40px; }

    .cs-metrics-strip { flex-direction: column; max-width: 100%; }
    .cs-metric-item { border-right: none; border-bottom: 1px solid var(--border); }
    .cs-metric-item:last-child { border-bottom: none; }

    .cs-section { padding: 56px 0; }
    .cs-section-title { font-size: 24px; }

    .cs-two-col,
    .cs-two-col-wide { grid-template-columns: 1fr; gap: 40px; }

    .cs-cards { grid-template-columns: 1fr; }
    .cs-outcomes { grid-template-columns: 1fr; }

    .cs-flowchart { flex-direction: column; overflow-x: visible; }
    .cs-flow-connector {
        flex-direction: row;
        padding: 6px 0;
        min-width: 0;
        gap: 12px;
        justify-content: flex-start;
    }
    .cs-flow-arrow-icon { transform: rotate(90deg); }
    .cs-flow-unlock { text-align: left; }

    .cs-footer-inner { flex-direction: column; gap: 24px; align-items: flex-start; }

    .cs-timeline { padding-left: 24px; }
    .cs-timeline::before { left: 4px; }
    .cs-timeline-item::before { left: -21px; }
}

@media (max-width: 400px) {
    .cs-title { font-size: 24px; }
}

/* ==========================================================================
   Loader
   ========================================================================== */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo {
    opacity: 0;
    transform: scale(0.9);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 32px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
.cursor-dot,
.cursor-ring {
    display: none;
}

/* ==========================================================================
   Text Reveal Utilities
   ========================================================================== */
.cs-title .line-outer,
.cs-section-title .line-outer {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: inherit;
    margin-bottom: 0.05em;
}

.cs-title .line-inner,
.cs-section-title .line-inner {
    display: block;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
