/* Pharo MOOC — single stylesheet, no framework, no web fonts, no JavaScript. */

:root {
    --bg: #ffffff;
    --bg-soft: #f4f7fa;
    --card: #ffffff;
    --text: #1d2730;
    --muted: #5b6875;
    --line: #dde4ea;
    --accent: #2f86c6;          /* Pharo blue */
    --accent-strong: #1f6aa3;
    --accent-soft: #e6f1fa;
    --warn: #b9600b;
    --warn-soft: #fdf0e1;
    --k-lecture: #2f86c6;
    --k-live: #2e9150;
    --k-redo: #6a5acd;
    --k-exercise: #c7811a;
    --k-challenge: #c43d3d;
    --radius: 10px;
    --max: 1040px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12171c;
        --bg-soft: #182027;
        --card: #1c252d;
        --text: #e3e9ee;
        --muted: #9aa8b5;
        --line: #2c3842;
        --accent: #5aaee8;
        --accent-strong: #84c3ef;
        --accent-soft: #1d3346;
        --warn: #f0a85a;
        --warn-soft: #3a2a18;
        --k-lecture: #5aaee8;
        --k-live: #58c27e;
        --k-redo: #a596f0;
        --k-exercise: #e7a548;
        --k-challenge: #ec7070;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.75rem; margin: 0 0 .75rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
.soft { background: var(--bg-soft); }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.brand img { height: 28px; width: auto; }

/* The menu scrolls sideways on narrow screens: no hamburger, no JS. */
.site-nav {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: .95rem;
    white-space: nowrap;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--text); }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn.small { padding: 6px 12px; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; }
.hero .wrap {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 40px;
    align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); margin: 0 0 .5rem; }
.hero h1 span { color: var(--accent); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.hero video {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    background: #000;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.facts li {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: .9rem;
}

/* ---------- Cards ---------- */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.card .emoji { font-size: 1.6rem; }
.card p { margin: .25rem 0 0; color: var(--muted); }

.enroll {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    border-left: 4px solid var(--accent);
}
.enroll ul { margin: .5rem 0 0; padding-left: 1.2em; }

details.more summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    margin-top: .5rem;
}

/* ---------- Install ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; }
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 52px;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.steps img { display: block; max-width: 520px; width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; }

.note {
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--accent-soft);
}

/* ---------- Weeks ---------- */
.week-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.week-nav a {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    background: var(--card);
}

.week {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    scroll-margin-top: 76px;
}
.week h3 { font-size: 1.35rem; }
.week h3 small { display: block; color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

.week-res { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 16px; font-size: .92rem; color: var(--muted); }

.items { list-style: none; margin: 0; padding: 0; }
.items li {
    display: grid;
    grid-template-columns: 112px 1fr auto;
    gap: 12px;
    align-items: baseline;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.kind {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--k);
}
/* Each kind has its own icon shape, so the kind never depends on color alone
   (color stays as a secondary cue). Icons are inline SVG masks drawn in the
   kind's color. */
.kind::before {
    content: "";
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    margin-right: 5px;
    vertical-align: -0.35em;
    background: var(--k);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

/* Lecture: presentation board */
.k-lecture {
    --k: var(--k-lecture);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='12' rx='1'/%3E%3Cpath d='M12 15v4M8 21l4-2 4 2M7 8h6M7 11h10'/%3E%3C/svg%3E");
}
/* Live: terminal prompt (live coding) */
.k-live {
    --k: var(--k-live);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='M6 9l4 3-4 3M12 15h6'/%3E%3C/svg%3E");
}
/* Redo: circular arrow */
.k-redo {
    --k: var(--k-redo);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.35-5.65'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E");
}
/* Exercise: pencil */
.k-exercise {
    --k: var(--k-exercise);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4z'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
}
/* Challenge: flag */
.k-challenge {
    --k: var(--k-challenge);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 4h12l-2.5 4L17 12H5'/%3E%3C/svg%3E");
}

.title .tags { margin-right: 4px; }

.links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.links a {
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.links a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.links a.pdf::before { content: "PDF "; font-weight: 400; opacity: .7; }
.links a.vid::before { content: "▶ "; }
.links a.err { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.links a.err::before { content: "⚠ "; }
.links a.err:hover { background: var(--warn); color: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); margin: 0 0 16px; }

/* ---------- Testimonies ---------- */
.quotes { columns: 3 280px; column-gap: 16px; }
.quotes blockquote {
    break-inside: avoid;
    margin: 0 0 16px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: .95rem;
}
.quotes cite { display: block; margin-top: 8px; color: var(--muted); font-style: normal; font-size: .85rem; }

/* ---------- Teachers & partners ---------- */
.teacher img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; float: left; margin: 0 14px 6px 0; }
.teacher p { font-size: .93rem; }

.partners { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: center; }
.partners img { height: 56px; width: auto; background: #fff; padding: 6px; border-radius: 6px; }

footer { padding: 32px 0; text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
    .hero .wrap { grid-template-columns: 1fr; }
    .enroll { grid-template-columns: 1fr; }
    .site-header .btn { display: none; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    section { padding: 40px 0; }
    .week { padding: 16px; }
    .items li { grid-template-columns: 1fr; gap: 4px; }
    .links { justify-content: flex-start; }
}

/* ---------- YouTube playlists ---------- */
.yt-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.yt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.yt:hover { border-color: #ff0000; color: var(--text); }
/* YouTube logo mark: red rounded rectangle with a white play triangle */
.yt::before {
    content: "";
    width: 28px;
    height: 20px;
    flex: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' rx='5' fill='%23FF0000'/%3E%3Cpath d='M11 5.5v9l8-4.5z' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Testimonies, a bit more shining ---------- */
.quotes blockquote {
    position: relative;
    padding: 28px 20px 16px 22px;
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, var(--accent-soft), var(--card) 65%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    line-height: 1.55;
    transition: transform .15s ease, box-shadow .15s ease;
}
.quotes blockquote:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
}
.quotes blockquote::before {
    content: "“";
    position: absolute;
    top: -6px;
    left: 12px;
    font: 700 3.4rem/1 Georgia, "Times New Roman", serif;
    color: var(--accent);
    opacity: .45;
}
.quotes blockquote em {
    font-style: italic;
    font-weight: 600;
    color: var(--accent-strong);
}
.quotes cite { font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .quotes blockquote { transition: none; }
    .quotes blockquote:hover { transform: none; }
}
