/* kapitech.app shared design: tokens, base, header, footer, and the subpage layouts (prose, blog, calculator). */
:root {
  --bg: #0b0e15;
  --surface: #131824;
  --surface-2: #1a2030;
  --ink: #edf0f5;
  --muted: #a3abb9;
  --accent: #55d17e;
  --accent-hover: #74de97;
  --accent-ink: #06130b;
  --card: #262633;

  --font: "Libre Franklin", system-ui, -apple-system, sans-serif;

  --step-small: 0.9375rem;                                  /* 15 */
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);   /* 17-19 */
  --step-lead: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);    /* 22-28 */
  --step-head: clamp(2.5rem, 1.4rem + 3.4vw, 4.5rem);       /* 40-72 */
  --step-fig: clamp(5.5rem, 1rem + 10vw, 11.5rem);              /* the price */

  --margin: clamp(1rem, 2.8vw, 2.5rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 12vw, 12rem);
  --radius: 12px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; }
button, input, output { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
p { max-width: 62ch; text-wrap: pretty; }
p + p { margin-top: 0.85em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { padding-inline: var(--margin); }
.head { font-weight: 800; font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.04em; text-wrap: balance; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--step-body); text-decoration: none; border-radius: 4px; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.button:active { transform: scale(0.97); }
.button--ink { background: var(--bg); color: var(--ink); }
.link { font-size: var(--step-body); font-weight: 600; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 180ms ease, color 180ms ease; }
.link--btn { color: var(--accent); text-decoration-color: currentColor; text-align: left; min-height: 44px; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background-color: var(--accent-hover); }
  .button--ink:hover { background-color: #1d2433; }
  .link:hover { text-decoration-color: currentColor; }
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; align-self: flex-start; min-height: 44px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.foot { padding: 40px 0 32px; font-size: var(--step-small); }
.foot__line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px; }
.foot__line p { color: var(--muted); }
.foot__line nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot__line a { text-decoration: none; color: var(--ink); display: inline-block; padding-block: 4px; }
@media (hover: hover) { .foot a:hover { text-decoration: underline; } }
.foot__r { justify-self: end; }
.credits { margin-top: 18px; color: var(--muted); max-width: none; }
.credits a { color: var(--ink); }@media (max-width: 1100px) {
  .foot__line { grid-template-columns: 1fr; gap: 14px; }
  .foot__r { justify-self: start; }
}
@media (max-width: 700px) {
  .foot__line nav { gap: 6px 20px; }
  .foot__line nav a { min-height: 32px; display: inline-flex; align-items: center; }
}

/* ================= subpages ================= */
/* header: wordmark, a few plain links, the language pair */
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; padding-block: 24px; }
.bar__nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: var(--step-small); font-weight: 600; }
.bar__nav a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; transition: color 180ms ease; }
.bar__nav a[aria-current=page] { color: var(--accent); }
@media (hover: hover) { .bar__nav a:hover { color: var(--accent); } }

/* page title block and reading column. Headings shrink with their length so none runs past two lines
   (each carries --chars, its length in characters, set in the markup). */
.container { padding-inline: var(--margin); }
.legal-page, .blog-post { padding-bottom: var(--section); }
.app-download > .container { padding-inline: 0; }
.sub h1 { font-weight: 800; letter-spacing: -0.04em; line-height: 1; text-wrap: balance; font-size: min(var(--step-head), calc(100cqi * 3.1 / var(--chars, 20))); max-width: none; }
.sub h2 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; font-size: max(1.375rem, min(clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem), calc(100cqi * 3.1 / var(--chars, 20)))); }
.sub h3 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; font-size: max(1.0625rem, min(1.375rem, calc(100cqi * 3.2 / var(--chars, 20)))); }
.sub h1 + p, .lede { margin-top: 28px; font-size: var(--step-lead); line-height: 1.4; }

