/* ===== Shared CSS — manicode.com ===== */

/* --- Font Face ---
 * Inter, self-hosted (same latin variable file as manicode.ai). The variable
 * font covers weights 100–900. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-latin-variable.woff2") format("woff2");
}

/* --- Design Tokens ---
 * Copied verbatim from the Manicode brand guidelines (manicode.ai/brand).
 * Brand = Rose · Neutrals = Zinc · Type = Inter · Mono = system stack */
:root {
    color-scheme: dark;

    /* Brand: Rose */
    --color-brand: #be123c;        /* rose-700 */
    --color-brand-hover: #9f1239;  /* rose-800 */
    --color-brand-active: #881337; /* rose-900 */

    /* Backgrounds: Zinc */
    --color-canvas: #09090b;   /* zinc-950 */
    --color-surface: #18181b;  /* zinc-900 */
    --color-elevated: #27272a; /* zinc-800 */
    --color-raised: #3f3f46;   /* zinc-700 */

    /* Text: Zinc */
    --color-content: #fafafa; /* zinc-50  */
    --color-dim: #d4d4d8;     /* zinc-300 */
    --color-subtle: #a1a1aa;  /* zinc-400 */
    --color-muted: #71717a;   /* zinc-500 */

    /* Borders: Zinc */
    --color-divide: #27272a; /* zinc-800 */
    --color-edge: #52525b;   /* zinc-600 */

    /* Status */
    --color-green-mid: #34d399;    /* emerald-400 */
    --color-green-strong: #10b981; /* emerald-500 */
    --color-green-deep: #047857;   /* emerald-700 */
    --color-green-subtle: #022c22; /* emerald-950 */
    --color-red-mid: #f87171;      /* red-400   */
    --color-red-strong: #f43f5e;   /* rose-500  */
    --color-red-deep: #9f1239;     /* rose-800  */
    --color-red-subtle: #4c0519;   /* rose-950  */

    /* Links */
    --color-link: #60a5fa; /* blue-400 */

    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    /* The signature Rose "spotlight" glow, from the top center. */
    --glow-brand: radial-gradient(60% 45% at 50% -8%, rgb(190 18 60 / 0.18), transparent 70%);

    /* Radii (brand: 6–8px on controls, 12–16px on cards) */
    --radius-control: 8px;
    --radius-card: 16px;

    /* Rose outline and tint for cards, tiles, and secondary buttons. */
    --color-outline-brand: rgb(190 18 60 / 0.55);
    --color-tint-brand: rgb(190 18 60 / 0.12);
    /* Dark card fill: Canvas with a faint Rose wash at the top. */
    --fill-card: linear-gradient(180deg, rgb(190 18 60 / 0.10), rgb(190 18 60 / 0) 55%), var(--color-canvas);
    /* Rose glows to lift a dark section from one side. */
    --glow-left: radial-gradient(45% 70% at 0% 50%, rgb(190 18 60 / 0.14), transparent 70%);
    --glow-right: radial-gradient(45% 70% at 100% 50%, rgb(190 18 60 / 0.14), transparent 70%);
    --glow-center: radial-gradient(50% 90% at 50% 0%, rgb(190 18 60 / 0.16), transparent 70%);
    /* Blue (the brand link color) as a quiet second accent. */
    --color-accent-blue: var(--color-link);
    --glow-blue: radial-gradient(30% 40% at 88% 0%, rgb(96 165 250 / 0.09), transparent 70%);

    /* Page margins, matching manicode.ai: a 1088px content column with
     * 32px gutters. Sections stay full width; their content lines up here. */
    --page-max: 1088px;
    --page-gutter: 32px;
    --page-pad: max(var(--page-gutter), calc((100% - var(--page-max)) / 2));

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* --- Base Reset --- */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

html {
    box-sizing: border-box;
    overflow-x: hidden;
    font-size: clamp(14px, 2vw, 18px);
    background-color: var(--color-canvas);
    margin: 0;
    padding: 0;
}

*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    background-color: var(--color-canvas);
    background-image: var(--glow-brand), var(--glow-blue);
    background-repeat: no-repeat;
    background-size: 100% 48rem;
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    color: var(--color-dim);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--color-content);
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: 2rem; }

