/* Literata, self-hosted so the headings look the same everywhere rather than resolving to
   whatever serif the OS happens to ship. Google's `latin` subset (U+0000-00FF, so å/ä/ö are
   covered), weight 600 only — the single weight the display face is ever set in.
   SIL OFL 1.1; the license travels with the font in fonts/OFL.txt. */
@font-face {
    font-family: "Literata";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/literata-latin.woff2") format("woff2");
}

:root {
    --am-bg: #0e2439;          /* deep dusk blue — the canvas, dark enough for cards to lift off it */
    --am-surface: #1b4166;     /* project cards */
    --am-surface-2: #16344f;   /* pills, ghost buttons, lang switch — a step below the cards */
    --am-border: rgba(255, 252, 249, 0.16);
    --am-text: #fffcf9;        /* porcelain */
    --am-muted: #cbd8e6;       /* muted porcelain, still ~7:1 on the card surface */
    --am-accent: #e0822f;      /* toasted almond, richer — fills (buttons, borders) */
    --am-accent-2: #ef9d4e;    /* a brighter almond for text/links + button hover */
    --am-on-accent: #0f2740;   /* dark ink for text on an almond fill */

    /* Serif display for headings against the sans body. The fallbacks only ever show during the
       font swap, or if the woff2 fails to load. */
    --am-display: "Literata", "Iowan Old Style", "Charter", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background: var(--am-bg);
    background-image: radial-gradient(1100px 620px at 50% -15%, #24507a 0%, rgba(14, 36, 57, 0) 62%);
    background-repeat: no-repeat;
    color: var(--am-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4.5rem 1.25rem 3rem;
}
main { width: 100%; max-width: 44rem; }
header { margin-bottom: 3rem; }

h1 {
    margin: 0 0 0.5rem;
    font-family: var(--am-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 7vw, 3.1rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.subtitle {
    margin: 0; color: var(--am-accent-2); font-weight: 600;
    font-size: 0.95rem; letter-spacing: 0.02em;
    display: flex; align-items: center; gap: 0.6rem;
}
.subtitle::before {
    content: ""; width: 1.6rem; height: 2px; border-radius: 2px;
    background: var(--am-accent); flex: none;
}
.intro { font-size: 1.08rem; color: var(--am-text); margin: 1.6rem 0 0; }
.intro .muted { color: var(--am-muted); }

/* Tech pills */
.skills-label {
    text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem;
    color: var(--am-muted); margin: 2rem 0 0.7rem;
}
.skills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.skills li {
    font-size: 0.82rem; font-weight: 600; color: var(--am-text);
    background: var(--am-surface-2); border: 1px solid var(--am-border);
    border-radius: 999px; padding: 0.35rem 0.8rem;
}
.skills li.more {
    background: transparent; color: var(--am-muted);
    border-style: dashed; font-weight: 500;
}

/* Projects */
.section-label {
    text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem;
    color: var(--am-muted); margin: 0 0 1rem;
}
.card {
    background: var(--am-surface);
    border: 1px solid var(--am-border);
    border-radius: 16px;
    padding: 1.75rem 1.9rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(224, 130, 47, 0.45);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
}
.card h2 {
    margin: 0 0 0.6rem; font-family: var(--am-display); font-weight: 600;
    font-size: 1.45rem; letter-spacing: -0.01em;
}
.card .eyebrow {
    text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem;
    color: var(--am-accent-2); margin: 0 0 0.55rem; font-weight: 600;
}
.card p { margin: 0.5rem 0; color: var(--am-muted); }
.card p strong { color: var(--am-text); font-weight: 600; }
.card code {
    font-size: 0.88em; background: rgba(0, 0, 0, 0.22);
    padding: 0.1em 0.4em; border-radius: 5px; color: var(--am-text);
}

/* auto-fit, so a lone card fills the row and a second one drops in beside it
   without touching this file again. */
.project-grid {
    display: grid; gap: 1.1rem; margin-top: 1.1rem;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}
.project-grid .card { padding: 1.5rem 1.6rem; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34); }
.project-grid .card h2 { font-size: 1.2rem; }
.project-grid .card p { font-size: 0.94rem; }

/* Per-card stack — the tech as evidence under each project, rather than a list of claims */
.stack {
    display: flex; flex-wrap: wrap; gap: 0.4rem 0.7rem; margin: 1.1rem 0 0;
    padding: 0; list-style: none;
    font-size: 0.75rem; letter-spacing: 0.04em; color: var(--am-muted);
}
.stack li { display: flex; align-items: center; gap: 0.7rem; }
.stack li + li::before {
    content: ""; width: 3px; height: 3px; border-radius: 50%;
    background: var(--am-accent); opacity: 0.65;
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.card .actions { margin-top: 1.3rem; }
a.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.4rem; border-radius: 10px; text-decoration: none; font-weight: 600;
    transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
a.btn:active { transform: translateY(1px); }
a.btn-primary { background: var(--am-accent); color: var(--am-on-accent); }
a.btn-primary:hover { background: var(--am-accent-2); }
a.btn-ghost { border: 1px solid var(--am-border); color: var(--am-text); background: var(--am-surface-2); }
a.btn-ghost:hover { border-color: var(--am-accent); }
a.inline { color: var(--am-accent-2); text-decoration: none; }
a.inline:hover { text-decoration: underline; }

/* Language switch */
.lang-switch { position: fixed; top: 1rem; right: 1rem; display: flex; gap: 0.3rem; z-index: 5; }
.lang-switch button {
    background: var(--am-surface-2); border: 1px solid var(--am-border); color: var(--am-muted);
    border-radius: 8px; padding: 0.25rem 0.6rem; font: inherit; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.lang-switch button:hover { color: var(--am-text); }
.lang-switch button.active { color: var(--am-text); border-color: var(--am-accent); }

footer { margin-top: 3rem; color: var(--am-muted); font-size: 0.85rem; }

/* Entrance motion. `both` holds the from-state during the delay, so the stagger reads as
   one sequence rather than five separate fades. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.14s; }
.reveal:nth-child(3) { animation-delay: 0.23s; }
.reveal:nth-child(4) { animation-delay: 0.32s; }
.reveal:nth-child(5) { animation-delay: 0.41s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; }
    .card { transition: none; }
    .card:hover { transform: none; }
}
