/*
 * MilanSetu on top of Bootstrap 5.
 *
 * Bootstrap does the layout, the grid, the tables, the forms and the
 * components. This file does two things only:
 *
 *   1. Repaints Bootstrap's own CSS variables in the MilanSetu palette, so
 *      every stock component comes out terracotta-on-cream without a utility
 *      class being overridden at the call site.
 *   2. Holds the handful of pieces Bootstrap genuinely has no component for —
 *      the dashboard sparkline, the reports bars and funnel, and the landing
 *      page's phone, counters, steps and reveal animation.
 *
 * Anything that can be said in Bootstrap classes is said in the Blade file,
 * not here.
 */

/* ------------------------------------------------------------- the face */

/*
 * Playfair Display, Latin subset, served from this host for the same reason
 * Bootstrap is: a marketing page should not go plain-looking because someone
 * else's CDN is having a bad morning. One variable file covers 400 to 700.
 *
 * It is the only display face on the site. The hero and the section headings
 * have to agree, so changing one means changing the other — two display serifs
 * on a page read as a mistake rather than as a pairing.
 */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/vendor/fonts/playfair-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
                   U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------ the palette */

/*
 * Terracotta on cream — the MilanSetu app's own colours, restored verbatim
 * from the stylesheets this file replaced, so the site and the phone in
 * somebody's hand are recognisably the same product.
 *
 * Terracotta carries every action and active state. The warm sand is for
 * surfaces that need to sit back from white. Olive means "verified" and
 * nothing else, because that is the one meaning here that is neither an action
 * nor an ornament.
 *
 * Every tint further down this file is written against these variables, so
 * this block is the only place a colour is decided.
 */
:root {
    --ms-ink: #2e2b25;
    --ms-ink-strong: #474238;
    --ms-ink-soft: #645c50;
    --ms-muted: #82796a;
    --ms-cream: #f9f4ed;
    --ms-cream-deep: #eee7db;
    --ms-line: #dcd3c4;

    --ms-accent: #c67139;
    --ms-accent-light: #d98c4f;
    --ms-accent-dark: #a85a2c;

    --ms-sage: #3d472b;
    --ms-sage-mid: #8a8f5e;
    --ms-sage-deep: #6b7444;
    --ms-sage-light: #e1eecc;

    --ms-danger-fg: #b8342b;
    --ms-danger-bg: #fdeceb;

    /* Channel lists, so the tints below can be written against the palette
       rather than against a hex nobody will remember to change. */
    --ms-accent-rgb: 198, 113, 57;
    --ms-ink-rgb: 46, 43, 37;
    --ms-cream-rgb: 249, 244, 237;

    --ms-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Bootstrap's own knobs, turned to the above. */
    --bs-primary: #c67139;
    --bs-primary-rgb: 198, 113, 57;
    --bs-body-color: #2e2b25;
    --bs-body-color-rgb: 46, 43, 37;
    --bs-body-bg: #f9f4ed;
    --bs-body-bg-rgb: 249, 244, 237;
    --bs-secondary-color: rgba(46, 43, 37, .66);
    --bs-border-color: #dcd3c4;
    --bs-link-color: #a85a2c;
    --bs-link-color-rgb: 168, 90, 44;
    --bs-link-hover-color: #8c4820;
    --bs-emphasis-color: #2e2b25;
    --bs-heading-color: #2e2b25;
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: 1rem;
    --bs-border-radius-xl: 1.25rem;
}

/*
 * Buttons and the focus ring. Bootstrap compiles .btn-primary from static
 * values rather than from --bs-primary, so the one component that must be
 * terracotta is the one that has to be told.
 */
.btn-primary {
    --bs-btn-bg: var(--ms-accent);
    --bs-btn-border-color: var(--ms-accent);
    --bs-btn-hover-bg: var(--ms-accent-dark);
    --bs-btn-hover-border-color: var(--ms-accent-dark);
    --bs-btn-active-bg: var(--ms-accent-dark);
    --bs-btn-active-border-color: var(--ms-accent-dark);
    --bs-btn-disabled-bg: var(--ms-accent);
    --bs-btn-disabled-border-color: var(--ms-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--ms-accent-dark);
    --bs-btn-border-color: var(--ms-accent);
    --bs-btn-hover-bg: var(--ms-accent);
    --bs-btn-hover-border-color: var(--ms-accent);
    --bs-btn-active-bg: var(--ms-accent-dark);
    --bs-btn-active-border-color: var(--ms-accent-dark);
}

