/*
  CostMint marketing site.

  Colours follow the app's theme (Client/Theme/CostMintTheme.cs): slate neutrals, Teal for things
  that carry text, Mint as an accent only - white on Mint is 2.5:1, which no text can be set in.

  The content security policy forbids inline styles and data: URIs, so everything is here, and
  every decoration is drawn with borders and gradients rather than embedded images.
*/

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    /* Must match the preload in _Layout exactly, or the font downloads twice. */
    src: url("/fonts/inter-latin-wght-normal-5.1.0.woff2") format("woff2");
}

:root {
    color-scheme: light dark;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-muted: #F1F5F9;
    --text: #0F172A;
    --text-muted: #475569;
    --border: #E2E8F0;

    --brand: #0F766E;
    --brand-hover: #115E59;
    --on-brand: #FFFFFF;
    --accent: #10B981;
    --accent-text: #047857;
    --accent-soft: #D1FAE5;
    --wordmark-accent: #059669;

    --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 12px 32px rgb(15 23 42 / 0.08);
    --radius: 12px;
    --radius-small: 8px;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B1220;
        --surface: #141F35;
        --surface-muted: #0F192C;
        --text: #F1F5F9;
        --text-muted: #94A3B8;
        --border: #1E293B;

        --brand: #2DD4BF;
        --brand-hover: #5EEAD4;
        --on-brand: #042F2E;
        --accent: #34D399;
        --accent-text: #6EE7B7;
        --accent-soft: rgb(52 211 153 / 0.14);
        --wordmark-accent: #34D399;

        --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.35);
    }
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
}

h3 {
    font-size: 1.25rem;
    font-weight: 650;
}

