/*
  The Davicloud design system: one stylesheet for everything Davicloud puts on screen.

  This site serves it at /design/davicloud.css and uses it itself. Other Davicloud applications fetch it
  from there and keep no copy of their own, so that nothing drifts apart.

  Tokens are custom properties named --dc-*. Classes are named dc-*. The file brings its own base
  (colours, fonts, links), so a page needs no other stylesheet to use it. One thing it leaves to the
  page is the monospace font, Cascadia Code, which each application ships in its own way.

  Renaming or removing a token or a class breaks the applications that use it. Add, do not rename.
*/

:root {
    --dc-bg: #0d0c0c;
    --dc-surface: rgba(20, 18, 18, 0.55);
    --dc-surface-strong: rgba(28, 25, 25, 0.85);
    --dc-ink: #ebe7e3;
    --dc-ink-dim: #8e8682;
    --dc-rule: rgba(235, 231, 227, 0.10);
    --dc-rule-strong: rgba(235, 231, 227, 0.18);
    --dc-red: #d04545;
    --dc-red-hover: #b83a3a;
    --dc-red-glow: rgba(208, 69, 69, 0.4);

    --dc-sans: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --dc-mono: 'Cascadia Code', 'Cascadia Code Variable', 'Cascadia Mono', Consolas, 'Courier New', ui-monospace, monospace;

    /* Motion: things arrive quickly and settle gently, as in Windows. */
    --dc-ease-out: cubic-bezier(0.1, 0.9, 0.2, 1);
    --dc-quick: 0.12s;
    --dc-calm: 0.24s;
}

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

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

html {
    position: relative;
    min-height: 100%;
    background: var(--dc-bg);
    color: var(--dc-ink);
    font-size: 15px;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

/* The body stays see-through so that a page can put a backdrop behind its content. */
body {
    margin: 0;
    background: transparent;
    color: var(--dc-ink);
    font-family: var(--dc-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--dc-ink);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover { color: var(--dc-red); }

::selection {
    background: var(--dc-red);
    color: var(--dc-bg);
}

/* A thin scrollbar, like Windows 11's. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
    background: rgba(235, 231, 227, 0.12);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(235, 231, 227, 0.22);
    background-clip: padding-box;
}

/* A still backdrop for pages without the site's moving one: two red glows on the dark ground. */
.dc-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 28% 18%, rgba(208, 69, 69, 0.14), transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 82%, rgba(208, 69, 69, 0.08), transparent 60%),
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(40, 18, 18, 0.4), transparent 70%);
}

/* ----- Page and sections ----- */

.dc-page.dc-page-narrow { max-width: 868px; }

.dc-page {
    position: relative;
    max-width: 1104px;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
}

.dc-page-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
}

.dc-page-lead {
    margin: 0.75rem 0 2.5rem;
    max-width: 36rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--dc-ink-dim);
}

.dc-section { margin-top: 6.5rem; }

.dc-section-tight { margin-top: 5rem; }

.dc-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1.25rem;
}

.dc-section-head h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}

.dc-section-head .dc-quiet-link { font-size: 0.9rem; }

.dc-section-lead {
    margin: -0.5rem 0 1.75rem;
    max-width: 38rem;
    line-height: 1.6;
    color: var(--dc-ink-dim);
}

/* ----- Header and footer ----- */

.dc-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
}

/* The bar keeps its place while one page gives way to the next. */
.dc-bar {
    view-transition-name: dc-bar;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.4rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(13, 12, 12, 0.65);
    border-bottom: 1px solid var(--dc-rule);
    padding: 0.35rem 1.25rem;
}

.dc-brand {
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 44px;
    color: var(--dc-ink);
}

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

.dc-brand-logo {
    filter: drop-shadow(0 0 8px var(--dc-red-glow));
}

.dc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-right: auto;
}

.dc-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.65rem;
    font-size: 0.9rem;
    color: var(--dc-ink-dim);
    box-shadow: inset 0 -2px 0 transparent;
    transition: color .15s ease, box-shadow .15s ease;
}

.dc-nav a:hover {
    color: var(--dc-ink);
    box-shadow: inset 0 -2px 0 var(--dc-rule-strong);
}