.btn-link {
    --bs-btn-color: var(--ms-accent-dark);
    --bs-btn-hover-color: var(--ms-accent-dark);
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
a:focus-visible {
    border-color: var(--ms-accent-light);
    box-shadow: 0 0 0 .2rem rgba(var(--ms-accent-rgb), .25);
    outline: none;
}

.form-check-input:checked {
    background-color: var(--ms-accent);
    border-color: var(--ms-accent);
}

.text-accent { color: var(--ms-accent) !important; }
.bg-cream { background-color: var(--ms-cream) !important; }
.bg-cream-deep { background-color: var(--ms-cream-deep) !important; }

.card {
    --bs-card-bg: #ffffff;
    --bs-card-border-color: var(--ms-line);
    --bs-card-border-radius: 1rem;
    --bs-card-inner-border-radius: calc(1rem - 1px);
}

/*
 * Tables.
 *
 * Bootstrap draws a border under every cell including the last row's, which
 * against the bottom of a card leaves a line sitting a pixel above the card's
 * own rounded edge and reads as broken. The rules below put the separators
 * back under the rows that actually need them and take them off the last one.
 *
 * The header gets a sand band rather than plain white: a long list of rows on
 * a single flat colour gives the eye nothing to hold on to, which is the other
 * half of the same complaint.
 */
.table {
    --bs-table-color: var(--ms-ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--ms-line);
    --bs-table-hover-bg: rgba(var(--ms-accent-rgb), .07);
    --bs-table-striped-bg: rgba(var(--ms-ink-rgb), .022);
    margin-bottom: 0;
}

.table > thead {
    background: var(--ms-cream-deep);
}

.table > thead th {
    padding: .7rem .9rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ms-ink-soft);
    white-space: nowrap;
    border-bottom: 1px solid var(--ms-line);
}

.table > tbody > tr > * {
    padding: .85rem .9rem;
    border-bottom: 1px solid var(--ms-line);
    vertical-align: middle;
}

/* Nothing under the final row — the card's own edge closes the table. */
.table > tbody > tr:last-child > * { border-bottom: 0; }

/* Zebra striping, kept faint enough that the hover state still reads over it. */
.table > tbody > tr:nth-of-type(even):not(:hover) > * {
    background-color: var(--bs-table-striped-bg);
}

/* A table filling a card should be clipped by the card's corners, not overlap
   them — `overflow: hidden` on the wrapper is what actually does the cutting. */
.card > .table-responsive {
    border-radius: inherit;
    overflow: hidden;
}

/* A card whose table sits directly under a header keeps square top corners. */
.card > .card-body + .table-responsive { border-start-start-radius: 0; border-start-end-radius: 0; }

/* A row for something switched off: still legible, plainly inactive. */
.row-muted > * { opacity: .55; }

/* ------------------------------------------------------------- the brand */

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: linear-gradient(135deg, var(--ms-accent), var(--ms-accent-dark));
    color: #fff;
    font-family: var(--ms-serif);
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(var(--ms-accent-rgb), .35);
}

.brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-name .accent { color: var(--ms-accent); }

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    display: inline-grid;
    place-items: center;
    background: var(--ms-cream-deep);
    color: var(--ms-ink-soft);
    font-weight: 600;
    flex: 0 0 auto;
}

/* ==================================================== the control panel */

/*
 * AdminLTE 4 owns the panel's chrome. This block only tells it which colours
 * to use, through the variables it already exposes, so there is no wrestling
 * with its layout rules and nothing to re-fix when it is upgraded.
 *
 * app.css is loaded after adminlte.min.css precisely so these land last.
 */

/* The sidebar. AdminLTE renders it under `data-bs-theme="dark"`, so the
   Bootstrap variables below are what its own text and borders read from —
   setting only the --lte-* ones would leave the theme half-applied. */
