@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #A41034;
    /* Crimson */
    --primary-dark: #820d29;
    --accent: #1e1e1e;
    /* Ink/Black */
    --bg-body: #f7f4f1;
    /* Off-white canvas */
    --bg-card: #ffffff;
    --text-main: #1e1e1e;
    --text-dim: #555555;
    --border: #dcdcdc;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding: 40px 20px;
}

.container {
    max-width: 850px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    /* Reduced from 70px */
    border-bottom: None;
    /* Removed thick border to reduce visual separation/gap feeling */
    padding-bottom: 0;
}

h1 {
    font-family: 'Crimson Pro', serif;
    font-size: 4.2rem;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.4rem;
    /* Larger */
    color: var(--text-dim);
    font-weight: 500;
    font-style: italic;
    max-width: 650px;
    margin: 0 auto;
}

/* Card Styles */
.study-card {
    background: var(--bg-card);
    padding: 30px;
    /* Reduced from 45px/40px */
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

h2,
h3 {
    font-family: 'Crimson Pro', serif;
    color: var(--accent);
    margin-bottom: 25px;
    font-weight: 600;
}

h2 {
    font-size: 2.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    text-transform: capitalize;
}

h3 {
    font-size: 1.7rem;
}

.study-highlight {
    background: #fdf2f2;
    border-left: 5px solid var(--primary);
    padding: 25px;
    margin: 25px 0;
    font-style: italic;
    color: var(--accent);
    font-size: 1.15rem;
    font-family: 'Crimson Pro', serif;
}

.reference-section {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    line-height: 1.5;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 45px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mode-btn {
    flex: 1;
    padding: 14px 28px;
    border: none;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dim);
    transition: var(--transition);
    border-right: 1px solid var(--border);
}

.mode-btn:last-child {
    border-right: none;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #f8f8f8;
    color: var(--primary);
}

/* Form Styles */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--accent);
}

input {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: inherit;
    background: #ffffff;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(164, 16, 52, 0.08);
}

.calculate-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.calculate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(164, 16, 52, 0.2);
}

/* Solution Display */
.solution-box {
    margin-top: 60px;
    padding: 50px;
    background: white;
    border-top: 6px solid var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: none;
}

.solution-box.active {
    display: block;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline {
    position: relative;
    padding-top: 20px;
}

.timeline-item {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 35px;
    bottom: -55px;
    width: 1px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.icon {
    min-width: 35px;
    height: 35px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    font-size: 1rem;
}

.time-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.time-block {
    flex: 1;
    background: #f9f9f9;
    padding: 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

.time-block.origin {
    border-left-color: var(--accent);
}

.time-block .label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.time-block .value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.time-block .date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* About Developer */
/* About Developer - Redesigned */
.about-card {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 8px;
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 80px;
}

.about-card h3 {
    color: var(--accent);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 5px;
    font-size: 2.2rem;
    text-transform: none;
    letter-spacing: -0.02em;
}

.about-card .role-title {
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 30px;
    display: block;
}

.about-content-wrapper {
    display: block;
    max-width: 800px;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.bio-details {
    background: #f8f8f8;
    padding: 30px;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: none;
    /* Reset old shadow */
}

.bio-details strong {
    color: var(--accent);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 15px;
    font-family: 'Crimson Pro', serif;
}

.bio-details ul {
    padding: 0;
    list-style: none;
    /* Ensure no bullets */
}

.bio-details ul li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-dim);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 8px;
    font-weight: 400;
    /* Reset */
}

/* Time Container Hierarchy */
.time-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.time-block {
    display: flex;
    flex-direction: column;
}

.time-block.main-time {
    flex: 2;
}

.time-block.sub-time {
    flex: 1;
    opacity: 0.6;
    border-left: 1px solid #ddd;
    padding-left: 15px;
    justify-content: center;
}

.time-block .label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.time-block.main-time .value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.time-block.sub-time .value {
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--text-dim);
}

.time-block .date {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.bio-details ul li:last-child {
    border-bottom: none;
}

/* Print Styles for PDF Export */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    /* Hide unnecessary elements */
    header,
    .mode-selector,
    .mode-switch,
    .form-section,
    .study-card,
    #print-btn,
    .subtitle,
    .about-card {
        /* Explicitly hide the bio card */
        display: none !important;
    }

    /* Show only results and attribution */
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        /* Remove padding to save space */
        box-shadow: none;
        border: none;
    }

    .solution-box {
        display: block !important;
        opacity: 1 !important;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-top: 0;
    }

    .solution-box h3 {
        display: none !important;
    }

    .print-summary {
        page-break-after: avoid;
        break-after: avoid;
    }

    .strategy-block {
        break-inside: avoid;
        page-break-inside: avoid;
        border-bottom: 1px solid #ddd;
    }

    .strategy-block.first-strategy {
        page-break-before: avoid;
        break-before: avoid;
    }

    .about-card {
        display: block;
        box-shadow: none;
        border: 1px solid #eee;
        margin-top: 50px;
        break-inside: avoid;
    }

    /* Force background colors to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

.bio-details ul li .label {
    font-weight: 600;
    color: var(--accent);
}

.about-card a {
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(164, 16, 52, 0.3);
    transition: all 0.2s;
}

.about-card a:hover {
    border-bottom-color: var(--primary);
}

footer {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 0.95rem;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 650px) {
    h1 {
        font-size: 2.8rem;
        line-height: 1.1;
    }

    .input-grid {
        grid-template-columns: 1fr;
    }

    .time-container {
        flex-direction: column;
    }

    .about-content-wrapper {
        display: block;
        /* No longer grid */
    }

    .about-card {
        padding: 30px;
    }

    .bio-details {
        display: none;
        /* Safely hide if still present in DOM, though removed from HTML */
    }

    .study-card {
        padding: 25px;
    }
}