/*
 * Écrin for the web: the programs' design system, carried over to the site.
 * The program's colour (or the brand's) frames the whole page; the page sits inside it with
 * rounded corners; the content is laid out in tiles. Token names follow theme.rs (frame, line,
 * ink…). The frame colours are set by site.js (from catalog.js) in the --c-… variables.
 */

@font-face { font-family: "Nunito"; font-weight: 500; font-display: swap; src: url("../fonts/Nunito-Medium.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("../fonts/Nunito-Bold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../fonts/Nunito-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("../fonts/Nunito-Black.ttf") format("truetype"); }
@font-face { font-family: "Ubuntu Sans Mono"; font-weight: 400; font-display: swap; src: url("../fonts/UbuntuSansMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "Ubuntu Sans Mono"; font-weight: 600; font-display: swap; src: url("../fonts/UbuntuSansMono-SemiBold.ttf") format("truetype"); }

/* ------------------------------------------------------------------ colours */

:root {
  color-scheme: light;
  --background: #F2F0EA;
  --surface: #FFFFFF;
  --surface-2: #F7F6F2;
  --ink: #1C1B19;
  --ink-muted: #5F5C55;
  --border: #E6E3DC;
  --border-strong: #858177;
  --shadow: 0 2px 6px rgba(28, 27, 25, 0.05), 0 10px 26px rgba(28, 27, 25, 0.06);
  --ok: #1B7A3E;
  --ok-pale: #E2F1E6;
  --warning: #9A5800;
  --warning-pale: #FBEBD2;

  /* The program's colours (replaced by site.js). */
  --c-frame: #33313B;
  --c-frame-hover: #4A4853;
  --c-line: #33313B;
  --c-line-text: #33313B;
  --c-line-pale: #ECEAF0;
  --c-on-frame-muted: #D9D7DE;

  --frame: var(--c-frame);
  --frame-hover: var(--c-frame-hover);
  --line: var(--c-line);
  --line-text: var(--c-line-text);
  --line-pale: var(--c-line-pale);
  --on-frame: #FFFFFF;
  --on-frame-muted: var(--c-on-frame-muted);

  --radius-1: 8px;
  --radius-2: 12px;
  --radius-3: 18px;
  --radius-4: 24px;
  --edge: 12px;
  --font-text: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Ubuntu Sans Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #121417;
    --surface: #1C1F25;
    --surface-2: #252930;
    --ink: #EDEBE6;
    --ink-muted: #A9A59C;
    --border: #2C2F36;
    --border-strong: #75726B;
    --shadow: none;
    --ok: #5FD08F;
    --ok-pale: #252930;
    --warning: #F2B24C;
    --warning-pale: #252930;
    --frame: var(--c-frame-dark, var(--c-frame));
    --frame-hover: var(--c-frame-hover-dark, var(--c-frame-hover));
    --line: var(--c-line-dark, var(--c-line));
    --line-text: var(--c-line-text-dark, var(--c-line-text));
    --line-pale: var(--c-line-pale-dark, var(--c-line-pale));
    --on-frame-muted: var(--c-on-frame-muted-dark, var(--c-on-frame-muted));
  }
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--frame);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--line-text); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--line); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 900; }
h2 { font-size: clamp(26px, 3.2vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-2);
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ the frame: masthead */

.masthead {
  display: flex; align-items: center; gap: 16px;
  padding: 14px calc(var(--edge) + 10px) 10px;
  color: var(--on-frame);
}
.masthead .brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.masthead .brand strong { font-size: 24px; font-weight: 800; }
.masthead .brand span { color: var(--on-frame-muted); font-size: 14px; padding-left: 12px; border-left: 1px solid var(--on-frame-muted); }
.masthead .settings { margin-left: auto; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; justify-content: flex-end; }
.masthead nav { display: flex; gap: 4px; flex-wrap: wrap; }
.masthead nav a {
  color: var(--on-frame); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 8px 14px; border-radius: 999px;
}
.masthead nav a:hover { background: var(--frame-hover); }
.pebble { display: inline-block; flex: none; }

/* Language: FR · EN · ES, the page's language in white. */
.languages { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--frame-hover); }
.languages a {
  color: var(--on-frame-muted); text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: 0.03em;
  padding: 4px 9px; border-radius: 999px;
}
.languages a:hover { color: var(--on-frame); }
.languages a[aria-current] { background: var(--on-frame); color: var(--frame); }