.app-sidebar {
    --lte-sidebar-color: rgba(255, 255, 255, .78);
    --lte-sidebar-hover-color: #fff;
    --lte-sidebar-active-color: #fff;
    --lte-sidebar-hover-bg: rgba(255, 255, 255, .09);
    --lte-sidebar-menu-active-bg: var(--ms-accent);
    --lte-sidebar-menu-active-color: #fff;
    --lte-sidebar-header-color: rgba(255, 255, 255, .45);
    --lte-sidebar-submenu-bg: rgba(0, 0, 0, .16);
    --lte-sidebar-submenu-color: rgba(255, 255, 255, .72);
    --lte-sidebar-submenu-hover-bg: rgba(255, 255, 255, .09);
    --lte-sidebar-submenu-hover-color: #fff;
    --lte-sidebar-submenu-active-bg: var(--ms-accent);
    --lte-sidebar-submenu-active-color: #fff;

    --bs-body-bg: var(--ms-ink);
    --bs-body-color: rgba(255, 255, 255, .78);
    --bs-border-color: rgba(255, 255, 255, .1);
    --bs-emphasis-color: #fff;
    --bs-secondary-color: rgba(255, 255, 255, .5);

    background-color: var(--ms-ink);
}

/* The active page, given the same filled terracotta the landing page uses for
   a primary action — AdminLTE default is a flat grey that reads as disabled. */
.app-sidebar .sidebar-menu .nav-link.active {
    background: linear-gradient(105deg, var(--ms-accent), var(--ms-accent-dark));
    box-shadow: 0 4px 12px rgba(var(--ms-accent-rgb), .35);
}

.app-sidebar .nav-icon { opacity: .8; margin-right: .55rem; }
.app-sidebar .nav-link.active .nav-icon { opacity: 1; }