p, li {
    color: var(--color-dim);
    font-family: var(--font-sans);
    font-weight: 400;
    font-style: normal;
}

p { font-size: 1.125rem; }

ul { list-style-type: none; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrapper { padding: 0; }

.bold-text { font-weight: 600; color: var(--color-content); }

/* Rose accent for a single word in a headline. */
.accent { color: var(--color-brand); }

/* Eyebrow / caps label (brand "label-caps"). */
.label-caps {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-brand);
}

/* Inline text links inside running copy. */
.class-highlights p a,
.instructor__bio a:not(.catalog-btn) {
    color: var(--color-accent-blue);
    text-decoration: underline;
    text-decoration-color: rgb(96 165 250 / 0.4);
    text-underline-offset: 0.2em;
}

.class-highlights p a:hover,
.instructor__bio a:not(.catalog-btn):hover {
    text-decoration-color: var(--color-accent-blue);
}

/* --- Shared Components --- */
.icon {
    display: inline !important;
    position: relative;
    top: .2rem;
    width: 1rem;
}

.phone {
    position: relative;
    left: .1rem;
}

.primary-contact-bar {
    background-color: var(--color-canvas);
    border-top: 1px solid var(--color-outline-brand);
    color: var(--color-dim);
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-sm) var(--page-pad);
    font-size: 0.875rem;
}

.primary-contact-bar ul {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.primary-contact-bar li {
    font-size: inherit;
}

.primary-contact-bar ul a {
    color: var(--color-dim);
    transition: color 160ms ease;
}

.primary-contact-bar ul a:hover {
    color: var(--color-content);
}

/* Site header, matching manicode.ai: lockup left, page links in the middle,
 * the external link and one Rose action on the right, over a 1px divider. */
.site-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
    height: 4rem;
    margin: 0 var(--page-pad);
    border-bottom: 1px solid var(--color-divide);
    font-size: 0.8rem;
}

.site-header__logo {
    display: block;
    flex-shrink: 0;
}

.site-header__logo img {
    display: block;
    height: 1rem;
    width: auto;
}

.site-header__nav {
    display: flex;
    gap: var(--space-xl);
}

.site-header__nav a {
    color: var(--color-subtle);
    white-space: nowrap;
    transition: color 160ms ease;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
    color: var(--color-content);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-header__external {
    color: var(--color-dim);
    transition: color 160ms ease;
}

.site-header__external::after {
    content: "\2197";
    margin-left: 0.15em;
    color: var(--color-accent-blue);
}

.site-header__external:hover {
    color: var(--color-content);
}

.site-header__cta {
    white-space: nowrap;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-control);
    background-color: var(--color-brand);
    color: var(--color-content);
    font-weight: 600;
    transition: background-color 160ms ease;
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
    background-color: var(--color-brand-hover);
}

.site-header__cta:active {
    background-color: var(--color-brand-active);
}

.class-highlights {
    width: 100%;
    padding: 4.5rem var(--page-pad) 4rem;
    text-align: center;
}