.dc-nav a.active {
    color: var(--dc-ink);
    box-shadow: inset 0 -2px 0 var(--dc-red);
}

.dc-footer {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.4rem;
    padding: 0.9rem 1.25rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(13, 12, 12, 0.65);
    border-top: 1px solid var(--dc-rule);
    font-size: 0.88rem;
    color: var(--dc-ink-dim);
}

.dc-footer a {
    color: var(--dc-ink-dim);
    border-bottom: 1px dotted var(--dc-rule);
}

.dc-footer a:hover {
    color: var(--dc-red);
    border-bottom-color: var(--dc-red);
}

/* ----- Panel ----- */

.dc-panel {
    background: var(--dc-surface-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--dc-rule);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ----- Chips ----- */

.dc-chip {
    font-family: var(--dc-mono);
    font-size: 0.78rem;
    background: rgba(235, 231, 227, 0.03);
    border: 1px solid var(--dc-rule-strong);
    color: var(--dc-ink);
    padding: 0.22em 0.6em;
    border-radius: 3px;
    white-space: nowrap;
}

.dc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ----- Icon tile ----- */

/* A small red-tinted square that holds an icon. */
.dc-tile {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 6px;
    background: rgba(208, 69, 69, 0.07);
    border: 1px solid rgba(208, 69, 69, 0.2);
    color: var(--dc-red);
    font-size: 1.05rem;
}

/* ----- Facts ----- */

.dc-facts {
    flex: 1 1 18rem;
    min-width: 0;
    margin: 0;
    padding: 0.5rem 1.4rem;
}

.dc-facts div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--dc-rule);
}

.dc-facts div:first-child { border-top: 0; }

.dc-facts dt {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--dc-ink-dim);
}

.dc-facts dd {
    margin: 0;
    font-size: 0.9rem;
    text-align: right;
}

.dc-facts dd a { border-bottom: 1px dotted rgba(208, 69, 69, 0.5); }

.dc-facts dd a:hover { border-bottom-color: var(--dc-red); }

/* ----- Strip ----- */

/* A panel with a sentence on the left and a button or two on the right. */
.dc-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    padding: 1.9rem 2rem;
}

.dc-strip > div:first-child,
.dc-strip > p {
    flex: 1 1 24rem;
    min-width: 0;
}

.dc-strip h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}

.dc-strip p {
    margin: 0.5rem 0 0;
    max-width: 34rem;
    font-size: 0.97rem;
    line-height: 1.6;
    color: var(--dc-ink-dim);
}

.dc-strip > p { margin: 0; }

.dc-strip p strong {
    color: var(--dc-ink);
    font-weight: 600;
}

/* ----- Actions and links ----- */

.dc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dc-quiet-link {
    color: var(--dc-ink-dim);
    border-bottom: 1px dotted var(--dc-rule-strong);
}

.dc-quiet-link:hover {
    color: var(--dc-red);
    border-bottom-color: var(--dc-red);
}

/* ----- Document ----- */

.dc-doc {
    margin-top: 2rem;
    padding: 1.75rem 2rem 2rem;
}

.dc-doc dl { margin: 0; }

.dc-doc h2,
.dc-doc dt {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dc-ink);
}

.dc-doc h2:first-child,
.dc-doc dt:first-child { margin-top: 0; }

.dc-doc p,
.dc-doc li,
.dc-doc dd {
    color: #cbc5c1;
    line-height: 1.65;
    font-size: 0.95rem;
}

/* Spacing and list marks are spelled out, so that the text looks the same over any reset. */
.dc-doc h2 { line-height: 1.2; }

.dc-doc p { margin: 0 0 1rem; }

.dc-doc ul,
.dc-doc ol {
    margin: 0 0 1rem;
    padding-left: 2rem;
}

.dc-doc ul { list-style: disc; }
.dc-doc ol { list-style: decimal; }

.dc-doc dd { margin: 0; }

.dc-doc dd + dd { margin-top: 0.5rem; }

.dc-doc a {
    color: var(--dc-ink);
    border-bottom: 1px dotted rgba(208, 69, 69, 0.4);
    word-break: break-word;
}