.app-sidebar .nav-header {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sidebar-brand {
    background-color: rgba(0, 0, 0, .2);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand .brand-link { padding: .9rem 1rem; color: #fff; }
.sidebar-brand .brand-name { font-size: 1.05rem; color: #fff; }
.sidebar-brand .brand-name .accent { color: var(--ms-accent-light); }
.sidebar-brand small { font-size: .7rem; }

/*
 * The header, in the brand terracotta rather than AdminLTE's white — it gives
 * the panel a top edge, and stops the white header and the white content cards
 * reading as one undifferentiated sheet.
 *
 * Everything in it therefore has to be repainted for a dark ground: AdminLTE
 * and Bootstrap both assume this bar is light.
 */
.app-header {
    background: linear-gradient(105deg, var(--ms-accent), var(--ms-accent-dark));
    border-bottom: 0;
    box-shadow: 0 2px 10px rgba(var(--ms-ink-rgb), .12);
}

/*
 * Everything in the bar on one centre line. `.navbar-text` ships with vertical
 * padding meant to match a `.nav-link`'s, which lands it a couple of pixels low
 * beside an icon button — so the padding comes off and the row centres instead.
 */
.app-header .navbar-nav { align-items: center; }
.app-header .navbar-text { padding-top: 0; padding-bottom: 0; line-height: 1; }

.app-header .nav-link {
    display: flex;
    align-items: center;
}

.app-header .nav-link,
.app-header .navbar-text { color: rgba(255, 255, 255, .88); }

.app-header .nav-link:hover,
.app-header .nav-link:focus { color: #fff; }

.app-header .text-body-secondary { color: rgba(255, 255, 255, .72) !important; }
.app-header .avatar { background: rgba(255, 255, 255, .2); color: #fff; }

/* The account trigger sits on the terracotta, so it is white there and only
   reverts to ink inside the dropdown, which is a white panel. */
.app-header .user-menu > .nav-link,
.app-header .user-menu > .nav-link:hover { color: #fff; }

/* The page ground, in the app's own cream rather than the stock grey.
   `bg-body-tertiary` on <body> is what AdminLTE paints with. */
body.bg-body-tertiary { background-color: var(--ms-cream) !important; }
.app-main { background-color: var(--ms-cream); }

.app-footer {
    background-color: #fff;
    border-top: 1px solid var(--ms-line);
    color: var(--ms-muted);
    font-size: .85rem;
}

/*
 * AdminLTE writes Bootstrap's blue straight into its card and callout variants
 * instead of reading --bs-primary, so `.card-primary` comes out #0d6efd however
 * the Bootstrap variables are set. Re-pointing the two it derives everything
 * else from is enough to bring the whole variant across.
 */
.card-primary,
.text-bg-primary {
    --lte-card-variant-bg: var(--ms-accent);
    --lte-card-variant-bg-rgb: var(--ms-accent-rgb);
}

/* ---------------------------------------------------- the account menu */

/* The menu is wider than the name it drops from, so it hangs off the right
   edge rather than pushing the header around. */
.user-menu > .dropdown-menu { overflow: hidden; }

/*
 * AdminLTE styles `.user-header` for a 90px <img>. Staff without a photo get a
 * span carrying their initial instead, so both need the same size — hence the
 * modifier rather than a rule that only matches one of them.
 */
/*
 * The panel's ink, not its terracotta. The header bar the menu drops from is
 * already terracotta, and repeating it here made the two read as one block
 * with a seam through it. Ink also ties the menu to the sidebar, which is the
 * other piece of chrome that is not content.
 */
.user-menu > .dropdown-menu > li.user-header {
    min-height: auto;
    padding: 1.5rem 1rem;
    background: linear-gradient(105deg, var(--ms-ink-strong), var(--ms-ink));
    color: #fff;
}

.user-menu > .dropdown-menu > li.user-header p { color: #fff; font-size: 1rem; margin-top: .75rem; }
.user-menu > .dropdown-menu > li.user-header small { opacity: .8; font-size: .8rem; }

.avatar-lg {
    width: 5rem;
    height: 5rem;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.user-menu > .dropdown-menu > li.user-footer { padding: .85rem; background: #fff; }

/*
 * Sign out reads as a leaving action, so it is the palette's red rather than a
 * grey outline that says nothing — but quiet until hovered, because it sits in
 * a menu somebody opens to read their own name, not only to leave.
 *
 * The project's own red, not Bootstrap's #dc3545, which is off-palette.
 */
.btn-signout {
    --bs-btn-color: var(--ms-danger-fg);
    --bs-btn-bg: var(--ms-danger-bg);
    --bs-btn-border-color: rgba(184, 52, 43, .35);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ms-danger-fg);
    --bs-btn-hover-border-color: var(--ms-danger-fg);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #96291f;
    --bs-btn-active-border-color: #96291f;
    --bs-btn-focus-shadow-rgb: 184, 52, 43;
    font-weight: 600;
}

/* The trigger is a link, so it must not take on link colour or underline. */
.user-menu > .nav-link,
.user-menu > .nav-link:hover { color: var(--ms-ink); text-decoration: none; }

/* ------------------------------------------------- the dashboard cards */

/*
 * AdminLTE's info-box sizes its icon block for a 1.875rem icon font. These
 * carry an SVG instead, so the block needs to centre one rather than a glyph.
 *
 * The border stays 1px whatever the card is saying. It used to thicken to 2px
 * when something was waiting, which pushed that card 1px wider and 1px taller
 * than the two beside it and broke the row's alignment — so urgency is a ring
 * drawn with box-shadow now, which paints outside the box and costs no layout.
 */
.info-box {
    background: #fff;
    border: 1px solid var(--ms-line);
    padding: .75rem;
    gap: .85rem;
}

.info-box.is-urgent {
    border-color: var(--tone);
    box-shadow: 0 0 0 2px rgba(var(--tone-rgb), .28);
}

.info-box-icon {
    width: 3.5rem;
    min-height: 3.5rem;
    border-radius: .75rem;
    flex: 0 0 3.5rem;
}

/*
 * One tone per card, so four figures side by side are told apart by colour
 * rather than only by their labels. Each tone drives the icon tile and the
 * watermark together, so a card is one colour and not two.
 *
 * A card with work waiting fills its tile; a card that is merely reporting
 * tints it. That is the same calm/urgent distinction the copy makes.
 */
.tone-accent { --tone: var(--ms-accent);    --tone-rgb: var(--ms-accent-rgb); }
.tone-danger { --tone: var(--ms-danger-fg); --tone-rgb: 184, 52, 43; }
.tone-sage   { --tone: var(--ms-sage-deep); --tone-rgb: 107, 116, 68; }
.tone-ink    { --tone: var(--ms-ink-strong);--tone-rgb: 71, 66, 56; }

.info-box .info-box-icon {
    background: rgba(var(--tone-rgb), .13);
    color: var(--tone);
}

.info-box.is-urgent .info-box-icon {
    background: var(--tone);
    color: #fff;
}

/* AdminLTE sets line-height 1.8 here, which is loose once the label wraps. */
.info-box-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.4;
}

/* The note under the figure, clamped for the same reason the label is. */
.info-box-content > small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

/*
 * AdminLTE truncates the label to one line with an ellipsis, which loses the
 * end of "Biodatas awaiting a decision". It wraps to two here instead, and is
 * clamped at two so a longer label can never push one card taller than the
 * three beside it.
 *
 * The min-height reserves both lines whether the label uses them or not, so
 * the four figures underneath stay on one baseline across the row.
 *
 * Specificity has to match AdminLTE's own `.info-box .info-box-text`; app.css
 * loading later is what settles the tie.
 */
.info-box .info-box-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: .97rem;
    font-weight: 700;
    line-height: 1.3;
    min-height: 2.6em;
    color: var(--ms-ink);
    text-transform: none;
    letter-spacing: -.005em;
}

.info-box-number {
    font-family: var(--ms-serif);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}

/* ------------------------------------------------------ the greeting card */

.greeting-card { overflow: hidden; }

.greeting-title {
    font-family: var(--ms-serif);
    font-size: clamp(1.65rem, 3.2vw, 2.4rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.015em;
}

/*
 * The watermark rides the top-right corner here rather than the bottom-right,
 * because the bottom of this card is the stats strip and a shape behind
 * figures is harder to read past than one behind a greeting.
 */
.greeting-card .card-watermark {
    top: -3rem;
    right: -2rem;
    bottom: auto;
    opacity: .05;
}

/*
 * The hairlines between the figures are a 1px grid gap letting the ground
 * through, not borders on the cells. Borders would need a different
 * :nth-child rule at every breakpoint; this keeps working however the strip
 * folds.
 */
.greeting-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--ms-line);
    border-top: 1px solid var(--ms-line);
}

@media (min-width: 992px) {
    .greeting-stats { grid-template-columns: repeat(4, 1fr); }
}

.greeting-stat {
    background: var(--ms-cream-deep);
    padding: 1.1rem 1.35rem;
}

.greeting-stat-value {
    display: block;
    font-family: var(--ms-serif);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--ms-ink);
}

.greeting-stat-value small { font-size: .9rem; font-weight: 400; }

.greeting-stat-label {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    color: var(--ms-ink-soft);
}

/* The six shortcuts under "Where to go". They are links, so they say so on
   hover rather than sitting there looking like the cards above them. */
.nav-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }

.nav-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--ms-accent-rgb), .5);
    box-shadow: 0 10px 24px rgba(var(--ms-ink-rgb), .1);
}

.nav-card .icon-tile { width: 2.6rem; height: 2.6rem; border-radius: .7rem; }

/*
 * The watermark: the card's own icon again, oversized and nearly transparent,
 * bleeding off the bottom-right corner. AdminLTE's small-box does this with a
 * positioned icon font; the same idea, with the SVG already on the card.
 *
 * It repeats the icon from the tile rather than naming a second one, so the
 * two can never drift apart.
 */
.has-watermark { position: relative; overflow: hidden; }

.card-watermark {
    position: absolute;
    right: -1.75rem;
    bottom: -2.5rem;
    line-height: 0;
    color: var(--tone, var(--ms-accent));
    opacity: .08;
    pointer-events: none;
    z-index: 0;
}

/* The card's real content has to sit over the watermark it is printed on. */
.has-watermark > *:not(.card-watermark) { position: relative; z-index: 1; }

@media (prefers-reduced-transparency: reduce) {
    .card-watermark { display: none; }
}

/* The two widths a panel page comes in: a full-width table, or a form nobody
   should have to read across a 27-inch monitor. */
.page-wide { max-width: 96rem; }
.page-narrow { max-width: 48rem; }
/* --------------------------------------------------- dashboard sparkline */

/*
 * Fourteen columns drawn against the busiest day. A flex row of percentage
 * heights, because a chart this small needs no library and no canvas.
 */
.spark {
    display: flex;
    align-items: flex-end;
    gap: .35rem;
    height: 7.5rem;
}

.spark-col {
    flex: 1 1 0;
    display: flex;
    align-items: flex-end;
    height: 100%;
    background: var(--ms-cream-deep);
    border-radius: .3rem;
    overflow: hidden;
}

.spark-bar {
    width: 100%;
    min-height: 2px;
    background: linear-gradient(180deg, var(--ms-accent-light), var(--ms-accent));
    border-radius: .3rem;
}

.spark-axis {
    display: flex;
    gap: .35rem;
    margin-top: .4rem;
    font-size: .7rem;
    color: var(--ms-muted);
}

.spark-axis > span {
    flex: 1 1 0;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

/* ------------------------------------------ reports bars and the funnel */

.bar {
    display: block;
    height: .6rem;
    min-width: 6rem;
    border-radius: 999px;
    background: var(--ms-cream-deep);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ms-accent-light), var(--ms-accent));
}