.class-highlights h1 {
    max-width: 18ch;
    margin: 0 auto var(--space-lg);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.class-highlights h1 span {
    color: var(--color-brand);
}

.class-highlights p {
    max-width: 40rem;
    margin: 0 auto var(--space-xl);
    font-size: 1.125rem;
}

.catalog-btn {
    display: inline-block;
    padding: .75rem 1.25rem;
    margin: 0 var(--space-xs) var(--space-md);
    background-color: transparent;
    border: 1px solid var(--color-outline-brand);
    border-radius: var(--radius-control);
    color: var(--color-content);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    font-style: normal;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.catalog-btn:hover,
.catalog-btn:focus-visible {
    background-color: var(--color-tint-brand);
    border-color: var(--color-brand);
}

/* Blue secondary button, for a quiet accent beside the Rose. */
.catalog-btn--blue {
    border-color: rgb(96 165 250 / 0.6);
    color: var(--color-accent-blue);
}

.catalog-btn--blue:hover,
.catalog-btn--blue:focus-visible {
    border-color: var(--color-accent-blue);
    background-color: rgb(96 165 250 / 0.12);
}

/* Blue fill and halo behind a blue button, for a highlighted secondary action. */
.catalog-btn--glow {
    background-color: rgb(96 165 250 / 0.14);
    box-shadow: 0 0 32px rgb(96 165 250 / 0.35);
}

.catalog-btn--glow:hover,
.catalog-btn--glow:focus-visible {
    background-color: rgb(96 165 250 / 0.22);
    box-shadow: 0 0 40px rgb(96 165 250 / 0.5);
}

/* The one Rose action per view. */
.catalog-btn--primary {
    background-color: var(--color-brand);
    border-color: var(--color-brand);
}

.catalog-btn--primary:hover,
.catalog-btn--primary:focus-visible {
    background-color: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
}

.catalog-btn--primary:active {
    background-color: var(--color-brand-active);
    border-color: var(--color-brand-active);
}

.instructors {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    background-color: var(--color-canvas);
}

.instructors .jim > img {
    width: 100%;
    border: 1px solid var(--color-outline-brand);
    border-radius: var(--radius-card);
}

.instructors .instructor {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2xl);
    width: 100%;
    padding: 4rem var(--page-pad) var(--space-xl);
}

.instructor__bio {
    padding: var(--space-md);
}

.instructor__bio .label-caps {
    margin-bottom: var(--space-md);
}

.instructor__bio h2 {
    margin-bottom: var(--space-lg);
}

.instructors .instructor p {
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Footer: a closing band. On the home page it holds an inset panel (after
 * cloudflare.com's closing call to action): dark, Rose-bordered, with a Rose
 * bloom rising from the bottom and a strip of highlights along its base. */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 5rem var(--page-pad) 3rem;
    border-top: 1px solid var(--color-divide);
    background-color: var(--color-canvas);
    background-image: radial-gradient(50% 80% at 50% 110%, rgb(190 18 60 / 0.22), transparent 70%);
    color: var(--color-content);
    text-align: center;
}

.footer h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-md);
}

.footer h2 span {
    color: var(--color-brand);
}

.footer p {
    color: var(--color-subtle);
    font-size: 0.875rem;
}

.footer:has(.footer__panel) {
    padding-top: 4rem;
    border-top: 0;
    background-image: none;
}

.footer__panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    padding: 5rem var(--space-xl) 0;
    border: 1px solid var(--color-outline-brand);
    border-radius: 24px;
    background:
        radial-gradient(55% 85% at 50% 120%, rgb(244 63 94 / 0.75), rgb(190 18 60 / 0.35) 45%, transparent 75%),
        radial-gradient(30% 50% at 100% 0%, rgb(96 165 250 / 0.10), transparent 70%),
        var(--color-canvas);
}

/* Dot texture across the panel */
.footer__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgb(250 250 250 / 0.14) 1px, transparent 1.4px);
    background-size: 6px 6px;
    -webkit-mask-image: linear-gradient(180deg, transparent, black 45%, transparent 85%);
    mask-image: linear-gradient(180deg, transparent, black 45%, transparent 85%);
}

.footer__panel h2 {
    font-size: clamp(2rem, 5vw, 3.25rem);
}

.footer__actions {
    margin: var(--space-xl) 0 4rem;
}

.footer__strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 calc(-1 * var(--space-xl));
    border-top: 1px solid rgb(244 63 94 / 0.45);
    /* Opaque, so the panel dots stop at the strip */
    background: linear-gradient(rgb(190 18 60 / 0.22), rgb(190 18 60 / 0.22)), var(--color-canvas);
}

