/* wisst studio at studio.wisst.app (design system: Studio). Tokens come from tokens.css; nothing here is a colour,
   a duration or a face of its own. The theme is the computer's (tokens.css follows prefers-color-scheme). */

* { box-sizing: border-box; }
html { color-scheme: light dark; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: var(--rule) solid var(--focus); outline-offset: var(--space-2); }
[hidden] { display: none !important; }

/* Every clickable element gets the hand cursor. */
@layer base {
  a[href], button:not(:disabled), [role="button"]:not([aria-disabled="true"]),
  summary, label[for] { cursor: pointer; }
}

.muted { color: var(--ink-muted); }
.secondary { color: var(--ink-secondary); }

.icon { width: var(--console-tag-icon); height: var(--console-tag-icon); flex: none; }

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

/* Buttons are pills (the app's Button): ink is the one filled button; outline, quiet and danger are words. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); border: 0;
       border-radius: var(--radius-pill); background: transparent; color: var(--ink); text-decoration: none; white-space: nowrap;
       transition: opacity var(--duration-press) var(--ease-standard), transform var(--duration-press) var(--ease-standard); }
.btn.lg { min-height: var(--control-lg); padding-inline: var(--space-24); }
.btn.md { min-height: var(--control-md); padding-inline: var(--space-24); }
.btn.sm { min-height: var(--control-sm); padding-inline: var(--space-16); }
.btn.outline, .btn.quiet { padding-inline: var(--space-8); }   /* the app's outline and quiet: words in ink and ink-muted */
.btn.quiet { color: var(--ink-muted); }
.btn.ink { background: var(--inverse); color: var(--on-inverse); }
.btn:hover:not(:disabled) { background: var(--fill-soft); }
.btn.quiet:hover:not(:disabled) { color: var(--ink); }
.btn.ink:hover:not(:disabled) { background: color-mix(in srgb, var(--inverse) 85%, var(--paper)); }
.btn:active:not(:disabled) { transform: scale(0.98); opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* A Notice: an icon and the sentence on paper-raised, a hairline round it. */
.notice { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-12) var(--space-16);
          border-radius: var(--radius-16); background: var(--paper-raised); border: var(--hairline) solid var(--line); color: var(--ink); }
.notice .icon { margin-top: var(--space-2); }
.notice-text { flex: 1; }
.notice.error { color: var(--danger); }

/* A field: the caption over a boxed input, as the app's Field. */
.field { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.input { height: var(--control-md); padding-inline: var(--space-16); border-radius: var(--radius-16); width: 100%;
         border: var(--hairline) solid var(--line-strong); background: var(--paper-raised); color: var(--ink); appearance: none; }
.input:hover:not(:disabled):not(:focus) { border-color: var(--ink-muted); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 var(--hairline) var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled { opacity: 0.4; }
.field-error { display: flex; align-items: center; gap: var(--space-8); color: var(--danger); }

/* ---------------------------------------------------------------- Sign in */

.signin { padding: var(--space-24) var(--space-48) var(--space-32); min-height: 100vh; }
.signin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-48); }
.mark { color: var(--ink); display: inline-flex; }
.mark svg { height: var(--space-24); width: auto; display: block; }
.mark .dot { fill: var(--signal); }
.signin-col { max-width: var(--measure); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-16); }
.signin-col.unavailable { padding: var(--space-48) var(--gutter); }

.scan { display: flex; gap: var(--space-24); align-items: center; margin-top: var(--space-16); }
.scan-words { display: flex; flex-direction: column; gap: var(--space-8); }

/* The code: dark on light in both themes, as on the home page; it changes with no animation. */
.qr { position: relative; flex: none; width: calc(10 * var(--space-24)); height: calc(10 * var(--space-24)); padding: var(--space-16);
      border-radius: var(--radius-12); background: var(--paper); color: var(--ink); box-shadow: 0 0 0 var(--hairline) var(--line); }
.qr:focus { outline: none; }
.qr > svg { display: block; width: 100%; height: 100%; }
.qr.dim { background: transparent; color: var(--ink); }
.qr.dim > svg { opacity: 0.16; }
.qr-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-16); }
@media (prefers-color-scheme: dark) {
  .qr { background: var(--ink); color: var(--paper); box-shadow: none; }
  .qr.dim { background: transparent; color: var(--ink); box-shadow: 0 0 0 var(--hairline) var(--line); }
}

.or { display: flex; align-items: center; gap: var(--space-12); margin-block: var(--space-16); }
.or::before, .or::after { content: ''; flex: 1; height: var(--hairline); background: var(--line); }