.dc-doc a:hover {
    color: var(--dc-red);
    border-bottom-color: var(--dc-red);
}

.dc-doc .dc-preamble {
    margin: 0 0 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--dc-rule);
    font-size: 0.9rem;
    color: var(--dc-ink-dim);
}

/* ----- Notice ----- */

.dc-notice {
    max-width: 620px;
    margin: 2rem auto 0;
    padding: 1.9rem 1.9rem 1.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.5);
}

.dc-notice h1 {
    font-size: clamp(1.45rem, 3.4vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

.dc-notice-text {
    margin: 0 0 1.4rem;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--dc-ink-dim);
}

.dc-notice-text a {
    color: var(--dc-ink);
    border-bottom: 1px dotted rgba(208, 69, 69, 0.5);
}

.dc-diagnostics {
    margin: 0 0 1.4rem;
    padding: 0.25rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--dc-rule);
    border-radius: 6px;
    font-family: var(--dc-mono);
    font-size: 0.8rem;
}

.dc-diagnostics div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.1rem 1rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--dc-rule);
}

.dc-diagnostics div:first-child { border-top: 0; }

.dc-diagnostics dt {
    font-weight: 400;
    color: var(--dc-ink-dim);
}

.dc-diagnostics dd {
    margin: 0;
    word-break: break-all;
}

/* ----- Buttons ----- */

/* Works on a link and on a button. Add dc-button-primary or dc-button-outline. */
.dc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform var(--dc-quick) ease;
}

/* A button gives a little under the finger. */
.dc-button:active { transform: scale(0.98); }

.dc-button i { font-size: 1em; }

.dc-button-primary,
.dc-button-primary:focus {
    background: var(--dc-red);
    border-color: var(--dc-red);
    color: #fff;
}

.dc-button-primary:hover {
    background: var(--dc-red-hover);
    border-color: var(--dc-red-hover);
    color: #fff;
}

.dc-button-outline,
.dc-button-outline:focus {
    background: transparent;
    border-color: var(--dc-rule-strong);
    color: var(--dc-ink);
}

.dc-button-outline:hover {
    background: rgba(235, 231, 227, 0.04);
    border-color: rgba(235, 231, 227, 0.28);
    color: var(--dc-ink);
}

.dc-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--dc-bg), 0 0 0 4px var(--dc-red);
}

.dc-button:disabled {
    opacity: 0.55;
    cursor: default;
}

/* ----- Form fields ----- */

/* A label with its input below it. dc-field-label holds the name and, at the right, a hint. */
.dc-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.84rem;
}

.dc-field-label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.dc-field-hint { color: var(--dc-ink-dim); }

.dc-input {
    width: 100%;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--dc-rule-strong);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--dc-ink);
    font-family: inherit;
    font-size: 0.94rem;
    transition: border-color var(--dc-quick) ease, box-shadow var(--dc-quick) ease;
}

.dc-input:focus-visible {
    outline: none;
    border-color: rgba(208, 69, 69, 0.6);
    box-shadow: 0 0 0 2px var(--dc-bg), 0 0 0 4px var(--dc-red);
}

/* ----- Motion ----- */

/* Little of it, and only where it says something: a page arriving, a thing appearing, a button taking a press.
   The last section of this file switches all of it off for people who asked their system for less motion. */

@keyframes dc-rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes dc-fade-in {
    from { opacity: 0; }
}

/* Put this on something that has just appeared. */
.dc-enter { animation: dc-rise-in var(--dc-calm) var(--dc-ease-out) both; }

/* Going from one page to the next, the old page fades into the new one instead of being cut off. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}

::view-transition-group(root) { animation-duration: 0.2s; }

/* ----- Narrow screens ----- */

@media (max-width: 575px) {
    /* Two rows on a phone: the brand and the language first, the links below. Too tall to stay pinned. */
    .dc-header { position: static; }

    .dc-nav {
        order: 3;
        flex: 1 0 100%;
        margin-left: -0.65rem;
    }

    .dc-page { padding: 2.5rem 1.1rem 4rem; }

    .dc-section { margin-top: 4.5rem; }

    .dc-strip { padding: 1.5rem 1.25rem; }
}

/* ----- Reduced motion ----- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