/* Currency: a pill-shaped menu. */
.currency select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-weight: 700; font-size: 14px; color: var(--on-frame);
  background: var(--frame-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 13px;
  border: 0; border-radius: 999px; padding: 6px 30px 6px 13px; cursor: pointer;
}
.currency select:hover { filter: brightness(1.1); }
.currency option { color: #1C1B19; background: #FFFFFF; }

/* "This site is also available in English": offered, never forced. */
.suggestion {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  background: var(--line-pale); border-radius: var(--radius-3); padding: 10px 12px 10px 16px; margin-bottom: 28px;
}
.suggestion > svg { width: 20px; height: 20px; color: var(--line-text); flex: none; }
.suggestion > span { flex: 1; min-width: 12em; font-weight: 700; }
.suggestion .button svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ the frame: tabs */

.tabs {
  display: flex; align-items: flex-end; gap: 10px;
  /* As in the programs: the first tab starts at the page's left edge. */
  padding: 0 var(--edge);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 11px;
  color: var(--on-frame-muted); text-decoration: none; font-weight: 700; font-size: 15px;
  border-radius: 999px; margin-bottom: 4px;
}
.tab:hover { background: var(--frame-hover); color: var(--on-frame); }
.tab .color-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot-color, transparent); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
/* The open tab: cut out of the page, rounded at the top, flowing into it at the bottom. */
.tab[aria-current="page"] {
  background: var(--background); color: var(--line-text); font-weight: 800;
  border-radius: var(--radius-2) var(--radius-2) 0 0; margin-bottom: 0; padding-bottom: 15px;
}
.tab[aria-current="page"]::before,
.tab[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; width: 10px; height: 10px; pointer-events: none;
}
.tab[aria-current="page"]::before { left: -10px; background: radial-gradient(circle at 0 0, transparent 9.5px, var(--background) 10px); }
.tab[aria-current="page"]::after { right: -10px; background: radial-gradient(circle at 100% 0, transparent 9.5px, var(--background) 10px); }
/* Open at the page's edge: no flare on the left, and the page's corner becomes square. */
.tab[aria-current="page"]:first-child::before { display: none; }
.page.square-corner { border-top-left-radius: 0; }

/* ------------------------------------------------------------------ the page */

.page {
  flex: 1;
  margin: 0 var(--edge);
  background: var(--background);
  border-radius: var(--radius-4);
  padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 56px) clamp(32px, 5vw, 64px);
}
.container { max-width: 1180px; margin: 0 auto; }
.section { margin-top: clamp(48px, 7vw, 88px); }
.section > .lead { color: var(--ink-muted); max-width: 70ch; font-size: 18px; margin-bottom: 28px; }
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--line-text); margin-bottom: 10px; }

/* ------------------------------------------------------------------ footer (on the frame) */

.footer {
  color: var(--on-frame-muted);
  padding: 28px calc(var(--edge) + 24px) 32px;
  display: grid; gap: 18px; grid-template-columns: 1.4fr repeat(3, 1fr);
  font-size: 15px;
}
.footer strong { color: var(--on-frame); display: block; margin-bottom: 6px; }
.footer a { color: var(--on-frame); text-decoration: none; display: block; padding: 2px 0; }
.footer a:hover { text-decoration: underline; }
.footer .footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer p { margin: 0; }
.footer .footer-languages { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.footer .footer-languages a { display: inline; }

/* ------------------------------------------------------------------ tiles */

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow);
  padding: 24px;
}
.tile h3 { margin-bottom: 6px; }
.tile p:last-child { margin-bottom: 0; }
.tile.featured { background: var(--frame); border-color: var(--frame); color: var(--on-frame); }
.tile.featured .muted, .tile.featured .detail { color: var(--on-frame-muted); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.muted { color: var(--ink-muted); }

.feature-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-pale); color: var(--line-text); margin-bottom: 12px;
}
.feature-icon svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ buttons */

.buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 20px;
  border-radius: var(--radius-2); border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--surface-2); text-decoration: none; }
