:root {
  --paper: #c58a45;
  --paper-light: #dfa961;
  --paper-pale: #e5b873;
  --ink: #241713;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, "Times New Roman", serif;
  overscroll-behavior: none;
}

main {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #fff1c8;
  outline-offset: 4px;
}

.hero {
  position: relative;
  height: 100dvh;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--paper);
  background-image: url("assets/beadle-landscape-2026.webp");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
}

.heroArtwork {
  position: absolute;
  z-index: -3;
  inset: 0;
  background-image: url("assets/beadle-landscape-2026.webp");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
}

.hero::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 18%, rgba(255, 228, 169, 0.12), transparent 32%),
    radial-gradient(circle at 42% 76%, rgba(73, 39, 23, 0.08), transparent 42%);
  mix-blend-mode: multiply;
}

.heroPanel {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  width: min(42vw, 42rem);
  height: 100%;
  margin-left: clamp(3rem, 7vw, 8.5rem);
  padding: clamp(7rem, 14dvh, 10rem) 0 clamp(3rem, 7dvh, 5.5rem);
}

.landingView,
.loginView,
.accountView {
  width: min(100%, 35rem);
  animation: settleIn 360ms ease-out both;
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: clamp(0.7rem, 0.9vw, 0.84rem);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(3.2rem, 5.7vw, 6.7rem);
  font-weight: 500;
  line-height: 0.91;
  letter-spacing: -0.05em;
}

.heroLead {
  margin: clamp(1.2rem, 3dvh, 2rem) 0 0;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.5;
}

.heroActions,
.loginActions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(1.4rem, 3.5dvh, 2.4rem);
}

.primaryButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  color: var(--paper-pale);
  background: var(--ink);
  font-weight: 700;
  letter-spacing: 0.035em;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.primaryButton:hover {
  color: var(--ink);
  background: transparent;
  transform: translateY(-2px);
}

.textButton,
.backButton {
  border: 0;
  padding: 0.5rem 0;
  color: var(--ink);
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  cursor: pointer;
}

.backButton {
  margin-bottom: clamp(1rem, 2.5dvh, 1.8rem);
  font-size: 0.88rem;
}

.loginView h1,
.accountView h1 {
  max-width: 7ch;
  font-size: clamp(3rem, 5.2vw, 6rem);
}

.accountView h1 {
  max-width: 9ch;
}

.loginForm,
.accountForm {
  display: grid;
  width: min(100%, 29rem);
  margin-top: clamp(0.9rem, 2dvh, 1.4rem);
}

.accountForm {
  width: min(100%, 30rem);
  margin-top: clamp(1.1rem, 2.5dvh, 1.65rem);
}

.loginForm label,
.accountForm label {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.accountForm label {
  margin-top: 0.9rem;
  margin-bottom: 0.5rem;
}

.loginForm input,
.accountForm input {
  min-height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: rgba(229, 184, 115, 0.74);
  box-shadow: inset 0 0 0 3px rgba(63, 36, 22, 0.08);
}

.loginActions {
  margin-top: 1.1rem;
}

.accountActions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.accountIntro {
  width: min(100%, 30rem);
  margin: 1.2rem 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.formHint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.recoveryNotice {
  width: min(100%, 30rem);
  margin-top: 1.35rem;
  border-left: 3px solid var(--ink);
  padding-left: 1rem;
  font-size: 0.93rem;
  line-height: 1.5;
}

.recoveryNotice p {
  margin: 0;
}

.recoveryNotice p + p {
  margin-top: 0.8rem;
}

.formStatus {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.formStatus--error {
  font-weight: 700;
}

.heroPanel--portal {
  align-items: flex-start;
  width: min(58vw, 56rem);
  padding-top: clamp(4rem, 9dvh, 6.5rem);
  padding-bottom: clamp(2rem, 5dvh, 4rem);
}

.portalView {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.35rem 1rem 1rem 0.15rem;
  scrollbar-color: rgba(36, 23, 19, 0.55) transparent;
}

.portalHeader {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2rem;
}

.portalView h1 {
  max-width: 10ch;
  font-size: clamp(3.1rem, 5vw, 5.8rem);
}

.logoutForm {
  flex: 0 0 auto;
}

.portalUtilities {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 1.25rem;
}

.siteDirectory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
  gap: 1rem;
  margin-top: clamp(1.5rem, 3.5dvh, 2.5rem);
}

.siteCard {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 13.5rem;
  border: 2px solid var(--ink);
  padding: 1.25rem;
  background: rgba(229, 184, 115, 0.76);
  box-shadow: 7px 7px 0 rgba(36, 23, 19, 0.12);
}

.siteCard--disabled {
  opacity: 0.7;
}

.siteCard h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}

.siteCard p:not(.siteRole) {
  margin: 0.8rem 0 0;
  font-size: 0.93rem;
  line-height: 1.45;
}

.siteRole,
.siteStatus {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.siteStatus {
  margin: 0;
}

.portalNote,
.emptyState {
  font-size: 0.82rem;
  line-height: 1.45;
}

.portalNote {
  margin: 1.1rem 0 0;
}

.emptyState {
  margin: 0;
}

.secondaryButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.secondaryButton:hover {
  color: var(--paper-pale);
  background: var(--ink);
  transform: translateY(-2px);
}

.secondaryButton:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.adminDocument,
.adminDocument body {
  min-height: 100%;
  height: auto;
  overflow: visible;
}

.adminPage {
  position: relative;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 10%, rgba(255, 228, 169, 0.18), transparent 25rem),
    radial-gradient(circle at 85% 70%, rgba(73, 39, 23, 0.09), transparent 36rem);
}

.adminPage::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: url("assets/beadle-landscape-2026.webp");
  background-repeat: no-repeat;
  background-position: right top;
  background-size: auto min(70rem, 115vh);
  opacity: 0.09;
}