.ways { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }
.google { display: inline-flex; align-items: center; gap: var(--space-12); min-height: var(--control-md); padding-inline: var(--space-24);
          border: 0; border-radius: var(--radius-16); background: var(--fill-soft); color: var(--ink); white-space: nowrap; }
.google:hover { background: linear-gradient(var(--fill-soft), var(--fill-soft)), var(--fill-soft); }
.google img { width: calc(var(--space-16) + var(--space-4)); height: calc(var(--space-16) + var(--space-4)); display: block; }

.email-step { display: flex; flex-direction: column; gap: var(--space-16); align-items: stretch; }
.email-step .back { align-self: flex-start; }
.field-row { display: flex; gap: var(--space-12); align-items: flex-end; }
.field-row .field { flex: 1; }
.field.code { max-width: calc(10 * var(--space-24)); }
.field.code .input { letter-spacing: var(--space-4); font-variant-numeric: tabular-nums; }

.signin-foot { display: flex; gap: var(--space-24); margin-top: var(--space-32); }
.signin-foot a { color: var(--ink); text-decoration: none; }
.signin-foot a:hover { text-decoration: underline; }

@media (max-width: 639px) {
  .signin { padding: var(--space-24) var(--gutter); }
  .scan { flex-direction: column; align-items: flex-start; }
  .field-row { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------------- the frame */

.shell { display: grid; grid-template-columns: var(--console-sidebar) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper-raised); border-inline-end: var(--hairline) solid var(--line); padding: var(--space-24) var(--space-16);
        display: flex; flex-direction: column; gap: var(--space-24); position: sticky; top: 0; height: 100vh; }
.side .mark { padding-inline: var(--space-12); align-self: flex-start; border-radius: var(--radius-4); }
.nav { display: flex; flex-direction: column; gap: var(--space-4); }
.nav a { display: flex; align-items: center; min-height: var(--control-md); padding-inline: var(--space-16);
         border-radius: var(--radius-pill); text-decoration: none; color: var(--ink-secondary); }
.nav a:hover { background: var(--fill-soft); }
.nav a[aria-current="page"] { background: var(--fill-soft); color: var(--ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-16); }
.side-foot .btn { padding-inline: var(--space-12); }   /* in line with the name, the address and the wordmark */
.who { display: flex; flex-direction: column; gap: var(--space-2); padding-inline: var(--space-12); min-width: 0; max-width: 100%; }
.who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: var(--space-48); min-width: 0; }
.column { max-width: var(--measure); display: flex; flex-direction: column; gap: var(--space-24); }

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-12);
          padding: var(--space-12) var(--gutter); border-inline-end: 0; border-bottom: var(--hairline) solid var(--line); }
  .side .mark { padding-inline: 0; align-self: center; }
  .nav { flex-direction: row; }
  .side-foot { margin-top: 0; margin-inline-start: auto; flex-direction: row; align-items: center; gap: var(--space-12); }
  .who { display: none; }
  .content { padding: var(--space-32) var(--gutter); }
}

/* ---------------------------------------------------------------- My articles and the article */

.ink-body { color: var(--ink-body); }
.btn.danger { color: var(--danger); }
.btn.danger.lg { background: var(--danger); color: var(--paper); }
.btn.danger.lg:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 85%, var(--paper)); }
.btn.danger:hover:not(:disabled) { background: var(--fill-soft); }
[dir="rtl"] .back .icon { transform: scaleX(-1); }

/* The topic's colours: the mark is the fill, the topic line the text colour (on paper, in either theme). */
.tp-science { --tc: var(--topic-science); --tct: var(--topic-science-text); }
.tp-technology { --tc: var(--topic-technology); --tct: var(--topic-technology-text); }
.tp-history { --tc: var(--topic-history); --tct: var(--topic-history-text); }
.tp-psychology { --tc: var(--topic-psychology); --tct: var(--topic-psychology-text); }
.tp-health { --tc: var(--topic-health); --tct: var(--topic-health-text); }
.tp-food { --tc: var(--topic-food); --tct: var(--topic-food-text); }
.tp-economics { --tc: var(--topic-economics); --tct: var(--topic-economics-text); }
.tp-society { --tc: var(--topic-society); --tct: var(--topic-society-text); }
.tp-nature { --tc: var(--topic-nature); --tct: var(--topic-nature-text); }
.tp-language { --tc: var(--topic-language); --tct: var(--topic-language-text); }
.tp-philosophy { --tc: var(--topic-philosophy); --tct: var(--topic-philosophy-text); }
.tp-arts { --tc: var(--topic-arts); --tct: var(--topic-arts-text); }