/* A stage applicants stop at rather than move on from. */
.funnel-stalled .bar-fill {
    background: linear-gradient(105deg, var(--ms-accent-light), var(--ms-danger-fg));
}

/* ========================================================= landing page */

/* ------------------------------------------------------------ typography */

.serif { font-family: var(--ms-serif); }

.display-hero {
    font-family: var(--ms-serif);
    font-size: clamp(2.3rem, 5.2vw, 3.9rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.015em;
}

.display-section {
    font-family: var(--ms-serif);
    font-size: clamp(1.85rem, 3.3vw, 2.6rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.012em;
}

.ink-accent { color: var(--ms-accent); }

/*
 * The accent phrase in the hero, underscored by hand. A background gradient
 * rather than text-decoration, so the stroke sits clear of the descenders
 * instead of slicing through them.
 */
.ink-accent-underline {
    color: var(--ms-accent);
    background-image: linear-gradient(90deg, rgba(var(--ms-accent-rgb), .32), rgba(var(--ms-accent-rgb), .32));
    background-repeat: no-repeat;
    background-size: 100% .18em;
    background-position: 0 88%;
}

/* The eyebrow, as a pill on a tint rather than loose tracked-out capitals. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: rgba(var(--ms-accent-rgb), .1);
    color: var(--ms-accent-dark);
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: var(--ms-accent);
}

.band-ink .eyebrow {
    background: rgba(var(--ms-cream-rgb), .14);
    color: var(--ms-cream);
}

/* ---------------------------------------------------------- the header */

.landing .navbar {
    background: rgba(var(--ms-cream-rgb), .82);
    backdrop-filter: blur(12px);
    transition: box-shadow .25s ease, background .25s ease;
}

.landing .navbar.is-stuck {
    background: rgba(var(--ms-cream-rgb), .96);
    box-shadow: 0 1px 0 var(--ms-line), 0 10px 30px rgba(var(--ms-ink-rgb), .07);
}

/* An underline that grows from the middle, only on the desktop bar. */
@media (min-width: 992px) {
    .landing .navbar .nav-link {
        position: relative;
        color: var(--ms-ink-soft);
    }

    .landing .navbar .nav-link::after {
        content: '';
        position: absolute;
        left: 50%;
        right: 50%;
        bottom: .25rem;
        height: 2px;
        border-radius: 2px;
        background: var(--ms-accent);
        transition: left .2s ease, right .2s ease;
    }

    .landing .navbar .nav-link:hover { color: var(--ms-ink); }
    .landing .navbar .nav-link:hover::after { left: .5rem; right: .5rem; }
}

/* ------------------------------------------------------------ the hero */

/*
 * The hero's background, after the chain-app-dev template's treatment: a soft
 * organic blob sitting behind the artwork, a wash across the copy, and a
 * hairline grid for texture.
 *
 * The template ships its blob as a flat PNG inside its hero decoration. Doing
 * it in CSS instead costs no request, scales to any viewport, and — the reason
 * that actually matters — takes its colour from the palette above, so it could
 * never drift from the brand the way a baked-in image does.
 *
 * All three are decorative and all three are aria-hidden, so they sit outside
 * the document flow entirely.
 */
.hero-glow {
    position: absolute;
    inset: -25% -10% auto -10%;
    height: 85vh;
    background:
        radial-gradient(closest-side, rgba(var(--ms-accent-rgb), .18), transparent 72%) 18% 34% / 60% 95% no-repeat,
        radial-gradient(closest-side, rgba(138, 143, 94, .15), transparent 72%) 88% 8% / 48% 75% no-repeat;
    pointer-events: none;
}

/*
 * The blob behind the phone. The four-value border-radius pairs are what make
 * it read as hand-drawn rather than as an ellipse — each corner gets its own
 * horizontal and vertical radius, and the asymmetry is the whole effect.
 */
.hero-blob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(30rem, 92%);
    aspect-ratio: 1 / 1.05;
    transform: translate(-50%, -50%) rotate(-8deg);
    border-radius: 47% 53% 38% 62% / 43% 36% 64% 57%;
    background: linear-gradient(105deg, var(--ms-cream-deep), rgba(var(--ms-accent-rgb), .13));
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(var(--ms-ink-rgb), .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--ms-ink-rgb), .045) 1px, transparent 1px);
    background-size: 64px 64px;
    /* Fades out before it reaches the copy, so the grid reads as texture. */
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
    pointer-events: none;
}

