/* ==========================================================================
   Inside the course (front/partials/course-inside): how a course teaches,
   in its own figures. A centred head, a row of tiles (video or step by step
   guides, pictures, knowledge checks, languages) and one card that draws
   the lessons of the course by kind as a bar with its legend. One sheet for
   every page that shows the block, printed once.

   The block measures itself (a container), so it is the same block behind
   View Course, on the team page and wherever else it is laid:

       the place          tiles a row     the bar and its legend
       1040px and wider   all of them     the legend on one or two rows
       620px to 1040px    two             the legend wraps
       under 620px        one             the legend one kind a row from 420px down

   Everything reads from the tokens below. On a page of the landing layer
   (.lp) the scale, the faces and the ink are the page's own, so the head is
   the head of every other section there; anywhere else the same values
   stand as written here. .cin--emerald hands the accent to a page whose
   accent is green. Nothing is read under 14px (the eyebrow is the 12.5px
   uppercase chip of every section head), nothing moves for a reader who
   asked for less motion.
   ========================================================================== */

.cin {
    --cin-scale: var(--lp-scale, var(--tp-scale, 1));
    --cin-ink: var(--lp-ink, #0b1220);
    --cin-ink-2: var(--lp-ink-2, #253247);
    --cin-ink-3: var(--lp-ink-3, #3f4d66);
    --cin-line: var(--lp-line, rgba(30, 58, 138, 0.1));
    --cin-glass: var(--lp-glass, rgba(255, 255, 255, 0.78));
    --cin-shadow: var(--lp-shadow, 0 1px 2px rgba(15, 23, 42, 0.04), 0 28px 60px -34px rgba(30, 58, 138, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9));
    --cin-shadow-hover: var(--lp-shadow-hover, 0 2px 4px rgba(15, 23, 42, 0.05), 0 34px 70px -34px rgba(30, 58, 138, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9));
    --cin-display: var(--lp-font-display, 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    --cin-body: var(--lp-font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    --cin-ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* the accent of the head, and one tone a kind: the tile, its rule, its bar and its dot */
    --cin-accent: #2563eb;
    --cin-accent-deep: #1d4ed8;
    --cin-blue: #2563eb;
    --cin-blue-deep: #1d4ed8;
    --cin-violet: #7c3aed;
    --cin-violet-deep: #6d28d9;
    --cin-emerald: #059669;
    --cin-emerald-deep: #047857;
    --cin-cyan: #0891b2;
    --cin-cyan-deep: #0e7490;
    --cin-orange: #ea580c;
    --cin-orange-deep: #c2410c;
    --cin-navy: #1e3a8a;
    --cin-navy-deep: #172554;
    --cin-slate: #94a3b8;

    container: cin / inline-size;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 clamp(44px, 5vw, calc(72px * var(--cin-scale)));
    font-family: var(--cin-body);
    color: var(--cin-ink);
    text-align: left;
}

.cin--emerald {
    --cin-accent: #059669;
    --cin-accent-deep: #047857;
}

.cin--flush {
    margin-bottom: 0;
}

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

/* Bold text is the same text, only heavier */
.cin strong,
.cin b {
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   The head: the chip, the title, the reading measure
   -------------------------------------------------------------------------- */
.cin-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto calc(40px * var(--cin-scale));
}

.cin .cin-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 calc(24px * var(--cin-scale));
    padding: 9px 16px 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--cin-line);
    box-shadow: 0 10px 24px -18px rgba(30, 58, 138, 0.5);
    font-family: var(--cin-body);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--cin-ink-2);
}

.cin .cin-eyebrow svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    padding: 5px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cin-accent) 0%, var(--cin-accent-deep) 100%);
    box-shadow: 0 6px 14px -8px var(--cin-accent);
}

.cin .cin-title {
    max-width: 22em;
    margin: 0;
    font-family: var(--cin-display);
    font-size: clamp(30px, 3.1vw, calc(44px * var(--cin-scale)));
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--cin-ink);
    text-wrap: balance;
}

.cin .cin-lede {
    max-width: calc(760px * var(--cin-scale));
    margin: calc(20px * var(--cin-scale)) auto 0;
    font-family: var(--cin-body);
    font-size: calc(17.5px * var(--cin-scale));
    font-weight: 500;
    line-height: 1.65;
    color: var(--cin-ink-2);
    text-wrap: pretty;
}

.cin .cin-lede strong {
    font-weight: 700;
    color: var(--cin-ink);
}

/* --------------------------------------------------------------------------
   The tiles
   -------------------------------------------------------------------------- */