.head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-16); }
.articles-body { display: flex; flex-direction: column; gap: var(--space-16); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.chip { display: inline-flex; align-items: center; gap: var(--space-4); height: var(--control-sm); padding-inline: var(--space-12);
        border: 0; border-radius: var(--radius-pill); background: var(--fill-soft); color: var(--ink); }
.chip[aria-selected="true"] { background: var(--inverse); color: var(--on-inverse); }
.chip:not([aria-selected="true"]):hover { background: color-mix(in srgb, var(--fill-soft) 60%, var(--line)); }
.chip-count { font-weight: 400; opacity: 0.8; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.arow { display: grid; grid-template-columns: var(--space-12) minmax(0, 1fr) auto; gap: var(--space-12) var(--space-16); align-items: start;
        padding: var(--space-16) var(--space-12); margin-inline: calc(-1 * var(--space-12)); border-top: var(--hairline) solid var(--line);
        text-decoration: none; color: inherit; border-radius: var(--radius-12); }
.arow:hover { background: var(--fill-soft); }
.mark-dot { width: var(--space-12); height: var(--space-12); border-radius: var(--radius-pill); background: var(--tc, var(--topic-none)); margin-top: calc(var(--space-8) - var(--space-2)); }
.arow-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.arow-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: start; overflow-wrap: anywhere; }
.arow-nums { white-space: nowrap; padding-top: var(--space-4); }
.arow-nums:empty { display: none; }

.empty { display: flex; flex-direction: column; gap: var(--space-12); align-items: flex-start; padding-top: var(--space-16); }

.skeleton { display: flex; flex-direction: column; }
.sk-row { display: flex; gap: var(--space-16); padding: var(--space-16) 0; border-top: var(--hairline) solid var(--line); }
.sk-dot { width: var(--space-12); height: var(--space-12); border-radius: var(--radius-pill); background: var(--fill-soft); margin-top: var(--space-8); flex: none; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: var(--space-8); }
.sk-bar { display: block; height: var(--space-12); width: 40%; border-radius: var(--radius-4); background: var(--fill-soft); }
.sk-bar.wide { width: 85%; height: var(--space-16); }
.sk-row .sk-bar { animation: pulse var(--duration-skeleton-pulse) var(--ease-standard) infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .sk-row .sk-bar { animation: none; } }

.article { display: flex; flex-direction: column; gap: var(--space-16); }
.back { align-self: flex-start; padding-inline: 0; gap: var(--space-4); margin-inline-start: calc(-1 * var(--space-4)); }
.topic-line { color: var(--tct, var(--ink-muted)); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-24); align-items: center; }
.actions .btn.outline, .actions .btn.danger { padding-inline: 0; }
.section { margin: var(--space-16) 0 0; }
.callout-danger { display: flex; align-items: flex-start; gap: var(--space-8); color: var(--danger); }
.callout-danger .icon { margin-top: var(--space-2); }
.readers { display: flex; flex-direction: column; }
.reader-row { display: flex; justify-content: space-between; align-items: center; min-height: var(--control-md); border-top: var(--hairline) solid var(--line); }
.reader-row .t-label { font-variant-numeric: tabular-nums; }
.insights { display: flex; flex-direction: column; gap: var(--space-16); }
.insight { display: flex; flex-direction: column; gap: var(--space-4); }
.insight p { text-align: start; }

/* A sheet at a desk, over the scrim; a toast at the bottom centre. */
.scrim { position: fixed; inset: 0; z-index: 10; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: var(--space-24); }
.sheet { width: var(--card-measure); max-width: 100%; background: var(--paper); color: var(--ink); border-radius: var(--radius-26);
         padding: var(--space-32) var(--space-32) var(--space-24); display: flex; flex-direction: column; gap: var(--space-12); }
.sheet .btn.lg { margin-top: var(--space-12); }
.toast { position: fixed; z-index: 20; bottom: var(--space-24); inset-inline: 0; margin-inline: auto; width: fit-content; max-width: calc(100% - 2 * var(--space-24));
         padding: var(--space-12) var(--space-16); border-radius: var(--radius-16); background: var(--inverse); color: var(--on-inverse); text-align: center; }
@media (min-width: 1024px) { .toast { inset-inline-start: var(--console-sidebar); } }