.adminMain {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  height: auto;
  overflow: visible;
}

.adminShell {
  width: min(100% - 3rem, 74rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 5rem;
}

.adminHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.adminHeader h1 {
  max-width: none;
  font-size: clamp(3.2rem, 6vw, 5.8rem);
}

.adminLead {
  max-width: 40rem;
  margin: 1.2rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.5;
}

.adminNav {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 1.5rem;
}

.adminNav form {
  margin: 0;
}

.adminPanel,
.adminUserCard {
  border: 2px solid var(--ink);
  background: rgba(229, 184, 115, 0.84);
  box-shadow: 7px 7px 0 rgba(36, 23, 19, 0.13);
}

.adminPanel {
  padding: clamp(1.35rem, 3.5vw, 2.5rem);
}

.adminSectionHeader {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(20rem, 1.2fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.adminSectionHeader h2,
.adminAccessDenied h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}

.adminSectionHeader > p {
  max-width: 38rem;
  margin: 0;
  line-height: 1.5;
}

.adminForm {
  display: grid;
  gap: 1.5rem;
}

.adminFieldGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.adminField {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.adminField--wide {
  grid-column: 1 / -1;
}

.adminField label,
.projectAccess legend {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.adminField input,
.projectRole select {
  width: 100%;
  min-height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: rgba(244, 204, 139, 0.8);
  box-shadow: inset 0 0 0 3px rgba(63, 36, 22, 0.06);
}

.adminField small,
.projectRole small {
  font-size: 0.77rem;
  line-height: 1.4;
}

.projectAccess {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.projectAccess legend {
  margin-bottom: 0.65rem;
  padding: 0;
}

.projectAccessGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.8rem;
}

.projectRole {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.8fr);
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(36, 23, 19, 0.42);
  padding: 0.8rem;
  background: rgba(197, 138, 69, 0.24);
}

.projectRole > span {
  display: grid;
  gap: 0.2rem;
}

.projectRole select {
  min-height: 2.65rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.88rem;
}

.adminActions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.adminActions--split {
  justify-content: space-between;
}

.adminNotice {
  margin-bottom: 1.25rem;
  border-left: 5px solid var(--ink);
  padding: 1rem 1.15rem;
  background: rgba(229, 184, 115, 0.92);
  font-weight: 700;
  line-height: 1.45;
}

.adminNotice--error {
  border: 2px solid var(--ink);
  border-left-width: 8px;
}

.adminDirectory {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.adminSectionHeader--directory {
  margin-bottom: 1.15rem;
  padding: 0 0.1rem;
}

.adminUserList {
  display: grid;
  gap: 0.85rem;
}

.adminUserCard {
  overflow: hidden;
}

.adminUserCard summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
}

.adminUserCard summary::-webkit-details-marker {
  display: none;
}

.adminUserCard summary::after {
  grid-column: 3;
  content: "+";
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.adminUserCard[open] summary::after {
  content: "−";
}

.adminUserIdentity,
.adminUserMeta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.adminUserIdentity {
  min-width: 0;
  flex-wrap: wrap;
}

.adminUserIdentity strong {
  font-size: 1.18rem;
}

.adminUserIdentity span,
.adminUserMeta {
  font-size: 0.84rem;
}

.adminUserMeta {
  grid-column: 2;
  grid-row: 1;
  margin-right: 2.5rem;
}

.adminStatus {
  border: 1px solid currentColor;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.adminStatus--disabled {
  opacity: 0.58;
}

.adminEditForm {
  border-top: 1px solid rgba(36, 23, 19, 0.5);
  padding: 1.5rem 1.25rem;
  background: rgba(223, 169, 97, 0.35);
}

.adminToggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.adminToggle input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--ink);
}

.adminAccessDenied {
  max-width: 42rem;
}

.adminAccessDenied p:not(.eyebrow) {
  margin: 1rem 0 1.5rem;
  line-height: 1.5;
}

@keyframes settleIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero {
    background-position: left center;
    background-size: auto 100%;
  }

  .heroPanel {
    align-items: flex-start;
    width: auto;
    height: 100%;
    margin: 0;
    padding: clamp(7.5rem, 16dvh, 10rem) 3rem 2rem;
  }

  .landingView,
  .loginView,
  .accountView {
    width: min(100%, 34rem);
  }

  .heroPanel--portal {
    width: auto;
    padding-top: clamp(4.5rem, 10dvh, 6.5rem);
  }

  .portalView {
    width: min(100%, 44rem);
  }

  h1,
  .loginView h1,
  .accountView h1 {
    font-size: clamp(3.1rem, 11vw, 5.6rem);
  }
}

@media (max-width: 920px) and (orientation: portrait) {
  .heroArtwork {
    background-image: url("assets/beadle-cover-2026.webp");
    background-position: center bottom;
    background-size: contain;
    opacity: 0.72;
  }

  .hero::before {
    background: linear-gradient(
      to bottom,
      rgba(223, 169, 97, 0.76) 0%,
      rgba(223, 169, 97, 0.58) 42%,
      rgba(223, 169, 97, 0.12) 76%,
      transparent 100%
    );
    mix-blend-mode: normal;
  }
}

@media (max-width: 620px) {
  .heroPanel {
    padding: clamp(6.5rem, 15dvh, 8rem) 1.5rem 1.5rem;
  }

  h1,
  .loginView h1,
  .accountView h1 {
    font-size: clamp(2.8rem, 14vw, 4.3rem);
  }

  .heroLead {
    margin-top: 1rem;
    font-size: 0.96rem;
  }

  .heroActions {
    margin-top: 1.25rem;
  }

  .loginForm,
  .accountForm {
    width: 100%;
  }

  .loginActions,
  .accountActions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .loginActions .primaryButton,
  .accountActions .primaryButton {
    width: 100%;
  }

  .portalHeader {
    flex-direction: column;
    gap: 0.5rem;
  }

  .portalView h1 {
    font-size: clamp(2.8rem, 14vw, 4.3rem);
  }

  .siteDirectory {
    grid-template-columns: 1fr;
  }

  .siteCard {
    min-height: 0;
  }

  .siteCard .primaryButton {
    width: 100%;
  }
}

@media (max-height: 700px) {
  .heroPanel {
    padding-top: 4.8rem;
    padding-bottom: 0.75rem;
  }

  .eyebrow {
    margin-bottom: 0.45rem;
  }

  h1,
  .loginView h1,
  .accountView h1 {
    font-size: clamp(2.5rem, 9dvh, 4.4rem);
  }

  .heroLead,
  .heroActions {
    margin-top: 0.8rem;
  }

  .backButton {
    margin-bottom: 0.4rem;
  }

  .loginForm {
    margin-top: 0.35rem;
  }

  .accountForm {
    margin-top: 0.7rem;
  }

  .loginForm label {
    margin-top: 0.35rem;
  }

  .accountForm label {
    margin-top: 0.65rem;
    margin-bottom: 0.45rem;
  }

  .loginForm input,
  .accountForm input {
    min-height: 2.6rem;
  }

  .loginActions {
    margin-top: 0.65rem;
  }

  .accountActions {
    margin-top: 1rem;
  }

  .primaryButton {
    min-height: 2.7rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .formStatus {
    margin-top: 0.4rem;
  }

  .heroPanel--portal {
    padding-top: 2rem;
    padding-bottom: 1rem;
  }

  .portalView h1 {
    font-size: clamp(2.5rem, 9dvh, 4.4rem);
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .heroPanel {
    align-items: center;
    width: min(54vw, 28rem);
    height: 100%;
    margin-left: clamp(2rem, 5vw, 3rem);
    padding: 1rem 0;
  }

  .landingView,
  .loginView,
  .accountView,
  .loginForm,
  .accountForm {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .adminShell {
    width: min(100% - 2rem, 74rem);
    padding-top: 2rem;
  }

  .adminHeader,
  .adminSectionHeader {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .adminHeader h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .adminNav {
    gap: 1.25rem;
  }

  .adminFieldGrid {
    grid-template-columns: 1fr;
  }

  .adminField--wide {
    grid-column: auto;
  }

  .projectRole {
    grid-template-columns: 1fr;
  }

  .adminUserCard summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem 1rem;
  }

  .adminUserCard summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .adminUserMeta {
    grid-column: 1;
    grid-row: 2;
    flex-wrap: wrap;
    margin-right: 0;
  }

  .adminActions--split {
    align-items: stretch;
    flex-direction: column;
  }

  .adminActions--split .primaryButton,
  .adminActions--split .secondaryButton {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landingView,
  .loginView,
  .accountView,
  .primaryButton {
    animation: none;
    transition: none;
  }
}