.cin-tiles {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cin-tile {
    --cin-tone: var(--cin-blue);
    --cin-tone-deep: var(--cin-blue-deep);
    position: relative;
    /* on a phone the tile is short: its mark beside its figure, the words under them */
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 22px 18px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--cin-glass);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: var(--cin-shadow), 0 0 0 1px var(--cin-line);
    transition: transform 0.28s var(--cin-ease), box-shadow 0.28s var(--cin-ease);
}

/* the rule of its tone, along the top edge */
.cin-tile::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cin-tone) 0%, var(--cin-tone-deep) 100%);
}

/* a soft light of the same tone in the far corner */
.cin-tile::after {
    content: "";
    position: absolute;
    top: -70px;
    right: -70px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cin-tone) 0%, rgba(255, 255, 255, 0) 68%);
    opacity: 0.1;
    pointer-events: none;
}

.cin-tile--video {
    --cin-tone: var(--cin-violet);
    --cin-tone-deep: var(--cin-violet-deep);
}

.cin-tile--pictures {
    --cin-tone: var(--cin-blue);
    --cin-tone-deep: var(--cin-blue-deep);
}

.cin-tile--guides {
    --cin-tone: var(--cin-emerald);
    --cin-tone-deep: var(--cin-emerald-deep);
}

.cin-tile--checks {
    --cin-tone: var(--cin-orange);
    --cin-tone-deep: var(--cin-orange-deep);
}

.cin-tile--languages {
    --cin-tone: var(--cin-navy);
    --cin-tone-deep: var(--cin-navy-deep);
}

.cin-tile__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cin-tone) 0%, var(--cin-tone-deep) 100%);
    box-shadow: 0 14px 22px -14px var(--cin-tone), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cin-tile__icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.cin .cin-tile__title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: var(--cin-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--cin-ink);
    text-wrap: balance;
}

.cin-tile__num {
    display: block;
    margin: 0 0 4px;
    font-size: 36px;
    line-height: 1;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    color: var(--cin-tone-deep);
}

.cin .cin-tile__text {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    margin: 14px 0 0;
    font-family: var(--cin-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--cin-ink-3);
    text-wrap: pretty;
}

/* The foot of a tile stands on its lower edge, so the tiles of a row end together: the videos by
   their names, a small drawing of what the tile counts, the languages in their own words. */
.cin-tile__foot {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    width: 100%;
    margin: 16px 0 0;
}

/* the videos of the course, by their names */
.cin-tile__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0 0;
    border-top: 1px solid var(--cin-line);
    list-style: none;
}

.cin-tile__list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cin-ink-2);
}

.cin-tile__list svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    padding: 4.5px;
    border-radius: 50%;
    color: #ffffff;
    stroke-width: 3;
    fill: currentColor;
    background: linear-gradient(135deg, var(--cin-tone) 0%, var(--cin-tone-deep) 100%);
}

.cin-tile__list .cin-tile__more {
    padding-left: 27px;
    font-weight: 500;
    color: var(--cin-ink-3);
}

/* A small drawing of what the tile counts: for the eye only, in the tone of its tile */
.cin-art {
    /* a phone keeps the words and leaves the drawing out */
    display: none;
    max-width: 236px;
    height: auto;
    overflow: visible;
}

.cin-art__card {
    fill: #ffffff;
    stroke: rgba(30, 58, 138, 0.16);
    stroke-width: 1;
}

.cin-art__card--tone {
    stroke: var(--cin-tone);
    stroke-width: 2.2;
}

.cin-art__in {
    fill: var(--cin-tone);
    fill-opacity: 0.1;
}

.cin-art__ink {
    fill: var(--cin-tone);
}

.cin-art__soft {
    fill: var(--cin-tone);
    fill-opacity: 0.42;
}

.cin-art__faint {
    fill: rgba(30, 58, 138, 0.16);
}

.cin-art__white {
    fill: #ffffff;
}