/*
 * Section decorations, pinned to the edges and bleeding off them — the
 * template's `.services:before` / `:after` idea, in soft terracotta rather
 * than as two more PNGs to download.
 *
 * `overflow: hidden` on the section is what keeps them from widening the page,
 * so `.section-dec` is only ever used on a section that has it.
 */
.section-dec { position: relative; overflow: hidden; }

.section-dec::before,
.section-dec::after {
    content: '';
    position: absolute;
    border-radius: 46% 54% 60% 40% / 52% 44% 56% 48%;
    background: rgba(var(--ms-accent-rgb), .07);
    pointer-events: none;
    z-index: 0;
}

.section-dec::before {
    top: -6rem;
    right: -8rem;
    width: 26rem;
    height: 22rem;
    transform: rotate(14deg);
}

.section-dec::after {
    bottom: -10rem;
    left: -9rem;
    width: 22rem;
    height: 20rem;
    background: rgba(138, 143, 94, .09);
    transform: rotate(-10deg);
}

/* The content has to out-rank the decoration it is sitting on. */
.section-dec > * { position: relative; z-index: 1; }

@media (max-width: 767.98px) {
    /* At this width the blobs crowd the copy rather than framing it. */
    .section-dec::before,
    .section-dec::after { display: none; }
}

/* The line of reassurances under the hero buttons. */
.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.4rem;
    font-size: .85rem;
    color: var(--ms-ink-soft);
}

