/* foilphysics - Custom Stylesheet
    Theme: Modern Dark / Physics Lab
*/

:root {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --accent: #38bdf8;
    --accent-secondary: #818cf8;
    --btn-dynamic: #6366f1;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items along the cross-axis */
    min-height: 100vh;
}

/* --- Header Section --- */
header {
    text-align: center;
    padding: 5rem 1rem 3rem;
    max-width: 800px;
    margin-inline: auto; /* The magic fix for horizontal centering */
}

h1 {
    font-size: 3.5rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(to right, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.2));
    letter-spacing: -1px;
}

p.subtitle {
    color: var(--text-dim);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Grid Layout --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    margin-inline: auto; /* Centers the grid block */
}

/* --- Card Styles --- */
.card {
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 
                0 0 20px rgba(56, 189, 248, 0.1);
}

.card-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin: 0 0 1.2rem 0;
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 1.3;
}

.card p {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

/* --- Button Styles --- */
.btn {
    background: #0ea5e9;
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card:hover .btn {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Specific button color for Dynamic Sim */
.btn-dynamic {
    background: var(--btn-dynamic) !important;
}

/* --- Footer --- */
footer {
    margin-top: auto;
    padding: 3rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    border-top: 1px solid #1e293b;
    letter-spacing: 1px;
}

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

/* Mobile Adjustments */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .grid { padding: 1rem; }
    .card { padding: 1.5rem; }
}