.cin-art__stroke,
.cin-art__rail,
.cin-art__okmark {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cin-art__stroke {
    stroke: var(--cin-tone-deep);
    stroke-width: 2.4;
}

.cin-art__rail {
    stroke: var(--cin-tone);
    stroke-opacity: 0.35;
    stroke-width: 3;
}

.cin-art__knob {
    fill: #ffffff;
    stroke: rgba(30, 58, 138, 0.3);
    stroke-width: 1.6;
}

.cin-art__right {
    fill: rgba(5, 150, 105, 0.1);
    stroke: rgba(5, 150, 105, 0.5);
    stroke-width: 1.2;
}

.cin-art__ok {
    fill: var(--cin-emerald);
}

.cin-art__okmark {
    stroke: #ffffff;
    stroke-width: 2;
}

.cin-art__okline {
    fill: var(--cin-emerald-deep);
    fill-opacity: 0.55;
}

/* a few languages in their own words, then the button of a course card: the flags, the count, the dialog */
.cin-tile__langs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cin-tile__names {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cin-tile__names li {
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(30, 58, 138, 0.06);
    border: 1px solid var(--cin-line);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', 'Nirmala UI', 'Leelawadee UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cin-ink-2);
}

.cin-tile__langs .course-langs {
    width: 100%;
    margin: 0;
}

/* the label of the button is never cut: in a narrow tile the button shows three flags */
.cin-tile__langs .course-langs__label {
    flex: 0 0 auto;
    overflow: visible;
}

/* --------------------------------------------------------------------------
   The lessons at a glance: the bar and its legend
   -------------------------------------------------------------------------- */
.cin-glance {
    margin: 20px 0 0;
    padding: 24px 18px;
    border-radius: 22px;
    background: var(--cin-glass);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: var(--cin-shadow), 0 0 0 1px var(--cin-line);
}

.cin .cin-glance__title {
    margin: 0 0 16px;
    font-family: var(--cin-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--cin-ink);
    text-wrap: balance;
}

.cin-glance__bar {
    display: block;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(30, 58, 138, 0.06);
}

.cin-fill--picture { fill: var(--cin-blue); }
.cin-fill--video { fill: var(--cin-violet); }
.cin-fill--guide { fill: var(--cin-emerald); }
.cin-fill--table { fill: var(--cin-cyan); }
.cin-fill--check { fill: var(--cin-orange); }
.cin-fill--text { fill: var(--cin-slate); }

.cin-glance__legend {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px 24px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.cin-glance__legend li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cin-ink-2);
}

.cin-glance__legend b {
    font-family: var(--cin-display);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--cin-ink);
}

.cin-dot {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.cin-dot--picture { background: var(--cin-blue); }
.cin-dot--video { background: var(--cin-violet); }
.cin-dot--guide { background: var(--cin-emerald); }
.cin-dot--table { background: var(--cin-cyan); }
.cin-dot--check { background: var(--cin-orange); }
.cin-dot--text { background: var(--cin-slate); }

.cin .cin-glance__note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--cin-line);
    font-family: var(--cin-body);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--cin-ink-3);
}

.cin-glance__note svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--cin-emerald);
}

/* --------------------------------------------------------------------------
   The block by its own width
   -------------------------------------------------------------------------- */
@container cin (min-width: 420px) {
    .cin-glance__legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container cin (min-width: 620px) {
    .cin-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    /* three tiles: the third takes the row under the first two */
    .cin-tiles--3 > .cin-tile:last-child {
        grid-column: 1 / -1;
    }

    /* from here a tile stands: the mark, the figure, the words, and its foot on the lower edge */
    .cin-tile {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 26px 26px;
        border-radius: calc(26px * var(--cin-scale));
    }

    .cin-tile__icon {
        margin: 0 0 18px;
    }

    .cin-tile__num {
        margin: 0 0 6px;
        font-size: 44px;
    }

    .cin .cin-tile__text {
        margin: 10px 0 0;
        padding-bottom: 20px;
    }

    .cin-tile__foot {
        margin: auto 0 0;
    }

    .cin-art {
        display: block;
    }

    .cin-glance {
        margin-top: 24px;
        padding: 28px;
        border-radius: calc(26px * var(--cin-scale));
    }

    .cin-glance__legend {
        display: flex;
        flex-wrap: wrap;
    }
}

@container cin (min-width: 900px) {
    .cin-tiles--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cin-tiles--3 > .cin-tile:last-child {
        grid-column: auto;
    }
}

@container cin (min-width: 1040px) {
    .cin-tiles--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cin-tiles--4 .cin-tile {
        padding: 28px 22px 24px;
    }
}

/* four tiles on a row are narrow: the button of the languages keeps three flags and closer parts */
@container cin (min-width: 1040px) and (max-width: 1239px) {
    .cin-tiles--4 .cin-tile__langs .course-langs {
        gap: 8px;
    }

    .cin-tiles--4 .cin-tile__langs .course-langs__flag:nth-child(n + 4) {
        display: none;
    }
}

@media (hover: hover) {
    .cin-tile:hover {
        transform: translateY(-3px);
        box-shadow: var(--cin-shadow-hover), 0 0 0 1px rgba(37, 99, 235, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cin-tile {
        transition: none;
    }

    .cin-tile:hover {
        transform: none;
    }
}