h4 {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

a {
    color: var(--brand);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-hover);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

main:focus {
    outline: none;
}

[id] {
    scroll-margin-top: 16px;
}

@media (min-width: 900px) {
    /* Clear the sticky header when jumping to a section. */
    [id] {
        scroll-margin-top: calc(var(--header-height) + 16px);
    }
}

.visually-hidden {
    position: absolute !important;
    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;
    left: 16px;
    top: -100px;
    z-index: 100;
    padding: 8px 16px;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
}

.skip-link:focus {
    top: 12px;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 16px;
}

.container-narrow {
    max-width: 760px;
}

@media (min-width: 640px) {
    .container {
        padding-inline: 24px;
    }
}

/* ---------- Shared pieces ---------- */

.eyebrow {
    color: var(--accent-text);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lead {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 62ch;
}

.fine-print {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.chip-accent {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent-text);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button-large {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 1rem;
}

.button-primary {
    background: var(--brand);
    color: var(--on-brand);
}

.button-primary:hover {
    background: var(--brand-hover);
    color: var(--on-brand);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--brand);
    color: var(--text);
}

.button-quiet {
    color: var(--text);
}

.button-quiet:hover {
    background: var(--surface-muted);
    color: var(--text);
}

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

/* ---------- Header ---------- */

/*
  Sticky only where the menu is a row of links. On small screens the menu is a <details> that no
  script can close, so after a tap on "/#pricing" it would stay open over the content - unless the
  header, and the open menu with it, scrolls away with the page.
*/
.site-header {
    position: relative;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.wordmark {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.wordmark-accent {
    color: var(--wordmark-accent);
}

.site-nav {
    display: none;
    margin-left: 8px;
}

.site-nav ul,
.mobile-menu ul,
.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav ul {
    display: flex;
    gap: 4px;
}

.site-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-small);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.header-actions {
    display: none;
    margin-left: auto;
    gap: 8px;
}

.mobile-menu {
    margin-left: auto;
}

.mobile-menu summary {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-small);
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-menu summary:hover {
    background: var(--surface-muted);
}

.mobile-menu[open] summary {
    background: var(--surface-muted);
}

.mobile-menu nav {
    position: absolute;
    top: calc(var(--header-height) - 4px);
    left: 12px;
    right: 12px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.mobile-menu li a:not(.button) {
    display: block;
    padding: 12px;
    border-radius: var(--radius-small);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}

.mobile-menu li a:not(.button):hover {
    background: var(--surface-muted);
}

.mobile-menu li .button {
    width: 100%;
    margin-top: 8px;
}

@media (min-width: 900px) {
    .site-header {
        position: sticky;
        top: 0;
    }

    .site-nav,
    .header-actions {
        display: flex;
    }

    .mobile-menu {
        display: none;
    }
}

/* ---------- Sections ---------- */

.section {
    padding-block: 72px;
}

.section-muted {
    background: var(--surface-muted);
    border-block: 1px solid var(--border);
}

.section-header {
    margin-bottom: 40px;
    max-width: 720px;
}

.section-header .lead {
    margin-top: 16px;
}

@media (min-width: 900px) {
    .section {
        padding-block: 96px;
    }
}

/* ---------- Hero ---------- */

.hero {
    padding-block: 48px 64px;
    background:
        radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 60%),
        var(--bg);
}

.hero-inner {
    display: grid;
    gap: 48px;
    align-items: center;
}

.hero-copy h1 {
    max-width: 16ch;
}

.hero-copy .lead {
    margin-top: 20px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-copy .fine-print {
    margin-top: 16px;
}

@media (min-width: 960px) {
    .hero {
        padding-block: 80px 96px;
    }

    .hero-inner {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 64px;
    }
}

/* The worked example: a recipe costed by the app's own calculator. */
.cost-card {
    margin: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.cost-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cost-card-product {
    font-weight: 700;
    font-size: 1.125rem;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
}

.cost-table th,
.cost-table td {
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cost-table thead th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cost-table tbody th {
    font-weight: 500;
}

.cost-table td {
    color: var(--text-muted);
}

.cost-table .num {
    text-align: right;
    color: var(--text);
    white-space: nowrap;
}

.cost-table tfoot th,
.cost-table tfoot td {
    font-weight: 650;
    border-bottom: none;
    padding-top: 10px;
    padding-bottom: 0;
}

.cost-table tfoot tr:first-child th,
.cost-table tfoot tr:first-child td {
    border-top: 2px solid var(--border);
}

.cost-table-margin .num {
    color: var(--accent-text);
    font-size: 1.125rem;
}

.cost-card-tip {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-small);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.9375rem;
}

.cost-card figcaption {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ---------- Features ---------- */

.feature-groups {
    display: grid;
    gap: 20px;
}

@media (min-width: 720px) {
    .feature-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .feature-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.feature-group {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.feature-group-lead {
    margin-top: 6px;
    color: var(--text-muted);
}

.feature-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.feature-list li {
    position: relative;
    padding-left: 28px;
}

/* A check mark drawn with borders: data: URIs are outside the content security policy. */
.feature-list li::before,
.plan-includes li::before,
.showcase-points li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.3em;
    width: 7px;
    height: 12px;
    border: solid var(--accent);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.feature-list p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ---------- See it in action ---------- */

.showcase {
    display: grid;
    gap: 56px;
}

.showcase-row {
    display: grid;
    gap: 28px;
    align-items: center;
}

.showcase-copy .eyebrow {
    margin-bottom: 8px;
}

.showcase-copy h3 {
    font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
}

.showcase-lead {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 1.0625rem;
    max-width: 52ch;
}

.showcase-points {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.showcase-points li {
    position: relative;
    padding-left: 28px;
}

@media (min-width: 960px) {
    .showcase {
        gap: 88px;
    }

    .showcase-row {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 56px;
    }

    /* Alternate sides, so the page reads as a walk through the app rather than a list - the
       screenshot keeps the wider column whichever side it is on. */
    .showcase-row:nth-child(even) {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    }

    .showcase-row:nth-child(even) .showcase-copy {
        order: 2;
    }
}

/* A screenshot in a browser window, drawn in CSS: three dots on a title bar, no images. */
.screen-frame {
    margin: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.screen-frame::before {
    content: "";
    display: block;
    height: 28px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 16px 50%, #F87171 0 5px, transparent 5.5px),
        radial-gradient(circle at 34px 50%, #FBBF24 0 5px, transparent 5.5px),
        radial-gradient(circle at 52px 50%, #34D399 0 5px, transparent 5.5px),
        var(--surface-muted);
}

.screen-frame img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- How it works ---------- */

.steps {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 20px;
}

@media (min-width: 720px) {
    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.step {
    counter-increment: step;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.step::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 700;
}

.step p {
    margin-top: 8px;
    color: var(--text-muted);
}

/* ---------- Pricing ---------- */

.plans {
    display: grid;
    gap: 20px;
}

@media (min-width: 640px) {
    .plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .plans {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.plan {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.plan[data-plan="Pro"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand), var(--shadow);
}

.plan-summary {
    margin-top: 6px;
    min-height: 3.2em;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.plan-price {
    margin-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.plan-amount {
    font-size: 2rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.plan-per {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-muted);
}

.plan-cycle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.plan-saving {
    display: inline-block;
    margin-left: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 600;
    font-size: 0.8125rem;
}

.plan-includes {
    list-style: none;
    margin: 20px 0 24px;
    padding: 0;
    display: grid;
    gap: 10px;
    font-size: 0.9375rem;
}

.plan-includes li {
    position: relative;
    padding-left: 28px;
}

.plan-includes .plan-excluded {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--border);
}

/* A dash instead of a check. */
.plan-includes .plan-excluded::before {
    top: 0.75em;
    width: 12px;
    height: 0;
    border-width: 0 0 2px 0;
    border-color: var(--border);
    transform: none;
}

.plan-action {
    margin-top: auto;
    width: 100%;
}

.plans-note {
    margin-top: 24px;
    text-align: center;
}

/* ---------- FAQ ---------- */

.faq {
    display: grid;
    gap: 12px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* A plus that turns into a minus, drawn with two bars. */
.faq-item summary::after {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(var(--text-muted), var(--text-muted)) center / 14px 2px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) center / 2px 14px no-repeat;
}

.faq-item[open] summary::after {
    background: linear-gradient(var(--text-muted), var(--text-muted)) center / 14px 2px no-repeat;
}

.faq-item p {
    padding: 0 20px 20px;
    color: var(--text-muted);
}

/* ---------- Final call to action ---------- */

.final-cta {
    padding-block: 72px;
}

.final-cta-inner {
    padding: 48px 24px;
    text-align: center;
    border-radius: 20px;
    background:
        radial-gradient(40rem 20rem at 50% 0%, var(--accent-soft), transparent 70%),
        var(--surface);
    border: 1px solid var(--border);
}

.final-cta-inner h2 {
    max-width: 22ch;
    margin-inline: auto;
}

.final-cta-inner p {
    margin-top: 12px;
    color: var(--text-muted);
}

.final-cta-inner .hero-actions {
    justify-content: center;
}

/* ---------- Legal and status pages ---------- */

.prose-header {
    margin-bottom: 32px;
}

.prose-header .fine-print {
    margin-top: 12px;
}

.prose h2 {
    margin-top: 40px;
    margin-bottom: 12px;
    font-size: 1.375rem;
}

.prose p {
    color: var(--text);
}

.prose p + p {
    margin-top: 12px;
}

.status-page {
    min-height: 50vh;
    display: grid;
    align-items: center;
}

.status-page .lead {
    margin-top: 16px;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding-top: 48px;
}

.footer-inner {
    display: grid;
    gap: 32px;
}

.footer-brand p {
    margin-top: 12px;
    max-width: 32ch;
    color: var(--text-muted);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 24px;
}

.footer-heading {
    margin-bottom: 12px;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-nav li + li {
    margin-top: 8px;
}

.footer-nav a {
    color: var(--text);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.footer-base {
    margin-top: 40px;
    padding-block: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (min-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1.4fr;
    }
}