.footer__strip li {
    padding: var(--space-md);
    color: var(--color-content);
    font-size: 0.9rem;
    font-weight: 500;
}

.footer__strip li + li {
    border-left: 1px solid rgb(244 63 94 / 0.35);
}

.footer__strip li::before {
    content: "\25C6";
    margin-right: var(--space-sm);
    color: var(--color-accent-blue);
    font-size: 0.7em;
    vertical-align: 0.15em;
}

/* Copyright line, the last thing on the page */
.site-legal {
    padding: var(--space-md) var(--page-pad) var(--space-lg);
    color: var(--color-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* --- Dotted Rose field (as on manicode.ai) ---
 * A faint grid of Rose dots behind a section, fading toward the edges. */
.has-dots {
    position: relative;
    isolation: isolate;
}

.has-dots::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(var(--color-red-strong) 1.1px, transparent 1.6px);
    background-size: 20px 20px;
    opacity: 0.3;
    -webkit-mask-image: radial-gradient(55% 55% at 50% 50%, black, transparent 72%);
    mask-image: radial-gradient(55% 55% at 50% 50%, black, transparent 72%);
}

/* --- Accessibility Utilities --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--color-surface);
    color: var(--color-content);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-control);
    z-index: 1000;
    font-family: var(--font-sans);
    font-size: 1rem;
    text-decoration: underline;
}

.skip-link:focus {
    top: var(--space-sm);
}

/* --- Focus-Visible --- */
:focus-visible {
    outline: 2px solid var(--color-content);
    outline-offset: 2px;
}

/* --- Tablet Breakpoint (768–1024px) --- */
@media screen and (max-width: 1024px) {
    .instructors .instructor {
        grid-template-columns: 1fr;
    }

    .site-header__nav {
        gap: var(--space-lg);
    }
}

/* --- Mobile Breakpoint (< 768px) --- */
@media screen and (max-width: 767px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    p { font-size: 1rem; }

    .primary-contact-bar ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }

    .class-highlights {
        padding: var(--space-xl) var(--page-pad) var(--space-2xl);
    }

    .class-highlights h1 {
        font-size: clamp(2rem, 9vw, 2.5rem);
    }

    .class-highlights p {
        font-size: 1rem;
    }

    .footer__panel {
        padding: var(--space-2xl) var(--space-md) 0;
    }

    .footer__strip {
        grid-template-columns: 1fr;
        margin: 0 calc(-1 * var(--space-md));
    }

    .footer__strip li + li {
        border-left: 0;
        border-top: 1px solid rgb(244 63 94 / 0.35);
    }

    .catalog-btn {
        display: block;
        margin: 0 auto var(--space-sm);
        max-width: 22rem;
    }


    .instructors .instructor {
        gap: var(--space-sm);
        padding: var(--space-2xl) var(--page-pad) var(--space-md);
    }

    .instructors .instructor p {
        font-size: 1rem;
    }
}

/* --- Error pages (404, 50x) --- */
.class-highlights--status {
    padding: 6rem var(--page-pad);
}

/* ===== Phones and tablets ===== */

/* Menu toggle: hidden on desktop */
.site-header__menu-input,
.site-header__menu-btn {
    display: none;
}

