/* Замультим: the design system. What each piece is for: docs/DESIGN_SYSTEM.md.
   See it all on one page at /admin/ui. Colours, sizes and corners come from the
   tokens below; a template that needs a new value adds a token here first. */

@font-face { font-family: Rubik; font-weight: 400; font-display: swap;
             src: url(fonts/rubik-cyrillic-400.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Rubik; font-weight: 400; font-display: swap;
             src: url(fonts/rubik-latin-400.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap;
             src: url(fonts/rubik-cyrillic-500.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap;
             src: url(fonts/rubik-latin-500.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap;
             src: url(fonts/rubik-cyrillic-600.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap;
             src: url(fonts/rubik-latin-600.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap;
             src: url(fonts/rubik-cyrillic-700.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap;
             src: url(fonts/rubik-latin-700.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }
@font-face { font-family: Rubik; font-weight: 800; font-display: swap;
             src: url(fonts/rubik-cyrillic-800.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Rubik; font-weight: 800; font-display: swap;
             src: url(fonts/rubik-latin-800.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }
@font-face { font-family: Caveat; font-weight: 700; font-display: swap;
             src: url(fonts/caveat-cyrillic-700.woff2) format("woff2");
             unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Caveat; font-weight: 700; font-display: swap;
             src: url(fonts/caveat-latin-700.woff2) format("woff2");
             unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20C0, U+2212; }

:root {
  /* text and surfaces */
  --ink: #2A1A4A; --dim: #5A4E72; --off: #706686;
  --paper: #FFF9E3; --surface: #fff; --sunk: #F4F0E2; --line: #E4DCC0; --field: #8A7FA0;
  /* brand */
  --accent: #D6361B; --accent-hover: #B3261A; --sun: #FFD23F; --soft: #FFE99A; --soft-ink: #5A4300;
  --link: #4B2E9E; --pale: #E6DEFA; --tint: #F3EFFC;
  --boy: #2F7BF6; --girl: #F0488F;
  /* states */
  --ok: #2F7D4F; --ok-bg: #D9F2DF; --ok-ink: #14573A;
  --bad: #B3261A; --bad-bg: #FBE0DC; --bad-ink: #8C1D18;
  --todo: #F2B705;
  /* type */
  --fs-xs: .8125rem; --fs-s: .9rem; --fs-m: 1rem; --fs-l: 1.2rem; --fs-xl: 1.75rem;
  /* corners */
  --r-s: .5rem; --r-m: .75rem; --r-l: 1rem; --r-full: 99rem;
  /* depth and motion */
  --lift: 0 1px 2px rgba(42, 26, 74, .06), 0 4px 16px rgba(42, 26, 74, .05);
  --fast: .12s ease;
  /* controls */
  --control: 3rem;
}

* { box-sizing: border-box; }
body { font: 17px/1.55 Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
       color: var(--ink); margin: 0; background: var(--paper); overflow-x: clip; }
main { max-width: 42rem; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
main.wide { max-width: 56rem; }
main.land { max-width: 75rem; padding-top: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.15; margin: 0 0 .5rem; }
h2 { font-size: var(--fs-l); font-weight: 700; margin: 2rem 0 .6rem; }
h3 { font-size: var(--fs-m); font-weight: 600; }
.flush { margin-top: 0; }
.wraps { overflow-wrap: anywhere; }
.page-head { margin: 0 0 1.5rem; }
.page-head h1 { margin-bottom: .2rem; }
.tight { margin: 0; }
.gap-below { margin: 0 0 1rem; }
.gap-above { margin-top: 1rem; }
p.lead { color: var(--dim); margin: 0 0 2rem; }
.note { font: 700 var(--fs-xl)/1.1 Caveat, cursive; margin: 0 0 .3rem; }
.hint { font-weight: 400; color: var(--dim); font-size: var(--fs-s); }
.hint.bad, .bad-text { color: var(--bad); }
.step { color: var(--dim); font-size: var(--fs-s); margin-bottom: .6rem; }
code { font-size: .9em; }
video { width: 100%; border-radius: var(--r-s); background: #000; }
audio { max-width: 100%; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* links: a word in a sentence that leads to another page. An action is a button. */
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em;
    transition: color var(--fast); }
a:hover { color: var(--ink); }

/* breadcrumbs: where this page stands */
.crumbs { display: flex; flex-wrap: wrap; gap: .1rem .45rem; align-items: center;
          color: var(--dim); font-size: var(--fs-s); margin: 0 0 .6rem; }
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--field); }

/* fields */
label { display: block; font-weight: 600; margin: 1.1rem 0 .3rem; }
input[type=text], input[type=email], textarea, select {
  width: 100%; min-height: var(--control); padding: .7rem .85rem; font: inherit; color: var(--ink);
  border: 1px solid var(--field); border-radius: var(--r-m); background: var(--surface);
  transition: border-color var(--fast), box-shadow var(--fast); }
input[type=text]:hover, input[type=email]:hover, textarea:hover, select:hover { border-color: var(--ink); }
input[type=text]:focus, input[type=email]:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px var(--pale); }
textarea { min-height: 5rem; resize: vertical; }
::placeholder { color: var(--off); }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; flex: none; margin: 0;
                                          accent-color: var(--link); cursor: pointer; }
input[type=file] { font: inherit; font-size: var(--fs-s); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; min-height: 2.5rem; margin-right: .75rem; padding: .3rem 1rem; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--field); border-radius: var(--r-m); }

/* buttons. Primary: `button`, `.cta`. Secondary: `.quiet`. Tertiary: `.plain`.
   `.danger` on the last two marks what takes something away. One red button
   to a screen; inside work cards the primary goes in ink. */
button, .cta { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
               min-height: var(--control); padding: .6rem 1.5rem; font: inherit; font-weight: 700;
               line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer;
               border: 0; border-radius: var(--r-m); background: var(--accent); color: #fff;
               transition: background-color var(--fast), border-color var(--fast), color var(--fast), transform var(--fast); }
button:hover, .cta:hover { background: var(--accent-hover); color: #fff; }
button:active, .cta:active { transform: translateY(1px); }
button.ink { background: var(--ink); }
button.ink:hover { background: #3E2A66; }
button.quiet, .cta.quiet { background: var(--surface); color: var(--ink); font-weight: 600;
                           box-shadow: inset 0 0 0 1px var(--field); }
button.quiet:hover, .cta.quiet:hover { background: var(--tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
button.plain, a.plain { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
                        min-height: 2.5rem; padding: .35rem .85rem; font-size: var(--fs-s); font-weight: 600;
                        line-height: 1.25; text-decoration: none; cursor: pointer; border: 0;
                        border-radius: var(--r-m); background: var(--tint); color: var(--link);
                        transition: background-color var(--fast), color var(--fast); }
button.plain:hover, a.plain:hover { background: var(--pale); color: var(--ink); }
button.danger.plain { background: none; color: var(--dim); }
button.danger.plain:hover { background: var(--bad-bg); color: var(--bad-ink); }
button.danger.quiet { color: var(--bad-ink); box-shadow: inset 0 0 0 1px var(--bad); }
button.danger.quiet:hover { background: var(--bad-bg); color: var(--bad-ink); box-shadow: inset 0 0 0 1px var(--bad); }
button.solid-danger { background: var(--bad); }
button.solid-danger:hover { background: var(--bad-ink); }
button:disabled, button:disabled:hover { background: var(--sunk); color: var(--dim); box-shadow: none;
                                         transform: none; cursor: not-allowed; }
button.wide, .cta.wide { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .9rem; }
.row form { margin: 0; }
.row .push, .row form.push { margin-left: auto; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
        padding: 1.25rem; margin: 1rem 0; box-shadow: var(--lift); }
.card.strong { border: 2px solid var(--ink); }
a.card { display: block; text-decoration: none; color: inherit;
         transition: border-color var(--fast), transform var(--fast); }
a.card:hover { border-color: var(--ink); color: inherit; transform: translateY(-1px); }
.empty { border: 2px dashed var(--field); box-shadow: none; text-align: center;
         padding: clamp(2rem, 6vw, 4rem) 1.5rem; }
.empty p:not(.note) { margin: 0 auto 1.4rem; max-width: 30em; color: var(--dim); }
.empty h2 { margin: 0 0 .6rem; }

/* what opens and shuts */
details { margin-top: .9rem; }
summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; cursor: pointer;
          color: var(--link); font-size: var(--fs-s); font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; flex: none; width: .45em; height: .45em; margin: 0 .1em;
                  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg);
                  transition: transform var(--fast); }
details[open] > summary::before { transform: rotate(45deg); }
summary:hover { color: var(--ink); }

/* statuses */
.pill, .chip { display: inline-block; font-size: var(--fs-xs); font-weight: 600; padding: .1rem .7rem;
               border-radius: var(--r-full); background: var(--soft); color: var(--soft-ink); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.dim, .chip.closed { background: var(--sunk); color: var(--dim); }
.chip.waiting_customer { background: var(--pale); color: var(--ink); }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: var(--r-full);
         background: var(--sun); color: var(--ink); font-size: var(--fs-xs); font-weight: 700; text-align: center; }

/* something is being made: it moves, so nobody wonders whether it hung */
.wait { display: flex; align-items: center; gap: .55rem; }
.wait::before { content: ""; flex: none; width: 1em; height: 1em; border-radius: 50%;
                border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .35; } }
#refreshing { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .25rem; font-size: var(--fs-xs); }
#refreshing::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--ok);
                      animation: breathe 2s ease-in-out infinite; }
/* a small arrow under a video: the file, for those who want it */
a.save { display: flex; width: 2.25rem; height: 2.25rem; margin: .25rem 0 -.25rem auto; align-items: center; justify-content: center;
         border-radius: var(--r-full); color: var(--dim); }
a.save:hover { background: var(--tint); color: var(--link); }
/* how long it takes: the block itself fills up. See `_meter.html` */
.meter { position: relative; overflow: hidden; margin: .75rem 0; padding: .65rem .9rem; background: var(--surface);
         border: 1px solid var(--line); border-radius: var(--r-m); }
.meter::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--from, 0%); background: var(--pale);
                 animation: meter-fill var(--seconds, 0s) linear forwards; }
.meter.unknown::before { width: 35%; animation: meter-sway 1.6s ease-in-out infinite alternate; }
.meter > p { position: relative; display: flex; align-items: center; gap: .75rem; margin: 0; }
.meter .hint { display: block; }
.meter .share { margin-left: auto; font-size: var(--fs-l); font-variant-numeric: tabular-nums; }
@keyframes meter-fill { from { width: var(--from, 0%); } to { width: var(--upto, 0%); } }
@keyframes meter-sway { from { left: 0; } to { left: 65%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* messages */
.error { background: var(--bad-bg); color: var(--bad-ink); border-radius: var(--r-m);
         padding: .75rem 1rem; margin: 1rem 0; }
.told { border-color: var(--ink); }

/* the bar on every page: who you are and the way out */
.top { background: var(--ink); }
.top > div { max-width: 75rem; margin: 0 auto; padding: .35rem 1rem; display: flex;
             flex-wrap: wrap; align-items: center; gap: 0 1.25rem; min-height: 3.5rem; }
.top a.mark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.35rem;
               letter-spacing: -.01em; text-decoration: none; color: #fff; margin-right: auto; }
/* the neck stands on the bar's lower edge, the beak reaches past it */
.top a.mark { align-self: stretch; }
.top a.mark::before { content: ""; flex: none; align-self: flex-end; width: 5.1rem; height: 3.25rem;
                      margin-bottom: -.35rem; background: url(stork.png) left bottom / contain no-repeat; }
.top a.mark b { font-weight: 800; color: var(--sun); }
.top a, .top button { white-space: nowrap; }
.top .who { color: var(--pale); font-size: var(--fs-s); opacity: .8; }
.top a:not(.mark), .top button.plain { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem;
             padding: 0; font-size: var(--fs-s); font-weight: 500; text-decoration: none;
             background: none; color: var(--pale); }
.top a:not(.mark):hover, .top button.plain:hover { background: none; color: #fff; }
.top a.in { color: var(--sun); font-weight: 600; }
.top form { display: inline; margin: 0; }
/* on a phone one row: the address goes first, then support, which is in the
   footer of every page, unless an answer is waiting there */
@media (max-width: 44rem) { .top .who { display: none; } }
@media (max-width: 30rem) {
  .top > div { gap: 0 .9rem; flex-wrap: nowrap; }
  .top a.mark { font-size: var(--fs-l); gap: .3rem; }
  .top a.mark::before { width: 3.9rem; height: 2.5rem; }
  .top a.calm { display: none; }
}
@media (max-width: 23rem) {
  .top > div { gap: 0 .5rem; }
  .top a.mark { font-size: .98rem; gap: .15rem; }
  .top a.mark::before { width: 2.5rem; height: 1.6rem; }
}

/* the footer: the seller, as the acquirer asks to see on every page */
footer { color: var(--dim); font-size: var(--fs-xs); margin-top: 3.5rem; padding-top: 1.25rem;
         border-top: 1px solid var(--line); }
footer p { margin: .5rem 0 0; }
footer .legal { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: var(--fs-s); }
footer .legal a { padding: .35rem 0; text-decoration: none; }
footer .legal a:hover { text-decoration: underline; }
footer .unready { color: var(--bad); }
body.sun footer, body.sun footer a { color: var(--ink); border-color: rgba(42, 26, 74, .2); }

/* a form in a card of its own, on the sun: the way in */
.gate { max-width: 29rem; margin: 0 auto; background: var(--surface); border-radius: var(--r-l);
        padding: clamp(1.4rem, 5vw, 2.5rem); box-shadow: var(--lift); }
.gate button[type=submit]:not(.plain) { width: 100%; }
.gate .lead { margin-bottom: 1.25rem; }
.gate input[name=code] { font-size: 1.6rem; font-weight: 600; letter-spacing: .3em; text-align: center; }
body.sun { background: var(--sun); }

/* rows of things that open: projects, requests */
.rows .card { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .75rem 0;
              padding: 1.15rem 1.35rem; }
.rows .card .name { font-weight: 700; font-size: var(--fs-l); flex: 1 1 12rem; }
.rows .card .when { color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.rows .card .state { padding: .15rem .75rem; border-radius: var(--r-full); background: var(--soft);
                     color: var(--soft-ink); font-size: var(--fs-xs); font-weight: 600; }

/* consent: each its own box, none ticked in advance */
.consent { display: flex; gap: .7rem; align-items: flex-start; margin: 0; padding: .9rem 0;
           border-top: 1px solid var(--line); font-size: var(--fs-s); font-weight: 400; cursor: pointer; }
.consent input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.consent em { color: var(--dim); }
.consent[hidden] { display: none; }
.req { color: var(--accent); font-weight: 700; margin-left: .2rem; }

/* tables, for the people who run this */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
th { text-align: left; font-weight: 600; color: var(--dim); font-size: var(--fs-xs);
     text-transform: uppercase; letter-spacing: .04em; padding: .4rem .5rem; }
td { padding: .5rem; border-top: 1px solid var(--line); vertical-align: top; }
tr.flag td { background: #FFF8E6; }

.letter { background: var(--sunk); border: 1px dashed var(--line); border-radius: var(--r-s);
          padding: .75rem 1rem; font: var(--fs-s)/1.5 ui-monospace, monospace; white-space: pre-wrap; }
.plain-list { padding-left: 1.2rem; color: var(--dim); font-size: var(--fs-s); }
.plain-list li { margin: .4rem 0; }
.faces { display: flex; flex-wrap: wrap; gap: .75rem; }
.faces label { margin: 0; cursor: pointer; font-weight: 400; }
.faces img { display: block; width: 150px; max-width: 100%; border-radius: var(--r-s); border: 3px solid transparent; }
.faces input { position: absolute; opacity: 0; }
.faces input:checked + img { border-color: var(--ink); }

/* asking before something is taken away: <form data-confirm="…"> */
.ask { max-width: 26rem; width: calc(100% - 2rem); padding: 1.5rem; border: 0; border-radius: var(--r-l);
       color: var(--ink); background: var(--surface); box-shadow: 0 12px 48px rgba(42, 26, 74, .28); }
.ask::backdrop { background: rgba(42, 26, 74, .45); }
.ask p { margin: 0 0 1.25rem; font-weight: 500; }
.ask .row { justify-content: flex-end; margin: 0; }
