*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  min-height: 100%;
  background: var(--shell-paper);
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  color: var(--shell-ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(164, 58, 42, 0.045), transparent 28rem),
    linear-gradient(90deg, rgba(79, 67, 53, 0.025) 1px, transparent 1px),
    var(--shell-paper);
  background-size: auto, 5rem 5rem, auto;
  font-family: var(--shell-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body.is-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  border: 1px solid var(--shell-rule-strong);
  border-radius: var(--shell-radius-sm);
  color: var(--shell-ink);
  background: var(--shell-paper-strong);
  font: inherit;
}

button {
  min-height: var(--shell-control-height);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
select,
textarea {
  accent-color: var(--shell-blue);
}

input::placeholder,
textarea::placeholder {
  color: var(--shell-placeholder);
  opacity: 1;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--shell-blue);
  outline-offset: 3px;
}

::selection {
  color: var(--shell-paper-strong);
  background: var(--shell-blue);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.65rem 0.85rem;
  color: var(--shell-paper-strong);
  background: var(--shell-blue);
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.member-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 15.5rem minmax(0, 1fr);
}

.site-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 30;
  min-width: 0;
  height: 100vh;
  flex-direction: column;
  color: var(--shell-paper);
  background: var(--shell-dark);
  border-right: 1px solid rgba(245, 241, 232, 0.24);
}

.site-brand-row {
  min-height: 5.25rem;
  border-bottom: 1px solid rgba(245, 241, 232, 0.18);
}

.site-brand {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1.35rem;
  text-decoration: none;
}

.site-brand-word {
  font: 600 1.55rem/1 var(--shell-display);
  letter-spacing: 0.035em;
}

.site-brand-subtitle {
  margin-top: 0.5rem;
  color: #b9c5bf;
  font: 0.625rem/1.2 var(--shell-mono);
  letter-spacing: 0.09em;
}

.site-menu-toggle {
  display: none;
  width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border-color: rgba(245, 241, 232, 0.28);
  background: transparent;
}

.site-menu-toggle span {
  display: block;
  width: 1rem;
  height: 1px;
  margin: 0.18rem auto;
  background: currentColor;
}

.site-nav {
  display: grid;
  gap: 0.25rem;
  padding: 1.25rem 0.75rem;
}

.site-nav a {
  display: grid;
  min-height: 2.875rem;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  padding: 0.35rem 0.75rem;
  color: #bec9c4;
  text-decoration: none;
  transition:
    color var(--shell-duration) var(--shell-ease),
    background-color var(--shell-duration) var(--shell-ease);
}

.site-nav a span {
  color: #809087;
  font: 0.65rem var(--shell-mono);
}

.site-nav a strong {
  font-size: 0.82rem;
  font-weight: 650;
}

.site-nav a:hover {
  color: var(--shell-paper-strong);
  background: rgba(245, 241, 232, 0.08);
}

.site-nav a.is-current {
  color: var(--shell-dark);
  background: var(--shell-paper);
}

.site-nav a.is-current span {
  color: var(--shell-blue);
}

.member-account {
  display: grid;
  gap: 0.24rem;
  margin-top: auto;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(245, 241, 232, 0.18);
  color: #b9c5bf;
  font-size: 0.72rem;
}

.member-account-label {
  color: #819087;
  font: 0.58rem var(--shell-mono);
  letter-spacing: 0.1em;
}

.member-account strong {
  color: var(--shell-paper-strong);
  font-size: 0.86rem;
}

.member-account button {
  width: fit-content;
  min-height: 2.75rem;
  margin-top: 0.4rem;
  padding: 0 0.25rem;
  border: 0;
  color: var(--shell-coral);
  background: transparent;
  font-size: 0.75rem;
}

.member-workspace {
  min-width: 0;
}

.member-topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.8rem var(--shell-page-gutter);
  border-bottom: 1px solid var(--shell-line);
  background: var(--shell-header-surface);
  backdrop-filter: blur(12px);
}

.member-topbar > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.member-topbar-kicker {
  color: var(--shell-blue);
  font: 0.58rem var(--shell-mono);
  letter-spacing: 0.12em;
}

.member-topbar strong {
  font: 600 1.18rem var(--shell-display);
}

.member-topbar-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1.2rem;
  color: var(--shell-muted);
  font-size: 0.72rem;
}

.member-topbar-status > span {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.member-topbar-status i {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid currentColor;
  background: var(--shell-success);
}

.member-topbar-status > span:last-child i {
  background: var(--shell-blue);
}

main {
  width: min(var(--shell-workbench-width), calc(100% - (2 * var(--shell-page-gutter))));
  min-width: 0;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem) 0;
}

.site-footer {
  display: flex;
  width: min(var(--shell-workbench-width), calc(100% - (2 * var(--shell-page-gutter))));
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  border-top: 1px solid var(--shell-rule);
  color: var(--shell-muted);
  font-size: 0.68rem;
}

[data-ui="surface"] {
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius-sm);
  background: var(--shell-surface);
}

@media (max-width: 52rem) {
  body.is-menu-open {
    overflow: auto;
  }

  .member-shell {
    display: block;
  }

  .site-header {
    display: block;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(245, 241, 232, 0.24);
  }

  .site-brand-row {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.75rem;
  }

  .site-brand {
    padding-inline: 1rem;
  }

  .site-brand-subtitle {
    display: none;
  }

  .site-menu-toggle {
    display: block;
  }

  .site-nav,
  .member-account {
    display: none;
  }

  .site-header.is-open .site-nav,
  .site-header.is-open .member-account {
    display: grid;
  }

  .site-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.75rem;
    border-top: 1px solid rgba(245, 241, 232, 0.16);
  }

  .member-account {
    margin-top: 0;
  }

  .member-topbar {
    position: static;
    min-height: 4.5rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }

  .member-topbar-status {
    justify-content: flex-start;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