.button svg { width: 20px; height: 20px; flex: none; }
.button.primary { background: var(--line); border-color: var(--line); color: #FFFFFF; }
.button.primary:hover { filter: brightness(1.1); background: var(--line); }
.button.on-frame { background: var(--on-frame); border-color: var(--on-frame); color: var(--frame); }
.button.on-frame:hover { filter: brightness(0.96); }
.button.small { min-height: 36px; padding: 6px 14px; font-size: 15px; }
.button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* ------------------------------------------------------------------ states (pills) */

.state {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 12px 3px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  background: var(--ok-pale); color: var(--ok);
}
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state.warning { background: var(--warning-pale); color: var(--warning); }
.state.warning::before { border-radius: 0; width: 0; height: 0; background: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid currentColor; }
.state.neutral { background: var(--surface-2); color: var(--ink-muted); }
.state.neutral::before { width: 9px; height: 2px; border-radius: 0; }

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

.hero { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; }
.intro { font-size: clamp(19px, 2vw, 22px); color: var(--ink-muted); max-width: 34ch; }
.hero .meta { margin-top: 14px; color: var(--ink-muted); font-size: 15px; }
.hero h1 .accent { color: var(--line-text); }
.product-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.product-title h1 { margin: 0; color: var(--line-text); }

/* A screenshot shown as a window. */
.window {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(20, 18, 30, 0.22), 0 2px 6px rgba(20, 18, 30, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--frame);
}
.window img { width: 100%; }
button.window { padding: 0; cursor: zoom-in; display: block; width: 100%; }

/* Home: one screenshot of each program, stacked. */
.stack { position: relative; aspect-ratio: 100 / 66; }
/* Each screenshot 12 % further right and 14 % lower: narrower when there are more of them. */
.stack .window { position: absolute; width: calc(100% - (var(--count, 2) - 1) * 12%); left: calc(var(--rank) * 12%); top: calc(var(--rank) * 14%); }
.stack .window:hover { z-index: 2; }

/* ------------------------------------------------------------------ products (home) */

.product-card {
  --card-frame: var(--k-frame); --card-line: var(--k-line-text);
  display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; padding: 0; overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .product-card { --card-frame: var(--k-frame-dark); --card-line: var(--k-line-text-dark); }
}
.product-card .banner { background: var(--card-frame); color: #FFFFFF; padding: 22px 24px 18px; display: flex; gap: 14px; align-items: center; }
.product-card .banner strong { font-size: 26px; font-weight: 900; display: block; line-height: 1.1; }
.product-card .banner span { color: rgba(255, 255, 255, 0.85); font-size: 15px; }
.product-card .card-body { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.product-card .card-body p { margin: 0; }
.product-card .card-link { margin-top: auto; font-weight: 800; color: var(--card-line); }
.product-card:hover .card-link { text-decoration: underline; }
.product-card.soon .banner { background: var(--surface-2); color: var(--ink); }
.product-card.soon .banner span { color: var(--ink-muted); }

/* ------------------------------------------------------------------ strengths */

.strengths { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strength { border-left: 3px solid var(--line); padding: 4px 0 4px 18px; }
.strength h3 { font-size: 19px; }
.strength p { color: var(--ink-muted); margin: 0; }

/* ------------------------------------------------------------------ screenshots */

.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 10px; color: var(--ink-muted); font-size: 15px; }
dialog.viewer { border: none; padding: 0; background: transparent; max-width: min(1400px, 96vw); }
dialog.viewer::backdrop { background: rgba(10, 10, 14, 0.78); }
dialog.viewer img { border-radius: 12px; max-height: 86vh; width: auto; margin: 0 auto; }
dialog.viewer p { color: #FFFFFF; text-align: center; margin-top: 12px; }
dialog.viewer .close { position: fixed; top: 16px; right: 20px; }

/* ------------------------------------------------------------------ offers */

.offers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); align-items: stretch; }
.offer { display: flex; flex-direction: column; gap: 6px; }
.offer .offer-name { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--line-text); }
.offer.featured .offer-name { color: var(--on-frame-muted); }
.offer .price { font-size: 40px; font-weight: 900; line-height: 1.1; }
.offer .detail { color: var(--ink-muted); font-size: 15px; margin-bottom: 8px; }
.offer ul { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 8px; }
.offer li { display: flex; gap: 10px; align-items: flex-start; }
.offer li svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--line-text); }
.offer.featured li svg { color: var(--on-frame); }
.offer .buttons { margin-top: auto; }
.offer .button { width: 100%; }
.fine-print { color: var(--ink-muted); font-size: 14px; margin-top: 14px; }

/* ------------------------------------------------------------------ free licences */

.key {
  font-family: var(--font-mono); font-size: 15px; line-height: 1.7; word-break: break-all;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-2); padding: 14px 16px; margin: 12px 0;
  user-select: all;
}
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--line); color: #FFFFFF;
}

.licenses { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
.license { display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 20px; }
.license .buttons { margin-bottom: 8px; }
.license-title { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.license-title h2 { margin: 0; font-size: 28px; color: var(--line-text); }
.license-title p { margin: 0; }
.small-title { font-size: 17px; margin: 14px 0 8px; }
.small-text { font-size: 15px; }

/* ------------------------------------------------------------------ download */

.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; }
.info dt { color: var(--ink-muted); }
.info dd { margin: 0; font-weight: 700; min-width: 0; }
.checksum { font-size: 13px; font-weight: 400; word-break: break-all; color: var(--ink-muted); }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--line-text); }

/* ------------------------------------------------------------------ questions */

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2); padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 900; color: var(--line-text); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-muted); margin: 0 0 16px; }

/* ------------------------------------------------------------------ final call */

.call { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.call h2 { margin: 0; }

/* ------------------------------------------------------------------ long texts (legal pages) */

.prose { max-width: 78ch; }
.prose h2 { font-size: 24px; margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.to-complete { background: var(--warning-pale); color: var(--warning); border-radius: 6px; padding: 0 6px; font-weight: 700; }
.note { background: var(--line-pale); border-radius: var(--radius-3); padding: 18px 22px; margin: 18px 0; }

/* ------------------------------------------------------------------ small screens */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .strengths { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  :root { --edge: 8px; }
  body { font-size: 16px; }
  .masthead { flex-wrap: wrap; padding: 12px 16px 8px; }
  .masthead .brand span { display: none; }
  .masthead .settings { margin-left: 0; justify-content: flex-start; }
  .page { border-radius: 18px; }
  .footer { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .offer .price { font-size: 34px; }
}

@media print {
  body { background: #FFFFFF; }
  .masthead nav, .tabs, .footer { display: none; }
  .page { margin: 0; padding: 0; }
}
