/* Hushly Calm: reset, page frame and type. Reads tokens only. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ColorBackdrop);
  scroll-padding-top: calc(var(--TopBarHeight) + var(--SafeTop));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ColorBackdrop);
  color: var(--ColorText);
  font-family: var(--FontBody);
  font-size: var(--TextBodySize);
  font-weight: var(--WeightRegular);
  line-height: var(--TextBodyLine);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}

a {
  color: var(--ColorPrimaryText);
  text-underline-offset: 3px;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--ColorPrimarySoft);
  color: var(--ColorText);
}

/* Visible focus on everything that can take it */
:focus-visible {
  outline: 3px solid var(--ColorFocus);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Page frame: a shell at most 430px wide, centred on a soft backdrop on larger screens */
.Shell {
  position: relative;
  width: 100%;
  max-width: var(--ShellMax);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--ColorBg);
  color: var(--ColorText);
  display: flex;
  flex-direction: column;
  padding-inline: var(--SafeLeft) var(--SafeRight);
}

@media (min-width: 480px) {
  .Shell {
    border-inline: 1px solid var(--ColorBorder);
    box-shadow: var(--ShadowCard);
  }
}

.Sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.VisuallyHidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Type styles. The heading level in the markup never decides the size. */
.TextDisplay {
  font-family: var(--FontDisplay);
  font-weight: var(--WeightDisplay);
  font-size: var(--TextDisplaySize);
  line-height: var(--TextDisplayLine);
  font-variation-settings: "SOFT" 100;
  letter-spacing: -0.01em;
}

.TextTitle {
  font-weight: var(--WeightBold);
  font-size: var(--TextTitleSize);
  line-height: var(--TextTitleLine);
  letter-spacing: -0.02em;
}

.TextHeading {
  font-weight: var(--WeightBold);
  font-size: var(--TextHeadingSize);
  line-height: var(--TextHeadingLine);
}

.TextBodyLg {
  font-weight: var(--WeightMedium);
  font-size: var(--TextBodyLgSize);
  line-height: var(--TextBodyLgLine);
}

.TextBody {
  font-size: var(--TextBodySize);
  line-height: var(--TextBodyLine);
}

.TextCaption {
  font-weight: var(--WeightMedium);
  font-size: var(--TextCaptionSize);
  line-height: var(--TextCaptionLine);
}

.TextLabel {
  font-weight: 600;
  font-size: var(--TextLabelSize);
  line-height: var(--TextLabelLine);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.TextSecondary {
  color: var(--ColorTextSecondary);
}

.TextCenter {
  text-align: center;
}

.TextDisplay.IsDisplayTight {
  letter-spacing: -0.015em;
}

/* Stacks and clusters */
.Stack {
  display: flex;
  flex-direction: column;
  gap: var(--CardGap);
}

.StackTight {
  display: flex;
  flex-direction: column;
  gap: var(--Space12);
}

.StackSmall {
  display: flex;
  flex-direction: column;
  gap: var(--Space8);
}

.Cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--Space8);
}

/* Icons: 24px grid, 2px stroke, round caps and joins */
.Icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.IconSmall {
  width: 18px;
  height: 18px;
}

.IconLarge {
  width: 32px;
  height: 32px;
}