@media screen and (max-width: 1023px) {
    /* Header: logo, Contact Jim, and a menu button on one row. The links drop
     * down as a full-width panel when the (visually hidden) checkbox is on. */
    .site-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 3.75rem;
        gap: 0 var(--space-md);
        font-size: 0.9rem;
    }

    .site-header__logo,
    .site-header__actions,
    .site-header__menu-btn {
        margin-block: 0.4rem;
    }

    .site-header__actions {
        margin-left: auto;
    }

    .site-header__logo {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    /* Footer contact strip and skip link: comfortable tap areas */
    .primary-contact-bar ul a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 0.4rem;
    }

    .skip-link {
        padding: 0.75rem var(--space-md);
    }

    .site-header__cta {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 1rem;
    }

    .site-header__menu-input {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .site-header__menu-btn {
        order: 2;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        margin-right: -10px;
        border-radius: var(--radius-control);
        cursor: pointer;
    }

    /* Three-line icon that turns into an X when open */
    .site-header__menu-btn span,
    .site-header__menu-btn span::before,
    .site-header__menu-btn span::after {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background-color: var(--color-content);
        transition: transform 200ms ease, background-color 200ms ease;
    }

    .site-header__menu-btn span {
        position: relative;
    }

    .site-header__menu-btn span::before,
    .site-header__menu-btn span::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .site-header__menu-btn span::before { top: -6px; }
    .site-header__menu-btn span::after { top: 6px; }

    .site-header__menu-input:checked ~ .site-header__menu-btn span {
        background-color: transparent;
    }

    .site-header__menu-input:checked ~ .site-header__menu-btn span::before {
        transform: translateY(6px) rotate(45deg);
    }

    .site-header__menu-input:checked ~ .site-header__menu-btn span::after {
        transform: translateY(-6px) rotate(-45deg);
    }

    .site-header__menu-input:focus-visible ~ .site-header__menu-btn {
        outline: 2px solid var(--color-content);
        outline-offset: 2px;
    }

    /* The open menu sits inside the header, below the top row, and pushes
     * the page down rather than floating over it. */
    .site-header__nav {
        display: none;
        order: 3;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        margin: 0 0 var(--space-sm);
        border-top: 1px solid var(--color-outline-brand);
    }

    .site-header__menu-input:checked ~ .site-header__nav {
        display: flex;
    }

    .site-header__nav a {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0 var(--space-xs);
        border-top: 1px solid var(--color-divide);
        color: var(--color-dim);
        font-size: 1rem;
    }

    .site-header__nav a:first-child {
        border-top: 0;
    }

    .site-header__nav a[aria-current="page"] {
        color: var(--color-content);
        box-shadow: inset 2px 0 0 var(--color-brand);
    }
}

@media screen and (max-width: 767px) {
    /* Phones: the header is just the logo and the menu button */
    .site-header__actions {
        display: none;
    }

    .site-header__menu-btn {
        margin-left: auto;
    }

    /* Tap targets: at least 44px tall */
    .catalog-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
    }

    /* Footer contact strip: text links on one row, contact details below,
     * every link with a comfortable tap area. */
    .primary-contact-bar {
        padding: var(--space-sm) var(--page-pad);
    }

    /* Three tidy rows: the text links, then phone and email, then the social
     * icons. Zero-height flex items (::before, ::after) force the line breaks. */
    .primary-contact-bar ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0 var(--space-xs);
    }

    .primary-contact-bar ul::before,
    .primary-contact-bar ul::after {
        content: "";
        flex-basis: 100%;
        height: 0;
    }

    .primary-contact-bar ul::before { order: 1; }
    .primary-contact-bar ul::after { order: 3; }

    .primary-contact-bar li {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        white-space: nowrap;
    }

    .primary-contact-bar li:has(.phone),
    .primary-contact-bar li:has(.envelope) {
        order: 2;
    }

    .primary-contact-bar li:has(> a > .icon) {
        order: 4;
    }

    /* Space between stacked buttons */
    .catalog-btn + .catalog-btn {
        margin-top: var(--space-sm);
    }

    /* Hero and footer panel: keep the two buttons side by side, just smaller */
    .class-highlights .catalog-btn,
    .footer__actions .catalog-btn {
        display: inline-flex;
        vertical-align: top;
        width: calc(50% - 0.6rem);
        max-width: 12rem;
        margin: 0 0.1rem;
        padding: 0 0.4rem;
        font-size: 0.8rem;
        line-height: 1.2;
        text-align: center;
    }

    .primary-contact-bar .icon {
        top: 0;
    }

    .site-legal {
        padding-top: 0;
    }
}