.trust-row li {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.trust-row svg { color: var(--ms-sage); flex: 0 0 auto; }

/* The phone drifts; the chip rides with it. Both stand still when asked to. */
.phone-float { animation: float 7s ease-in-out infinite; }

.phone {
    max-width: 290px;
    width: 100%;
    filter: drop-shadow(0 30px 60px rgba(var(--ms-ink-rgb), .26));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

/*
 * The store buttons. Their own component rather than a .btn, because a .btn
 * carrying two lines of different-sized text is a .btn being misused.
 */
.store-btn {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem 1.2rem;
    border-radius: .85rem;
    background: var(--ms-ink);
    color: var(--ms-cream);
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(var(--ms-ink-rgb), .18);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.store-btn:hover {
    background: #1f1d19;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(var(--ms-ink-rgb), .26);
}

.store-btn small { display: block; font-size: .65rem; opacity: .75; line-height: 1.2; }
.store-btn strong { display: block; font-size: .95rem; line-height: 1.2; font-weight: 600; }
.store-btn-light { background: #fff; color: var(--ms-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.store-btn-light:hover { background: var(--ms-cream); color: var(--ms-ink); }

/* ----------------------------------------------------------- the stats */

.stat-num {
    display: block;
    font-family: var(--ms-serif);
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 600;
    line-height: 1;
    color: var(--ms-accent);
}

/* Hairline rules between the figures, dropped on the wrap to avoid orphans. */
@media (min-width: 992px) {
    .stats-band [class*='col-']:not(:last-child) {
        border-right: 1px solid var(--ms-line);
    }
}

/* -------------------------------------------------------- feature cards */

.feature-card {
    border: 1px solid var(--ms-line);
    border-radius: 1.1rem;
    background: #fff;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--ms-accent-rgb), .45);
    box-shadow: 0 18px 40px rgba(var(--ms-ink-rgb), .10);
}

/* The icon sits on a tinted tile, so a thin 1.7px stroke still has presence. */
.icon-tile {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    background: linear-gradient(135deg, rgba(var(--ms-accent-rgb), .16), rgba(var(--ms-accent-rgb), .07));
    color: var(--ms-accent-dark);
}

/* ----------------------------------------------------------- the steps */

.step-num {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ms-accent), var(--ms-accent-dark));
    box-shadow: 0 0 0 4px var(--ms-cream-deep);
    color: #fff;
    font-family: var(--ms-serif);
    font-size: 1.2rem;
    font-weight: 600;
    flex: 0 0 auto;
    box-shadow: 0 6px 16px rgba(var(--ms-accent-rgb), .32);
    position: relative;
    z-index: 1;
}

/*
 * The illustration above each step. A fixed max-width and a 200:140 viewBox,
 * so all four are the same height and the badges below them line up.
 */
.step-art {
    display: block;
    width: 100%;
    max-width: var(--ms-step-art-w);
    height: auto;
    margin: 0 auto;
}

/* The badge laps onto the bottom of its illustration rather than sitting in a
   gap below it, which reads as one object instead of two. */
.step-item .step-num { margin-top: -1.9rem; }

/*
 * The rule that joins one step to the next, drawn from the badge rather than
 * as a full-width line behind everything — so it stops at the last step
 * instead of running off the edge, and disappears the moment the steps stack.
 *
 * Its offset is the art's own height (width × 140/200) less the badge's
 * overlap, plus half the badge — derived from the two variables above rather
 * than measured off a screenshot, so changing the art's width keeps it aligned.
 */
:root { --ms-step-art-w: 13rem; }

@media (min-width: 1200px) {
    .step-item { position: relative; }

    .step-item:not(:last-child)::after {
        content: '';
        position: absolute;
        top: calc(var(--ms-step-art-w) * 0.7 - 1.9rem + 1.5rem);
        left: calc(50% + 1.75rem);
        width: calc(100% - 3.5rem);
        border-top: 2px dashed rgba(var(--ms-accent-rgb), .35);
    }
}

/* --------------------------------------------------------- the sections */

.section-warm { background: var(--ms-cream-deep); }

/* A short centred rule to close a section heading. */
.rule-accent {
    width: 3.5rem;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(105deg, var(--ms-accent-light), var(--ms-accent-dark));
}

.band-ink {
    background:
        radial-gradient(closest-side, rgba(var(--ms-accent-rgb), .28), transparent 70%) 50% 0% / 70% 140% no-repeat,
        var(--ms-ink);
    color: var(--ms-cream);
}

.band-ink a:not(.store-btn) { color: var(--ms-cream); }
.band-ink .display-section { color: var(--ms-cream); }

/* The contact card's label column. */
.contact-label {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ms-muted);
}

/*
 * Sections fade up as they arrive. main.js adds .is-visible, so with
 * scripting off nothing may start invisible — hence the .js guard rather
 * than a plain opacity:0.
 */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .phone-float { animation: none; }
    .feature-card:hover, .store-btn:hover { transform: none; }
}

/* Placeholders that must be replaced before the page is published. Visible on
   purpose: a dead store link should be obvious in the browser, not in a diff. */
[data-placeholder="true"] { outline: 1px dashed rgba(var(--ms-accent-rgb), .55); outline-offset: 3px; }

/* ---------------------------------------------------- legal documents */

/*
 * Rendered in the app's WebView with scripting off, so everything here is
 * plain CSS over Bootstrap's typography and nothing depends on JavaScript.
 */
.doc { max-width: 46rem; }
.doc h2 { font-family: var(--ms-serif); font-size: 1.3rem; margin-top: 2rem; margin-bottom: .6rem; }
.doc h3 { font-size: 1.05rem; margin-top: 1.4rem; }
.doc p, .doc li { line-height: 1.7; }
.doc ul, .doc ol { padding-left: 1.2rem; }
.doc li { margin-bottom: .4rem; }