.prose { font-size: var(--step-body); }
.prose > * + * { margin-top: 1em; }
.prose p, .prose li { max-width: none; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; list-style: revert; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose img { border-radius: var(--radius); }

/* legal and help pages */
.legal-page { padding-top: clamp(32px, 6vw, 88px); }
.legal-content > h1 { margin-bottom: 0; }
.legal-content > h1 + p { margin-top: 28px; }

/* articles: the date and category sit under the title as a byline */
.blog-post { padding-top: clamp(32px, 6vw, 88px); }
.blog-post-header { display: flex; flex-direction: column; }
.blog-post-header h1 { order: 1; }
.blog-post-header .blog-meta { order: 2; margin-top: 20px; }
.blog-post-header > :not(h1):not(.blog-meta) { order: 3; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: var(--step-small); }
.blog-meta span + span::before { content: "·"; margin-right: 18px; }
.blog-featured-image { margin-top: 40px; }
.blog-featured-image img { width: 100%; border-radius: var(--radius); }
.blog-post-content { margin-top: 48px; }
.method-box, .blog-cta, .calc-callout, .facts-box { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.method-box > :first-child, .blog-cta > :first-child, .calc-callout > :first-child, .facts-box > :first-child { margin-top: 0; }
.method-box > * + *, .blog-cta > * + *, .calc-callout > * + *, .facts-box > * + * { margin-top: 0.8em; }
.page-shot { width: min(100%, 300px); border-radius: 20px; background: #000; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.faq-list > * + * { margin-top: 0.6em; }
.faq-list h3 { margin-top: 1.4em; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); background: var(--surface); }
.compare-table { width: 100%; border-collapse: collapse; font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.compare-table th, .compare-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #232a3a; vertical-align: top; }
.compare-table th { color: var(--muted); font-weight: 600; }
.compare-table tr:last-child td { border-bottom: 0; }

/* the App Store links keep their own words, drawn as the site's button */
.app-store-button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem; background: var(--accent); color: var(--accent-ink) !important; font-weight: 700; text-decoration: none; border-radius: 4px; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.app-store-button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .app-store-button:hover { background: var(--accent-hover); } }

/* closing field of green, as on the homepage */
.app-download, .calc-cta { background: var(--accent); color: var(--accent-ink); padding-block: clamp(4rem, 10vw, 8rem); }
.sub .app-download h2, .sub .calc-cta h2 { letter-spacing: -0.04em; line-height: 0.98; font-size: min(clamp(2.25rem, 1rem + 4vw, 4.5rem), calc(100cqi * 1.8 / var(--chars, 20))); }
.download-content, .calc-cta .container { container-type: inline-size; padding-inline: var(--margin); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px var(--gutter); align-items: end; }
.download-content > *, .calc-cta .container > * { grid-column: 1; }
.download-content > .download-buttons, .calc-cta .container > .app-store-button { grid-column: 2; grid-row: 1 / span 3; justify-self: end; align-self: end; }
.app-download p, .calc-cta p { font-size: var(--step-body); max-width: 46ch; }
.calc-cta .container > p:first-child { font-size: clamp(1.625rem, 1rem + 1.8vw, 2.25rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.app-download .app-store-button, .calc-cta .app-store-button { background: var(--bg); color: var(--ink) !important; }
@media (hover: hover) and (pointer: fine) { .app-download .app-store-button:hover, .calc-cta .app-store-button:hover { background: #1d2433; } }
.app-download :focus-visible, .calc-cta :focus-visible { outline-color: var(--accent-ink); }

/* blog index: one row per article, picture and words side by side */
.blog-hero { padding-top: clamp(32px, 6vw, 88px); }
.blog-hero-content p { margin-top: 24px; font-size: var(--step-lead); line-height: 1.4; }
.blog-listing { padding-block: clamp(48px, 7vw, 96px) var(--section); }
.blog-grid > * + * { margin-top: clamp(40px, 6vw, 72px); }
.blog-card { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gutter) calc(var(--gutter) * 1.5); align-items: center; }
.blog-card-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); transition: transform 300ms var(--ease-out); }
@media (hover: hover) { .blog-card:hover .blog-card-image img { transform: translateY(-4px); } }
.blog-card-content h2 { margin-top: 12px; }
.blog-card-content h2 a { text-decoration: none; }
.blog-card-content p { margin-top: 12px; }
.blog-card .blog-meta { order: 0; }
.read-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--accent); font-weight: 600; }

/* ================= calculator: the homepage's payoff plan, at full size ================= */
.calc-hero { padding-top: clamp(32px, 6vw, 88px); }
.calc-hero .container { container-type: inline-size; }
.calc-hero h1 + p { margin-top: 24px; font-size: var(--step-lead); line-height: 1.4; max-width: 40ch; }
.calc-wrap { margin-top: 0; }
.calc-box { background: var(--surface); border-radius: 18px; padding: clamp(16px, 3vw, 32px); font-size: 15px; color: #f2f2f7; }
.calc-box > p { max-width: none; }
#debt-rows { display: grid; gap: 8px; }
.debt-row { display: grid; grid-template-columns: 1.5fr 1fr 0.7fr 1fr auto; gap: 10px; align-items: end; background: #1f2533; border-radius: 14px; padding: 12px 14px; }
.debt-row > *, .calc-box label { min-width: 0; }
.calc-box label { display: flex; flex-direction: column; gap: 6px; color: #a0a8b6; font-size: 13px; }
.calc-box input { font: inherit; font-size: 16px; color: #f2f2f7; background: #2a3142; border: 0; border-radius: 8px; padding: 0 10px; min-height: 44px; width: 100%; font-variant-numeric: tabular-nums; }
.calc-box input:focus-visible { outline-offset: 1px; }
.calc-box input[type=number] { -moz-appearance: textfield; text-align: right; }
.calc-box input::-webkit-outer-spin-button, .calc-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.debt-row .d-name { text-align: left; }
.remove-debt { min-height: 44px; padding: 0 12px; border-radius: 8px; color: #c9ced8; background: #2a3142; transition: background-color 180ms ease; }
#add-debt { margin-top: 12px; min-height: 44px; padding: 0 16px; border-radius: 10px; color: var(--accent); font-weight: 600; background: #1f2533; transition: background-color 180ms ease, transform 140ms var(--ease-out); }
#add-debt:active, .remove-debt:active { transform: scale(0.97); }
@media (hover: hover) { #add-debt:hover, .remove-debt:hover { background: #2a3142; } }
.extra-wrap { margin-top: 24px; max-width: 320px; font-size: 15px !important; color: #f2f2f7 !important; font-weight: 600; }
.extra-wrap input { font-size: 28px !important; font-weight: 700; min-height: 60px; text-align: left !important; }
.calc-submit { display: block; width: 100%; margin-top: 24px; min-height: 3.25rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--step-body); border-radius: 4px; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.calc-submit:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .calc-submit:hover { background: var(--accent-hover); } }
#calc-error { color: #ff8a80; margin-top: 10px; min-height: 1em; }
#calc-error:empty { margin-top: 0; min-height: 0; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.result-card { background: #1f2533; border-radius: 14px; padding: 18px; transition: background-color 240ms ease; animation: rise 500ms var(--ease-out) both; }
.result-card + .result-card { animation-delay: 80ms; }
.result-card.is-best { background: #22303a; }
.result-title { font-size: 17px; font-weight: 600; }
.result-sub { color: #a0a8b6; font-size: 13px; margin-top: 2px; }
.result-pair { margin-top: 14px; font-size: 15px; }
.result-pair .result-label { display: block; color: #c9ced8; }
.result-big { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.result-pair--order { color: #f2f2f7; }
.result-span { margin-top: 2px; color: #c9ced8; font-size: 13px; }
.result-card > p.result-big { margin-top: 14px; }
.results-summary { margin-top: 20px; font-size: var(--step-body); font-weight: 600; max-width: none; }
.results-note { margin-top: 8px; color: #a0a8b6; font-size: 13px; }
.calc-box > p:last-child { margin-top: 24px; }
.calc-box a { color: var(--accent); }
.calc-explainer { margin-top: clamp(64px, 9vw, 128px); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* reveals: content is there without script; with it, blocks rise in once */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(20px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
  .js .rv.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .result-card { animation: none; } }

@media (max-width: 760px) {
  .debt-row { grid-template-columns: 1fr 1fr; }
  .debt-row label:first-child { grid-column: 1 / -1; }
  .remove-debt { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: 1fr; }
  .blog-card { grid-template-columns: 1fr; }
  .bar__in { padding-block: 16px 8px; position: relative; }
  .bar__nav { gap: 0 16px; }
  .bar__nav a { white-space: nowrap; }
  /* the language link moves up beside the wordmark so the page links fit one row */
  .bar__nav a[hreflang] { position: absolute; top: 16px; right: var(--margin); }
}

/* ================= subpage frame: a full-width title, then the words and a rail of app pictures ================= */
.title { container-type: inline-size; max-width: 72rem; }
.legal-page .title, .blog-post .title { margin-bottom: clamp(40px, 6vw, 80px); }
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.split > .prose, .split > .split__main { grid-column: 1 / 8; container-type: inline-size; }
.split > .rail { grid-column: 9 / 13; }
.calc-hero { padding-bottom: clamp(32px, 5vw, 56px); }
.calc-hero + .split { padding-inline: var(--margin); padding-bottom: var(--section); }
.calc-hero .container > * { max-width: 72rem; }
.rail ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--gutter); }
.split > .rail { position: sticky; top: 32px; }
.rail--screens ul { max-width: min(100%, 380px); margin-left: auto; }
.rail li { min-width: 0; }
.rail img { width: 100%; border-radius: 18px; background: #000; transition: transform 300ms var(--ease-out); }
.rail--cards img { border-radius: 10px; }
.rail p { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
@media (hover: hover) { .rail li:hover img { transform: translateY(-4px); } }
.blog-post-header img { max-height: 72svh; object-fit: cover; }
.blog-hero .container { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
.blog-hero-content { grid-column: 1 / 8; container-type: inline-size; }
.blog-hero__pic { grid-column: 9 / 12; }
.blog-hero__pic img { width: 100%; max-width: 300px; border-radius: 18px; background: #000; }
@media (max-width: 1100px) {
  .split > .prose, .split > .split__main { grid-column: 1 / -1; }
  .split > .rail { grid-column: 1 / -1; margin-top: clamp(56px, 8vw, 96px); position: static; }
  .rail ul, .rail--screens ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px var(--gutter); max-width: none; margin-left: 0; }
}
@media (max-width: 760px) {
  .rail ul, .rail--screens ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-hero-content { grid-column: 1 / -1; }
  .blog-hero__pic { grid-column: 1 / 7; margin-top: 32px; }
  .download-content, .calc-cta .container { grid-template-columns: 1fr; }
  .download-content > .download-buttons, .calc-cta .container > .app-store-button { grid-column: 1; grid-row: auto; justify-self: start; }
  .sub h1 + p, .lede, .calc-hero h1 + p, .blog-hero-content p { font-size: 1.1875rem; }
}
.blog-card-content { display: flex; flex-direction: column; align-items: flex-start; container-type: inline-size; }
.blog-card-content > h2 { order: 1; margin-top: 0; }
.blog-card-content > .blog-meta { order: 2; margin-top: 12px; }
.blog-card-content > :not(h2):not(.blog-meta) { order: 3; }
